]>
Commit | Line | Data |
---|---|---|
5e993f12 | 1 | --- Configure.orig 2007-04-08 22:19:09.000000000 -0400 |
2 | +++ Configure 2007-04-09 02:34:02.000000000 -0400 | |
3 | @@ -1263,6 +1263,7 @@ | |
4 | : Possible local library directories to search. | |
5 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
6 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
7 | +loclibpth="" | |
8 | ||
9 | : general looking path for locating libraries | |
10 | glibpth="/lib /usr/lib $xlibpth" | |
11 | @@ -1981,6 +1982,30 @@ | |
12 | esac;; | |
13 | esac" | |
14 | ||
15 | +: figure out sizes of things with just compile tests | |
16 | +: based on AC_CHECK_SIZEOF from autoconf | |
17 | +cat <<EOSC >mysizeof | |
18 | +$startsh | |
19 | +size=0 | |
20 | +while true; do | |
21 | + echo "$sizeincludes" > try.c | |
22 | + echo "typedef \$type ac__type_sizeof_;" > try.c | |
23 | + echo "int main() {" >> try.c | |
24 | + echo "static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= \$size)];" >> try.c | |
25 | + echo "test_array [0] = 0; return 0;}" >> try.c | |
26 | + if \$cc $cflags -c try.c >/dev/null 2>&1; then | |
27 | + break | |
28 | + fi | |
29 | + : sanity check | |
30 | + if test \$size -gt 20; then | |
31 | + size="" | |
32 | + break | |
33 | + fi | |
34 | + size=\`expr \$size + 1\` | |
35 | +done | |
36 | +\$rm -f try.* | |
37 | +EOSC | |
38 | + | |
39 | : now set up to do reads with possible shell escape and default assignment | |
40 | cat <<EOSC >myread | |
41 | $startsh | |
42 | @@ -4617,7 +4642,18 @@ | |
43 | for thisdir in $libpth $xlibpth; do | |
44 | test -d $thisdir && libspath="$libspath $thisdir" | |
45 | done | |
46 | +echo 'main(){}' > try.c | |
47 | for thislib in $libswanted; do | |
48 | + printf "Checking for -l$thislib ... " >&4 | |
49 | + if $cc $cflags $ldflags -l$thislib try.c >/dev/null 2>&1; then | |
50 | + echo "OK" >&4 | |
51 | + dflt="$dflt -l$thislib" | |
52 | + libsfiles="$libsfiles lib${thislib}.so" | |
53 | + libsfound="$libsfound /usr/lib/lib${thislib}.so" | |
54 | + else | |
55 | + echo "nope" >&4 | |
56 | + fi | |
57 | + continue | |
58 | for thisdir in $libspath; do | |
59 | xxx='' | |
60 | if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then | |
61 | @@ -5025,6 +5061,8 @@ | |
62 | rp="You have a problem. Shall I abort Configure" | |
63 | dflt=y | |
64 | fi | |
65 | + # we dont care how it executed, just that it compiled | |
66 | + dflt=n | |
67 | else | |
68 | echo "I can't compile the test program." >>try.msg | |
69 | rp="You have a BIG problem. Shall I abort Configure" | |
70 | @@ -5182,23 +5220,20 @@ | |
71 | case "$intsize" in | |
72 | '') | |
73 | echo "Checking to see how big your integers are..." >&4 | |
74 | - $cat >try.c <<EOCP | |
75 | -#include <stdio.h> | |
76 | -#$i_stdlib I_STDLIB | |
77 | -#ifdef I_STDLIB | |
78 | -#include <stdlib.h> | |
79 | -#endif | |
80 | -int main() | |
81 | -{ | |
82 | - printf("intsize=%d;\n", (int)sizeof(int)); | |
83 | - printf("longsize=%d;\n", (int)sizeof(long)); | |
84 | - printf("shortsize=%d;\n", (int)sizeof(short)); | |
85 | - exit(0); | |
86 | -} | |
87 | -EOCP | |
88 | - set try | |
89 | - if eval $compile_ok && $run ./try > /dev/null; then | |
90 | - eval `$run ./try` | |
91 | + | |
92 | + type="int" | |
93 | + . ./mysizeof | |
94 | + intsize="$size" | |
95 | + | |
96 | + type="long" | |
97 | + . ./mysizeof | |
98 | + longsize="$size" | |
99 | + | |
100 | + type="short" | |
101 | + . ./mysizeof | |
102 | + shortsize="$size" | |
103 | + | |
104 | + if test "X$intsize" != X -a "X$longsize" != X -a "X$shortsize" != X; then | |
105 | echo "Your integers are $intsize bytes long." | |
106 | echo "Your long integers are $longsize bytes long." | |
107 | echo "Your short integers are $shortsize bytes long." | |
108 | @@ -5225,7 +5260,6 @@ | |
109 | fi | |
110 | ;; | |
111 | esac | |
112 | -$rm -f try try.* | |
113 | ||
114 | : check for long long | |
115 | echo " " | |
116 | @@ -5246,19 +5280,11 @@ | |
117 | : check for length of long long | |
118 | case "${d_longlong}${longlongsize}" in | |
119 | $define) | |
120 | - echo " " | |
121 | - echo "Checking to see how big your long longs are..." >&4 | |
122 | - $cat >try.c <<'EOCP' | |
123 | -#include <stdio.h> | |
124 | -int main() | |
125 | -{ | |
126 | - printf("%d\n", (int)sizeof(long long)); | |
127 | - return(0); | |
128 | -} | |
129 | -EOCP | |
130 | - set try | |
131 | - if eval $compile_ok; then | |
132 | - longlongsize=`$run ./try` | |
133 | + type="long long" | |
134 | + . ./mysizeof | |
135 | + longlongsize="$size" | |
136 | + | |
137 | + if test "X$longlongsize" != X; then | |
138 | echo "Your long longs are $longlongsize bytes long." | |
139 | else | |
140 | dflt='8' | |
141 | @@ -5572,21 +5598,10 @@ | |
142 | case "$doublesize" in | |
143 | '') | |
144 | echo "Checking to see how big your double precision numbers are..." >&4 | |
145 | - $cat >try.c <<EOCP | |
146 | -#include <stdio.h> | |
147 | -#$i_stdlib I_STDLIB | |
148 | -#ifdef I_STDLIB | |
149 | -#include <stdlib.h> | |
150 | -#endif | |
151 | -int main() | |
152 | -{ | |
153 | - printf("%d\n", (int)sizeof(double)); | |
154 | - exit(0); | |
155 | -} | |
156 | -EOCP | |
157 | - set try | |
158 | - if eval $compile_ok; then | |
159 | - doublesize=`$run ./try` | |
160 | + type="double" | |
161 | + . ./mysizeof | |
162 | + doublesize="$size" | |
163 | + if test "X$doublesize" != X; then | |
164 | echo "Your double is $doublesize bytes long." | |
165 | else | |
166 | dflt='8' | |
167 | @@ -5620,17 +5635,10 @@ | |
168 | $define) | |
169 | echo " " | |
170 | echo "Checking to see how big your long doubles are..." >&4 | |
171 | - $cat >try.c <<'EOCP' | |
172 | -#include <stdio.h> | |
173 | -int main() | |
174 | -{ | |
175 | - printf("%d\n", sizeof(long double)); | |
176 | -} | |
177 | -EOCP | |
178 | - set try | |
179 | - set try | |
180 | - if eval $compile; then | |
181 | - longdblsize=`$run ./try` | |
182 | + type="long double" | |
183 | + . ./mysizeof | |
184 | + longdblsize="$size" | |
185 | + if test "X$longdblsize" != X; then | |
186 | echo "Your long doubles are $longdblsize bytes long." | |
187 | else | |
188 | dflt='8' | |
189 | @@ -6268,25 +6276,13 @@ | |
190 | '') | |
191 | echo "Checking to see how big your pointers are..." >&4 | |
192 | if test "$voidflags" -gt 7; then | |
193 | - echo '#define VOID_PTR char *' > try.c | |
194 | + type="char *" | |
195 | else | |
196 | - echo '#define VOID_PTR void *' > try.c | |
197 | + type="void *" | |
198 | fi | |
199 | - $cat >>try.c <<EOCP | |
200 | -#include <stdio.h> | |
201 | -#$i_stdlib I_STDLIB | |
202 | -#ifdef I_STDLIB | |
203 | -#include <stdlib.h> | |
204 | -#endif | |
205 | -int main() | |
206 | -{ | |
207 | - printf("%d\n", (int)sizeof(VOID_PTR)); | |
208 | - exit(0); | |
209 | -} | |
210 | -EOCP | |
211 | - set try | |
212 | - if eval $compile_ok; then | |
213 | - ptrsize=`$run ./try` | |
214 | + . ./mysizeof | |
215 | + ptrsize="$size" | |
216 | + if test "X$ptrsize" != X; then | |
217 | echo "Your pointers are $ptrsize bytes long." | |
218 | else | |
219 | dflt='4' | |
220 | @@ -8837,18 +8833,10 @@ | |
221 | ||
222 | echo " " | |
223 | echo "Checking to see how big your file offsets are..." >&4 | |
224 | -$cat >try.c <<EOCP | |
225 | -#include <sys/types.h> | |
226 | -#include <stdio.h> | |
227 | -int main() | |
228 | -{ | |
229 | - printf("%d\n", (int)sizeof($lseektype)); | |
230 | - return(0); | |
231 | -} | |
232 | -EOCP | |
233 | -set try | |
234 | -if eval $compile_ok; then | |
235 | - lseeksize=`$run ./try` | |
236 | +type="$lseektype" | |
237 | +. ./mysizeof | |
238 | +lseeksize="$size" | |
239 | +if test "X$lseeksize" != X; then | |
240 | echo "Your file offsets are $lseeksize bytes long." | |
241 | else | |
242 | dflt=$longsize | |
243 | @@ -8871,21 +8859,10 @@ | |
244 | *) zzz="fpos_t" ;; | |
245 | esac | |
246 | echo "Checking the size of $zzz..." >&4 | |
247 | -cat > try.c <<EOCP | |
248 | -#include <sys/types.h> | |
249 | -#include <stdio.h> | |
250 | -#$i_stdlib I_STDLIB | |
251 | -#ifdef I_STDLIB | |
252 | -#include <stdlib.h> | |
253 | -#endif | |
254 | -int main() { | |
255 | - printf("%d\n", (int)sizeof($fpostype)); | |
256 | - exit(0); | |
257 | -} | |
258 | -EOCP | |
259 | -set try | |
260 | -if eval $compile_ok; then | |
261 | - yyy=`$run ./try` | |
262 | +type="$zzz" | |
263 | +. ./mysizeof | |
264 | +yyy="$size" | |
265 | +if test "X$yyy" != X; then | |
266 | case "$yyy" in | |
267 | '') fpossize=4 | |
268 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 | |
269 | @@ -8953,18 +8930,10 @@ | |
270 | if $test -f uselargefiles.cbu; then | |
271 | echo " " | |
272 | echo "Rechecking to see how big your file offsets are..." >&4 | |
273 | - $cat >try.c <<EOCP | |
274 | -#include <sys/types.h> | |
275 | -#include <stdio.h> | |
276 | -int main() | |
277 | -{ | |
278 | - printf("%d\n", (int)sizeof($lseektype)); | |
279 | - return(0); | |
280 | -} | |
281 | -EOCP | |
282 | - set try | |
283 | - if eval $compile_ok; then | |
284 | - lseeksize=`$run ./try` | |
285 | + type="$lseektype" | |
286 | + . ./mysizeof | |
287 | + lseeksize="$size" | |
288 | + if test "X$lseeksize" != X; then | |
289 | $echo "Your file offsets are now $lseeksize bytes long." | |
290 | else | |
291 | dflt="$lseeksize" | |
292 | @@ -14590,22 +14559,10 @@ | |
293 | case "$charsize" in | |
294 | '') | |
295 | echo "Checking to see how big your characters are (hey, you never know)..." >&4 | |
296 | - $cat >try.c <<EOCP | |
297 | -#include <stdio.h> | |
298 | -#$i_stdlib I_STDLIB | |
299 | -#ifdef I_STDLIB | |
300 | -#include <stdlib.h> | |
301 | -#endif | |
302 | -int main() | |
303 | -{ | |
304 | - printf("%d\n", (int)sizeof(char)); | |
305 | - exit(0); | |
306 | -} | |
307 | -EOCP | |
308 | - set try | |
309 | - if eval $compile_ok; then | |
310 | - dflt=`$run ./try` | |
311 | - else | |
312 | + type="char" | |
313 | + . ./mysizeof | |
314 | + dflt="$size" | |
315 | + if test "X$dflt" = X; then | |
316 | dflt='1' | |
317 | echo "(I can't seem to compile the test program. Guessing...)" | |
318 | fi | |
319 | @@ -17430,6 +17387,24 @@ | |
320 | esac | |
321 | else | |
322 | dflt='4321' | |
323 | +$cat >try.c <<EOCP | |
324 | +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | |
325 | +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; | |
326 | +void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; } | |
327 | +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; | |
328 | +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; | |
329 | +void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; } | |
330 | +int main() { _ascii (); _ebcdic (); return 0; } | |
331 | +EOCP | |
332 | + if $cc $cflags -c try.c -o try.o; then | |
333 | + if grep BIGenDianSyS try.o >/dev/null; then | |
334 | + dflt='4321' | |
335 | + else | |
336 | + if grep LiTTleEnDian try.o >/dev/null; then | |
337 | + dflt='1234' | |
338 | + fi | |
339 | + fi | |
340 | + fi | |
341 | cat <<'EOM' | |
342 | (I can't seem to compile the test program. Guessing big-endian...) | |
343 | EOM | |
344 | @@ -17753,6 +17728,13 @@ | |
345 | set try | |
346 | if eval $compile_ok; then | |
347 | dflt=`$run ./try` | |
348 | + if test "X$dflt" = X; then | |
349 | + if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then | |
350 | + dflt='__alignof__(long double)' | |
351 | + else | |
352 | + dflt='__alignof__(double)' | |
353 | + fi | |
354 | + fi | |
355 | else | |
356 | dflt='8' | |
357 | echo "(I can't seem to compile the test program...)" | |
358 | @@ -18475,21 +18457,10 @@ | |
359 | *) zzz="gid" ;; | |
360 | esac | |
361 | echo "Checking the size of $zzz..." >&4 | |
362 | -cat > try.c <<EOCP | |
363 | -#include <sys/types.h> | |
364 | -#include <stdio.h> | |
365 | -#$i_stdlib I_STDLIB | |
366 | -#ifdef I_STDLIB | |
367 | -#include <stdlib.h> | |
368 | -#endif | |
369 | -int main() { | |
370 | - printf("%d\n", (int)sizeof($gidtype)); | |
371 | - exit(0); | |
372 | -} | |
373 | -EOCP | |
374 | -set try | |
375 | -if eval $compile_ok; then | |
376 | - yyy=`$run ./try` | |
377 | +type="$zzz" | |
378 | +. ./mysizeof | |
379 | +yyy="$type" | |
380 | +if test "X$yyy" != X; then | |
381 | case "$yyy" in | |
382 | '') gidsize=4 | |
383 | echo "(I can't execute the test program--guessing $gidsize.)" >&4 | |
384 | @@ -19659,21 +19630,10 @@ | |
385 | *) zzz="filesize" ;; | |
386 | esac | |
387 | echo "Checking the size of $zzz..." >&4 | |
388 | -cat > try.c <<EOCP | |
389 | -#include <sys/types.h> | |
390 | -#include <stdio.h> | |
391 | -#$i_stdlib I_STDLIB | |
392 | -#ifdef I_STDLIB | |
393 | -#include <stdlib.h> | |
394 | -#endif | |
395 | -int main() { | |
396 | - printf("%d\n", (int)sizeof($sizetype)); | |
397 | - exit(0); | |
398 | -} | |
399 | -EOCP | |
400 | -set try | |
401 | -if eval $compile_ok; then | |
402 | - yyy=`$run ./try` | |
403 | +type="$sizetype" | |
404 | +. ./mysizeof | |
405 | +yyy="$size" | |
406 | +if test "X$yyy" != X; then | |
407 | case "$yyy" in | |
408 | '') sizesize=4 | |
409 | echo "(I can't execute the test program--guessing $sizesize.)" >&4 |