scripts/build/libc/glibc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jan 20 00:27:36 2011 +0100 (2011-01-20)
changeset 2277 71803c9f6de0
parent 2276 ac021d186cd6
child 2278 e86826b8621a
permissions -rw-r--r--
libc/glibc-eglibc: misc janitorial cleanups.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     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
     4 
     5 # Add the definitions common to glibc and eglibc
     6 #   do_libc_headers
     7 #   do_libc_start_files
     8 #   do_libc
     9 #   do_libc_finish
    10 #   do_libc_add_ons_list
    11 #   do_libc_min_kernel_config
    12 . "${CT_LIB_DIR}/scripts/build/libc/glibc-eglibc.sh-common"
    13 
    14 # Download glibc
    15 do_libc_get() {
    16     local date
    17     local version
    18     local -a addons_list
    19 
    20     addons_list=($(do_libc_add_ons_list " "))
    21 
    22     # Main source
    23     CT_GetFile "glibc-${CT_LIBC_VERSION}"               \
    24                {ftp,http}://ftp.gnu.org/gnu/glibc       \
    25                ftp://gcc.gnu.org/pub/glibc/releases     \
    26                ftp://gcc.gnu.org/pub/glibc/snapshots
    27 
    28     # C library addons
    29     for addon in "${addons_list[@]}"; do
    30         # NPTL addon is not to be downloaded, in any case
    31         [ "${addon}" = "nptl" ] && continue || true
    32         CT_GetFile "glibc-${addon}-${CT_LIBC_VERSION}"      \
    33                    {ftp,http}://ftp.gnu.org/gnu/glibc       \
    34                    ftp://gcc.gnu.org/pub/glibc/releases     \
    35                    ftp://gcc.gnu.org/pub/glibc/snapshots
    36     done
    37 
    38     return 0
    39 }
    40 
    41 # Extract glibc
    42 do_libc_extract() {
    43     local -a addons_list
    44 
    45     addons_list=($(do_libc_add_ons_list " "))
    46 
    47     CT_Extract "glibc-${CT_LIBC_VERSION}"
    48 
    49     CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
    50     CT_Patch nochdir "glibc" "${CT_LIBC_VERSION}"
    51 
    52     # C library addons
    53     for addon in "${addons_list[@]}"; do
    54         # NPTL addon is not to be extracted, in any case
    55         [ "${addon}" = "nptl" ] && continue || true
    56         CT_Extract nochdir "glibc-${addon}-${CT_LIBC_VERSION}"
    57 
    58         # Some addons have the 'long' name, while others have the
    59         # 'short' name, but patches are non-uniformly built with
    60         # either the 'long' or 'short' name, whatever the addons name
    61         # so we have to make symlinks from the existing to the missing
    62         # Fortunately for us, [ -d foo ], when foo is a symlink to a
    63         # directory, returns true!
    64         [ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
    65         [ -d "glibc-${addon}-${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}"
    66         CT_Patch nochdir "glibc" "${addon}-${CT_LIBC_VERSION}"
    67     done
    68 
    69     # The configure files may be older than the configure.in files
    70     # if using a snapshot (or even some tarballs). Fake them being
    71     # up to date.
    72     sleep 2
    73     find . -type f -name configure -exec touch {} \; 2>&1 |CT_DoLog ALL
    74 
    75     CT_Popd
    76 
    77     return 0
    78 }
    79 
    80 # There is nothing to do for glibc check config
    81 do_libc_check_config() {
    82     :
    83 }