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
6 echo "binutils-${CT_BINUTILS_VERSION}"
11 CT_GetFile "${CT_BINUTILS_FILE}" \
12 ftp://ftp.gnu.org/gnu/binutils \
13 ftp://ftp.kernel.org/pub/linux/devel/binutils
17 do_binutils_extract() {
18 CT_ExtractAndPatch "${CT_BINUTILS_FILE}"
23 mkdir -p "${CT_BUILD_DIR}/build-binutils"
24 cd "${CT_BUILD_DIR}/build-binutils"
26 CT_DoStep INFO "Installing binutils"
28 CT_DoLog EXTRA "Configuring binutils"
29 CFLAGS="${CT_CFLAGS_FOR_HOST}" \
30 "${CT_SRC_DIR}/${CT_BINUTILS_FILE}/configure" \
34 --target=${CT_TARGET} \
35 --prefix=${CT_PREFIX_DIR} \
37 ${CT_BINUTILS_EXTRA_CONFIG} \
38 ${BINUTILS_SYSROOT_ARG} 2>&1 |CT_DoLog ALL
40 CT_DoLog EXTRA "Building binutils"
41 make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
43 CT_DoLog EXTRA "Installing binutils"
44 make install 2>&1 |CT_DoLog ALL
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
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}"