scripts/build/debug/dmalloc.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 161 be4484f10ac7
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@103
     1
# Build script for the dmalloc debug library facility
yann@103
     2
yann@103
     3
is_enabled="${CT_DMALLOC}"
yann@103
     4
yann@161
     5
do_print_filename() {
yann@161
     6
    [ "${CT_DMALLOC}" = "y" ] || return 0
yann@161
     7
    echo "dmalloc-${CT_DMALLOC_VERSION}"
yann@161
     8
}
yann@161
     9
yann@103
    10
do_debug_dmalloc_get() {
yann@103
    11
    CT_GetFile "dmalloc-${CT_DMALLOC_VERSION}" http://dmalloc.com/releases/
yann@103
    12
}
yann@103
    13
yann@103
    14
do_debug_dmalloc_extract() {
yann@103
    15
    CT_ExtractAndPatch "dmalloc-${CT_DMALLOC_VERSION}"
yann@103
    16
}
yann@103
    17
yann@103
    18
do_debug_dmalloc_build() {
yann@103
    19
    CT_DoStep INFO "Installing dmalloc"
yann@103
    20
    CT_DoLog EXTRA "Configuring dmalloc"
yann@103
    21
yann@103
    22
    mkdir -p "${CT_BUILD_DIR}/build-dmalloc"
yann@103
    23
    cd "${CT_BUILD_DIR}/build-dmalloc"
yann@103
    24
yann@103
    25
    extra_config=
yann@103
    26
    case "${CT_CC_LANG_CXX}" in
yann@103
    27
        y)  extra_config="${extra_config} --enable-cxx";;
yann@103
    28
        *)  extra_config="${extra_config} --disable-cxx";;
yann@103
    29
    esac
yann@136
    30
    case "${CT_THREADS_NONE}" in
yann@103
    31
        y)  extra_config="${extra_config} --disable-threads";;
yann@103
    32
        *)  extra_config="${extra_config} --enable-threads";;
yann@103
    33
    esac
yann@103
    34
    case "${CT_SHARED_LIBS}" in
yann@103
    35
        y)  extra_config="${extra_config} --enable-shlib";;
yann@103
    36
        *)  extra_config="${extra_config} --disable-shlib";;
yann@103
    37
    esac
yann@103
    38
yann@103
    39
    CT_DoLog DEBUG "Extra config passed: \"${extra_config}\""
yann@103
    40
yann@103
    41
    LD="${CT_TARGET}-ld"                                        \
yann@103
    42
    AR="${CT_TARGET}-ar"                                        \
yann@103
    43
    "${CT_SRC_DIR}/dmalloc-${CT_DMALLOC_VERSION}/configure"     \
yann@103
    44
        --prefix=/usr                                           \
yann@103
    45
        --build="${CT_BUILD}"                                   \
yann@103
    46
        --host="${CT_TARGET}"                                   \
yann@103
    47
        ${extra_config}                                         2>&1 |CT_DoLog ALL
yann@103
    48
yann@103
    49
    CT_DoLog EXTRA "Building dmalloc"
yann@359
    50
    make 2>&1 |CT_DoLog ALL
yann@103
    51
yann@104
    52
    CT_DoLog EXTRA "Installing dmalloc"
yann@103
    53
    make DESTDIR="${CT_SYSROOT_DIR}"       installincs      \
yann@103
    54
                                           installlib       2>&1 |CT_DoLog ALL
yann@103
    55
    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" installutil      2>&1 |CT_DoLog ALL
yann@103
    56
yann@103
    57
    CT_EndStep
yann@103
    58
}