scripts/build/tools/libelf.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
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@245
     1
# Build script for libelf
yann@245
     2
yann@245
     3
is_enabled="${CT_LIBELF}"
yann@245
     4
yann@245
     5
do_print_filename() {
yann@245
     6
    [ "{CT_LIBELF}" = "y" ] || return 0
yann@245
     7
    echo "libelf-${CT_LIBELF_VERSION}"
yann@245
     8
}
yann@245
     9
yann@245
    10
do_tools_libelf_get() {
yann@245
    11
    # The server hosting libelf will return an "HTTP 300 : Multiple Choices"
yann@245
    12
    # error code if we try to download a file that does not exists there.
yann@245
    13
    # So we have to request the file with an explicit extension.
yann@245
    14
    CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
yann@245
    15
}
yann@245
    16
yann@245
    17
do_tools_libelf_extract() {
yann@245
    18
    CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
yann@245
    19
}
yann@245
    20
yann@245
    21
do_tools_libelf_build() {
yann@245
    22
    CT_DoStep INFO "Installing libelf"
yann@245
    23
    mkdir -p "${CT_BUILD_DIR}/build-libelf"
yann@245
    24
    CT_Pushd "${CT_BUILD_DIR}/build-libelf"
yann@245
    25
yann@245
    26
    CT_DoLog EXTRA "Configuring libelf"
yann@245
    27
    CC="${CT_TARGET}-gcc"                                   \
yann@245
    28
    "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure"   \
yann@245
    29
        --build=${CT_BUILD}                                 \
yann@245
    30
        --host=${CT_TARGET}                                 \
yann@245
    31
        --target=${CT_TARGET}                               \
yann@245
    32
        --prefix=/usr                                       \
yann@245
    33
        --enable-compat                                     \
yann@245
    34
        --enable-elf64                                      \
yann@245
    35
        --enable-shared                                     \
yann@245
    36
        --enable-extended-format                            \
yann@245
    37
        --enable-static                                     2>&1 |CT_DoLog ALL
yann@245
    38
yann@245
    39
    CT_DoLog EXTRA "Building libelf"
yann@245
    40
    make    2>&1 |CT_DoLog ALL
yann@245
    41
yann@245
    42
    CT_DoLog EXTRA "Installing libelf"
yann@245
    43
    make instroot="${CT_SYSROOT_DIR}" install   2>&1 |CT_DoLog ALL
yann@245
    44
yann@245
    45
    CT_Popd
yann@245
    46
    CT_EndStep
yann@245
    47
}
yann@245
    48