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 patch makes configure use the cross ld and ar rather than the native tools.
3 It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
4 bits gathered from buildroot, which is LGPL v2.1
5 License for dmalloc is:
6 * Permission to use, copy, modify, and distribute this software for
7 * any purpose and without fee is hereby granted, provided that the
8 * above copyright notice and this permission notice appear in all
9 * copies, and that the name of Gray Watson not be used in advertising
10 * or publicity pertaining to distribution of the document or software
11 * without specific, written prior permission.
13 * Gray Watson makes no representations about the suitability of the
14 * software described herein for any purpose. It is provided "as is"
15 * without express or implied warranty.
17 I personnaly believe that the resulting code should therefore be
18 LGPL v2.1, but don't believe me, ask your lawyers!
20 diff -dur dmalloc-5.5.2.orig/configure dmalloc-5.5.2/configure
21 --- dmalloc-5.5.2.orig/configure 2007-05-14 19:26:14.000000000 +0200
22 +++ dmalloc-5.5.2/configure 2007-05-18 11:38:25.000000000 +0200
23 @@ -4418,14 +4418,14 @@
24 (exit $ac_status); }; }; then
26 # so now we try to create an archive from the compiled .o file
27 - (ar cr conftest.a conftest.o) 2>&5
28 + (${AR} cr conftest.a conftest.o) 2>&5
29 # see which shared-library ld commands work
31 # Darwin/Mac OS X - Terry Teague
32 # username terry_teague at domain users.sourceforge.net
33 ac_cv_shared_lib_link_objs=no
34 if test `uname` = "Darwin"; then
35 - if (ld -dylib -o conftest.so.t -lc conftest.a) 2>&5; then
36 + if (${LD} -dylib -o conftest.so.t -lc conftest.a) 2>&5; then
37 # By convention on some platforms
38 # libLLL.so, libLLL.X.so are symlinks to libLLL.X.Y.Z.so
39 # where X.Y.Z is version # (major.minor.increment) of the library
40 @@ -4443,12 +4443,12 @@
41 ac_cv_shared_link_args='# Could not configure shlib linking'
44 - elif (ld -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
45 - ac_cv_shared_link_args='ld -shared --whole-archive -soname $@ -o $@.t'
46 - elif (ld -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
47 - ac_cv_shared_link_args='ld -shared -o $@.t -all -soname $@ -none -lc -all'
48 - elif (ld -G -o conftest.so.t conftest.a) 2>&5; then
49 - ac_cv_shared_link_args='ld -G -o $@.t'
50 + elif (${LD} -shared --whole-archive -soname conftest.so -o conftest.so.t conftest.a) 2>&5; then
51 + ac_cv_shared_link_args="${LD}"' -shared --whole-archive -soname $@ -o $@.t'
52 + elif (${LD} -shared -o conftest.so.t -all -soname conftest.so.t -none -lc -all conftest.a) 2>&5; then
53 + ac_cv_shared_link_args="${LD}"' -shared -o $@.t -all -soname $@ -none -lc -all'
54 + elif (${LD} -G -o conftest.so.t conftest.a) 2>&5; then
55 + ac_cv_shared_link_args="${LD}"' -G -o $@.t'
57 # oh well, toss an error
58 ac_cv_shared_link_args='# Could not configure shlib linking'