scripts/build/tools/template.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 156 0b7096103d95
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@156
     1
# Template file for a tool utility
yann@156
     2
yann@156
     3
# Check here wether your tool is enabled or not.
yann@156
     4
# This will get redefined over and over again for each tool, so don't
yann@156
     5
# count on it in the functions below.
yann@156
     6
is_enabled="${CT_FOOBAR}"
yann@156
     7
yann@156
     8
# Small function to print the filename
yann@156
     9
# Note that this function gets redefined over and over again for each tool.
yann@156
    10
# It's of no use when building the toolchain proper, but shows all its
yann@156
    11
# usefullness when saving the toolchain and building the tarball.
yann@156
    12
# You shall not echo anything if you're not enabled!
yann@156
    13
# Echo the name of the file, without the extension, below.
yann@156
    14
do_print_filename() {
yann@156
    15
    # For example:
yann@156
    16
    # [ "{CT_FOOBAR}" = "y" ] || return 0
yann@156
    17
    # echo "foobar-${CT_FOOBAR_VERSION}"
yann@156
    18
    :
yann@156
    19
}
yann@156
    20
yann@156
    21
# Put your download code here
yann@156
    22
do_tools_foobar_get() {
yann@156
    23
    # For example:
yann@156
    24
    # CT_GetFile "foobar-${CT_FOOBAR_VERSION}" http://foobar.com/releases/
yann@156
    25
    :
yann@156
    26
}
yann@156
    27
yann@156
    28
# Put your extract code here
yann@156
    29
do_tools_foobar_extract() {
yann@156
    30
    # For example:
yann@156
    31
    # CT_ExtractAndPatch "foobar-${CT_FOOBAR_VERSION}"
yann@156
    32
    :
yann@156
    33
}
yann@156
    34
yann@156
    35
# Put your build code here
yann@156
    36
do_tools_foobar_build() {
yann@156
    37
    # For example:
yann@234
    38
    # mkdir -p "${CT_BUILD_DIR}/build-foobar"
yann@234
    39
    # CT_Pushd "${CT_BUILD_DIR}/build-foobar"
yann@156
    40
    # "${CT_SRC_DIR}/foobar-${CT_FOOBAR_VERSION}/configure"   \
yann@156
    41
    #     --build=${CT_BUILD}                                 \
yann@156
    42
    #     --host=${CT_TARGET}                                 \
yann@156
    43
    #     --prefix=/usr                                       \
yann@156
    44
    #     --foobar-options
yann@156
    45
    # make
yann@156
    46
    # make DESTDIR="${CT_SYSROOT_DIR}" install
yann@156
    47
    # CT_Popd
yann@156
    48
    :
yann@156
    49
}
yann@156
    50