patches/gcc/3.2.3/100-config.sub.patch
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(-)
     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
     4 following error:
     5 
     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
     9 --enable-languages=c
    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
    12 --disable-shared
    13 ...
    14 *** --with-headers is only supported when cross compiling
    15 
    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
    20 cross-compiler.
    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.)
    25 
    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".
    34 
    35 
    36 
    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
    39 @@ -433,9 +433,12 @@
    40  	crds | unos)
    41  		basic_machine=m68k-crds
    42  		;;
    43 -	cris | cris-* | etrax*)
    44 +	cris | etrax*)
    45  		basic_machine=cris-axis
    46  		;;
    47 +	cris-*)
    48 +		basic_machine=cris-`echo $basic_machine | sed 's/^[^-]*-//'`
    49 +		;;
    50  	da30 | da30-*)
    51  		basic_machine=m68k-da30
    52  		;;
    53 @@ -820,11 +823,17 @@
    54  	rtpc | rtpc-*)
    55  		basic_machine=romp-ibm
    56  		;;
    57 -	s390 | s390-*)
    58 +	s390)
    59  		basic_machine=s390-ibm
    60  		;;
    61 -	s390x | s390x-*)
    62 +	s390-*)
    63 +		basic_machine=s390-`echo $basic_machine | sed 's/^[^-]*-//'`
    64 +		;;
    65 +	s390x)
    66  		basic_machine=s390x-ibm
    67 +		;;
    68 +	s390x-*)
    69 +		basic_machine=s390x-`echo $basic_machine | sed 's/^[^-]*-//'`
    70  		;;
    71  	sa29200)
    72  		basic_machine=a29k-amd