patches/gdb/6.6/600-fix-compile-flag-mismatch.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(-)
yann@96
     1
diff -rduNp gdb-6.6-100/Makefile.in gdb-6.6/Makefile.in
yann@96
     2
--- gdb-6.6-100/Makefile.in	2006-12-18 08:21:19.000000000 +0100
yann@96
     3
+++ gdb-6.6/Makefile.in	2007-05-14 10:54:29.000000000 +0200
yann@96
     4
@@ -331,7 +331,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
yann@96
     5
 # CFLAGS will be just -g.  We want to ensure that TARGET libraries
yann@96
     6
 # (which we know are built with gcc) are built with optimizations so
yann@96
     7
 # prepend -O2 when setting CFLAGS_FOR_TARGET.
yann@96
     8
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
yann@96
     9
+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
yann@96
    10
 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
yann@96
    11
 CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
yann@96
    12
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
yann@96
    13
diff -rduNp gdb-6.6-100/Makefile.tpl gdb-6.6/Makefile.tpl
yann@96
    14
--- gdb-6.6-100/Makefile.tpl	2006-11-15 00:26:39.000000000 +0100
yann@96
    15
+++ gdb-6.6/Makefile.tpl	2007-05-14 10:54:29.000000000 +0200
yann@96
    16
@@ -334,7 +334,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
yann@96
    17
 # CFLAGS will be just -g.  We want to ensure that TARGET libraries
yann@96
    18
 # (which we know are built with gcc) are built with optimizations so
yann@96
    19
 # prepend -O2 when setting CFLAGS_FOR_TARGET.
yann@96
    20
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
yann@96
    21
+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
yann@96
    22
 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
yann@96
    23
 CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
yann@96
    24
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
yann@96
    25
diff -rduNp gdb-6.6-100/gdb/configure gdb-6.6/gdb/configure
yann@96
    26
--- gdb-6.6-100/gdb/configure	2006-12-17 16:38:59.000000000 +0100
yann@96
    27
+++ gdb-6.6/gdb/configure	2007-05-14 10:55:41.000000000 +0200
yann@96
    28
@@ -272,7 +272,7 @@ PACKAGE_STRING=
yann@96
    29
 PACKAGE_BUGREPORT=
yann@96
    30
 
yann@96
    31
 ac_unique_file="main.c"
yann@96
    32
-ac_subdirs_all="$ac_subdirs_all doc testsuite"
yann@96
    33
+ac_subdirs_all="$ac_subdirs_all doc"
yann@96
    34
 # Factoring default headers for most tests.
yann@96
    35
 ac_includes_default="\
yann@96
    36
 #include <stdio.h>
yann@96
    37
@@ -3055,7 +3055,7 @@ _ACEOF
yann@96
    38
 
yann@96
    39
 
yann@96
    40
 
yann@96
    41
-subdirs="$subdirs doc testsuite"
yann@96
    42
+subdirs="$subdirs doc"
yann@96
    43
 
yann@96
    44
 
yann@96
    45
 # Provide defaults for some variables set by the per-host and per-target
yann@96
    46
diff -rduNp gdb-6.6-100/gdb/gdbserver/configure gdb-6.6/gdb/gdbserver/configure
yann@96
    47
--- gdb-6.6-100/gdb/gdbserver/configure	2006-11-22 01:10:19.000000000 +0100
yann@96
    48
+++ gdb-6.6/gdb/gdbserver/configure	2007-05-14 10:54:29.000000000 +0200
yann@96
    49
@@ -1239,7 +1239,7 @@ echo "$as_me: error: \`$ac_var' was not 
yann@96
    50
       ac_cache_corrupted=: ;;
yann@96
    51
     ,);;
yann@96
    52
     *)
yann@96
    53
-      if test "x$ac_old_val" != "x$ac_new_val"; then
yann@96
    54
+      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
yann@96
    55
 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
yann@96
    56
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
yann@96
    57
 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
yann@96
    58
diff -rduNp gdb-6.6-100/gdb/testsuite/configure gdb-6.6/gdb/testsuite/configure
yann@96
    59
--- gdb-6.6-100/gdb/testsuite/configure	2006-06-21 15:57:21.000000000 +0200
yann@96
    60
+++ gdb-6.6/gdb/testsuite/configure	2007-05-14 10:54:29.000000000 +0200
yann@96
    61
@@ -1248,7 +1248,7 @@ echo "$as_me: error: \`$ac_var' was not 
yann@96
    62
       ac_cache_corrupted=: ;;
yann@96
    63
     ,);;
yann@96
    64
     *)
yann@96
    65
-      if test "x$ac_old_val" != "x$ac_new_val"; then
yann@96
    66
+      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
yann@96
    67
 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
yann@96
    68
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
yann@96
    69
 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5