scripts/build/binutils.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Apr 26 21:31:05 2008 +0000 (2008-04-26)
changeset 454 372b2f397baa
parent 305 00a7e6c275da
child 458 17f3122a2864
permissions -rw-r--r--
Configure tsocks with a simple heuristic.

Consider the proxy has to be in a 'local' network. It means it is directly
reachable by the local machine, even if the local machine has to hop through
one or more gates to reach the proxy (often the case in enterprise networks
where class A 10.0.0.0/8 is in fact sub-divided into smaller networks, each
one of them in a different location, eg. 10.1.0.0/16 in a place, while
10.2.0.0/16 would be on the other side of the world). Not being in the same
subnet does not mean the proxy is not available.

So we will build a mask with at most high bits set, which defines a network
that has both the local machine and the proxy. Because a machine may have
more than one interface, build a mask for each of them, removing 127.0.0.1
which is added automagically by tsocks, and removing duplicate masks.

If all of this does not work, then it means the local machine can NOT in fact
reach the proxy, which in turn means the user mis-configured something (most
probably a typo...).

/trunk/scripts/crosstool.sh | 61 52 9 0 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 9 deletions(-)
yann@1
     1
# This file adds functions to build binutils
yann@1
     2
# Copyright 2007 Yann E. MORIN
yann@1
     3
# Licensed under the GPL v2. See COPYING in the root of this package
yann@1
     4
yann@161
     5
do_print_filename() {
yann@164
     6
    echo "binutils-${CT_BINUTILS_VERSION}"
yann@161
     7
}
yann@161
     8
yann@63
     9
# Download binutils
yann@63
    10
do_binutils_get() {
yann@63
    11
    CT_GetFile "${CT_BINUTILS_FILE}"                            \
yann@63
    12
               ftp://ftp.gnu.org/gnu/binutils                   \
yann@63
    13
               ftp://ftp.kernel.org/pub/linux/devel/binutils
yann@63
    14
}
yann@63
    15
yann@63
    16
# Extract binutils
yann@63
    17
do_binutils_extract() {
yann@63
    18
    CT_ExtractAndPatch "${CT_BINUTILS_FILE}"
yann@63
    19
}
yann@63
    20
yann@63
    21
# Build binutils
yann@1
    22
do_binutils() {
yann@1
    23
    mkdir -p "${CT_BUILD_DIR}/build-binutils"
yann@1
    24
    cd "${CT_BUILD_DIR}/build-binutils"
yann@1
    25
yann@1
    26
    CT_DoStep INFO "Installing binutils"
yann@1
    27
yann@1
    28
    CT_DoLog EXTRA "Configuring binutils"
yann@1
    29
    CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
yann@1
    30
    "${CT_SRC_DIR}/${CT_BINUTILS_FILE}/configure"   \
yann@1
    31
        ${CT_CANADIAN_OPT}                          \
yann@116
    32
        --build=${CT_BUILD}                         \
yann@116
    33
        --host=${CT_HOST}                           \
yann@1
    34
        --target=${CT_TARGET}                       \
yann@1
    35
        --prefix=${CT_PREFIX_DIR}                   \
yann@1
    36
        --disable-nls                               \
yann@1
    37
        ${CT_BINUTILS_EXTRA_CONFIG}                 \
yann@78
    38
        ${BINUTILS_SYSROOT_ARG}                     2>&1 |CT_DoLog ALL
yann@1
    39
yann@1
    40
    CT_DoLog EXTRA "Building binutils"
yann@78
    41
    make ${PARALLELMFLAGS}  2>&1 |CT_DoLog ALL
yann@1
    42
yann@1
    43
    CT_DoLog EXTRA "Installing binutils"
yann@78
    44
    make install            2>&1 |CT_DoLog ALL
yann@1
    45
yann@331
    46
    # Make those new tools available to the core C compilers to come.
yann@1
    47
    # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
yann@305
    48
    # well. Create that.
yann@136
    49
    mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
yann@136
    50
    mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
yann@136
    51
    mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
yann@136
    52
    mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
yann@1
    53
    for t in ar as ld strip; do
yann@136
    54
        ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
yann@136
    55
        ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
yann@136
    56
        ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
yann@136
    57
        ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
yann@78
    58
    done |CT_DoLog ALL
yann@1
    59
yann@1
    60
    CT_EndStep
yann@1
    61
}