scripts/build/debug/ltrace.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 ltrace
yann@245
     2
yann@245
     3
is_enabled="${CT_LTRACE}"
yann@245
     4
yann@245
     5
do_print_filename() {
yann@245
     6
    [ "${CT_LTRACE}" = "y" ] || return 0
yann@245
     7
    echo "ltrace-${CT_LTRACE_VERSION}.orig"
yann@245
     8
}
yann@245
     9
yann@245
    10
do_debug_ltrace_get() {
yann@245
    11
    CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" ftp://ftp.de.debian.org/debian/pool/main/l/ltrace/
yann@245
    12
    # Create a link so that the following steps are easier to do:
yann@245
    13
    cd "${CT_TARBALLS_DIR}"
yann@245
    14
    ltrace_ext=`CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig"`
yann@245
    15
    ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
yann@245
    16
}
yann@245
    17
yann@245
    18
do_debug_ltrace_extract() {
yann@245
    19
    CT_ExtractAndPatch "ltrace-${CT_LTRACE_VERSION}"
yann@245
    20
}
yann@245
    21
yann@245
    22
do_debug_ltrace_build() {
yann@245
    23
    CT_DoStep INFO "Installing ltrace"
yann@245
    24
    mkdir -p "${CT_BUILD_DIR}/build-ltrace"
yann@245
    25
    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
yann@245
    26
yann@245
    27
    CT_DoLog EXTRA "Configuring ltrace"
yann@245
    28
#    CFLAGS="-I${CT_SYSROOT_DIR}/usr/include"                \
yann@245
    29
#    LDFLAGS="-L${CT_SYSROOT_DIR}/usr/include"               \
yann@245
    30
    "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/configure"   \
yann@245
    31
        --build=${CT_BUILD}                                 \
yann@245
    32
        --host=${CT_TARGET}                                 \
yann@245
    33
        --prefix=/usr
yann@245
    34
yann@245
    35
    CT_DoLog EXTRA "Building ltrace"
yann@245
    36
    make
yann@245
    37
yann@245
    38
    CT_DoLog EXTRA "Installing ltrace"
yann@245
    39
    make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
yann@245
    40
yann@245
    41
    CT_Popd
yann@245
    42
    CT_EndStep
yann@245
    43
}
yann@245
    44