scripts/build/libc/glibc.sh
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:09:43 2011 +0200 (2011-05-19)
branch1.11
changeset 2465 5f98b7a90fbc
parent 2277 71803c9f6de0
child 2482 af25723a794f
permissions -rw-r--r--
complibs/ppl: fix 0.11-0.11.2 to compile with --disable-shared

PPL 0.11 (through 0.11.2) had a small bug where it still tried to build
and test its Java interface even when shared libraries are disabled.
Since that's exactly what ct-ng does, it explodes.

This is the patch from the PPL authors (see final link below).

More information can be found in these messages/threads:

Anthony's initial report and analysis with Yann:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00046.html

Ron Flory hit the same problem:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00054.html

Anthony's report to the ppl-devel list:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017450.html

Roberto's reply with a link to the fix in the PPL git repo:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017455.html

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