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