vim entered the distribution, now we only need usb vga and keyboard support, to have...
[openwrt.git] / openwrt / package / vim / patches / vim_configure.patch
1 This patch is required to stop vim's configure script from insisting on
2 compiling test programs which obviously do not work in a cross compiled
3 environment.  
4
5 --- vim-5.8_original/src/configure      2001-05-11 04:59:18.000000000 +1000
6 +++ vim-5.8/src/configure       2006-03-24 01:04:55.000000000 +1100
7 @@ -995,10 +995,6 @@
8  
9  test "$GCC" = yes && CFLAGS="$CFLAGS -Wall"
10  
11 -if test "$cross_compiling" = yes; then
12 -  { echo "configure: error: cannot compile a simple program, check CC and CFLAGS" 1>&2; exit 1; }
13 -fi
14 -
15  test "$GCC" = yes && CPP_MM=M; 
16  
17  if test -f ./toolcheck; then
18 @@ -3365,29 +3361,7 @@
19  
20  echo $ac_n "checking quality of toupper""... $ac_c" 1>&6
21  echo "configure:3368: checking quality of toupper" >&5
22 -if test "$cross_compiling" = yes; then
23 -  { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
24 -else
25 -  cat > conftest.$ac_ext <<EOF
26 -#line 3373 "configure"
27 -#include "confdefs.h"
28 -#include <ctype.h>
29 -main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
30 -EOF
31 -if { (eval echo configure:3378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
32 -then
33 -  cat >> confdefs.h <<\EOF
34 -#define BROKEN_TOUPPER 1
35 -EOF
36 - echo "$ac_t""bad" 1>&6
37 -else
38 -  echo "configure: failed program was:" >&5
39 -  cat conftest.$ac_ext >&5
40 -  rm -fr conftest*
41 -  echo "$ac_t""good" 1>&6
42 -fi
43 -rm -fr conftest*
44 -fi
45 +echo "$ac_t""good" 1>&6
46  
47  
48  echo $ac_n "checking whether __DATE__ and __TIME__ work""... $ac_c" 1>&6
49 @@ -4340,34 +4314,10 @@
50  if test "x$olibs" != "x$LIBS"; then
51    echo $ac_n "checking whether we talk terminfo""... $ac_c" 1>&6
52  echo "configure:4343: checking whether we talk terminfo" >&5
53 -  if test "$cross_compiling" = yes; then
54 -  { echo "configure: error: failed to compile test program." 1>&2; exit 1; }
55 -else
56 -  cat > conftest.$ac_ext <<EOF
57 -#line 4348 "configure"
58 -#include "confdefs.h"
59 -
60 -#ifdef HAVE_TERMCAP_H
61 -# include <termcap.h>
62 -#endif
63 -main()
64 -{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
65 -EOF
66 -if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
67 -then
68 -  echo "$ac_t""no -- we are in termcap land" 1>&6
69 -else
70 -  echo "configure: failed program was:" >&5
71 -  cat conftest.$ac_ext >&5
72 -  rm -fr conftest*
73 -  echo "$ac_t""yes -- terminfo spoken here" 1>&6; cat >> confdefs.h <<\EOF
74 +echo "$ac_t""yes -- terminfo spoken here" 1>&6; cat >> confdefs.h <<\EOF
75  #define TERMINFO 1
76  EOF
77  
78 -fi
79 -rm -fr conftest*
80 -fi
81 -
82  else
83    echo "$ac_t""none found" 1>&6
84  fi
85 @@ -4600,70 +4550,14 @@
86  
87  echo $ac_n "checking for struct sigcontext""... $ac_c" 1>&6
88  echo "configure:4603: checking for struct sigcontext" >&5
89 -cat > conftest.$ac_ext <<EOF
90 -#line 4605 "configure"
91 -#include "confdefs.h"
92  
93 -#include <signal.h>
94 -test_sig()
95 -{
96 -    struct sigcontext *scont;
97 -    scont = (struct sigcontext *)0;
98 -    return 1;
99 -} 
100 -int main() {
101 -
102 -; return 0; }
103 -EOF
104 -if { (eval echo configure:4619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
105 -  rm -rf conftest*
106 -  echo "$ac_t""yes" 1>&6
107 -               cat >> confdefs.h <<\EOF
108 +cat >> confdefs.h <<\EOF
109  #define HAVE_SIGCONTEXT 1
110  EOF
111  
112 -else
113 -  echo "configure: failed program was:" >&5
114 -  cat conftest.$ac_ext >&5
115 -  rm -rf conftest*
116 -  echo "$ac_t""no" 1>&6
117 -fi
118 -rm -f conftest*
119 -
120  echo $ac_n "checking getcwd implementation""... $ac_c" 1>&6
121  echo "configure:4635: checking getcwd implementation" >&5
122 -if test "$cross_compiling" = yes; then
123 -  { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
124 -else
125 -  cat > conftest.$ac_ext <<EOF
126 -#line 4640 "configure"
127 -#include "confdefs.h"
128 -
129 -char *dagger[] = { "IFS=pwd", 0 };
130 -main()
131 -{
132 -  char buffer[500];
133 -  extern char **environ;
134 -  environ = dagger;
135 -  return getcwd(buffer, 500) ? 0 : 1;
136 -}
137 -EOF
138 -if { (eval echo configure:4652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
139 -then
140 -  echo "$ac_t""it is usable" 1>&6
141 -else
142 -  echo "configure: failed program was:" >&5
143 -  cat conftest.$ac_ext >&5
144 -  rm -fr conftest*
145 -  echo "$ac_t""it stinks" 1>&6
146 -               cat >> confdefs.h <<\EOF
147 -#define BAD_GETCWD 1
148 -EOF
149 -
150 -fi
151 -rm -fr conftest*
152 -fi
153 -
154 +echo "$ac_t""it is usable" 1>&6
155  
156  for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpwnam getpwuid \
157         gettimeofday getwd lstat memcmp memset nanosleep opendir putenv qsort \
158 @@ -4872,89 +4766,11 @@
159  
160  echo $ac_n "checking whether memmove/bcopy/memcpy handle overlaps""... $ac_c" 1>&6
161  echo "configure:4875: checking whether memmove/bcopy/memcpy handle overlaps" >&5
162 -bcopy_test_prog='
163 -main() {
164 -  char buf[10];
165 -  strcpy(buf, "abcdefghi");
166 -  mch_memmove(buf, buf + 2, 3);
167 -  if (strncmp(buf, "ababcf", 6))
168 -    exit(1);
169 -  strcpy(buf, "abcdefghi");
170 -  mch_memmove(buf + 2, buf, 3);
171 -  if (strncmp(buf, "cdedef", 6))
172 -    exit(1);
173 -  exit(0); /* libc version works properly.  */
174 -}'
175 -
176 -
177 -if test "$cross_compiling" = yes; then
178 -  { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
179 -else
180 -  cat > conftest.$ac_ext <<EOF
181 -#line 4895 "configure"
182 -#include "confdefs.h"
183 -#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog
184 -EOF
185 -if { (eval echo configure:4899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
186 -then
187 -  cat >> confdefs.h <<\EOF
188 +cat >> confdefs.h <<\EOF
189  #define USEMEMMOVE 1
190 -EOF
191 - echo "$ac_t""memmove does" 1>&6
192 -else
193 -  echo "configure: failed program was:" >&5
194 -  cat conftest.$ac_ext >&5
195 -  rm -fr conftest*
196 -  if test "$cross_compiling" = yes; then
197 -  { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
198 -else
199 -  cat > conftest.$ac_ext <<EOF
200 -#line 4913 "configure"
201 -#include "confdefs.h"
202 -#define mch_memmove(s,d,l) bcopy(d,s,l) $bcopy_test_prog
203 -EOF
204 -if { (eval echo configure:4917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
205 -then
206 -  cat >> confdefs.h <<\EOF
207  #define USEBCOPY 1
208 -EOF
209 - echo "$ac_t""bcopy does" 1>&6
210 -else
211 -  echo "configure: failed program was:" >&5
212 -  cat conftest.$ac_ext >&5
213 -  rm -fr conftest*
214 -  if test "$cross_compiling" = yes; then
215 -  { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
216 -else
217 -  cat > conftest.$ac_ext <<EOF
218 -#line 4931 "configure"
219 -#include "confdefs.h"
220 -#define mch_memmove(s,d,l) memcpy(d,s,l) $bcopy_test_prog
221 -EOF
222 -if { (eval echo configure:4935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
223 -then
224 -  cat >> confdefs.h <<\EOF
225  #define USEMEMCPY 1
226  EOF
227 - echo "$ac_t""memcpy does" 1>&6
228 -else
229 -  echo "configure: failed program was:" >&5
230 -  cat conftest.$ac_ext >&5
231 -  rm -fr conftest*
232 -  echo "$ac_t""no" 1>&6
233 -fi
234 -rm -fr conftest*
235 -fi
236 -
237 -fi
238 -rm -fr conftest*
239 -fi
240 -
241 -fi
242 -rm -fr conftest*
243 -fi
244 -
245 -
246  
247  if test "$enable_multibyte" = "yes"; then
248    cflags_save=$CFLAGS