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 When configuring a s390->s390 or cris->cris crosscompiler
2 (ok, I haven't hit this yet, but one of these days I'll get me an account
3 on an s390, and then I'll need this patch :-), you'll get the
6 + /build/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/gcc-3.3/configure
7 --target=s390-unknown-linux-gnu --host=s390-host_unknown-linux-gnu
8 --prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2
10 --with-local-prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/s390-
11 unknown-linux-gnu --enable-threads=no --without-headers --with-newlib
14 *** --with-headers is only supported when cross compiling
16 This error pops up only when you're using Daniel Jacobowitz's technique
17 of slightly changing the target and host tuples to make them different
18 enough to force gcc's build system to not try to pull in system libraries
19 or headers. This technique is needed e.g. to build an x86 -> x86
21 (The LFS developers ran into the same bug that prompted me to use
22 this technique; they point people who run into it to
23 http://linuxfromscratch.org/~greg/pure_lfs.txt, which is a different
24 way of avoiding this problem. I think the tuple tweak is the way to go, though.)
26 config-patches@gnu.org rejected this patch, on the grounds that there
27 is only one vendor of each of those two architectures, so the
28 canonicalization is by definition correct. When I pointed out the
29 difficulty this causes for people building s390 -> s390 or
30 cris -> cris compilers that are incompatible with the system
31 libraries and thus must be built like cross-compilers, he grumped and said
32 "autoconf should let you specify a cross-compiler in some other way than
33 comparing tuple strings".
37 --- gcc-3.3/config.sub.old Sun Jun 8 20:38:47 2003
38 +++ gcc-3.3/config.sub Sun Jun 8 20:40:34 2003
41 basic_machine=m68k-crds
43 - cris | cris-* | etrax*)
45 basic_machine=cris-axis
48 + basic_machine=cris-`echo $basic_machine | sed 's/^[^-]*-//'`
51 basic_machine=m68k-da30
55 basic_machine=romp-ibm
59 basic_machine=s390-ibm
63 + basic_machine=s390-`echo $basic_machine | sed 's/^[^-]*-//'`
66 basic_machine=s390x-ibm
69 + basic_machine=s390x-`echo $basic_machine | sed 's/^[^-]*-//'`
72 basic_machine=a29k-amd