Commit | Line | Data |
---|---|---|
2304df62 AD |
1 | #! /bin/sh |
2 | # | |
3 | # If these # comments don't work, trim them. Don't worry about any other | |
4 | # shell scripts, Configure will trim # comments from them for you. | |
5 | # | |
6 | # (If you are trying to port this package to a machine without sh, | |
7 | # I would suggest you have a look at the prototypical config_h.SH file | |
8 | # and edit it to reflect your system. Some packages may include samples | |
9 | # of config.h for certain machines, so you might look for one of those.) | |
10 | # | |
11 | # Yes, you may rip this off to use in other distribution packages. This | |
12 | # script belongs to the public domain and cannot be copyrighted. | |
13 | # | |
14 | # (Note: this Configure script was generated automatically. Rather than | |
15 | # working with this copy of Configure, you may wish to get metaconfig. | |
16 | # The dist-3.0 package (which contains metaconfig) was posted in | |
dfe9444c AD |
17 | # comp.sources.misc and is available on CPAN under authors/id/RAM so |
18 | # you may fetch it yourself from your nearest archive site.) | |
2304df62 AD |
19 | # |
20 | ||
dfe9444c | 21 | # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ |
2304df62 | 22 | # |
3bf3851b | 23 | # Generated on Sun Apr 24 14:17:04 CEST 2005 [metaconfig 3.0 PL70] |
7f2de2d2 | 24 | # (with additional metaconfig patches by perlbug@perl.org) |
2304df62 | 25 | |
283fdd21 | 26 | cat >c1$$ <<EOF |
2304df62 AD |
27 | ARGGGHHHH!!!!! |
28 | ||
29 | SCO csh still thinks true is false. Write to SCO today and tell them that next | |
30 | year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-) | |
31 | ||
32 | (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All | |
33 | we'd have to do is go in and swap the && and || tokens, wherever they are.) | |
34 | ||
35 | [End of diatribe. We now return you to your regularly scheduled programming...] | |
36 | EOF | |
283fdd21 | 37 | cat >c2$$ <<EOF |
2304df62 AD |
38 | |
39 | OOPS! You naughty creature! You didn't run Configure with sh! | |
40 | I will attempt to remedy the situation by running sh for you... | |
41 | EOF | |
42 | ||
283fdd21 | 43 | true || cat c1$$ c2$$ |
2304df62 AD |
44 | true || exec sh $0 $argv:q |
45 | ||
283fdd21 | 46 | (exit $?0) || cat c2$$ |
2304df62 | 47 | (exit $?0) || exec sh $0 $argv:q |
283fdd21 | 48 | rm -f c1$$ c2$$ |
2304df62 | 49 | |
a868f49f | 50 | if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then |
2ea5368e JH |
51 | cat >&4 <<EOF |
52 | *** | |
53 | *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do | |
54 | *** Configure that well. (Plan 9 is close to UNIX but not close enough.) | |
55 | *** Please read the README.plan9 for further instructions. | |
56 | *** Cannot continue, aborting. | |
57 | *** | |
58 | EOF | |
59 | exit 1 | |
60 | fi | |
61 | ||
a0d0e21e LW |
62 | : compute my invocation name |
63 | me=$0 | |
64 | case "$0" in | |
65 | */*) | |
66 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` | |
67 | test "$me" || me=$0 | |
68 | ;; | |
69 | esac | |
70 | ||
dfe9444c | 71 | : Proper separator for the PATH environment variable |
8e07c86e AD |
72 | p_=: |
73 | : On OS/2 this directory should exist if this is not floppy only system :-] | |
8257dec7 | 74 | if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then |
dfe9444c AD |
75 | if test -n "$OS2_SHELL"; then |
76 | p_=\; | |
77 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` | |
78 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` | |
8257dec7 | 79 | is_os2=yes |
c4f23d77 | 80 | elif test -n "$DJGPP"; then |
495e2cbe MB |
81 | case "X${MACHTYPE:-nonesuchmach}" in |
82 | *cygwin) ;; | |
83 | *) p_=\; ;; | |
84 | esac | |
dfe9444c | 85 | fi |
39e571d4 | 86 | fi |
a0d0e21e LW |
87 | |
88 | : Proper PATH setting | |
89 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' | |
16d20bd9 | 90 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
232e078e | 91 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
16d20bd9 | 92 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
232e078e | 93 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
066079d9 | 94 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin" |
232e078e AD |
95 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" |
96 | paths="$paths /sbin /usr/sbin /usr/libexec" | |
3c728e00 | 97 | paths="$paths /system/gnu_library/bin" |
a0d0e21e LW |
98 | |
99 | for p in $paths | |
100 | do | |
8e07c86e AD |
101 | case "$p_$PATH$p_" in |
102 | *$p_$p$p_*) ;; | |
103 | *) test -d $p && PATH=$PATH$p_$p ;; | |
a0d0e21e LW |
104 | esac |
105 | done | |
106 | ||
8e07c86e | 107 | PATH=.$p_$PATH |
2304df62 AD |
108 | export PATH |
109 | ||
dfe9444c AD |
110 | : shall we be using ksh? |
111 | inksh='' | |
112 | needksh='' | |
113 | avoidksh='' | |
114 | newsh=/bin/ksh | |
115 | changesh='' | |
ff0cee69 | 116 | if (PATH=.; alias -x) >/dev/null 2>&1; then |
dfe9444c AD |
117 | inksh=true |
118 | fi | |
119 | if test -f /hp-ux -a -f /bin/ksh; then | |
120 | needksh='to avoid sh bug in "here document" expansion' | |
121 | fi | |
122 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then | |
123 | if test X`/usr/bin/uname -v` = X4; then | |
124 | avoidksh="to avoid AIX 4's /bin/sh" | |
125 | newsh=/usr/bin/bsh | |
2304df62 | 126 | fi |
dfe9444c | 127 | fi |
cf04f91f JH |
128 | if test -f /osf_boot -a -f /usr/sbin/setld; then |
129 | if test X`/usr/bin/uname -s` = XOSF1; then | |
130 | avoidksh="to avoid Digital UNIX' ksh" | |
131 | newsh=/bin/sh | |
132 | unset BIN_SH # if this is 'xpg4' sh will start up ksh | |
133 | fi | |
134 | fi | |
dfe9444c AD |
135 | case "$inksh/$needksh" in |
136 | /[a-z]*) | |
c4f23d77 | 137 | ENV='' |
dfe9444c AD |
138 | changesh=true |
139 | reason="$needksh" | |
140 | ;; | |
141 | esac | |
142 | case "$inksh/$avoidksh" in | |
143 | true/[a-z]*) | |
144 | changesh=true | |
145 | reason="$avoidksh" | |
146 | ;; | |
147 | esac | |
148 | case "$inksh/$needksh-$avoidksh-" in | |
149 | true/--) | |
a0d0e21e LW |
150 | cat <<EOM |
151 | (I see you are using the Korn shell. Some ksh's blow up on $me, | |
dfe9444c | 152 | mainly on older exotic systems. If yours does, try the Bourne shell instead.) |
ff0cee69 | 153 | EOM |
dfe9444c AD |
154 | ;; |
155 | esac | |
156 | case "$changesh" in | |
157 | true) | |
2e2a97a6 | 158 | export newsh |
dfe9444c AD |
159 | echo "(Feeding myself to $newsh $reason.)" |
160 | case "$0" in | |
161 | Configure|*/Configure) exec $newsh $0 "$@";; | |
162 | *) exec $newsh Configure "$@";; | |
163 | esac | |
164 | ;; | |
165 | esac | |
2304df62 | 166 | |
bfb7748a AD |
167 | : if needed set CDPATH to a harmless value that is not chatty |
168 | : avoid bash 2.02 problems with empty CDPATH. | |
169 | case "$CDPATH" in | |
170 | '') ;; | |
171 | *) case "$SHELL" in | |
172 | *bash*) CDPATH='.' ;; | |
173 | *) CDPATH='' ;; | |
174 | esac | |
175 | ;; | |
176 | esac | |
2304df62 AD |
177 | : Configure runs within the UU subdirectory |
178 | test -d UU || mkdir UU | |
8e07c86e | 179 | cd UU && rm -f ./* |
2304df62 | 180 | |
6b356c8e JH |
181 | ccname='' |
182 | ccversion='' | |
b4eb6b3d JH |
183 | ccsymbols='' |
184 | cppccsymbols='' | |
185 | cppsymbols='' | |
5440bc8e JH |
186 | from='' |
187 | run='' | |
188 | targetarch='' | |
189 | to='' | |
190 | usecrosscompile='' | |
bd43df42 | 191 | mistrustnm='' |
9c839522 | 192 | perllibs='' |
b4eb6b3d JH |
193 | dynamic_ext='' |
194 | extensions='' | |
195 | known_extensions='' | |
196 | nonxs_ext='' | |
197 | static_ext='' | |
198 | useopcode='' | |
199 | useposix='' | |
6fcddf3b | 200 | extras='' |
ecfc5424 | 201 | d_bsd='' |
40a7a20a | 202 | d_eunice='' |
2304df62 AD |
203 | d_xenix='' |
204 | eunicefix='' | |
205 | Mcc='' | |
dfe9444c | 206 | ar='' |
2304df62 AD |
207 | awk='' |
208 | bash='' | |
209 | bison='' | |
210 | byacc='' | |
211 | cat='' | |
212 | chgrp='' | |
213 | chmod='' | |
214 | chown='' | |
ecfc5424 | 215 | comm='' |
2304df62 AD |
216 | compress='' |
217 | cp='' | |
218 | cpio='' | |
219 | cpp='' | |
220 | csh='' | |
221 | date='' | |
222 | echo='' | |
223 | egrep='' | |
224 | emacs='' | |
225 | expr='' | |
226 | find='' | |
227 | flex='' | |
3c728e00 | 228 | gmake='' |
2304df62 | 229 | grep='' |
8ff267be | 230 | gzip='' |
2304df62 AD |
231 | inews='' |
232 | ksh='' | |
233 | less='' | |
234 | line='' | |
235 | lint='' | |
236 | ln='' | |
237 | lp='' | |
238 | lpr='' | |
239 | ls='' | |
240 | mail='' | |
241 | mailx='' | |
dfe9444c | 242 | make='' |
2304df62 AD |
243 | mkdir='' |
244 | more='' | |
245 | mv='' | |
693762b4 | 246 | nm='' |
2304df62 AD |
247 | nroff='' |
248 | perl='' | |
249 | pg='' | |
250 | pmake='' | |
251 | pr='' | |
252 | rm='' | |
253 | rmail='' | |
254 | sed='' | |
255 | sendmail='' | |
2304df62 AD |
256 | shar='' |
257 | sleep='' | |
258 | smail='' | |
259 | sort='' | |
260 | submit='' | |
261 | tail='' | |
262 | tar='' | |
263 | tbl='' | |
693762b4 | 264 | tee='' |
2304df62 AD |
265 | test='' |
266 | touch='' | |
267 | tr='' | |
268 | troff='' | |
269 | uname='' | |
270 | uniq='' | |
271 | uuname='' | |
272 | vi='' | |
273 | zcat='' | |
8ff267be | 274 | zip='' |
b4eb6b3d JH |
275 | full_ar='' |
276 | full_sed='' | |
a0d0e21e | 277 | libswanted='' |
2304df62 AD |
278 | hint='' |
279 | myuname='' | |
85e6fe83 LW |
280 | osname='' |
281 | osvers='' | |
2304df62 AD |
282 | Author='' |
283 | Date='' | |
284 | Header='' | |
285 | Id='' | |
286 | Locker='' | |
287 | Log='' | |
288 | RCSfile='' | |
289 | Revision='' | |
290 | Source='' | |
291 | State='' | |
dfe9444c AD |
292 | _a='' |
293 | _exe='' | |
294 | _o='' | |
4633a7c4 LW |
295 | archobjs='' |
296 | exe_ext='' | |
297 | firstmakefile='' | |
298 | lib_ext='' | |
299 | obj_ext='' | |
300 | path_sep='' | |
b4eb6b3d | 301 | afs='' |
a6d26a0d | 302 | afsroot='' |
b4eb6b3d JH |
303 | alignbytes='' |
304 | ansi2knr='' | |
305 | archlib='' | |
306 | archlibexp='' | |
307 | d_archlib='' | |
308 | installarchlib='' | |
309 | archname='' | |
310 | myarchname='' | |
311 | d_atolf='' | |
312 | d_atoll='' | |
313 | baserev='' | |
314 | bin='' | |
315 | binexp='' | |
316 | installbin='' | |
b4eb6b3d | 317 | byteorder='' |
2304df62 | 318 | cc='' |
2304df62 AD |
319 | ccflags='' |
320 | cppflags='' | |
321 | ldflags='' | |
322 | lkflags='' | |
8e07c86e | 323 | locincpth='' |
2304df62 | 324 | optimize='' |
b4eb6b3d | 325 | cf_email='' |
2304df62 AD |
326 | cf_by='' |
327 | cf_time='' | |
b4eb6b3d | 328 | charsize='' |
2304df62 | 329 | contains='' |
b4eb6b3d | 330 | cpp_stuff='' |
2304df62 AD |
331 | cpplast='' |
332 | cppminus='' | |
333 | cpprun='' | |
334 | cppstdin='' | |
74cac757 | 335 | d__fwalk='' |
b4eb6b3d JH |
336 | d_access='' |
337 | d_accessx='' | |
5a29c6bc | 338 | d_aintl='' |
b4eb6b3d | 339 | d_alarm='' |
10bc17b6 JH |
340 | asctime_r_proto='' |
341 | d_asctime_r='' | |
b4eb6b3d JH |
342 | d_attribut='' |
343 | d_bcmp='' | |
344 | d_bcopy='' | |
345 | d_bzero='' | |
346 | d_casti32='' | |
347 | castflags='' | |
348 | d_castneg='' | |
349 | d_chown='' | |
350 | d_chroot='' | |
351 | d_chsize='' | |
758a5d79 | 352 | d_class='' |
b4eb6b3d JH |
353 | d_closedir='' |
354 | d_void_closedir='' | |
4e0554ec | 355 | d_cmsghdr_s='' |
b4eb6b3d | 356 | d_const='' |
5a29c6bc | 357 | d_copysignl='' |
b4eb6b3d JH |
358 | cryptlib='' |
359 | d_crypt='' | |
10bc17b6 JH |
360 | crypt_r_proto='' |
361 | d_crypt_r='' | |
b4eb6b3d JH |
362 | d_csh='' |
363 | full_csh='' | |
10bc17b6 JH |
364 | ctermid_r_proto='' |
365 | d_ctermid_r='' | |
366 | ctime_r_proto='' | |
367 | d_ctime_r='' | |
b4eb6b3d JH |
368 | d_cuserid='' |
369 | d_dbl_dig='' | |
2ef53570 | 370 | d_dbminitproto='' |
b4eb6b3d | 371 | d_difftime='' |
ae0e3d3b | 372 | d_dirfd='' |
b4eb6b3d | 373 | d_dlerror='' |
a0d0e21e | 374 | d_dlopen='' |
b4eb6b3d JH |
375 | d_dlsymun='' |
376 | d_dosuid='' | |
377 | d_suidsafe='' | |
10bc17b6 JH |
378 | d_drand48_r='' |
379 | drand48_r_proto='' | |
b4eb6b3d JH |
380 | d_drand48proto='' |
381 | d_dup2='' | |
382 | d_eaccess='' | |
383 | d_endgrent='' | |
10bc17b6 JH |
384 | d_endgrent_r='' |
385 | endgrent_r_proto='' | |
b4eb6b3d | 386 | d_endhent='' |
10bc17b6 JH |
387 | d_endhostent_r='' |
388 | endhostent_r_proto='' | |
b4eb6b3d | 389 | d_endnent='' |
10bc17b6 JH |
390 | d_endnetent_r='' |
391 | endnetent_r_proto='' | |
b4eb6b3d | 392 | d_endpent='' |
10bc17b6 JH |
393 | d_endprotoent_r='' |
394 | endprotoent_r_proto='' | |
b4eb6b3d | 395 | d_endpwent='' |
10bc17b6 JH |
396 | d_endpwent_r='' |
397 | endpwent_r_proto='' | |
b4eb6b3d | 398 | d_endsent='' |
10bc17b6 JH |
399 | d_endservent_r='' |
400 | endservent_r_proto='' | |
ff0950a8 | 401 | d_faststdio='' |
b363b713 | 402 | d_fchdir='' |
b4eb6b3d JH |
403 | d_fchmod='' |
404 | d_fchown='' | |
405 | d_fcntl='' | |
9d9004a9 | 406 | d_fcntl_can_lock='' |
b4eb6b3d JH |
407 | d_fd_macros='' |
408 | d_fd_set='' | |
409 | d_fds_bits='' | |
410 | d_fgetpos='' | |
758a5d79 JH |
411 | d_finite='' |
412 | d_finitel='' | |
b4eb6b3d JH |
413 | d_flexfnam='' |
414 | d_flock='' | |
2ef53570 | 415 | d_flockproto='' |
b4eb6b3d | 416 | d_fork='' |
758a5d79 JH |
417 | d_fp_class='' |
418 | d_fpclass='' | |
419 | d_fpclassify='' | |
420 | d_fpclassl='' | |
b4eb6b3d JH |
421 | d_fpos64_t='' |
422 | d_frexpl='' | |
423 | d_fs_data_s='' | |
424 | d_fseeko='' | |
425 | d_fsetpos='' | |
426 | d_fstatfs='' | |
411ab01c | 427 | d_fsync='' |
b4eb6b3d JH |
428 | d_ftello='' |
429 | d_ftime='' | |
430 | d_gettimeod='' | |
431 | d_Gconvert='' | |
432 | d_getcwd='' | |
433 | d_getespwnam='' | |
434 | d_getfsstat='' | |
435 | d_getgrent='' | |
10bc17b6 JH |
436 | d_getgrent_r='' |
437 | getgrent_r_proto='' | |
438 | d_getgrgid_r='' | |
439 | getgrgid_r_proto='' | |
440 | d_getgrnam_r='' | |
441 | getgrnam_r_proto='' | |
b4eb6b3d JH |
442 | d_getgrps='' |
443 | d_gethbyaddr='' | |
444 | d_gethbyname='' | |
445 | d_gethent='' | |
446 | aphostname='' | |
447 | d_gethname='' | |
448 | d_phostname='' | |
449 | d_uname='' | |
10bc17b6 JH |
450 | d_gethostbyaddr_r='' |
451 | gethostbyaddr_r_proto='' | |
452 | d_gethostbyname_r='' | |
453 | gethostbyname_r_proto='' | |
454 | d_gethostent_r='' | |
455 | gethostent_r_proto='' | |
b4eb6b3d | 456 | d_gethostprotos='' |
4e0554ec | 457 | d_getitimer='' |
b4eb6b3d | 458 | d_getlogin='' |
10bc17b6 JH |
459 | d_getlogin_r='' |
460 | getlogin_r_proto='' | |
b4eb6b3d JH |
461 | d_getmnt='' |
462 | d_getmntent='' | |
463 | d_getnbyaddr='' | |
464 | d_getnbyname='' | |
465 | d_getnent='' | |
10bc17b6 JH |
466 | d_getnetbyaddr_r='' |
467 | getnetbyaddr_r_proto='' | |
468 | d_getnetbyname_r='' | |
469 | getnetbyname_r_proto='' | |
470 | d_getnetent_r='' | |
471 | getnetent_r_proto='' | |
b4eb6b3d | 472 | d_getnetprotos='' |
0c0643d0 | 473 | d_getpagsz='' |
b4eb6b3d JH |
474 | d_getpent='' |
475 | d_getpgid='' | |
476 | d_getpgrp2='' | |
477 | d_bsdgetpgrp='' | |
478 | d_getpgrp='' | |
479 | d_getppid='' | |
480 | d_getprior='' | |
481 | d_getpbyname='' | |
482 | d_getpbynumber='' | |
10bc17b6 JH |
483 | d_getprotobyname_r='' |
484 | getprotobyname_r_proto='' | |
485 | d_getprotobynumber_r='' | |
486 | getprotobynumber_r_proto='' | |
487 | d_getprotoent_r='' | |
488 | getprotoent_r_proto='' | |
b4eb6b3d JH |
489 | d_getprotoprotos='' |
490 | d_getprpwnam='' | |
491 | d_getpwent='' | |
10bc17b6 JH |
492 | d_getpwent_r='' |
493 | getpwent_r_proto='' | |
494 | d_getpwnam_r='' | |
495 | getpwnam_r_proto='' | |
496 | d_getpwuid_r='' | |
497 | getpwuid_r_proto='' | |
b4eb6b3d | 498 | d_getsent='' |
10bc17b6 JH |
499 | d_getservbyname_r='' |
500 | getservbyname_r_proto='' | |
501 | d_getservbyport_r='' | |
502 | getservbyport_r_proto='' | |
503 | d_getservent_r='' | |
504 | getservent_r_proto='' | |
b4eb6b3d JH |
505 | d_getservprotos='' |
506 | d_getspnam='' | |
10bc17b6 JH |
507 | d_getspnam_r='' |
508 | getspnam_r_proto='' | |
b4eb6b3d JH |
509 | d_getsbyname='' |
510 | d_getsbyport='' | |
10bc17b6 JH |
511 | d_gmtime_r='' |
512 | gmtime_r_proto='' | |
a4f3eea9 | 513 | d_gnulibc='' |
5f6e0ee4 | 514 | gnulibc_version='' |
b4eb6b3d JH |
515 | d_hasmntopt='' |
516 | d_htonl='' | |
5a29c6bc | 517 | d_ilogbl='' |
b4eb6b3d JH |
518 | d_inetaton='' |
519 | d_int64_t='' | |
520 | d_isascii='' | |
758a5d79 JH |
521 | d_isfinite='' |
522 | d_isinf='' | |
b4eb6b3d JH |
523 | d_isnan='' |
524 | d_isnanl='' | |
525 | d_killpg='' | |
526 | d_lchown='' | |
527 | d_ldbl_dig='' | |
a663fd0a | 528 | d_libm_lib_version='' |
b4eb6b3d | 529 | d_link='' |
10bc17b6 JH |
530 | d_localtime_r='' |
531 | localtime_r_proto='' | |
b4eb6b3d JH |
532 | d_locconv='' |
533 | d_lockf='' | |
534 | d_longdbl='' | |
535 | longdblsize='' | |
536 | d_longlong='' | |
537 | longlongsize='' | |
538 | d_lseekproto='' | |
539 | d_lstat='' | |
540 | d_madvise='' | |
541 | d_mblen='' | |
542 | d_mbstowcs='' | |
543 | d_mbtowc='' | |
544 | d_memchr='' | |
545 | d_memcmp='' | |
546 | d_memcpy='' | |
547 | d_memmove='' | |
548 | d_memset='' | |
549 | d_mkdir='' | |
550 | d_mkdtemp='' | |
551 | d_mkfifo='' | |
552 | d_mkstemp='' | |
553 | d_mkstemps='' | |
554 | d_mktime='' | |
555 | d_mmap='' | |
556 | mmaptype='' | |
557 | d_modfl='' | |
e67aeab1 | 558 | d_modfl_pow32_bug='' |
bc9a1b2c | 559 | d_modflproto='' |
b4eb6b3d JH |
560 | d_mprotect='' |
561 | d_msg='' | |
562 | d_msgctl='' | |
563 | d_msgget='' | |
4e0554ec | 564 | d_msghdr_s='' |
b4eb6b3d JH |
565 | d_msgrcv='' |
566 | d_msgsnd='' | |
567 | d_msync='' | |
568 | d_munmap='' | |
569 | d_nice='' | |
2765b840 | 570 | d_nl_langinfo='' |
b4eb6b3d JH |
571 | d_off64_t='' |
572 | d_open3='' | |
573 | d_fpathconf='' | |
574 | d_pathconf='' | |
575 | d_pause='' | |
576 | d_pipe='' | |
577 | d_poll='' | |
2304df62 | 578 | d_portable='' |
a33c94aa | 579 | d_procselfexe='' |
f24dbf84 | 580 | procselfexe='' |
b4eb6b3d JH |
581 | d_old_pthread_create_joinable='' |
582 | old_pthread_create_joinable='' | |
d6483fcc | 583 | d_pthread_atfork='' |
16c773f9 | 584 | d_pthread_attr_setscope='' |
b4eb6b3d JH |
585 | d_pthread_yield='' |
586 | d_sched_yield='' | |
587 | sched_yield='' | |
588 | d_qgcvt='' | |
10bc17b6 JH |
589 | d_random_r='' |
590 | random_r_proto='' | |
591 | d_readdir64_r='' | |
592 | readdir64_r_proto='' | |
b4eb6b3d JH |
593 | d_readdir='' |
594 | d_rewinddir='' | |
595 | d_seekdir='' | |
596 | d_telldir='' | |
10bc17b6 JH |
597 | d_readdir_r='' |
598 | readdir_r_proto='' | |
b4eb6b3d | 599 | d_readlink='' |
4e0554ec JH |
600 | d_readv='' |
601 | d_recvmsg='' | |
b4eb6b3d JH |
602 | d_rename='' |
603 | d_rmdir='' | |
604 | d_safebcpy='' | |
605 | d_safemcpy='' | |
606 | d_sanemcmp='' | |
ef9f17be | 607 | d_sbrkproto='' |
5a29c6bc | 608 | d_scalbnl='' |
b4eb6b3d JH |
609 | d_select='' |
610 | d_sem='' | |
611 | d_semctl='' | |
612 | d_semget='' | |
613 | d_semop='' | |
4e0554ec | 614 | d_sendmsg='' |
b4eb6b3d JH |
615 | d_setegid='' |
616 | d_seteuid='' | |
617 | d_setgrent='' | |
10bc17b6 JH |
618 | d_setgrent_r='' |
619 | setgrent_r_proto='' | |
b4eb6b3d JH |
620 | d_setgrps='' |
621 | d_sethent='' | |
10bc17b6 JH |
622 | d_sethostent_r='' |
623 | sethostent_r_proto='' | |
4e0554ec | 624 | d_setitimer='' |
b4eb6b3d JH |
625 | d_setlinebuf='' |
626 | d_setlocale='' | |
10bc17b6 JH |
627 | d_setlocale_r='' |
628 | setlocale_r_proto='' | |
b4eb6b3d | 629 | d_setnent='' |
10bc17b6 JH |
630 | d_setnetent_r='' |
631 | setnetent_r_proto='' | |
b4eb6b3d JH |
632 | d_setpent='' |
633 | d_setpgid='' | |
634 | d_setpgrp2='' | |
635 | d_bsdsetpgrp='' | |
636 | d_setpgrp='' | |
637 | d_setprior='' | |
638 | d_setproctitle='' | |
10bc17b6 JH |
639 | d_setprotoent_r='' |
640 | setprotoent_r_proto='' | |
b4eb6b3d | 641 | d_setpwent='' |
10bc17b6 JH |
642 | d_setpwent_r='' |
643 | setpwent_r_proto='' | |
b4eb6b3d JH |
644 | d_setregid='' |
645 | d_setresgid='' | |
646 | d_setresuid='' | |
647 | d_setreuid='' | |
648 | d_setrgid='' | |
649 | d_setruid='' | |
650 | d_setsent='' | |
10bc17b6 JH |
651 | d_setservent_r='' |
652 | setservent_r_proto='' | |
b4eb6b3d JH |
653 | d_setsid='' |
654 | d_setvbuf='' | |
655 | d_sfio='' | |
656 | usesfio='' | |
657 | d_shm='' | |
658 | d_shmat='' | |
659 | d_shmatprototype='' | |
660 | shmattype='' | |
661 | d_shmctl='' | |
662 | d_shmdt='' | |
663 | d_shmget='' | |
664 | d_sigaction='' | |
983dbef6 | 665 | d_sigprocmask='' |
b4eb6b3d | 666 | d_sigsetjmp='' |
5d39362b | 667 | usesitecustomize='' |
49a78c82 | 668 | d_sockatmark='' |
2ef53570 | 669 | d_sockatmarkproto='' |
b4eb6b3d JH |
670 | d_msg_ctrunc='' |
671 | d_msg_dontroute='' | |
672 | d_msg_oob='' | |
673 | d_msg_peek='' | |
674 | d_msg_proxy='' | |
675 | d_oldsock='' | |
676 | d_scm_rights='' | |
677 | d_socket='' | |
678 | d_sockpair='' | |
679 | sockethdr='' | |
680 | socketlib='' | |
681 | d_socklen_t='' | |
682 | d_socks5_init='' | |
683 | d_sqrtl='' | |
10bc17b6 JH |
684 | d_srand48_r='' |
685 | srand48_r_proto='' | |
686 | d_srandom_r='' | |
687 | srandom_r_proto='' | |
eef837ea | 688 | d_sresgproto='' |
640374d0 | 689 | d_sresuproto='' |
b4eb6b3d JH |
690 | d_statblks='' |
691 | d_statfs_f_flags='' | |
692 | d_statfs_s='' | |
693 | d_fstatvfs='' | |
694 | d_statvfs='' | |
695 | d_stdio_cnt_lval='' | |
696 | d_stdio_ptr_lval='' | |
a7ffa9b9 NC |
697 | d_stdio_ptr_lval_nochange_cnt='' |
698 | d_stdio_ptr_lval_sets_cnt='' | |
b4eb6b3d JH |
699 | d_stdiobase='' |
700 | d_stdstdio='' | |
701 | stdio_base='' | |
702 | stdio_bufsiz='' | |
703 | stdio_cnt='' | |
704 | stdio_filbuf='' | |
705 | stdio_ptr='' | |
706 | d_index='' | |
707 | d_strchr='' | |
708 | d_strcoll='' | |
709 | d_strctcpy='' | |
710 | d_strerrm='' | |
711 | d_strerror='' | |
712 | d_sysernlst='' | |
713 | d_syserrlst='' | |
10bc17b6 JH |
714 | d_strerror_r='' |
715 | strerror_r_proto='' | |
b3c85772 | 716 | d_strftime='' |
84baed4c CB |
717 | d_strlcat='' |
718 | d_strlcpy='' | |
b4eb6b3d JH |
719 | d_strtod='' |
720 | d_strtol='' | |
721 | d_strtold='' | |
722 | d_strtoll='' | |
28e5dec8 | 723 | d_strtoq='' |
b4eb6b3d JH |
724 | d_strtoul='' |
725 | d_strtoull='' | |
726 | d_strtouq='' | |
727 | d_strxfrm='' | |
728 | d_symlink='' | |
729 | d_syscall='' | |
2ef53570 | 730 | d_syscallproto='' |
b4eb6b3d JH |
731 | d_sysconf='' |
732 | d_system='' | |
733 | d_tcgetpgrp='' | |
734 | d_tcsetpgrp='' | |
735 | d_telldirproto='' | |
736 | d_time='' | |
737 | timetype='' | |
738 | clocktype='' | |
739 | d_times='' | |
10bc17b6 JH |
740 | d_tmpnam_r='' |
741 | tmpnam_r_proto='' | |
b4eb6b3d | 742 | d_truncate='' |
10bc17b6 JH |
743 | d_ttyname_r='' |
744 | ttyname_r_proto='' | |
b4eb6b3d | 745 | d_tzname='' |
4e0554ec JH |
746 | d_u32align='' |
747 | d_ualarm='' | |
b4eb6b3d JH |
748 | d_umask='' |
749 | d_semctl_semid_ds='' | |
750 | d_semctl_semun='' | |
751 | d_union_semun='' | |
758a5d79 | 752 | d_unordered='' |
4e0554ec | 753 | d_usleep='' |
2ef53570 | 754 | d_usleepproto='' |
b4eb6b3d JH |
755 | d_ustat='' |
756 | d_vfork='' | |
757 | usevfork='' | |
758 | d_voidsig='' | |
759 | signal_t='' | |
760 | d_volatile='' | |
761 | d_charvspr='' | |
762 | d_vprintf='' | |
763 | d_wait4='' | |
764 | d_waitpid='' | |
765 | d_wcstombs='' | |
766 | d_wctomb='' | |
4e0554ec | 767 | d_writev='' |
b4eb6b3d | 768 | dlext='' |
85e6fe83 LW |
769 | cccdlflags='' |
770 | ccdlflags='' | |
2304df62 | 771 | dlsrc='' |
232e078e | 772 | ld='' |
85e6fe83 | 773 | lddlflags='' |
2304df62 | 774 | usedl='' |
b4eb6b3d JH |
775 | doublesize='' |
776 | ebcdic='' | |
777 | fflushNULL='' | |
778 | fflushall='' | |
779 | fpossize='' | |
780 | fpostype='' | |
2d736872 | 781 | gccansipedantic='' |
5b463ca7 | 782 | gccosandvers='' |
8a27cf78 | 783 | gccversion='' |
b4eb6b3d JH |
784 | gidformat='' |
785 | gidsign='' | |
786 | gidsize='' | |
787 | gidtype='' | |
788 | groupstype='' | |
789 | h_fcntl='' | |
790 | h_sysfile='' | |
6e1038e0 MB |
791 | html1dir='' |
792 | html1direxp='' | |
793 | installhtml1dir='' | |
794 | html3dir='' | |
795 | html3direxp='' | |
796 | installhtml3dir='' | |
b4eb6b3d | 797 | i_arpainet='' |
10bc17b6 | 798 | i_crypt='' |
b4eb6b3d JH |
799 | db_hashtype='' |
800 | db_prefixtype='' | |
640374d0 JH |
801 | db_version_major='' |
802 | db_version_minor='' | |
803 | db_version_patch='' | |
b4eb6b3d JH |
804 | i_db='' |
805 | i_dbm='' | |
806 | i_rpcsvcdbm='' | |
807 | d_dirnamlen='' | |
808 | direntrytype='' | |
809 | i_dirent='' | |
a0d0e21e | 810 | i_dld='' |
b4eb6b3d JH |
811 | i_dlfcn='' |
812 | i_fcntl='' | |
813 | i_float='' | |
758a5d79 JH |
814 | i_fp='' |
815 | i_fp_class='' | |
b4eb6b3d JH |
816 | i_gdbm='' |
817 | d_grpasswd='' | |
818 | i_grp='' | |
b4eb6b3d JH |
819 | i_ieeefp='' |
820 | i_inttypes='' | |
2765b840 | 821 | i_langinfo='' |
b4eb6b3d JH |
822 | i_libutil='' |
823 | i_limits='' | |
824 | i_locale='' | |
825 | i_machcthr='' | |
826 | i_malloc='' | |
827 | i_math='' | |
828 | i_memory='' | |
829 | i_mntent='' | |
830 | i_ndbm='' | |
831 | i_netdb='' | |
832 | i_neterrno='' | |
833 | i_netinettcp='' | |
834 | i_niin='' | |
835 | i_sysin='' | |
836 | i_poll='' | |
837 | i_prot='' | |
838 | i_pthread='' | |
839 | d_pwage='' | |
840 | d_pwchange='' | |
841 | d_pwclass='' | |
842 | d_pwcomment='' | |
843 | d_pwexpire='' | |
844 | d_pwgecos='' | |
845 | d_pwpasswd='' | |
846 | d_pwquota='' | |
847 | i_pwd='' | |
848 | i_sfio='' | |
849 | i_shadow='' | |
850 | i_socks='' | |
851 | i_stddef='' | |
852 | i_stdlib='' | |
853 | i_string='' | |
854 | strings='' | |
855 | i_sunmath='' | |
856 | i_sysaccess='' | |
857 | i_sysdir='' | |
858 | i_sysfile='' | |
859 | d_voidtty='' | |
860 | i_bsdioctl='' | |
861 | i_sysfilio='' | |
862 | i_sysioctl='' | |
863 | i_syssockio='' | |
864 | i_syslog='' | |
865 | i_sysmman='' | |
866 | i_sysmode='' | |
867 | i_sysmount='' | |
868 | i_sysndir='' | |
869 | i_sysparam='' | |
870 | i_sysresrc='' | |
871 | i_syssecrt='' | |
872 | i_sysselct='' | |
873 | i_sysstat='' | |
874 | i_sysstatfs='' | |
875 | i_sysstatvfs='' | |
876 | i_systimes='' | |
877 | i_systypes='' | |
878 | i_sysuio='' | |
879 | i_sysun='' | |
880 | i_sysutsname='' | |
881 | i_sysvfs='' | |
882 | i_syswait='' | |
883 | i_sgtty='' | |
884 | i_termio='' | |
885 | i_termios='' | |
14b90194 JH |
886 | d_tm_tm_gmtoff='' |
887 | d_tm_tm_zone='' | |
b4eb6b3d JH |
888 | i_systime='' |
889 | i_systimek='' | |
890 | i_time='' | |
891 | timeincl='' | |
892 | i_unistd='' | |
893 | i_ustat='' | |
894 | i_utime='' | |
895 | i_values='' | |
896 | i_stdarg='' | |
897 | i_varargs='' | |
898 | i_varhdr='' | |
899 | i_vfork='' | |
900 | inc_version_list='' | |
901 | inc_version_list_init='' | |
902 | installprefix='' | |
903 | installprefixexp='' | |
904 | installstyle='' | |
905 | installusrbinperl='' | |
906 | intsize='' | |
907 | longsize='' | |
908 | shortsize='' | |
4b661809 | 909 | issymlink='' |
2304df62 | 910 | libc='' |
b4eb6b3d JH |
911 | ldlibpthname='' |
912 | libperl='' | |
913 | shrpenv='' | |
914 | useshrplib='' | |
a0d0e21e | 915 | glibpth='' |
2304df62 | 916 | libpth='' |
8e07c86e | 917 | loclibpth='' |
2304df62 AD |
918 | plibpth='' |
919 | xlibpth='' | |
1cfa4ec7 | 920 | ignore_versioned_solibs='' |
2304df62 | 921 | libs='' |
43999f95 JH |
922 | libsdirs='' |
923 | libsfiles='' | |
924 | libsfound='' | |
13b3f787 | 925 | libspath='' |
85e6fe83 | 926 | lns='' |
b4eb6b3d JH |
927 | d_PRIEUldbl='' |
928 | d_PRIFUldbl='' | |
929 | d_PRIGUldbl='' | |
930 | d_PRIeldbl='' | |
931 | d_PRIfldbl='' | |
932 | d_PRIgldbl='' | |
933 | d_SCNfldbl='' | |
934 | sPRIEUldbl='' | |
935 | sPRIFUldbl='' | |
936 | sPRIGUldbl='' | |
937 | sPRIeldbl='' | |
938 | sPRIfldbl='' | |
939 | sPRIgldbl='' | |
940 | sSCNfldbl='' | |
941 | lseeksize='' | |
942 | lseektype='' | |
8ff267be | 943 | make_set_make='' |
b4eb6b3d JH |
944 | d_mymalloc='' |
945 | freetype='' | |
946 | mallocobj='' | |
947 | mallocsrc='' | |
948 | malloctype='' | |
1c6118a4 | 949 | usemallocwrap='' |
b4eb6b3d JH |
950 | usemymalloc='' |
951 | installman1dir='' | |
952 | man1dir='' | |
953 | man1direxp='' | |
954 | man1ext='' | |
955 | installman3dir='' | |
956 | man3dir='' | |
957 | man3direxp='' | |
958 | man3ext='' | |
959 | modetype='' | |
960 | multiarch='' | |
961 | mydomain='' | |
962 | myhostname='' | |
963 | phostname='' | |
2304df62 AD |
964 | c='' |
965 | n='' | |
b4eb6b3d JH |
966 | d_eofnblk='' |
967 | eagain='' | |
968 | o_nonblock='' | |
969 | rd_nodata='' | |
2cc61e15 | 970 | need_va_copy='' |
b4eb6b3d JH |
971 | netdb_hlen_type='' |
972 | netdb_host_type='' | |
973 | netdb_name_type='' | |
974 | netdb_net_type='' | |
975 | groupcat='' | |
976 | hostcat='' | |
977 | passcat='' | |
978 | orderlib='' | |
979 | ranlib='' | |
980 | d_perl_otherlibdirs='' | |
981 | otherlibdirs='' | |
2304df62 AD |
982 | package='' |
983 | spackage='' | |
b4eb6b3d JH |
984 | pager='' |
985 | api_revision='' | |
986 | api_subversion='' | |
987 | api_version='' | |
988 | api_versionstring='' | |
989 | patchlevel='' | |
151e6568 | 990 | perl_patchlevel='' |
b4eb6b3d JH |
991 | revision='' |
992 | subversion='' | |
993 | version='' | |
861eb78d | 994 | version_patchlevel_string='' |
b4eb6b3d JH |
995 | perl5='' |
996 | perladmin='' | |
997 | perlpath='' | |
998 | d_nv_preserves_uv='' | |
b4eb6b3d JH |
999 | i16size='' |
1000 | i16type='' | |
1001 | i32size='' | |
1002 | i32type='' | |
1003 | i64size='' | |
1004 | i64type='' | |
1005 | i8size='' | |
1006 | i8type='' | |
1007 | ivsize='' | |
1008 | ivtype='' | |
53133ed1 | 1009 | nv_preserves_uv_bits='' |
b4eb6b3d JH |
1010 | nvsize='' |
1011 | nvtype='' | |
1012 | u16size='' | |
1013 | u16type='' | |
1014 | u32size='' | |
1015 | u32type='' | |
1016 | u64size='' | |
1017 | u64type='' | |
1018 | u8size='' | |
1019 | u8type='' | |
1020 | uvsize='' | |
1021 | uvtype='' | |
1022 | ivdformat='' | |
1023 | nvEUformat='' | |
1024 | nvFUformat='' | |
1025 | nvGUformat='' | |
1026 | nveformat='' | |
1027 | nvfformat='' | |
1028 | nvgformat='' | |
1029 | uvXUformat='' | |
1030 | uvoformat='' | |
1031 | uvuformat='' | |
1032 | uvxformat='' | |
1033 | pidtype='' | |
1034 | prefix='' | |
1035 | prefixexp='' | |
1036 | installprivlib='' | |
1037 | privlib='' | |
1038 | privlibexp='' | |
1039 | prototype='' | |
1040 | ptrsize='' | |
1041 | d_PRIXU64='' | |
1042 | d_PRId64='' | |
1043 | d_PRIi64='' | |
1044 | d_PRIo64='' | |
1045 | d_PRIu64='' | |
1046 | d_PRIx64='' | |
1047 | sPRIXU64='' | |
1048 | sPRId64='' | |
1049 | sPRIi64='' | |
1050 | sPRIo64='' | |
1051 | sPRIu64='' | |
1052 | sPRIx64='' | |
1053 | d_quad='' | |
1054 | quadkind='' | |
1055 | quadtype='' | |
1056 | uquadtype='' | |
1057 | drand01='' | |
1058 | randbits='' | |
1059 | randfunc='' | |
1060 | randseedtype='' | |
1061 | seedfunc='' | |
1062 | installscript='' | |
1063 | scriptdir='' | |
1064 | scriptdirexp='' | |
1065 | selectminbits='' | |
1066 | selecttype='' | |
8ff267be | 1067 | sh='' |
b4eb6b3d JH |
1068 | sig_count='' |
1069 | sig_name='' | |
1070 | sig_name_init='' | |
1071 | sig_num='' | |
1072 | sig_num_init='' | |
76d3c696 | 1073 | sig_size='' |
b4eb6b3d JH |
1074 | installsitearch='' |
1075 | sitearch='' | |
1076 | sitearchexp='' | |
1077 | installsitebin='' | |
1078 | sitebin='' | |
1079 | sitebinexp='' | |
3bb95762 JH |
1080 | installsitehtml1dir='' |
1081 | sitehtml1dir='' | |
1082 | sitehtml1direxp='' | |
1083 | installsitehtml3dir='' | |
1084 | sitehtml3dir='' | |
1085 | sitehtml3direxp='' | |
b4eb6b3d JH |
1086 | installsitelib='' |
1087 | sitelib='' | |
1088 | sitelib_stem='' | |
1089 | sitelibexp='' | |
3bb95762 JH |
1090 | installsiteman1dir='' |
1091 | siteman1dir='' | |
1092 | siteman1direxp='' | |
1093 | installsiteman3dir='' | |
1094 | siteman3dir='' | |
1095 | siteman3direxp='' | |
b4eb6b3d JH |
1096 | siteprefix='' |
1097 | siteprefixexp='' | |
6e1038e0 MB |
1098 | installsitescript='' |
1099 | sitescript='' | |
1100 | sitescriptexp='' | |
b4eb6b3d JH |
1101 | sizesize='' |
1102 | sizetype='' | |
a0d0e21e | 1103 | so='' |
b4eb6b3d | 1104 | socksizetype='' |
2304df62 AD |
1105 | sharpbang='' |
1106 | shsharp='' | |
1107 | spitshell='' | |
dfe9444c | 1108 | src='' |
b4eb6b3d JH |
1109 | ssizetype='' |
1110 | startperl='' | |
2304df62 | 1111 | startsh='' |
b4eb6b3d JH |
1112 | stdchar='' |
1113 | d_stdio_stream_array='' | |
1114 | stdio_stream_array='' | |
1115 | sysman='' | |
5ff3f7a4 | 1116 | trnl='' |
b4eb6b3d JH |
1117 | uidformat='' |
1118 | uidsign='' | |
1119 | uidsize='' | |
1120 | uidtype='' | |
1121 | archname64='' | |
1122 | use64bitall='' | |
1123 | use64bitint='' | |
ff0950a8 | 1124 | usefaststdio='' |
b4eb6b3d JH |
1125 | ccflags_uselargefiles='' |
1126 | ldflags_uselargefiles='' | |
1127 | libswanted_uselargefiles='' | |
1128 | uselargefiles='' | |
1129 | uselongdouble='' | |
1130 | usemorebits='' | |
1131 | usemultiplicity='' | |
2304df62 | 1132 | nm_opt='' |
40a7a20a | 1133 | nm_so_opt='' |
2304df62 AD |
1134 | runnm='' |
1135 | usenm='' | |
b4eb6b3d | 1136 | useperlio='' |
29209bc5 | 1137 | usesocks='' |
b4eb6b3d JH |
1138 | d_oldpthreads='' |
1139 | use5005threads='' | |
1140 | useithreads='' | |
9514c62b | 1141 | usereentrant='' |
b4eb6b3d | 1142 | usethreads='' |
2304df62 | 1143 | incpath='' |
2304df62 AD |
1144 | mips_type='' |
1145 | usrinc='' | |
b4eb6b3d JH |
1146 | d_vendorarch='' |
1147 | installvendorarch='' | |
1148 | vendorarch='' | |
1149 | vendorarchexp='' | |
1150 | d_vendorbin='' | |
1151 | installvendorbin='' | |
1152 | vendorbin='' | |
1153 | vendorbinexp='' | |
3bb95762 JH |
1154 | installvendorhtml1dir='' |
1155 | vendorhtml1dir='' | |
1156 | vendorhtml1direxp='' | |
1157 | installvendorhtml3dir='' | |
1158 | vendorhtml3dir='' | |
1159 | vendorhtml3direxp='' | |
b4eb6b3d JH |
1160 | d_vendorlib='' |
1161 | installvendorlib='' | |
1162 | vendorlib='' | |
1163 | vendorlib_stem='' | |
1164 | vendorlibexp='' | |
3bb95762 JH |
1165 | installvendorman1dir='' |
1166 | vendorman1dir='' | |
1167 | vendorman1direxp='' | |
1168 | installvendorman3dir='' | |
1169 | vendorman3dir='' | |
1170 | vendorman3direxp='' | |
b4eb6b3d JH |
1171 | usevendorprefix='' |
1172 | vendorprefix='' | |
1173 | vendorprefixexp='' | |
6e1038e0 MB |
1174 | d_vendorscript='' |
1175 | installvendorscript='' | |
1176 | vendorscript='' | |
1177 | vendorscriptexp='' | |
d56c5707 | 1178 | versiononly='' |
b4eb6b3d JH |
1179 | defvoidused='' |
1180 | voidflags='' | |
3659ebf1 JH |
1181 | yacc='' |
1182 | yaccflags='' | |
2304df62 AD |
1183 | CONFIG='' |
1184 | ||
ecfc5424 AD |
1185 | define='define' |
1186 | undef='undef' | |
1187 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' | |
1188 | rmlist='' | |
1189 | ||
1190 | : We must find out about Eunice early | |
1191 | eunicefix=':' | |
1192 | if test -f /etc/unixtovms; then | |
1193 | eunicefix=/etc/unixtovms | |
1194 | fi | |
1195 | if test -f /etc/unixtovms.exe; then | |
1196 | eunicefix=/etc/unixtovms.exe | |
1197 | fi | |
1198 | ||
cfb04860 | 1199 | : Set executable suffix now -- needed before hints available |
6153ba32 PG |
1200 | if test -f "/libs/version.library"; then |
1201 | : Amiga OS | |
1202 | _exe="" | |
1203 | elif test -f "/system/gnu_library/bin/ar.pm"; then | |
1204 | : Stratus VOS | |
cfb04860 | 1205 | _exe=".pm" |
6153ba32 PG |
1206 | elif test -n "$DJGPP"; then |
1207 | : DOS DJGPP | |
cfb04860 | 1208 | _exe=".exe" |
8257dec7 | 1209 | elif test -d c:/. -o -n "$is_os2" ; then |
506faf56 | 1210 | : OS/2 or cygwin |
ba863942 JH |
1211 | _exe=".exe" |
1212 | fi | |
868439a2 | 1213 | |
b4eb6b3d | 1214 | i_whoami='' |
6bd2d01f NC |
1215 | ccname='' |
1216 | ccversion='' | |
1217 | perllibs='' | |
1218 | : set useposix=false in your hint file to disable the POSIX extension. | |
1219 | useposix=true | |
1220 | : set useopcode=false in your hint file to disable the Opcode extension. | |
1221 | useopcode=true | |
1222 | : Trailing extension. Override this in a hint file, if needed. | |
1223 | : Extra object files, if any, needed on this platform. | |
1224 | archobjs='' | |
1225 | archname='' | |
ff935051 JH |
1226 | : Possible local include directories to search. |
1227 | : Set locincpth to "" in a hint file to defeat local include searches. | |
1228 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" | |
1229 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" | |
1230 | : | |
1231 | : no include file wanted by default | |
1232 | inclwanted='' | |
1233 | ||
b4eb6b3d | 1234 | groupstype='' |
64615a5e | 1235 | libnames='' |
732c9516 JH |
1236 | : change the next line if compiling for Xenix/286 on Xenix/386 |
1237 | xlibpth='/usr/lib/386 /lib/386' | |
732c9516 JH |
1238 | : Possible local library directories to search. |
1239 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
1240 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
1241 | ||
1242 | : general looking path for locating libraries | |
5869b1f1 | 1243 | glibpth="/lib /usr/lib $xlibpth" |
732c9516 | 1244 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" |
f7dd4e7f JH |
1245 | test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth" |
1246 | test -f /shlib/libc.so && glibpth="/shlib $glibpth" | |
732c9516 JH |
1247 | |
1248 | : Private path used by Configure to find libraries. Its value | |
1249 | : is prepended to libpth. This variable takes care of special | |
1250 | : machines, like the mips. Usually, it should be empty. | |
1251 | plibpth='' | |
1252 | ||
1cfa4ec7 GS |
1253 | : default library list |
1254 | libswanted='' | |
921b2963 | 1255 | : some systems want to use only the non-versioned libso:s |
1cfa4ec7 | 1256 | ignore_versioned_solibs='' |
6bd2d01f NC |
1257 | siteman1dir='' |
1258 | siteman3dir='' | |
1259 | sitescript='' | |
b4eb6b3d JH |
1260 | archname64='' |
1261 | ccflags_uselargefiles='' | |
1262 | ldflags_uselargefiles='' | |
1263 | libswanted_uselargefiles='' | |
1264 | : set usemultiplicity on the Configure command line to enable multiplicity. | |
29209bc5 | 1265 | : set usesocks on the Configure command line to enable socks. |
b4eb6b3d | 1266 | : set usethreads on the Configure command line to enable threads. |
cd040c5e | 1267 | usereentrant='undef' |
6bd2d01f NC |
1268 | : full support for void wanted by default |
1269 | defvoidused=15 | |
1270 | ||
ecfc5424 | 1271 | : List of libraries we want. |
406c4b1e JH |
1272 | : If anyone needs extra -lxxx, put those in a hint file. |
1273 | libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun" | |
1274 | libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD" | |
1aef975c | 1275 | : We probably want to search /usr/shlib before most other libraries. |
94b6baf5 | 1276 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
ecfc5424 AD |
1277 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
1278 | glibpth="/usr/shlib $glibpth" | |
1279 | : Do not use vfork unless overridden by a hint file. | |
1280 | usevfork=false | |
1281 | ||
8ff267be | 1282 | : Find the basic shell for Bourne shell scripts |
1283 | case "$sh" in | |
1284 | '') | |
8ff267be | 1285 | case "$SYSTYPE" in |
1286 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; | |
1287 | *) xxx='/bin/sh';; | |
1288 | esac | |
1289 | if test -f "$xxx"; then | |
1290 | sh="$xxx" | |
1291 | else | |
1292 | : Build up a list and do a single loop so we can 'break' out. | |
1293 | pth=`echo $PATH | sed -e "s/$p_/ /g"` | |
1294 | for xxx in sh bash ksh pdksh ash; do | |
1295 | for p in $pth; do | |
1296 | try="$try ${p}/${xxx}" | |
1297 | done | |
1298 | done | |
1299 | for xxx in $try; do | |
1300 | if test -f "$xxx"; then | |
1301 | sh="$xxx"; | |
8ff267be | 1302 | break |
a5a94ea5 JH |
1303 | elif test "X$_exe" != X -a -f "$xxx$_exe"; then |
1304 | sh="$xxx"; | |
1305 | break | |
8ff267be | 1306 | elif test -f "$xxx.exe"; then |
1307 | sh="$xxx"; | |
8ff267be | 1308 | break |
1309 | fi | |
1310 | done | |
1311 | fi | |
1312 | ;; | |
1313 | esac | |
1314 | ||
1315 | case "$sh" in | |
a33c94aa | 1316 | '') cat >&2 <<EOM |
8ff267be | 1317 | $me: Fatal Error: I can't find a Bourne Shell anywhere. |
dfe9444c | 1318 | |
8ff267be | 1319 | Usually it's in /bin/sh. How did you even get this far? |
7f2de2d2 | 1320 | Please contact me (Perl Maintainers) at perlbug@perl.org and |
dfe9444c | 1321 | we'll try to straighten this all out. |
8ff267be | 1322 | EOM |
1323 | exit 1 | |
1324 | ;; | |
1325 | esac | |
1326 | ||
760ac839 | 1327 | : see if sh knows # comments |
73614538 | 1328 | if `$sh -c '#' >/dev/null 2>&1`; then |
760ac839 LW |
1329 | shsharp=true |
1330 | spitshell=cat | |
760ac839 | 1331 | xcat=/bin/cat |
a931254c JH |
1332 | test -f $xcat$_exe || xcat=/usr/bin/cat |
1333 | if test ! -f $xcat$_exe; then | |
4bdb8fb5 | 1334 | for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do |
a931254c | 1335 | if test -f $p/cat$_exe; then |
1deb0a86 | 1336 | xcat=$p/cat |
3c728e00 JH |
1337 | break |
1338 | fi | |
1339 | done | |
1deb0a86 JH |
1340 | if test ! -f $xcat$_exe; then |
1341 | echo "Can't find cat anywhere!" | |
3c728e00 JH |
1342 | exit 1 |
1343 | fi | |
1344 | fi | |
5440bc8e JH |
1345 | echo "#!$xcat" >sharp |
1346 | $eunicefix sharp | |
1347 | chmod +x sharp | |
1348 | ./sharp > today | |
760ac839 | 1349 | if test -s today; then |
760ac839 LW |
1350 | sharpbang='#!' |
1351 | else | |
5440bc8e JH |
1352 | echo "#! $xcat" > sharp |
1353 | $eunicefix sharp | |
1354 | chmod +x sharp | |
1355 | ./sharp > today | |
760ac839 | 1356 | if test -s today; then |
760ac839 LW |
1357 | sharpbang='#! ' |
1358 | else | |
760ac839 LW |
1359 | sharpbang=': use ' |
1360 | fi | |
1361 | fi | |
1362 | else | |
dfe9444c | 1363 | echo " " |
8ff267be | 1364 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
760ac839 LW |
1365 | shsharp=false |
1366 | cd .. | |
1367 | echo "exec grep -v '^[ ]*#'" >spitshell | |
1368 | chmod +x spitshell | |
1369 | $eunicefix spitshell | |
1370 | spitshell=`pwd`/spitshell | |
1371 | cd UU | |
1372 | echo "I presume that if # doesn't work, #! won't work either!" | |
1373 | sharpbang=': use ' | |
1374 | fi | |
5440bc8e | 1375 | rm -f sharp today |
760ac839 LW |
1376 | |
1377 | : figure out how to guarantee sh startup | |
8ff267be | 1378 | case "$startsh" in |
1379 | '') startsh=${sharpbang}${sh} ;; | |
1380 | *) | |
760ac839 | 1381 | esac |
5440bc8e | 1382 | cat >sharp <<EOSS |
760ac839 LW |
1383 | $startsh |
1384 | set abc | |
1385 | test "$?abc" != 1 | |
1386 | EOSS | |
1387 | ||
5440bc8e JH |
1388 | chmod +x sharp |
1389 | $eunicefix sharp | |
1390 | if ./sharp; then | |
8ff267be | 1391 | : echo "Yup, it does." |
760ac839 | 1392 | else |
dfe9444c AD |
1393 | echo "Hmm... '$startsh' does not guarantee sh startup..." |
1394 | echo "You may have to fix up the shell scripts to make sure $sh runs them." | |
760ac839 | 1395 | fi |
5440bc8e | 1396 | rm -f sharp |
760ac839 | 1397 | |
aebf16e7 AD |
1398 | |
1399 | : Save command line options in file UU/cmdline.opt for later use in | |
1400 | : generating config.sh. | |
1401 | cat > cmdline.opt <<EOSH | |
1402 | # Configure command line arguments. | |
1403 | config_arg0='$0' | |
1404 | config_args='$*' | |
1405 | config_argc=$# | |
1406 | EOSH | |
1407 | argn=1 | |
ee45ea83 IZ |
1408 | args_exp='' |
1409 | args_sep='' | |
aebf16e7 AD |
1410 | for arg in "$@"; do |
1411 | cat >>cmdline.opt <<EOSH | |
1412 | config_arg$argn='$arg' | |
1413 | EOSH | |
ee45ea83 IZ |
1414 | # Extreme backslashitis: replace each ' by '"'"' |
1415 | cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt | |
1416 | $arg | |
1417 | EOC | |
1418 | arg_exp=`cat cmdl.opt` | |
1419 | args_exp="$args_exp$args_sep'$arg_exp'" | |
aebf16e7 | 1420 | argn=`expr $argn + 1` |
ee45ea83 | 1421 | args_sep=' ' |
aebf16e7 | 1422 | done |
ee45ea83 IZ |
1423 | # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@" |
1424 | # used by ./hints/os2.sh | |
1425 | rm -f cmdl.opt | |
aebf16e7 | 1426 | |
2304df62 AD |
1427 | : produce awk script to parse command line options |
1428 | cat >options.awk <<'EOF' | |
1429 | BEGIN { | |
02e93a22 | 1430 | optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification |
2304df62 AD |
1431 | |
1432 | len = length(optstr); | |
1433 | for (i = 1; i <= len; i++) { | |
1434 | c = substr(optstr, i, 1); | |
1435 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; | |
1436 | if (a == ":") { | |
1437 | arg[c] = 1; | |
1438 | i++; | |
1439 | } | |
1440 | opt[c] = 1; | |
1441 | } | |
1442 | } | |
1443 | { | |
1444 | expect = 0; | |
1445 | str = $0; | |
1446 | if (substr(str, 1, 1) != "-") { | |
1447 | printf("'%s'\n", str); | |
1448 | next; | |
1449 | } | |
1450 | len = length($0); | |
1451 | for (i = 2; i <= len; i++) { | |
1452 | c = substr(str, i, 1); | |
1453 | if (!opt[c]) { | |
1454 | printf("-%s\n", substr(str, i)); | |
1455 | next; | |
1456 | } | |
1457 | printf("-%s\n", c); | |
1458 | if (arg[c]) { | |
1459 | if (i < len) | |
1460 | printf("'%s'\n", substr(str, i + 1)); | |
1461 | else | |
1462 | expect = 1; | |
1463 | next; | |
1464 | } | |
1465 | } | |
1466 | } | |
1467 | END { | |
1468 | if (expect) | |
1469 | print "?"; | |
1470 | } | |
1471 | EOF | |
1472 | ||
1473 | : process the command line options | |
4633a7c4 LW |
1474 | set X `for arg in "$@"; do echo "X$arg"; done | |
1475 | sed -e s/X// | awk -f options.awk` | |
2304df62 AD |
1476 | eval "set $*" |
1477 | shift | |
1478 | rm -f options.awk | |
1479 | ||
1480 | : set up default values | |
1481 | fastread='' | |
1482 | reuseval=false | |
1483 | config_sh='' | |
1484 | alldone='' | |
1485 | error='' | |
1486 | silent='' | |
1487 | extractsh='' | |
ecfc5424 | 1488 | override='' |
16d20bd9 | 1489 | knowitall='' |
02e93a22 | 1490 | rm -f optdef.sh posthint.sh |
28757baa | 1491 | cat >optdef.sh <<EOS |
1492 | $startsh | |
1493 | EOS | |
2304df62 | 1494 | |
dfe9444c | 1495 | |
2304df62 AD |
1496 | : option parsing |
1497 | while test $# -gt 0; do | |
1498 | case "$1" in | |
1499 | -d) shift; fastread=yes;; | |
1500 | -e) shift; alldone=cont;; | |
1501 | -f) | |
1502 | shift | |
1503 | cd .. | |
1504 | if test -r "$1"; then | |
1505 | config_sh="$1" | |
1506 | else | |
a0d0e21e | 1507 | echo "$me: cannot read config file $1." >&2 |
2304df62 AD |
1508 | error=true |
1509 | fi | |
1510 | cd UU | |
1511 | shift;; | |
1512 | -h) shift; error=true;; | |
1513 | -r) shift; reuseval=true;; | |
dfe9444c | 1514 | -s) shift; silent=true; realsilent=true;; |
2304df62 | 1515 | -E) shift; alldone=exit;; |
16d20bd9 | 1516 | -K) shift; knowitall=true;; |
ecfc5424 | 1517 | -O) shift; override=true;; |
dfe9444c | 1518 | -S) shift; silent=true; extractsh=true;; |
a0d0e21e LW |
1519 | -D) |
1520 | shift | |
1521 | case "$1" in | |
1522 | *=) | |
1523 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 | |
1524 | echo "$me: ignoring -D $1" >&2 | |
1525 | ;; | |
ecfc5424 | 1526 | *=*) echo "$1" | \ |
1aef975c AD |
1527 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
1528 | *) echo "$1='define'" >> optdef.sh;; | |
a0d0e21e LW |
1529 | esac |
1530 | shift | |
1531 | ;; | |
1532 | -U) | |
1533 | shift | |
1534 | case "$1" in | |
1aef975c | 1535 | *=) echo "$1" >> optdef.sh;; |
a0d0e21e LW |
1536 | *=*) |
1537 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 | |
1538 | echo "$me: ignoring -U $1" >&2 | |
1539 | ;; | |
1aef975c | 1540 | *) echo "$1='undef'" >> optdef.sh;; |
a0d0e21e LW |
1541 | esac |
1542 | shift | |
1543 | ;; | |
02e93a22 JH |
1544 | -A) |
1545 | shift | |
1546 | xxx='' | |
1547 | yyy="$1" | |
02e93a22 | 1548 | zzz='' |
5f83a3e9 | 1549 | uuu=undef |
02e93a22 | 1550 | case "$yyy" in |
f7c31117 | 1551 | *=*) zzz=`echo "$yyy"|sed 's!=.*!!'` |
5f83a3e9 JH |
1552 | case "$zzz" in |
1553 | *:*) zzz='' ;; | |
1554 | *) xxx=append | |
f7c31117 JH |
1555 | zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'` |
1556 | yyy=`echo "$yyy"|sed 's!=.*!!'` ;; | |
5f83a3e9 JH |
1557 | esac |
1558 | ;; | |
1559 | esac | |
1560 | case "$xxx" in | |
1561 | '') case "$yyy" in | |
f7c31117 JH |
1562 | *:*) xxx=`echo "$yyy"|sed 's!:.*!!'` |
1563 | yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` | |
1564 | zzz=`echo "$yyy"|sed 's!^[^=]*=!!'` | |
1565 | yyy=`echo "$yyy"|sed 's!=.*!!'` ;; | |
1566 | *) xxx=`echo "$yyy"|sed 's!:.*!!'` | |
1567 | yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;; | |
5f83a3e9 JH |
1568 | esac |
1569 | ;; | |
1570 | esac | |
02e93a22 JH |
1571 | case "$xxx" in |
1572 | append) | |
5f83a3e9 | 1573 | echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;; |
02e93a22 | 1574 | clear) |
5f83a3e9 | 1575 | echo "$yyy=''" >> posthint.sh ;; |
02e93a22 JH |
1576 | define) |
1577 | case "$zzz" in | |
1578 | '') zzz=define ;; | |
1579 | esac | |
5f83a3e9 | 1580 | echo "$yyy='$zzz'" >> posthint.sh ;; |
02e93a22 | 1581 | eval) |
5f83a3e9 | 1582 | echo "eval \"$yyy=$zzz\"" >> posthint.sh ;; |
02e93a22 | 1583 | prepend) |
5f83a3e9 | 1584 | echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;; |
02e93a22 JH |
1585 | undef) |
1586 | case "$zzz" in | |
1587 | '') zzz="$uuu" ;; | |
1588 | esac | |
5f83a3e9 JH |
1589 | echo "$yyy=$zzz" >> posthint.sh ;; |
1590 | *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;; | |
02e93a22 | 1591 | esac |
bde6b06b | 1592 | shift |
02e93a22 | 1593 | ;; |
dfe9444c | 1594 | -V) echo "$me generated by metaconfig 3.0 PL70." >&2 |
5f83a3e9 | 1595 | exit 0;; |
2304df62 | 1596 | --) break;; |
a0d0e21e | 1597 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
2304df62 AD |
1598 | *) break;; |
1599 | esac | |
1600 | done | |
1601 | ||
1602 | case "$error" in | |
1603 | true) | |
1604 | cat >&2 <<EOM | |
2afac517 | 1605 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
02e93a22 | 1606 | [-U symbol] [-U symbol=] [-A command:symbol...] |
2304df62 AD |
1607 | -d : use defaults for all answers. |
1608 | -e : go on without questioning past the production of config.sh. | |
1609 | -f : specify an alternate default configuration file. | |
1610 | -h : print this help message and exit (with an error status). | |
1611 | -r : reuse C symbols value if possible (skips costly nm extraction). | |
1612 | -s : silent mode, only echoes questions and essential information. | |
a0d0e21e LW |
1613 | -D : define symbol to have some value: |
1614 | -D symbol symbol gets the value 'define' | |
1615 | -D symbol=value symbol gets the value 'value' | |
2304df62 | 1616 | -E : stop at the end of questions, after having produced config.sh. |
16d20bd9 | 1617 | -K : do not use unless you know what you are doing. |
ecfc5424 | 1618 | -O : let -D and -U override definitions from loaded configuration file. |
2304df62 | 1619 | -S : perform variable substitutions on all .SH files (can mix with -f) |
a0d0e21e LW |
1620 | -U : undefine symbol: |
1621 | -U symbol symbol gets the value 'undef' | |
1622 | -U symbol= symbol gets completely empty | |
02e93a22 | 1623 | -A : manipulate symbol after the platform specific hints have been applied: |
5f83a3e9 | 1624 | -A symbol=value append " "value to symbol |
02e93a22 JH |
1625 | -A append:symbol=value append value to symbol |
1626 | -A define:symbol=value define symbol to have value | |
02e93a22 JH |
1627 | -A clear:symbol define symbol to be '' |
1628 | -A define:symbol define symbol to be 'define' | |
1629 | -A eval:symbol=value define symbol to be eval of value | |
1630 | -A prepend:symbol=value prepend value to symbol | |
1631 | -A undef:symbol define symbol to be 'undef' | |
1632 | -A undef:symbol= define symbol to be '' | |
2304df62 AD |
1633 | -V : print version number and exit (with a zero status). |
1634 | EOM | |
1635 | exit 1 | |
1636 | ;; | |
1637 | esac | |
1638 | ||
dfe9444c AD |
1639 | : Sanity checks |
1640 | case "$fastread$alldone" in | |
1641 | yescont|yesexit) ;; | |
1642 | *) | |
aaeb8e51 GS |
1643 | case "$extractsh" in |
1644 | true) ;; | |
1645 | *) | |
1646 | if test ! -t 0; then | |
1647 | echo "Say 'sh Configure', not 'sh <Configure'" | |
1648 | exit 1 | |
1649 | fi | |
1650 | ;; | |
1651 | esac | |
dfe9444c AD |
1652 | ;; |
1653 | esac | |
1654 | ||
2304df62 AD |
1655 | exec 4>&1 |
1656 | case "$silent" in | |
1657 | true) exec 1>/dev/null;; | |
1658 | esac | |
1659 | ||
ecfc5424 | 1660 | : run the defines and the undefines, if any, but leave the file out there... |
1aef975c AD |
1661 | touch optdef.sh |
1662 | . ./optdef.sh | |
02e93a22 JH |
1663 | : create the posthint manipulation script and leave the file out there... |
1664 | touch posthint.sh | |
a0d0e21e | 1665 | |
2304df62 | 1666 | : set package name |
85e6fe83 | 1667 | package=perl5 |
b4eb6b3d JH |
1668 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
1669 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` | |
1670 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1671 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; | |
1672 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; | |
1673 | esac | |
2304df62 | 1674 | |
2304df62 AD |
1675 | : Some greps do not return status, grrr. |
1676 | echo "grimblepritz" >grimble | |
1677 | if grep blurfldyick grimble >/dev/null 2>&1 ; then | |
1678 | contains=contains | |
1679 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then | |
1680 | contains=grep | |
1681 | else | |
1682 | contains=contains | |
1683 | fi | |
1684 | rm -f grimble | |
1685 | : the following should work in any shell | |
1686 | case "$contains" in | |
1687 | contains*) | |
1688 | echo " " | |
1689 | echo "AGH! Grep doesn't return a status. Attempting remedial action." | |
1690 | cat >contains <<'EOSS' | |
1691 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp | |
1692 | EOSS | |
1693 | chmod +x contains | |
1694 | esac | |
1695 | ||
dfe9444c AD |
1696 | : Find the path to the source tree |
1697 | case "$src" in | |
1698 | '') case "$0" in | |
b233458b JH |
1699 | */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'` |
1700 | case "$src" in | |
1701 | /*) ;; | |
8504afb7 | 1702 | .) ;; |
b233458b JH |
1703 | *) src=`cd ../$src && pwd` ;; |
1704 | esac | |
1705 | ;; | |
dfe9444c AD |
1706 | *) src='.';; |
1707 | esac;; | |
1708 | esac | |
1709 | case "$src" in | |
1710 | '') src=/ | |
1711 | rsrc=/ | |
1712 | ;; | |
1713 | /*) rsrc="$src";; | |
1714 | *) rsrc="../$src";; | |
1715 | esac | |
1716 | if test -f $rsrc/Configure && \ | |
1717 | $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1 | |
1718 | then | |
1719 | : found it, so we are ok. | |
1720 | else | |
1721 | rsrc='' | |
1722 | for src in . .. ../.. ../../.. ../../../..; do | |
1723 | if test -f ../$src/Configure && \ | |
1724 | $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1 | |
1725 | then | |
1726 | rsrc=../$src | |
1727 | break | |
1728 | fi | |
1729 | done | |
1730 | fi | |
1731 | case "$rsrc" in | |
1732 | '') | |
1733 | cat <<EOM >&4 | |
1734 | ||
1735 | Sorry, I can't seem to locate the source dir for $package. Please start | |
1736 | Configure with an explicit path -- i.e. /some/path/Configure. | |
1737 | ||
1738 | EOM | |
1739 | exit 1 | |
1740 | ;; | |
1741 | ../.) rsrc='..';; | |
1742 | *) | |
1743 | echo " " | |
1744 | echo "Sources for $package found in \"$src\"." >&4 | |
1745 | ;; | |
1746 | esac | |
1747 | ||
1748 | : script used to extract .SH files with variable substitutions | |
1749 | cat >extract <<'EOS' | |
a02608de | 1750 | PERL_CONFIG_SH=true |
dfe9444c | 1751 | echo "Doing variable substitutions on .SH files..." |
24ccb310 JH |
1752 | if test -f MANIFEST; then |
1753 | set x `awk '{print $1}' < MANIFEST | grep '\.SH$'` | |
dfe9444c AD |
1754 | else |
1755 | echo "(Looking for .SH files under the source directory.)" | |
6904989c | 1756 | set x `(cd "$src"; find . -name "*.SH" -print)` |
dfe9444c AD |
1757 | fi |
1758 | shift | |
1759 | case $# in | |
6904989c | 1760 | 0) set x `(cd "$src"; echo *.SH)`; shift;; |
dfe9444c | 1761 | esac |
6904989c | 1762 | if test ! -f "$src/$1"; then |
dfe9444c AD |
1763 | shift |
1764 | fi | |
1765 | mkdir_p=' | |
1766 | name=$1; | |
1767 | create=""; | |
1768 | while test $name; do | |
1769 | if test ! -d "$name"; then | |
1770 | create="$name $create"; | |
1771 | name=`echo $name | sed -e "s|^[^/]*$||"`; | |
1772 | name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; | |
1773 | else | |
1774 | name=""; | |
1775 | fi; | |
1776 | done; | |
1777 | for file in $create; do | |
1778 | mkdir $file; | |
1779 | done | |
1780 | ' | |
1781 | for file in $*; do | |
1782 | case "$src" in | |
1783 | ".") | |
1784 | case "$file" in | |
1785 | */*) | |
1786 | dir=`expr X$file : 'X\(.*\)/'` | |
1787 | file=`expr X$file : 'X.*/\(.*\)'` | |
6904989c | 1788 | (cd "$dir" && . ./$file) |
dfe9444c AD |
1789 | ;; |
1790 | *) | |
1791 | . ./$file | |
1792 | ;; | |
1793 | esac | |
1794 | ;; | |
1795 | *) | |
1796 | case "$file" in | |
1797 | */*) | |
1798 | dir=`expr X$file : 'X\(.*\)/'` | |
1799 | file=`expr X$file : 'X.*/\(.*\)'` | |
1800 | (set x $dir; shift; eval $mkdir_p) | |
6904989c | 1801 | sh <"$src/$dir/$file" |
dfe9444c AD |
1802 | ;; |
1803 | *) | |
6904989c | 1804 | sh <"$src/$file" |
dfe9444c AD |
1805 | ;; |
1806 | esac | |
1807 | ;; | |
1808 | esac | |
1809 | done | |
6904989c | 1810 | if test -f "$src/config_h.SH"; then |
dfe9444c AD |
1811 | if test ! -f config.h; then |
1812 | : oops, they left it out of MANIFEST, probably, so do it anyway. | |
6904989c | 1813 | . "$src/config_h.SH" |
dfe9444c AD |
1814 | fi |
1815 | fi | |
1816 | EOS | |
1817 | ||
1818 | : extract files and exit if asked to do so | |
1819 | case "$extractsh" in | |
1820 | true) | |
1821 | case "$realsilent" in | |
1822 | true) ;; | |
1823 | *) exec 1>&4;; | |
1824 | esac | |
1825 | case "$config_sh" in | |
1826 | '') config_sh='config.sh';; | |
1827 | esac | |
1828 | echo " " | |
1829 | echo "Fetching answers from $config_sh..." | |
1830 | cd .. | |
1831 | . $config_sh | |
1832 | test "$override" && . ./optdef.sh | |
1833 | echo " " | |
1834 | . UU/extract | |
1835 | rm -rf UU | |
24ccb310 | 1836 | echo "Extraction done." |
dfe9444c AD |
1837 | exit 0 |
1838 | ;; | |
1839 | esac | |
1840 | ||
1841 | : Eunice requires " " instead of "", can you believe it | |
1842 | echo " " | |
1843 | : Here we go... | |
1844 | echo "Beginning of configuration questions for $package." | |
1845 | ||
1846 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 | |
1847 | ||
2304df62 AD |
1848 | : first determine how to suppress newline on echo command |
1849 | echo " " | |
1850 | echo "Checking echo to see how to suppress newlines..." | |
1851 | (echo "hi there\c" ; echo " ") >.echotmp | |
1852 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
1853 | echo "...using -n." | |
1854 | n='-n' | |
1855 | c='' | |
1856 | else | |
1857 | cat <<'EOM' | |
1858 | ...using \c | |
1859 | EOM | |
1860 | n='' | |
1861 | c='\c' | |
1862 | fi | |
1863 | echo $n "The star should be here-->$c" | |
1864 | echo '*' | |
1865 | rm -f .echotmp | |
1866 | ||
1867 | : Now test for existence of everything in MANIFEST | |
1868 | echo " " | |
6904989c | 1869 | if test -f "$rsrc/MANIFEST"; then |
2304df62 | 1870 | echo "First let's make sure your kit is complete. Checking..." >&4 |
4242830c | 1871 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50) |
2304df62 | 1872 | rm -f missing |
dfe9444c | 1873 | tmppwd=`pwd` |
2304df62 | 1874 | for filelist in x??; do |
6904989c | 1875 | (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing") |
2304df62 AD |
1876 | done |
1877 | if test -s missing; then | |
1878 | cat missing >&4 | |
1879 | cat >&4 <<'EOM' | |
1880 | ||
1881 | THIS PACKAGE SEEMS TO BE INCOMPLETE. | |
1882 | ||
1883 | You have the option of continuing the configuration process, despite the | |
1884 | distinct possibility that your kit is damaged, by typing 'y'es. If you | |
1885 | do, don't blame me if something goes wrong. I advise you to type 'n'o | |
7f2de2d2 | 1886 | and contact the author (perlbug@perl.org). |
2304df62 AD |
1887 | |
1888 | EOM | |
1889 | echo $n "Continue? [n] $c" >&4 | |
1890 | read ans | |
1891 | case "$ans" in | |
1892 | y*) | |
1893 | echo "Continuing..." >&4 | |
1894 | rm -f missing | |
1895 | ;; | |
1896 | *) | |
1897 | echo "ABORTING..." >&4 | |
1898 | kill $$ | |
1899 | ;; | |
1900 | esac | |
1901 | else | |
dfe9444c | 1902 | echo "Looks good..." |
2304df62 AD |
1903 | fi |
1904 | else | |
1905 | echo "There is no MANIFEST file. I hope your kit is complete !" | |
1906 | fi | |
1907 | rm -f missing x?? | |
1908 | ||
5ff3f7a4 GS |
1909 | echo " " |
1910 | : Find the appropriate value for a newline for tr | |
1911 | if test -n "$DJGPP"; then | |
1912 | trnl='\012' | |
1913 | fi | |
1914 | if test X"$trnl" = X; then | |
1915 | case "`echo foo|tr '\n' x 2>/dev/null`" in | |
1916 | foox) trnl='\n' ;; | |
1917 | esac | |
1918 | fi | |
1919 | if test X"$trnl" = X; then | |
1920 | case "`echo foo|tr '\012' x 2>/dev/null`" in | |
1921 | foox) trnl='\012' ;; | |
1922 | esac | |
1923 | fi | |
1924 | if test X"$trnl" = X; then | |
8be2c24c JH |
1925 | case "`echo foo|tr '\r\n' xy 2>/dev/null`" in |
1926 | fooxy) trnl='\n\r' ;; | |
1927 | esac | |
1928 | fi | |
1929 | if test X"$trnl" = X; then | |
5ff3f7a4 GS |
1930 | cat <<EOM >&2 |
1931 | ||
1932 | $me: Fatal Error: cannot figure out how to translate newlines with 'tr'. | |
1933 | ||
1934 | EOM | |
1935 | exit 1 | |
1936 | fi | |
1937 | ||
2304df62 AD |
1938 | : compute the number of columns on the terminal for proper question formatting |
1939 | case "$COLUMNS" in | |
1940 | '') COLUMNS='80';; | |
1941 | esac | |
1942 | ||
1943 | : set up the echo used in my read | |
1944 | myecho="case \"\$xxxm\" in | |
1945 | '') echo $n \"\$rp $c\" >&4;; | |
1946 | *) case \"\$rp\" in | |
1947 | '') echo $n \"[\$xxxm] $c\";; | |
1948 | *) | |
1949 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then | |
1950 | echo \"\$rp\" >&4 | |
1951 | echo $n \"[\$xxxm] $c\" >&4 | |
1952 | else | |
1953 | echo $n \"\$rp [\$xxxm] $c\" >&4 | |
1954 | fi | |
1955 | ;; | |
1956 | esac;; | |
1957 | esac" | |
1958 | ||
1959 | : now set up to do reads with possible shell escape and default assignment | |
1960 | cat <<EOSC >myread | |
28757baa | 1961 | $startsh |
2304df62 AD |
1962 | xxxm=\$dflt |
1963 | $myecho | |
1964 | ans='!' | |
1965 | case "\$fastread" in | |
1966 | yes) case "\$dflt" in | |
1967 | '') ;; | |
1968 | *) ans=''; | |
1969 | case "\$silent-\$rp" in | |
1970 | true-) ;; | |
1971 | *) echo " " >&4;; | |
1972 | esac;; | |
1973 | esac;; | |
1974 | *) case "\$silent" in | |
1975 | true) case "\$rp" in | |
1976 | '') ans='';; | |
1977 | esac;; | |
1978 | esac;; | |
1979 | esac | |
1980 | while expr "X\$ans" : "X!" >/dev/null; do | |
1981 | read answ | |
1982 | set x \$xxxm | |
1983 | shift | |
dfe9444c | 1984 | aok=''; eval "ans=\\"\$answ\\"" && aok=y |
2304df62 | 1985 | case "\$answ" in |
dfe9444c AD |
1986 | "!") |
1987 | sh 1>&4 | |
1988 | echo " " | |
1989 | $myecho | |
1990 | ;; | |
1991 | !*) | |
1992 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` | |
1993 | shift | |
1994 | sh 1>&4 -c "\$*" | |
1995 | echo " " | |
1996 | $myecho | |
1997 | ;; | |
2304df62 AD |
1998 | "\$ans") |
1999 | case "\$ans" in | |
ecfc5424 AD |
2000 | \\&*) |
2001 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` | |
2002 | shift | |
2003 | case "\$1" in | |
2004 | -d) | |
2005 | fastread=yes | |
40a7a20a | 2006 | echo "(OK, I'll run with -d after this question.)" >&4 |
ecfc5424 AD |
2007 | ;; |
2008 | -*) | |
40a7a20a | 2009 | echo "*** Sorry, \$1 not supported yet." >&4 |
ecfc5424 AD |
2010 | ;; |
2011 | esac | |
2012 | $myecho | |
2013 | ans=! | |
2014 | ;; | |
2304df62 AD |
2015 | esac;; |
2016 | *) | |
2017 | case "\$aok" in | |
2018 | y) | |
2019 | echo "*** Substitution done -- please confirm." | |
2020 | xxxm="\$ans" | |
c9795ab7 | 2021 | ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\` |
2304df62 AD |
2022 | xxxm="\$ans" |
2023 | ans=! | |
2024 | ;; | |
2025 | *) | |
2026 | echo "*** Error -- try again." | |
2027 | ans=! | |
2028 | ;; | |
2029 | esac | |
2030 | $myecho | |
2031 | ;; | |
2032 | esac | |
2033 | case "\$ans\$xxxm\$nostick" in | |
2034 | '') | |
2035 | ans=! | |
2036 | $myecho | |
2037 | ;; | |
2038 | esac | |
2039 | done | |
2040 | case "\$ans" in | |
2041 | '') ans="\$xxxm";; | |
2042 | esac | |
2043 | EOSC | |
2044 | ||
2045 | : create .config dir to save info across Configure sessions | |
2046 | test -d ../.config || mkdir ../.config | |
2047 | cat >../.config/README <<EOF | |
2048 | This directory created by Configure to save information that should | |
dfe9444c | 2049 | persist across sessions for $package. |
2304df62 AD |
2050 | |
2051 | You may safely delete it if you wish. | |
2052 | EOF | |
2053 | ||
9507cadf | 2054 | xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
af960fef | 2055 | case "$usedevel" in |
0107c034 | 2056 | $define|true|[yY]*) ;; |
9507cadf | 2057 | *) case "$xversion" in |
0107c034 JH |
2058 | *[13579]) |
2059 | cat >&4 <<EOH | |
2060 | *** WHOA THERE!!! *** | |
2061 | ||
2062 | This is an UNSTABLE DEVELOPMENT release. | |
9507cadf JH |
2063 | The version of this $package distribution is $xversion, that is, odd, |
2064 | (as opposed to even) and that signifies a development release. | |
3d5d58b1 | 2065 | If you want a maintenance release, you want an even-numbered version. |
0107c034 JH |
2066 | |
2067 | Do ***NOT*** install this into production use. | |
2068 | Data corruption and crashes are possible. | |
2069 | ||
2070 | It is most seriously suggested that you do not continue any further | |
2071 | unless you want to help in developing and debugging Perl. | |
2072 | ||
6adc6a45 JH |
2073 | If you *still* want to build perl, you can answer 'y' now, |
2074 | or pass -Dusedevel to Configure. | |
2075 | ||
0107c034 JH |
2076 | EOH |
2077 | rp='Do you really want to continue?' | |
2078 | dflt='n' | |
2079 | . ./myread | |
2080 | case "$ans" in | |
8feeef0e JH |
2081 | [yY]) echo >&4 "Okay, continuing." |
2082 | usedevel="$define" ;; | |
0107c034 JH |
2083 | *) echo >&4 "Okay, bye." |
2084 | exit 1 | |
2085 | ;; | |
2086 | esac | |
2087 | ;; | |
2088 | esac | |
2089 | ;; | |
2090 | esac | |
8feeef0e JH |
2091 | case "$usedevel" in |
2092 | $define|true|[yY]*) | |
2093 | case "$versiononly" in | |
2094 | '') versiononly="$define" ;; | |
2095 | esac | |
2096 | case "$installusrbinperl" in | |
2097 | '') installusrbinperl="$undef" ;; | |
2098 | esac | |
2099 | ;; | |
2100 | esac | |
0107c034 | 2101 | |
2304df62 AD |
2102 | : general instructions |
2103 | needman=true | |
2104 | firsttime=true | |
760ac839 | 2105 | user=`(logname) 2>/dev/null` |
dfe9444c AD |
2106 | case "$user" in |
2107 | '') user=`whoami 2>&1`;; | |
760ac839 | 2108 | esac |
2304df62 AD |
2109 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
2110 | firsttime=false | |
2111 | echo " " | |
2112 | rp='Would you like to see the instructions?' | |
2113 | dflt=n | |
2114 | . ./myread | |
2115 | case "$ans" in | |
2116 | [yY]*) ;; | |
2117 | *) needman=false;; | |
2118 | esac | |
2119 | fi | |
2120 | if $needman; then | |
2121 | cat <<EOH | |
4e2a5f63 | 2122 | |
2304df62 | 2123 | This installation shell script will examine your system and ask you questions |
a0d0e21e | 2124 | to determine how the perl5 package should be installed. If you get |
2304df62 AD |
2125 | stuck on a question, you may use a ! shell escape to start a subshell or |
2126 | execute a command. Many of the questions will have default answers in square | |
2127 | brackets; typing carriage return will give you the default. | |
2128 | ||
2129 | On some of the questions which ask for file or directory names you are allowed | |
2130 | to use the ~name construct to specify the login directory belonging to "name", | |
2131 | even if you don't have a shell which knows about that. Questions where this is | |
2132 | allowed will be marked "(~name ok)". | |
2133 | ||
2134 | EOH | |
2135 | rp='' | |
2136 | dflt='Type carriage return to continue' | |
2137 | . ./myread | |
2138 | cat <<'EOH' | |
2139 | ||
2140 | The prompter used in this script allows you to use shell variables and | |
2141 | backticks in your answers. You may use $1, $2, etc... to refer to the words | |
2142 | in the default answer, as if the default line was a set of arguments given to a | |
2143 | script shell. This means you may also use $* to repeat the whole default line, | |
2144 | so you do not have to re-type everything to add something to the default. | |
2145 | ||
2146 | Everytime there is a substitution, you will have to confirm. If there is an | |
2147 | error (e.g. an unmatched backtick), the default answer will remain unchanged | |
2148 | and you will be prompted again. | |
2149 | ||
2150 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all | |
2151 | the questions and use the computed defaults (or the previous answers if there | |
2152 | was already a config.sh file). Type 'Configure -h' for a list of options. | |
ecfc5424 | 2153 | You may also start interactively and then answer '& -d' at any prompt to turn |
dfe9444c | 2154 | on the non-interactive behaviour for the remainder of the execution. |
2304df62 AD |
2155 | |
2156 | EOH | |
2157 | . ./myread | |
2158 | cat <<EOH | |
2159 | ||
2160 | Much effort has been expended to ensure that this shell script will run on any | |
2161 | Unix system. If despite that it blows up on yours, your best bet is to edit | |
40000a8c AD |
2162 | Configure and run it again. If you can't run Configure for some reason, |
2163 | you'll have to generate a config.sh file by hand. Whatever problems you | |
7f2de2d2 | 2164 | have, let me (perlbug@perl.org) know how I blew it. |
2304df62 AD |
2165 | |
2166 | This installation script affects things in two ways: | |
2167 | ||
2168 | 1) it may do direct variable substitutions on some of the files included | |
2169 | in this kit. | |
2170 | 2) it builds a config.h file for inclusion in C programs. You may edit | |
2171 | any of these files as the need arises after running this script. | |
2172 | ||
2173 | If you make a mistake on a question, there is no easy way to back up to it | |
2174 | currently. The easiest thing to do is to edit config.sh and rerun all the SH | |
2175 | files. Configure will offer to let you do this before it runs the SH files. | |
2176 | ||
2177 | EOH | |
2178 | dflt='Type carriage return to continue' | |
2179 | . ./myread | |
2180 | case "$firsttime" in | |
2181 | true) echo $user >>../.config/instruct;; | |
2182 | esac | |
2183 | fi | |
2184 | ||
2304df62 AD |
2185 | : find out where common programs are |
2186 | echo " " | |
2187 | echo "Locating common programs..." >&4 | |
2188 | cat <<EOSC >loc | |
2189 | $startsh | |
2190 | case \$# in | |
2191 | 0) exit 1;; | |
2192 | esac | |
2193 | thing=\$1 | |
2194 | shift | |
2195 | dflt=\$1 | |
2196 | shift | |
2197 | for dir in \$*; do | |
2198 | case "\$thing" in | |
2199 | .) | |
2200 | if test -d \$dir/\$thing; then | |
2201 | echo \$dir | |
2202 | exit 0 | |
2203 | fi | |
2204 | ;; | |
2205 | *) | |
a0d0e21e | 2206 | for thisthing in \$dir/\$thing; do |
ecfc5424 | 2207 | : just loop through to pick last item |
a0d0e21e | 2208 | done |
25f94b33 | 2209 | if test -f \$thisthing; then |
a0d0e21e | 2210 | echo \$thisthing |
2304df62 | 2211 | exit 0 |
a5a94ea5 JH |
2212 | elif test "X$_exe" != X -a -f \$thisthing$_exe; then |
2213 | echo \$thisthing | |
2214 | exit 0 | |
2304df62 | 2215 | elif test -f \$dir/\$thing.exe; then |
c4f23d77 AD |
2216 | if test -n "$DJGPP"; then |
2217 | echo \$dir/\$thing.exe | |
5b7ea690 | 2218 | elif test "$eunicefix" != ":"; then |
c4f23d77 AD |
2219 | : on Eunice apparently |
2220 | echo \$dir/\$thing | |
5b7ea690 | 2221 | exit 0 |
c4f23d77 | 2222 | fi |
2d736872 | 2223 | exit 0 |
2304df62 AD |
2224 | fi |
2225 | ;; | |
2226 | esac | |
2227 | done | |
2228 | echo \$dflt | |
2229 | exit 1 | |
2230 | EOSC | |
2231 | chmod +x loc | |
2232 | $eunicefix loc | |
2233 | loclist=" | |
2234 | awk | |
2235 | cat | |
f8006fac | 2236 | chmod |
b4eb6b3d JH |
2237 | comm |
2238 | cp | |
2304df62 AD |
2239 | echo |
2240 | expr | |
2241 | grep | |
a0d0e21e | 2242 | ls |
b4eb6b3d | 2243 | mkdir |
2304df62 AD |
2244 | rm |
2245 | sed | |
b4eb6b3d | 2246 | sort |
85e6fe83 | 2247 | touch |
2304df62 | 2248 | tr |
b4eb6b3d | 2249 | uniq |
2304df62 AD |
2250 | " |
2251 | trylist=" | |
2252 | Mcc | |
dfe9444c | 2253 | ar |
3659ebf1 | 2254 | bison |
b4eb6b3d | 2255 | byacc |
2304df62 | 2256 | cpp |
b4eb6b3d | 2257 | csh |
2304df62 AD |
2258 | date |
2259 | egrep | |
1fef16b3 | 2260 | gmake |
8ff267be | 2261 | gzip |
b4eb6b3d | 2262 | less |
8ff267be | 2263 | ln |
3c728e00 | 2264 | make |
b4eb6b3d | 2265 | more |
693762b4 | 2266 | nm |
b4eb6b3d JH |
2267 | nroff |
2268 | pg | |
2304df62 AD |
2269 | test |
2270 | uname | |
8ff267be | 2271 | zip |
2304df62 | 2272 | " |
8e07c86e | 2273 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
2274 | pth="$pth /lib /usr/lib" |
2275 | for file in $loclist; do | |
dfe9444c AD |
2276 | eval xxx=\$$file |
2277 | case "$xxx" in | |
2278 | /*|?:[\\/]*) | |
2279 | if test -f "$xxx"; then | |
2280 | : ok | |
2281 | else | |
2282 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 | |
2283 | xxx=`./loc $file $file $pth` | |
2284 | fi | |
2285 | ;; | |
2286 | '') xxx=`./loc $file $file $pth`;; | |
2287 | *) xxx=`./loc $xxx $xxx $pth`;; | |
2288 | esac | |
a5a94ea5 | 2289 | eval $file=$xxx$_exe |
2304df62 AD |
2290 | eval _$file=$xxx |
2291 | case "$xxx" in | |
2292 | /*) | |
2293 | echo $file is in $xxx. | |
2294 | ;; | |
8e07c86e AD |
2295 | ?:[\\/]*) |
2296 | echo $file is in $xxx. | |
2297 | ;; | |
2304df62 | 2298 | *) |
25f94b33 AD |
2299 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
2300 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
4633a7c4 | 2301 | exit 1 |
2304df62 AD |
2302 | ;; |
2303 | esac | |
2304 | done | |
2305 | echo " " | |
2306 | echo "Don't worry if any of the following aren't found..." | |
2307 | say=offhand | |
2308 | for file in $trylist; do | |
dfe9444c AD |
2309 | eval xxx=\$$file |
2310 | case "$xxx" in | |
2311 | /*|?:[\\/]*) | |
2312 | if test -f "$xxx"; then | |
2313 | : ok | |
2314 | else | |
2315 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 | |
2316 | xxx=`./loc $file $file $pth` | |
2317 | fi | |
2318 | ;; | |
2319 | '') xxx=`./loc $file $file $pth`;; | |
2320 | *) xxx=`./loc $xxx $xxx $pth`;; | |
2321 | esac | |
306a8474 | 2322 | eval $file=$xxx$_exe |
2304df62 AD |
2323 | eval _$file=$xxx |
2324 | case "$xxx" in | |
2325 | /*) | |
2326 | echo $file is in $xxx. | |
2327 | ;; | |
8e07c86e AD |
2328 | ?:[\\/]*) |
2329 | echo $file is in $xxx. | |
2330 | ;; | |
2304df62 AD |
2331 | *) |
2332 | echo "I don't see $file out there, $say." | |
2333 | say=either | |
2334 | ;; | |
2335 | esac | |
2336 | done | |
2337 | case "$egrep" in | |
1fef16b3 | 2338 | egrep) |
2304df62 AD |
2339 | echo "Substituting grep for egrep." |
2340 | egrep=$grep | |
868439a2 | 2341 | _egrep=$grep |
2304df62 AD |
2342 | ;; |
2343 | esac | |
8ff267be | 2344 | case "$ln" in |
1fef16b3 | 2345 | ln) |
8ff267be | 2346 | echo "Substituting cp for ln." |
2347 | ln=$cp | |
868439a2 | 2348 | _ln=$cp |
8ff267be | 2349 | ;; |
2350 | esac | |
2e26f1d5 JH |
2351 | case "$make" in |
2352 | make) | |
2353 | case "$gmake" in | |
2354 | gmake) | |
2355 | echo "I can't find make or gmake, and my life depends on it." >&4 | |
2356 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
2357 | exit 1 | |
2358 | ;; | |
2359 | esac | |
2360 | ;; | |
2361 | esac | |
2362 | case "$gmake" in | |
2363 | gmake) ;; | |
2364 | *) # We can't have osname yet. | |
1fef16b3 JH |
2365 | if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS |
2366 | # Assume that gmake, if found, is definitely GNU make | |
2367 | # and prefer it over the system make. | |
2368 | echo "Substituting gmake for make." | |
2369 | make=$gmake | |
868439a2 | 2370 | _make=$gmake |
1fef16b3 JH |
2371 | fi |
2372 | ;; | |
a5a94ea5 | 2373 | esac |
2304df62 AD |
2374 | case "$test" in |
2375 | test) | |
2376 | echo "Hopefully test is built into your sh." | |
2377 | ;; | |
2378 | *) | |
73614538 | 2379 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
5d644a95 | 2380 | echo "Using the test built into your sh." |
2304df62 AD |
2381 | test=test |
2382 | _test=test | |
2383 | fi | |
2384 | ;; | |
2385 | esac | |
2386 | case "$echo" in | |
2387 | echo) | |
2388 | echo "Hopefully echo is built into your sh." | |
2389 | ;; | |
2390 | '') ;; | |
2391 | *) | |
2392 | echo " " | |
2393 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
2394 | $echo $n "hi there$c" >foo1 | |
2395 | echo $n "hi there$c" >foo2 | |
2396 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
2397 | echo "They are compatible. In fact, they may be identical." | |
2398 | else | |
2399 | case "$n" in | |
2400 | '-n') n='' c='\c';; | |
2401 | *) n='-n' c='';; | |
2402 | esac | |
2403 | cat <<FOO | |
2404 | They are not compatible! You are probably running ksh on a non-USG system. | |
2405 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
2406 | have echo built in and we may have to run some Bourne shell scripts. That | |
2407 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
2408 | ||
2409 | FOO | |
2410 | $echo $n "The star should be here-->$c" | |
2411 | $echo "*" | |
2412 | fi | |
2413 | $rm -f foo1 foo2 | |
2414 | ;; | |
2415 | esac | |
2416 | ||
6b769f8f | 2417 | cat <<EOS >trygcc |
2573c5f9 JH |
2418 | $startsh |
2419 | EOS | |
6b769f8f | 2420 | cat <<'EOSC' >>trygcc |
2573c5f9 JH |
2421 | case "$cc" in |
2422 | '') ;; | |
2423 | *) $rm -f try try.* | |
2424 | $cat >try.c <<EOM | |
2425 | int main(int argc, char *argv[]) { | |
2426 | return 0; | |
2427 | } | |
2428 | EOM | |
e4778687 | 2429 | if $cc -o try $ccflags $ldflags try.c; then |
2573c5f9 JH |
2430 | : |
2431 | else | |
2432 | echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4 | |
2433 | despair=yes | |
2434 | trygcc=yes | |
2435 | case "$cc" in | |
2436 | *gcc*) trygcc=no ;; | |
2437 | esac | |
2438 | case "`$cc -v -c try.c 2>&1`" in | |
2439 | *gcc*) trygcc=no ;; | |
2440 | esac | |
2441 | if $test X"$trygcc" = Xyes; then | |
2442 | if gcc -o try -c try.c; then | |
2443 | echo " " | |
2444 | echo "You seem to have a working gcc, though." >&4 | |
2445 | rp="Would you like to use it?" | |
2446 | dflt=y | |
2447 | if $test -f myread; then | |
2448 | . ./myread | |
2449 | else | |
2450 | if $test -f UU/myread; then | |
2451 | . ./UU/myread | |
2452 | else | |
2453 | echo "Cannot find myread, sorry. Aborting." >&2 | |
2454 | exit 1 | |
2455 | fi | |
2456 | fi | |
2457 | case "$ans" in | |
6371411c RB |
2458 | [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no; |
2459 | if $test -f usethreads.cbu; then | |
2460 | $cat >&4 <<EOM | |
2461 | ||
2462 | *** However, any setting of the C compiler flags (e.g. for thread support) | |
2463 | *** has been lost. It may be necessary to pass -Dcc=gcc to Configure | |
2464 | *** (together with e.g. -Dusethreads). | |
2465 | ||
2466 | EOM | |
2467 | fi;; | |
2573c5f9 JH |
2468 | esac |
2469 | fi | |
2470 | fi | |
6b769f8f RB |
2471 | fi |
2472 | $rm -f try try.* | |
2473 | ;; | |
2474 | esac | |
2475 | EOSC | |
2476 | ||
2477 | cat <<EOS >checkcc | |
2478 | $startsh | |
2479 | EOS | |
2480 | cat <<'EOSC' >>checkcc | |
2481 | case "$cc" in | |
2482 | '') ;; | |
2483 | *) $rm -f try try.* | |
2484 | $cat >try.c <<EOM | |
2485 | int main(int argc, char *argv[]) { | |
2486 | return 0; | |
2487 | } | |
2488 | EOM | |
2489 | if $cc -o try $ccflags $ldflags try.c; then | |
2490 | : | |
2491 | else | |
2573c5f9 | 2492 | if $test X"$despair" = Xyes; then |
6b769f8f RB |
2493 | echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4 |
2494 | fi | |
2495 | $cat >&4 <<EOM | |
5dd4fbdf MB |
2496 | You need to find a working C compiler. |
2497 | Either (purchase and) install the C compiler supplied by your OS vendor, | |
2498 | or for a free C compiler try http://gcc.gnu.org/ | |
2499 | I cannot continue any further, aborting. | |
2500 | EOM | |
6b769f8f | 2501 | exit 1 |
2573c5f9 JH |
2502 | fi |
2503 | $rm -f try try.* | |
2504 | ;; | |
2505 | esac | |
2506 | EOSC | |
2507 | ||
a0d0e21e LW |
2508 | : determine whether symbolic links are supported |
2509 | echo " " | |
2510 | $touch blurfl | |
2511 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
2512 | echo "Symbolic links are supported." >&4 | |
818f00be | 2513 | lns="$ln -s" |
a0d0e21e LW |
2514 | else |
2515 | echo "Symbolic links are NOT supported." >&4 | |
2516 | lns="$ln" | |
2517 | fi | |
2518 | $rm -f blurfl sym | |
2519 | ||
dafca956 JH |
2520 | : determine whether symbolic links are supported |
2521 | echo " " | |
2522 | case "$lns" in | |
18ea2752 | 2523 | *"ln"*" -s") |
dafca956 JH |
2524 | echo "Checking how to test for symbolic links..." >&4 |
2525 | $lns blurfl sym | |
4b661809 | 2526 | if $test "X$issymlink" = X; then |
2e2a97a6 JH |
2527 | case "$newsh" in |
2528 | '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;; | |
2529 | *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;; | |
2530 | esac | |
5d644a95 MB |
2531 | if test $? = 0; then |
2532 | issymlink="test -h" | |
2e2a97a6 JH |
2533 | else |
2534 | echo "Your builtin 'test -h' may be broken." >&4 | |
2535 | case "$test" in | |
2536 | /*) ;; | |
2537 | *) pth=`echo $PATH | sed -e "s/$p_/ /g"` | |
2538 | for p in $pth | |
2539 | do | |
2540 | if test -f "$p/$test"; then | |
2541 | test="$p/$test" | |
2542 | break | |
2543 | fi | |
2544 | done | |
2545 | ;; | |
2546 | esac | |
2547 | case "$test" in | |
2548 | /*) | |
2549 | echo "Trying external '$test -h'." >&4 | |
2550 | issymlink="$test -h" | |
2551 | if $test ! -h sym >/dev/null 2>&1; then | |
3c728e00 | 2552 | echo "External '$test -h' is broken, too." >&4 |
2e2a97a6 JH |
2553 | issymlink='' |
2554 | fi | |
2555 | ;; | |
2556 | *) issymlink='' ;; | |
2557 | esac | |
5d644a95 MB |
2558 | fi |
2559 | fi | |
4b661809 | 2560 | if $test "X$issymlink" = X; then |
dafca956 | 2561 | if $test -L sym 2>/dev/null; then |
5d644a95 | 2562 | issymlink="$test -L" |
2e2a97a6 | 2563 | echo "The builtin '$test -L' worked." >&4 |
dafca956 JH |
2564 | fi |
2565 | fi | |
4b661809 | 2566 | if $test "X$issymlink" != X; then |
5d644a95 | 2567 | echo "You can test for symbolic links with '$issymlink'." >&4 |
dafca956 JH |
2568 | else |
2569 | echo "I do not know how you can test for symbolic links." >&4 | |
2570 | fi | |
2571 | $rm -f blurfl sym | |
2572 | ;; | |
2573 | *) echo "No symbolic links, so not testing for their testing..." >&4 | |
2574 | ;; | |
2575 | esac | |
2576 | echo " " | |
2577 | ||
2578 | ||
2579 | case "$mksymlinks" in | |
2580 | $define|true|[yY]*) | |
2581 | case "$src" in | |
2582 | ''|'.') echo "Cannot create symlinks in the original directory." >&4 | |
2583 | exit 1 | |
2584 | ;; | |
4b661809 | 2585 | *) case "$lns:$issymlink" in |
f314eb9f | 2586 | *"ln"*" -s:"*"test -"?) |
dafca956 JH |
2587 | echo "Creating the symbolic links..." >&4 |
2588 | echo "(First creating the subdirectories...)" >&4 | |
2589 | cd .. | |
2590 | awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do | |
2591 | read directory | |
2592 | test -z "$directory" && break | |
2593 | mkdir -p $directory | |
2594 | done | |
2595 | # Sanity check 1. | |
2596 | if test ! -d t/base; then | |
2597 | echo "Failed to create the subdirectories. Aborting." >&4 | |
2598 | exit 1 | |
2599 | fi | |
2600 | echo "(Then creating the symlinks...)" >&4 | |
2601 | awk '{print $1}' $src/MANIFEST | while true; do | |
2602 | read filename | |
2603 | test -z "$filename" && break | |
2604 | if test -f $filename; then | |
5d644a95 | 2605 | if $issymlink $filename; then |
dafca956 JH |
2606 | rm -f $filename |
2607 | fi | |
2608 | fi | |
2609 | if test -f $filename; then | |
2610 | echo "$filename already exists, not symlinking." | |
2611 | else | |
2612 | ln -s $src/$filename $filename | |
2613 | fi | |
2614 | done | |
2615 | # Sanity check 2. | |
a0d24b8a JH |
2616 | if test ! -f t/base/lex.t; then |
2617 | echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4 | |
dafca956 JH |
2618 | exit 1 |
2619 | fi | |
2620 | cd UU | |
2621 | ;; | |
2622 | *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4 | |
2623 | ;; | |
2624 | esac | |
2625 | ;; | |
2626 | esac | |
2627 | ;; | |
2628 | esac | |
2629 | ||
5440bc8e JH |
2630 | |
2631 | case "$usecrosscompile" in | |
2632 | $define|true|[yY]*) | |
93bc48fa | 2633 | $echo "Cross-compiling..." |
5440bc8e JH |
2634 | croak='' |
2635 | case "$cc" in | |
2636 | *-*-gcc) # A cross-compiling gcc, probably. | |
93bc48fa | 2637 | targetarch=`$echo $cc|$sed 's/-gcc$//'` |
5440bc8e JH |
2638 | ar=$targetarch-ar |
2639 | # leave out ld, choosing it is more complex | |
2640 | nm=$targetarch-nm | |
2641 | ranlib=$targetarch-ranlib | |
93bc48fa | 2642 | $echo 'extern int foo;' > try.c |
f8006fac | 2643 | set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'` |
93bc48fa JH |
2644 | shift |
2645 | if $test $# -gt 0; then | |
2646 | incpth="$incpth $*" | |
f8006fac JH |
2647 | incpth="`$echo $incpth|$sed 's/^ //'`" |
2648 | echo "Guessing incpth '$incpth'." >&4 | |
93bc48fa | 2649 | for i in $*; do |
f8006fac | 2650 | j="`$echo $i|$sed 's,/include$,/lib,'`" |
93bc48fa JH |
2651 | if $test -d $j; then |
2652 | libpth="$libpth $j" | |
2653 | fi | |
2654 | done | |
f8006fac JH |
2655 | libpth="`$echo $libpth|$sed 's/^ //'`" |
2656 | echo "Guessing libpth '$libpth'." >&4 | |
93bc48fa JH |
2657 | fi |
2658 | $rm -f try.c | |
5440bc8e JH |
2659 | ;; |
2660 | esac | |
2661 | case "$targetarch" in | |
93bc48fa JH |
2662 | '') echo "Targetarch not defined." >&4; croak=y ;; |
2663 | *) echo "Using targetarch $targetarch." >&4 ;; | |
5440bc8e JH |
2664 | esac |
2665 | case "$incpth" in | |
93bc48fa | 2666 | '') echo "Incpth not defined." >&4; croak=y ;; |
f8006fac | 2667 | *) echo "Using incpth '$incpth'." >&4 ;; |
5440bc8e JH |
2668 | esac |
2669 | case "$libpth" in | |
93bc48fa | 2670 | '') echo "Libpth not defined." >&4; croak=y ;; |
f8006fac | 2671 | *) echo "Using libpth '$libpth'." >&4 ;; |
5440bc8e | 2672 | esac |
93bc48fa JH |
2673 | case "$usrinc" in |
2674 | '') for i in $incpth; do | |
2675 | if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then | |
2676 | usrinc=$i | |
2677 | echo "Guessing usrinc $usrinc." >&4 | |
2678 | break | |
2679 | fi | |
2680 | done | |
2681 | case "$usrinc" in | |
2682 | '') echo "Usrinc not defined." >&4; croak=y ;; | |
2683 | esac | |
2684 | ;; | |
2685 | *) echo "Using usrinc $usrinc." >&4 ;; | |
5440bc8e | 2686 | esac |
93bc48fa JH |
2687 | case "$targethost" in |
2688 | '') echo "Targethost not defined." >&4; croak=y ;; | |
2689 | *) echo "Using targethost $targethost." >&4 | |
5440bc8e | 2690 | esac |
93bc48fa JH |
2691 | locincpth=' ' |
2692 | loclibpth=' ' | |
5440bc8e | 2693 | case "$croak" in |
93bc48fa | 2694 | y) echo "Cannot continue, aborting." >&4; exit 1 ;; |
5440bc8e JH |
2695 | esac |
2696 | case "$src" in | |
2697 | /*) run=$src/Cross/run | |
93c0359c | 2698 | targetmkdir=$src/Cross/mkdir |
5440bc8e JH |
2699 | to=$src/Cross/to |
2700 | from=$src/Cross/from | |
2701 | ;; | |
93bc48fa | 2702 | *) pwd=`$test -f ../Configure & cd ..; pwd` |
5440bc8e | 2703 | run=$pwd/Cross/run |
f8006fac | 2704 | targetmkdir=$pwd/Cross/mkdir |
5440bc8e JH |
2705 | to=$pwd/Cross/to |
2706 | from=$pwd/Cross/from | |
2707 | ;; | |
2708 | esac | |
2709 | case "$targetrun" in | |
2710 | '') targetrun=ssh ;; | |
2711 | esac | |
2712 | case "$targetto" in | |
2713 | '') targetto=scp ;; | |
2714 | esac | |
2715 | case "$targetfrom" in | |
2716 | '') targetfrom=scp ;; | |
2717 | esac | |
2718 | run=$run-$targetrun | |
2719 | to=$to-$targetto | |
2720 | from=$from-$targetfrom | |
93bc48fa JH |
2721 | case "$targetdir" in |
2722 | '') targetdir=/tmp | |
2723 | echo "Guessing targetdir $targetdir." >&4 | |
2724 | ;; | |
2725 | esac | |
5440bc8e | 2726 | case "$targetuser" in |
93bc48fa JH |
2727 | '') targetuser=root |
2728 | echo "Guessing targetuser $targetuser." >&4 | |
2729 | ;; | |
5440bc8e JH |
2730 | esac |
2731 | case "$targetfrom" in | |
2732 | scp) q=-q ;; | |
2733 | *) q='' ;; | |
2734 | esac | |
2735 | case "$targetrun" in | |
2736 | ssh|rsh) | |
2737 | cat >$run <<EOF | |
2738 | #!/bin/sh | |
93c0359c JH |
2739 | case "\$1" in |
2740 | -cwd) | |
2741 | shift | |
2742 | cwd=\$1 | |
2743 | shift | |
2744 | ;; | |
2745 | esac | |
2746 | case "\$cwd" in | |
2747 | '') cwd=$targetdir ;; | |
2748 | esac | |
5440bc8e JH |
2749 | exe=\$1 |
2750 | shift | |
93c0359c JH |
2751 | if $test ! -f \$exe.xok; then |
2752 | $to \$exe | |
2753 | $touch \$exe.xok | |
2754 | fi | |
2755 | $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@" | |
5440bc8e JH |
2756 | EOF |
2757 | ;; | |
93bc48fa | 2758 | *) echo "Unknown targetrun '$targetrun'" >&4 |
5440bc8e JH |
2759 | exit 1 |
2760 | ;; | |
2761 | esac | |
93c0359c JH |
2762 | case "$targetmkdir" in |
2763 | */Cross/mkdir) | |
2764 | cat >$targetmkdir <<EOF | |
2765 | #!/bin/sh | |
2766 | $targetrun -l $targetuser $targethost "mkdir -p \$@" | |
2767 | EOF | |
f8006fac | 2768 | $chmod a+rx $targetmkdir |
93c0359c JH |
2769 | ;; |
2770 | *) echo "Unknown targetmkdir '$targetmkdir'" >&4 | |
2771 | exit 1 | |
2772 | ;; | |
2773 | esac | |
5440bc8e JH |
2774 | case "$targetto" in |
2775 | scp|rcp) | |
2776 | cat >$to <<EOF | |
2777 | #!/bin/sh | |
2778 | for f in \$@ | |
2779 | do | |
93c0359c JH |
2780 | case "\$f" in |
2781 | /*) | |
2782 | $targetmkdir \`dirname \$f\` | |
2783 | $targetto $q \$f $targetuser@$targethost:\$f || exit 1 | |
2784 | ;; | |
2785 | *) | |
2786 | $targetmkdir $targetdir/\`dirname \$f\` | |
2787 | $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1 | |
2788 | ;; | |
2789 | esac | |
5440bc8e JH |
2790 | done |
2791 | exit 0 | |
2792 | EOF | |
2793 | ;; | |
2794 | cp) cat >$to <<EOF | |
2795 | #!/bin/sh | |
93c0359c JH |
2796 | for f in \$@ |
2797 | do | |
2798 | case "\$f" in | |
2799 | /*) | |
2800 | $mkdir -p $targetdir/\`dirname \$f\` | |
2801 | $cp \$f $targetdir/\$f || exit 1 | |
2802 | ;; | |
2803 | *) | |
2804 | $targetmkdir $targetdir/\`dirname \$f\` | |
2805 | $cp \$f $targetdir/\$f || exit 1 | |
2806 | ;; | |
2807 | esac | |
2808 | done | |
2809 | exit 0 | |
5440bc8e JH |
2810 | EOF |
2811 | ;; | |
93bc48fa | 2812 | *) echo "Unknown targetto '$targetto'" >&4 |
5440bc8e JH |
2813 | exit 1 |
2814 | ;; | |
2815 | esac | |
2816 | case "$targetfrom" in | |
2817 | scp|rcp) | |
2818 | cat >$from <<EOF | |
2819 | #!/bin/sh | |
2820 | for f in \$@ | |
2821 | do | |
93c0359c | 2822 | $rm -f \$f |
5440bc8e JH |
2823 | $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1 |
2824 | done | |
2825 | exit 0 | |
2826 | EOF | |
2827 | ;; | |
2828 | cp) cat >$from <<EOF | |
2829 | #!/bin/sh | |
2830 | for f in \$@ | |
2831 | do | |
93c0359c | 2832 | $rm -f \$f |
5440bc8e JH |
2833 | cp $targetdir/\$f . || exit 1 |
2834 | done | |
2835 | exit 0 | |
2836 | EOF | |
2837 | ;; | |
93bc48fa | 2838 | *) echo "Unknown targetfrom '$targetfrom'" >&4 |
5440bc8e JH |
2839 | exit 1 |
2840 | ;; | |
2841 | esac | |
93bc48fa JH |
2842 | if $test ! -f $run; then |
2843 | echo "Target 'run' script '$run' not found." >&4 | |
5440bc8e | 2844 | else |
f8006fac | 2845 | $chmod a+rx $run |
5440bc8e | 2846 | fi |
93bc48fa JH |
2847 | if $test ! -f $to; then |
2848 | echo "Target 'to' script '$to' not found." >&4 | |
5440bc8e | 2849 | else |
f8006fac | 2850 | $chmod a+rx $to |
5440bc8e | 2851 | fi |
93bc48fa JH |
2852 | if $test ! -f $from; then |
2853 | echo "Target 'from' script '$from' not found." >&4 | |
5440bc8e | 2854 | else |
f8006fac | 2855 | $chmod a+rx $from |
5440bc8e | 2856 | fi |
93bc48fa | 2857 | if $test ! -f $run -o ! -f $to -o ! -f $from; then |
5440bc8e JH |
2858 | exit 1 |
2859 | fi | |
2860 | cat >&4 <<EOF | |
f8006fac JH |
2861 | Using '$run' for remote execution, |
2862 | and '$from' and '$to' | |
93bc48fa | 2863 | for remote file transfer. |
5440bc8e JH |
2864 | EOF |
2865 | ;; | |
2866 | *) run='' | |
2867 | to=: | |
2868 | from=: | |
2869 | usecrosscompile='undef' | |
2870 | targetarch='' | |
2871 | ;; | |
2872 | esac | |
2873 | ||
ecfc5424 AD |
2874 | : see whether [:lower:] and [:upper:] are supported character classes |
2875 | echo " " | |
ecfc5424 AD |
2876 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in |
2877 | ABYZ) | |
2878 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
2879 | up='[:upper:]' | |
2880 | low='[:lower:]' | |
2881 | ;; | |
c931d01c NC |
2882 | *) # There is a discontinuity in EBCDIC between 'R' and 'S' |
2883 | # (0xd9 and 0xe2), therefore that is a nice testing point. | |
2884 | if test "X$up" = X -o "X$low" = X; then | |
2885 | case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in | |
2886 | rs) up='[A-Z]' | |
2887 | low='[a-z]' | |
28e8609d JH |
2888 | ;; |
2889 | esac | |
c931d01c | 2890 | fi |
28e8609d | 2891 | if test "X$up" = X -o "X$low" = X; then |
c931d01c NC |
2892 | case "`echo RS | $tr R-S r-s 2>/dev/null`" in |
2893 | rs) up='A-Z' | |
28e8609d JH |
2894 | low='a-z' |
2895 | ;; | |
2896 | esac | |
c931d01c | 2897 | fi |
28e8609d | 2898 | if test "X$up" = X -o "X$low" = X; then |
c931d01c NC |
2899 | case "`echo RS | od -x 2>/dev/null`" in |
2900 | *D9E2*|*d9e2*) | |
28e8609d JH |
2901 | echo "Hey, this might be EBCDIC." >&4 |
2902 | if test "X$up" = X -o "X$low" = X; then | |
c931d01c NC |
2903 | case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
2904 | rs) up='[A-IJ-RS-Z]' | |
2905 | low='[a-ij-rs-z]' | |
28e8609d JH |
2906 | ;; |
2907 | esac | |
2908 | fi | |
2909 | if test "X$up" = X -o "X$low" = X; then | |
c931d01c NC |
2910 | case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
2911 | rs) up='A-IJ-RS-Z' | |
2912 | low='a-ij-rs-z' | |
28e8609d JH |
2913 | ;; |
2914 | esac | |
2915 | fi | |
2916 | ;; | |
2917 | esac | |
2918 | fi | |
2919 | esac | |
c931d01c NC |
2920 | case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in |
2921 | rs) | |
28e8609d JH |
2922 | echo "Using $up and $low to convert case." >&4 |
2923 | ;; | |
ecfc5424 | 2924 | *) |
28e8609d JH |
2925 | echo "I don't know how to translate letters from upper to lower case." >&4 |
2926 | echo "Your tr is not acting any way I know of." >&4 | |
2927 | exit 1 | |
2928 | ;; | |
ecfc5424 AD |
2929 | esac |
2930 | : set up the translation script tr, must be called with ./tr of course | |
2931 | cat >tr <<EOSC | |
2932 | $startsh | |
2933 | case "\$1\$2" in | |
2934 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
2935 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
2936 | esac | |
2937 | exec $tr "\$@" | |
2938 | EOSC | |
2939 | chmod +x tr | |
2940 | $eunicefix tr | |
2941 | ||
2304df62 AD |
2942 | : Try to determine whether config.sh was made on this system |
2943 | case "$config_sh" in | |
2944 | '') | |
43999f95 JH |
2945 | myuname=`$uname -a 2>/dev/null` |
2946 | $test -z "$myuname" && myuname=`hostname 2>/dev/null` | |
28e8609d JH |
2947 | # tr '[A-Z]' '[a-z]' would not work in EBCDIC |
2948 | # because the A-Z/a-z are not consecutive. | |
a0d0e21e | 2949 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
3eaeeeae | 2950 | ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` |
1aef975c | 2951 | newmyuname="$myuname" |
2304df62 | 2952 | dflt=n |
16d20bd9 AD |
2953 | case "$knowitall" in |
2954 | '') | |
2955 | if test -f ../config.sh; then | |
2956 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
2957 | eval "`grep myuname= ../config.sh`" | |
2958 | fi | |
2959 | if test "X$myuname" = "X$newmyuname"; then | |
2960 | dflt=y | |
2961 | fi | |
2304df62 | 2962 | fi |
16d20bd9 AD |
2963 | ;; |
2964 | *) dflt=y;; | |
2965 | esac | |
2304df62 AD |
2966 | |
2967 | : Get old answers from old config file if Configure was run on the | |
2968 | : same system, otherwise use the hints. | |
2969 | hint=default | |
2970 | cd .. | |
2971 | if test -f config.sh; then | |
16d20bd9 AD |
2972 | echo " " |
2973 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
2974 | . UU/myread |
2975 | case "$ans" in | |
f83701cd AD |
2976 | n*|N*) echo "OK, I'll ignore it." |
2977 | mv config.sh config.sh.old | |
2978 | myuname="$newmyuname" | |
2979 | ;; | |
2304df62 | 2980 | *) echo "Fetching default answers from your old config.sh file..." >&4 |
ecfc5424 AD |
2981 | tmp_n="$n" |
2982 | tmp_c="$c" | |
85cad39c | 2983 | tmp_sh="$sh" |
2304df62 AD |
2984 | . ./config.sh |
2985 | cp config.sh UU | |
ecfc5424 AD |
2986 | n="$tmp_n" |
2987 | c="$tmp_c" | |
85cad39c | 2988 | : Older versions did not always set $sh. Catch re-use of such |
2989 | : an old config.sh. | |
2990 | case "$sh" in | |
2991 | '') sh="$tmp_sh" ;; | |
2992 | esac | |
2304df62 AD |
2993 | hint=previous |
2994 | ;; | |
2995 | esac | |
2996 | fi | |
2573c5f9 | 2997 | . ./UU/checkcc |
2304df62 AD |
2998 | if test ! -f config.sh; then |
2999 | $cat <<EOM | |
3000 | ||
4e2a5f63 AD |
3001 | First time through, eh? I have some defaults handy for some systems |
3002 | that need some extra help getting the Configure answers right: | |
2304df62 AD |
3003 | |
3004 | EOM | |
dfe9444c | 3005 | (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
2304df62 AD |
3006 | dflt='' |
3007 | : Half the following guesses are probably wrong... If you have better | |
7f2de2d2 | 3008 | : tests or hints, please send them to perlbug@perl.org |
2304df62 | 3009 | : The metaconfig authors would also appreciate a copy... |
a0d0e21e | 3010 | $test -f /irix && osname=irix |
85e6fe83 LW |
3011 | $test -f /xenix && osname=sco_xenix |
3012 | $test -f /dynix && osname=dynix | |
3013 | $test -f /dnix && osname=dnix | |
5f05dabc | 3014 | $test -f /lynx.os && osname=lynxos |
3015 | $test -f /unicos && osname=unicos && osvers=`$uname -r` | |
c71a9cee | 3016 | $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` |
7a4c00b4 | 3017 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
85e6fe83 | 3018 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
3019 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
3020 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
3021 | $test -d /usr/apollo/bin && osname=apollo |
3022 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 3023 | $test -d /usr/include/minix && osname=minix |
d54344fc | 3024 | $test -f /system/gnu_library/bin/ar.pm && osname=vos |
e060872b | 3025 | if $test -d /MachTen -o -d /MachTen_Folder; then |
dfe9444c | 3026 | osname=machten |
4633a7c4 | 3027 | if $test -x /sbin/version; then |
dfe9444c | 3028 | osvers=`/sbin/version | $awk '{print $2}' | |
4633a7c4 LW |
3029 | $sed -e 's/[A-Za-z]$//'` |
3030 | elif $test -x /usr/etc/version; then | |
dfe9444c | 3031 | osvers=`/usr/etc/version | $awk '{print $2}' | |
4633a7c4 LW |
3032 | $sed -e 's/[A-Za-z]$//'` |
3033 | else | |
3034 | osvers="$2.$3" | |
3035 | fi | |
3036 | fi | |
aaacdc8b GS |
3037 | |
3038 | $test -f /sys/posix.dll && | |
3039 | $test -f /usr/bin/what && | |
3040 | set X `/usr/bin/what /sys/posix.dll` && | |
3041 | $test "$3" = UWIN && | |
3042 | osname=uwin && | |
3043 | osvers="$5" | |
3044 | ||
2304df62 AD |
3045 | if $test -f $uname; then |
3046 | set X $myuname | |
3047 | shift | |
3048 | ||
2304df62 | 3049 | case "$5" in |
85e6fe83 | 3050 | fps*) osname=fps ;; |
2304df62 AD |
3051 | mips*) |
3052 | case "$4" in | |
85e6fe83 LW |
3053 | umips) osname=umips ;; |
3054 | *) osname=mips ;; | |
2304df62 | 3055 | esac;; |
85e6fe83 LW |
3056 | [23]100) osname=mips ;; |
3057 | next*) osname=next ;; | |
ecfc5424 | 3058 | i386*) |
c6912327 JH |
3059 | tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` |
3060 | if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then | |
619ffc2b JH |
3061 | osname='sco' |
3062 | osvers=$tmp | |
3063 | elif $test -f /etc/kconfig; then | |
ecfc5424 | 3064 | osname=isc |
bd628c73 | 3065 | if test "$lns" = "$ln -s"; then |
a0d0e21e LW |
3066 | osvers=4 |
3067 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
3068 | osvers=3 | |
2304df62 | 3069 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 3070 | osvers=2 |
ecfc5424 AD |
3071 | fi |
3072 | fi | |
2000072c | 3073 | tmp='' |
ecfc5424 | 3074 | ;; |
c4f23d77 AD |
3075 | pc*) |
3076 | if test -n "$DJGPP"; then | |
3077 | osname=dos | |
3078 | osvers=djgpp | |
3079 | fi | |
3080 | ;; | |
2304df62 AD |
3081 | esac |
3082 | ||
3083 | case "$1" in | |
a0d0e21e LW |
3084 | aix) osname=aix |
3085 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
3086 | case "$tmp" in | |
066079d9 NC |
3087 | # oslevel can fail with: |
3088 | # oslevel: Unable to acquire lock. | |
3089 | *not\ found) osvers="$4"."$3" ;; | |
a0d0e21e LW |
3090 | '<3240'|'<>3240') osvers=3.2.0 ;; |
3091 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
3092 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 3093 | *) osvers=$tmp;; |
a0d0e21e LW |
3094 | esac |
3095 | ;; | |
aaacdc8b GS |
3096 | bsd386) osname=bsd386 |
3097 | osvers=`$uname -r` | |
3098 | ;; | |
3099 | cygwin*) osname=cygwin | |
3100 | osvers="$3" | |
3101 | ;; | |
23f87696 SZ |
3102 | *dc.osx) osname=dcosx |
3103 | osvers="$3" | |
3104 | ;; | |
a0d0e21e LW |
3105 | dnix) osname=dnix |
3106 | osvers="$3" | |
3107 | ;; | |
3108 | domainos) osname=apollo | |
3109 | osvers="$3" | |
3110 | ;; | |
54b41212 | 3111 | dgux) osname=dgux |
a0d0e21e LW |
3112 | osvers="$3" |
3113 | ;; | |
760ac839 | 3114 | dynixptx*) osname=dynixptx |
e58e581d | 3115 | osvers=`echo "$4"|sed 's/^v//'` |
760ac839 | 3116 | ;; |
a0d0e21e LW |
3117 | freebsd) osname=freebsd |
3118 | osvers="$3" ;; | |
54b41212 NC |
3119 | genix) osname=genix ;; |
3120 | gnu) osname=gnu | |
3121 | osvers="$3" ;; | |
3122 | hp*) osname=hpux | |
bfb7748a | 3123 | osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` |
a0d0e21e | 3124 | ;; |
54b41212 | 3125 | irix*) osname=irix |
a0d0e21e LW |
3126 | case "$3" in |
3127 | 4*) osvers=4 ;; | |
3128 | 5*) osvers=5 ;; | |
ecfc5424 | 3129 | *) osvers="$3" ;; |
a0d0e21e LW |
3130 | esac |
3131 | ;; | |
54b41212 | 3132 | linux) osname=linux |
a0d0e21e | 3133 | case "$3" in |
a0d0e21e LW |
3134 | *) osvers="$3" ;; |
3135 | esac | |
3136 | ;; | |
54b41212 | 3137 | MiNT) osname=mint |
28e8609d JH |
3138 | ;; |
3139 | netbsd*) osname=netbsd | |
ecfc5424 AD |
3140 | osvers="$3" |
3141 | ;; | |
4e81affe MM |
3142 | news-os) osvers="$3" |
3143 | case "$3" in | |
3144 | 4*) osname=newsos4 ;; | |
3145 | *) osname=newsos ;; | |
3146 | esac | |
3147 | ;; | |
aaacdc8b | 3148 | next*) osname=next ;; |
28bb1e2c | 3149 | nonstop-ux) osname=nonstopux ;; |
65dc58a1 TM |
3150 | openbsd) osname=openbsd |
3151 | osvers="$3" | |
3152 | ;; | |
8257dec7 IZ |
3153 | os2) osname=os2 |
3154 | osvers="$4" | |
3155 | ;; | |
aaacdc8b GS |
3156 | POSIX-BC | posix-bc ) osname=posix-bc |
3157 | osvers="$3" | |
a0d0e21e | 3158 | ;; |
ae3afa4e TH |
3159 | powerux | power_ux | powermax_os | powermaxos | \ |
3160 | powerunix | power_unix) osname=powerux | |
3161 | osvers="$3" | |
3162 | ;; | |
aaacdc8b GS |
3163 | qnx) osname=qnx |
3164 | osvers="$4" | |
3165 | ;; | |
a0d0e21e LW |
3166 | solaris) osname=solaris |
3167 | case "$3" in | |
3168 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 3169 | *) osvers="$3" ;; |
a0d0e21e LW |
3170 | esac |
3171 | ;; | |
85e6fe83 LW |
3172 | sunos) osname=sunos |
3173 | case "$3" in | |
85e6fe83 LW |
3174 | 5*) osname=solaris |
3175 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 3176 | *) osvers="$3" ;; |
2304df62 AD |
3177 | esac |
3178 | ;; | |
a0d0e21e | 3179 | titanos) osname=titanos |
85e6fe83 | 3180 | case "$3" in |
a0d0e21e LW |
3181 | 1*) osvers=1 ;; |
3182 | 2*) osvers=2 ;; | |
3183 | 3*) osvers=3 ;; | |
3184 | 4*) osvers=4 ;; | |
ecfc5424 | 3185 | *) osvers="$3" ;; |
2304df62 AD |
3186 | esac |
3187 | ;; | |
85e6fe83 | 3188 | ultrix) osname=ultrix |
ecfc5424 | 3189 | osvers="$3" |
2304df62 | 3190 | ;; |
28757baa | 3191 | osf1|mls+) case "$5" in |
fed7345c AD |
3192 | alpha) |
3193 | osname=dec_osf | |
c0e211e2 | 3194 | osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'` |
2aa76180 JH |
3195 | case "$osvers" in |
3196 | [1-9].[0-9]*) ;; | |
3197 | *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;; | |
3198 | esac | |
ecfc5424 AD |
3199 | ;; |
3200 | hp*) osname=hp_osf1 ;; | |
3201 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
3202 | esac |
3203 | ;; | |
bfd7eeef JH |
3204 | # UnixWare 7.1.2 is known as Open UNIX 8 |
3205 | openunix|unixware) osname=svr5 | |
0337d152 BG |
3206 | osvers="$4" |
3207 | ;; | |
3c728e00 | 3208 | uts) osname=uts |
a0d0e21e LW |
3209 | osvers="$3" |
3210 | ;; | |
3c728e00 JH |
3211 | vos) osvers="$3" |
3212 | ;; | |
85e6fe83 | 3213 | $2) case "$osname" in |
2304df62 | 3214 | *isc*) ;; |
a0d0e21e | 3215 | *freebsd*) ;; |
5f05dabc | 3216 | svr*) |
a0d0e21e LW |
3217 | : svr4.x or possibly later |
3218 | case "svr$3" in | |
3219 | ${osname}*) | |
3220 | osname=svr$3 | |
3221 | osvers=$4 | |
3222 | ;; | |
3223 | esac | |
3224 | case "$osname" in | |
3225 | svr4.0) | |
3226 | : Check for ESIX | |
3227 | if test -f /stand/boot ; then | |
3228 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
3229 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
3230 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
3231 | if test -n "$isesix"; then | |
a0d0e21e LW |
3232 | osname=esix4 |
3233 | fi | |
3234 | fi | |
3235 | fi | |
3236 | ;; | |
3237 | esac | |
3238 | ;; | |
2304df62 | 3239 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
3240 | osname=sco |
3241 | set `echo $3 | $sed 's/\./ /g'` $4 | |
c4f23d77 | 3242 | if $test -f $src/hints/sco_$1_$2_$3.sh; then |
85e6fe83 | 3243 | osvers=$1.$2.$3 |
c4f23d77 | 3244 | elif $test -f $src/hints/sco_$1_$2.sh; then |
85e6fe83 | 3245 | osvers=$1.$2 |
c4f23d77 | 3246 | elif $test -f $src/hints/sco_$1.sh; then |
85e6fe83 | 3247 | osvers=$1 |
2304df62 | 3248 | fi |
a0d0e21e LW |
3249 | else |
3250 | case "$osname" in | |
3251 | '') : Still unknown. Probably a generic Sys V. | |
3252 | osname="sysv" | |
3253 | osvers="$3" | |
3254 | ;; | |
3255 | esac | |
2304df62 AD |
3256 | fi |
3257 | ;; | |
3258 | esac | |
3259 | ;; | |
a0d0e21e LW |
3260 | *) case "$osname" in |
3261 | '') : Still unknown. Probably a generic BSD. | |
3262 | osname="$1" | |
3263 | osvers="$3" | |
3264 | ;; | |
3265 | esac | |
3266 | ;; | |
2304df62 AD |
3267 | esac |
3268 | else | |
dfe9444c AD |
3269 | if test -f /vmunix -a -f $src/hints/news_os.sh; then |
3270 | (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 | |
3271 | if $contains news-os UU/kernel.what >/dev/null 2>&1; then | |
3272 | osname=news_os | |
2304df62 | 3273 | fi |
dfe9444c | 3274 | $rm -f UU/kernel.what |
8257dec7 | 3275 | elif test -d c:/. -o -n "$is_os2" ; then |
8e07c86e AD |
3276 | set X $myuname |
3277 | osname=os2 | |
3278 | osvers="$5" | |
2304df62 AD |
3279 | fi |
3280 | fi | |
85e6fe83 | 3281 | |
5440bc8e JH |
3282 | case "$targetarch" in |
3283 | '') ;; | |
3284 | *) hostarch=$osname | |
3285 | osname=`echo $targetarch|sed 's,^[^-]*-,,'` | |
3286 | osvers='' | |
3287 | ;; | |
3288 | esac | |
3289 | ||
a0d0e21e LW |
3290 | : Now look for a hint file osname_osvers, unless one has been |
3291 | : specified already. | |
3292 | case "$hintfile" in | |
3293 | ''|' ') | |
1e127011 | 3294 | file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'` |
a0d0e21e | 3295 | : Also try without trailing minor version numbers. |
1e127011 DD |
3296 | xfile=`echo $file | $sed -e 's%_[^_]*$%%'` |
3297 | xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'` | |
3298 | xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'` | |
3299 | xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'` | |
a0d0e21e LW |
3300 | case "$file" in |
3301 | '') dflt=none ;; | |
3302 | *) case "$osvers" in | |
3303 | '') dflt=$file | |
3304 | ;; | |
dfe9444c | 3305 | *) if $test -f $src/hints/$file.sh ; then |
a0d0e21e | 3306 | dflt=$file |
dfe9444c | 3307 | elif $test -f $src/hints/$xfile.sh ; then |
a0d0e21e | 3308 | dflt=$xfile |
dfe9444c | 3309 | elif $test -f $src/hints/$xxfile.sh ; then |
a0d0e21e | 3310 | dflt=$xxfile |
dfe9444c | 3311 | elif $test -f $src/hints/$xxxfile.sh ; then |
a0d0e21e | 3312 | dflt=$xxxfile |
dfe9444c | 3313 | elif $test -f $src/hints/$xxxxfile.sh ; then |
a0d0e21e | 3314 | dflt=$xxxxfile |
dfe9444c | 3315 | elif $test -f "$src/hints/${osname}.sh" ; then |
a0d0e21e LW |
3316 | dflt="${osname}" |
3317 | else | |
3318 | dflt=none | |
3319 | fi | |
3320 | ;; | |
3321 | esac | |
85e6fe83 LW |
3322 | ;; |
3323 | esac | |
4e2a5f63 AD |
3324 | if $test -f Policy.sh ; then |
3325 | case "$dflt" in | |
3326 | *Policy*) ;; | |
3327 | none) dflt="Policy" ;; | |
3328 | *) dflt="Policy $dflt" ;; | |
3329 | esac | |
3330 | fi | |
85e6fe83 | 3331 | ;; |
a0d0e21e | 3332 | *) |
ecfc5424 | 3333 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 3334 | ;; |
2304df62 | 3335 | esac |
1aef975c | 3336 | |
4e2a5f63 AD |
3337 | if $test -f Policy.sh ; then |
3338 | $cat <<EOM | |
3339 | ||
3340 | There's also a Policy hint file available, which should make the | |
3341 | site-specific (policy) questions easier to answer. | |
3342 | EOM | |
3343 | ||
3344 | fi | |
3345 | ||
2304df62 AD |
3346 | $cat <<EOM |
3347 | ||
3348 | You may give one or more space-separated answers, or "none" if appropriate. | |
4e2a5f63 | 3349 | A well-behaved OS will have no hints, so answering "none" or just "Policy" |
a3635516 | 3350 | is a good thing. DO NOT give a wrong version or a wrong OS. |
2304df62 AD |
3351 | |
3352 | EOM | |
4e2a5f63 | 3353 | |
2304df62 | 3354 | rp="Which of these apply, if any?" |
dfe9444c | 3355 | . UU/myread |
85e6fe83 LW |
3356 | tans=$ans |
3357 | for file in $tans; do | |
4e2a5f63 AD |
3358 | if $test X$file = XPolicy -a -f Policy.sh; then |
3359 | . Policy.sh | |
3360 | $cat Policy.sh >> UU/config.sh | |
3361 | elif $test -f $src/hints/$file.sh; then | |
dfe9444c AD |
3362 | . $src/hints/$file.sh |
3363 | $cat $src/hints/$file.sh >> UU/config.sh | |
5440bc8e | 3364 | elif $test X"$tans" = X -o X"$tans" = Xnone ; then |
2304df62 AD |
3365 | : nothing |
3366 | else | |
85e6fe83 LW |
3367 | : Give one chance to correct a possible typo. |
3368 | echo "$file.sh does not exist" | |
3369 | dflt=$file | |
3370 | rp="hint to use instead?" | |
dfe9444c | 3371 | . UU/myread |
85e6fe83 | 3372 | for file in $ans; do |
dfe9444c AD |
3373 | if $test -f "$src/hints/$file.sh"; then |
3374 | . $src/hints/$file.sh | |
3375 | $cat $src/hints/$file.sh >> UU/config.sh | |
85e6fe83 LW |
3376 | elif $test X$ans = X -o X$ans = Xnone ; then |
3377 | : nothing | |
3378 | else | |
3379 | echo "$file.sh does not exist -- ignored." | |
3380 | fi | |
3381 | done | |
2304df62 AD |
3382 | fi |
3383 | done | |
85e6fe83 | 3384 | |
2304df62 | 3385 | hint=recommended |
85e6fe83 | 3386 | : Remember our hint file for later. |
dfe9444c | 3387 | if $test -f "$src/hints/$file.sh" ; then |
a0d0e21e | 3388 | hintfile="$file" |
85e6fe83 | 3389 | else |
a0d0e21e | 3390 | hintfile='' |
85e6fe83 | 3391 | fi |
2304df62 AD |
3392 | fi |
3393 | cd UU | |
3394 | ;; | |
3395 | *) | |
3396 | echo " " | |
3397 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
3398 | tmp_n="$n" |
3399 | tmp_c="$c" | |
2304df62 AD |
3400 | cd .. |
3401 | cp $config_sh config.sh 2>/dev/null | |
a78b0d02 | 3402 | chmod +w config.sh |
2304df62 AD |
3403 | . ./config.sh |
3404 | cd UU | |
3405 | cp ../config.sh . | |
ecfc5424 AD |
3406 | n="$tmp_n" |
3407 | c="$tmp_c" | |
2304df62 AD |
3408 | hint=previous |
3409 | ;; | |
3410 | esac | |
1aef975c | 3411 | test "$override" && . ./optdef.sh |
2304df62 AD |
3412 | |
3413 | : Restore computed paths | |
3414 | for file in $loclist $trylist; do | |
3415 | eval $file="\$_$file" | |
3416 | done | |
3417 | ||
85e6fe83 | 3418 | cat << EOM |
a0d0e21e | 3419 | |
85e6fe83 | 3420 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
3421 | The default value is probably right if the name rings a bell. Otherwise, |
3422 | since spelling matters for me, either accept the default or answer "none" | |
3423 | to leave it blank. | |
a0d0e21e | 3424 | |
85e6fe83 | 3425 | EOM |
85e6fe83 | 3426 | case "$osname" in |
a0d0e21e | 3427 | ''|' ') |
85e6fe83 | 3428 | case "$hintfile" in |
a0d0e21e | 3429 | ''|' '|none) dflt=none ;; |
ecfc5424 | 3430 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
3431 | esac |
3432 | ;; | |
3433 | *) dflt="$osname" ;; | |
3434 | esac | |
3435 | rp="Operating system name?" | |
3436 | . ./myread | |
3437 | case "$ans" in | |
ecfc5424 AD |
3438 | none) osname='' ;; |
3439 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 3440 | esac |
8ff267be | 3441 | echo " " |
3442 | case "$osvers" in | |
3443 | ''|' ') | |
3444 | case "$hintfile" in | |
3445 | ''|' '|none) dflt=none ;; | |
3446 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` | |
3447 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` | |
3448 | case "$dflt" in | |
3449 | ''|' ') dflt=none ;; | |
3450 | esac | |
3451 | ;; | |
3452 | esac | |
3453 | ;; | |
3454 | *) dflt="$osvers" ;; | |
3455 | esac | |
3456 | rp="Operating system version?" | |
3457 | . ./myread | |
3458 | case "$ans" in | |
3459 | none) osvers='' ;; | |
3460 | *) osvers="$ans" ;; | |
3461 | esac | |
3462 | ||
02e93a22 JH |
3463 | |
3464 | . ./posthint.sh | |
3465 | ||
2304df62 | 3466 | : who configured the system |
59b83a6f | 3467 | cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1` |
dfe9444c AD |
3468 | case "$cf_by" in |
3469 | "") | |
3d46c0ef | 3470 | cf_by=`(logname) 2>/dev/null` |
dfe9444c | 3471 | case "$cf_by" in |
3d46c0ef NC |
3472 | "") |
3473 | cf_by=`(whoami) 2>/dev/null` | |
3474 | case "$cf_by" in | |
3475 | "") cf_by=unknown ;; | |
3476 | esac ;; | |
8ff267be | 3477 | esac ;; |
3478 | esac | |
2304df62 | 3479 | |
b4eb6b3d JH |
3480 | : set up the script used to warn in case of inconsistency |
3481 | cat <<EOS >whoa | |
3482 | $startsh | |
3483 | EOS | |
3484 | cat <<'EOSC' >>whoa | |
3485 | dflt=y | |
3486 | echo " " | |
3487 | echo "*** WHOA THERE!!! ***" >&4 | |
3488 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
3489 | rp=" Keep the $hint value?" | |
3490 | . ./myread | |
3491 | case "$ans" in | |
3492 | y) td=$was; tu=$was;; | |
3493 | esac | |
3494 | EOSC | |
3495 | ||
3496 | : function used to set $1 to $val | |
3497 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
3498 | case "$val$was" in | |
3499 | $define$undef) . ./whoa; eval "$var=\$td";; | |
3500 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
3501 | *) eval "$var=$val";; | |
3502 | esac' | |
3503 | ||
b29b105d JH |
3504 | case "$usesocks" in |
3505 | $define|true|[yY]*) dflt='y';; | |
3506 | *) dflt='n';; | |
3507 | esac | |
3508 | cat <<EOM | |
3509 | ||
3510 | Perl can be built to use the SOCKS proxy protocol library. To do so, | |
3511 | Configure must be run with -Dusesocks. If you use SOCKS you also need | |
3512 | to use the PerlIO abstraction layer, this will be implicitly selected. | |
3513 | ||
3514 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
3515 | EOM | |
3516 | rp='Build Perl for SOCKS?' | |
3517 | . ./myread | |
3518 | case "$ans" in | |
3519 | y|Y) val="$define" ;; | |
3520 | *) val="$undef" ;; | |
3521 | esac | |
3522 | set usesocks | |
3523 | eval $setvar | |
3524 | ||
3525 | case "$usesocks" in | |
3526 | $define|true|[yY]*) useperlio="$define";; | |
3527 | esac | |
3528 | ||
3529 | case "$useperlio" in | |
3530 | $define|true|[yY]*|'') dflt='y';; | |
3531 | *) dflt='n';; | |
3532 | esac | |
3533 | cat <<EOM | |
3534 | ||
3535 | Previous version of $package used the standard IO mechanisms as | |
3536 | defined in <stdio.h>. Versions 5.003_02 and later of $package allow | |
3537 | alternate IO mechanisms via the PerlIO abstraction layer, but the | |
3538 | stdio mechanism is still available if needed. The abstraction layer | |
3539 | can use AT&T's sfio (if you already have sfio installed) or regular stdio. | |
3540 | Using PerlIO with sfio may cause problems with some extension modules. | |
3541 | ||
3542 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
3543 | EOM | |
3544 | rp='Use the PerlIO abstraction layer?' | |
3545 | . ./myread | |
3546 | case "$ans" in | |
3547 | y|Y) | |
3548 | val="$define" | |
3549 | ;; | |
3550 | *) | |
3551 | echo "Ok, doing things the stdio way." | |
3552 | val="$undef" | |
3553 | ;; | |
3554 | esac | |
3555 | set useperlio | |
3556 | eval $setvar | |
3557 | ||
3558 | case "$usesocks" in | |
3559 | $define|true|[yY]*) | |
3560 | case "$useperlio" in | |
3561 | $define|true|[yY]*) ;; | |
3562 | *) cat >&4 <<EOM | |
3563 | ||
3564 | You are using the SOCKS proxy protocol library which means that you | |
3565 | should also use the PerlIO layer. You may be headed for trouble. | |
3566 | ||
3567 | EOM | |
3568 | ;; | |
3569 | esac | |
3570 | ;; | |
3571 | esac | |
3572 | ||
3573 | ||
b4eb6b3d JH |
3574 | case "$usethreads" in |
3575 | $define|true|[yY]*) dflt='y';; | |
8e285145 AD |
3576 | *) # Catch case where user specified ithreads or 5005threads but |
3577 | # forgot -Dusethreads (A.D. 4/2002) | |
3578 | case "$useithreads$use5005threads" in | |
b29b105d JH |
3579 | *$define*) |
3580 | case "$useperlio" in | |
3581 | "$define") dflt='y' ;; | |
3582 | *) dflt='n' ;; | |
3583 | esac | |
3584 | ;; | |
3585 | *) dflt='n';; | |
8e285145 AD |
3586 | esac |
3587 | ;; | |
b4eb6b3d JH |
3588 | esac |
3589 | cat <<EOM | |
3590 | ||
3591 | Perl can be built to take advantage of threads on some systems. | |
3592 | To do so, Configure can be run with -Dusethreads. | |
3593 | ||
bfce6503 DM |
3594 | Note that Perl built with threading support runs slightly slower |
3595 | and uses more memory than plain Perl. The current implementation | |
3596 | is believed to be stable, but it is fairly new, and so should be | |
3597 | treated with caution. | |
b4eb6b3d JH |
3598 | |
3599 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
3600 | EOM | |
3601 | rp='Build a threading Perl?' | |
3602 | . ./myread | |
3603 | case "$ans" in | |
3604 | y|Y) val="$define" ;; | |
3605 | *) val="$undef" ;; | |
3606 | esac | |
3607 | set usethreads | |
3608 | eval $setvar | |
3609 | ||
3610 | case "$usethreads" in | |
3611 | $define) | |
3612 | $cat <<EOM | |
3613 | ||
bfce6503 DM |
3614 | Since release 5.6, Perl has had two different threading implementations, |
3615 | the newer interpreter-based version (ithreads) with one interpreter per | |
3616 | thread, and the older 5.005 version (5005threads). | |
3617 | The 5005threads version is effectively unmaintained and will probably be | |
3618 | removed in Perl 5.10, so there should be no need to build a Perl using it | |
3619 | unless needed for backwards compatibility with some existing 5.005threads | |
3620 | code. | |
b4eb6b3d | 3621 | |
b4eb6b3d JH |
3622 | EOM |
3623 | : Default to ithreads unless overridden on command line or with | |
3624 | : old config.sh | |
3625 | dflt='y' | |
3626 | case "$use5005threads" in | |
3627 | $define|true|[yY]*) dflt='n';; | |
3628 | esac | |
3629 | case "$useithreads" in | |
3630 | $undef|false|[nN]*) dflt='n';; | |
3631 | esac | |
bfce6503 | 3632 | rp='Use the newer interpreter-based ithreads?' |
b4eb6b3d JH |
3633 | . ./myread |
3634 | case "$ans" in | |
3635 | y|Y) val="$define" ;; | |
3636 | *) val="$undef" ;; | |
3637 | esac | |
3638 | set useithreads | |
3639 | eval $setvar | |
3640 | : Now set use5005threads to the opposite value. | |
3641 | case "$useithreads" in | |
3642 | $define) val="$undef" ;; | |
3643 | *) val="$define" ;; | |
3644 | esac | |
3645 | set use5005threads | |
3646 | eval $setvar | |
3647 | ;; | |
3648 | *) | |
3649 | useithreads="$undef" | |
3650 | use5005threads="$undef" | |
3651 | ;; | |
3652 | esac | |
3653 | ||
c915ce7f JH |
3654 | case "$useithreads$use5005threads" in |
3655 | "$define$define") | |
3656 | $cat >&4 <<EOM | |
3657 | ||
3658 | You cannot have both the ithreads and the 5.005 threads enabled | |
3659 | at the same time. Disabling the 5.005 threads since they are | |
3660 | much less stable than the ithreads. | |
3661 | ||
3662 | EOM | |
3663 | use5005threads="$undef" | |
3664 | ;; | |
3665 | esac | |
3666 | ||
b29b105d JH |
3667 | if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then |
3668 | cat >&4 <<EOF | |
3669 | *** | |
3670 | *** To build with ithreads you must also use the PerlIO layer. | |
3671 | *** Cannot continue, aborting. | |
3672 | *** | |
3673 | EOF | |
3674 | exit 1 | |
3675 | fi | |
3676 | ||
b4eb6b3d JH |
3677 | case "$d_oldpthreads" in |
3678 | '') : Configure tests would be welcome here. For now, assume undef. | |
3679 | val="$undef" ;; | |
3680 | *) val="$d_oldpthreads" ;; | |
3681 | esac | |
3682 | set d_oldpthreads | |
3683 | eval $setvar | |
3684 | ||
3685 | ||
b4eb6b3d JH |
3686 | : Look for a hint-file generated 'call-back-unit'. If the |
3687 | : user has specified that a threading perl is to be built, | |
3688 | : we may need to set or change some other defaults. | |
6bd2d01f NC |
3689 | if $test -f usethreads.cbu; then |
3690 | echo "Your platform has some specific hints regarding threaded builds, using them..." | |
3691 | . ./usethreads.cbu | |
3692 | else | |
3693 | case "$usethreads" in | |
3694 | "$define"|true|[yY]*) | |
b4eb6b3d | 3695 | $cat <<EOM |
6bd2d01f | 3696 | (Your platform does not have any specific hints for threaded builds. |
b4eb6b3d JH |
3697 | Assuming POSIX threads, then.) |
3698 | EOM | |
b4eb6b3d | 3699 | ;; |
6bd2d01f NC |
3700 | esac |
3701 | fi | |
b4eb6b3d JH |
3702 | |
3703 | cat <<EOM | |
3704 | ||
3705 | Perl can be built so that multiple Perl interpreters can coexist | |
3706 | within the same Perl executable. | |
3707 | EOM | |
3708 | ||
3709 | case "$useithreads" in | |
3710 | $define) | |
3711 | cat <<EOM | |
3712 | This multiple interpreter support is required for interpreter-based threads. | |
3713 | EOM | |
3714 | val="$define" | |
3715 | ;; | |
3716 | *) case "$usemultiplicity" in | |
3717 | $define|true|[yY]*) dflt='y';; | |
3718 | *) dflt='n';; | |
3719 | esac | |
3720 | echo " " | |
3721 | echo "If this doesn't make any sense to you, just accept the default '$dflt'." | |
3722 | rp='Build Perl for multiplicity?' | |
3723 | . ./myread | |
3724 | case "$ans" in | |
3725 | y|Y) val="$define" ;; | |
3726 | *) val="$undef" ;; | |
3727 | esac | |
3728 | ;; | |
3729 | esac | |
3730 | set usemultiplicity | |
3731 | eval $setvar | |
3732 | ||
96056487 JH |
3733 | |
3734 | case "$usemorebits" in | |
3735 | "$define"|true|[yY]*) | |
3736 | use64bitint="$define" | |
3737 | uselongdouble="$define" | |
3738 | usemorebits="$define" | |
3739 | ;; | |
3740 | *) usemorebits="$undef" | |
3741 | ;; | |
3742 | esac | |
3743 | ||
e5e20432 JH |
3744 | : make some quick guesses about what we are up against |
3745 | echo " " | |
3746 | $echo $n "Hmm... $c" | |
3747 | echo exit 1 >bsd | |
3748 | echo exit 1 >usg | |
3749 | echo exit 1 >v7 | |
3750 | echo exit 1 >osf1 | |
3751 | echo exit 1 >eunice | |
3752 | echo exit 1 >xenix | |
3753 | echo exit 1 >venix | |
3754 | echo exit 1 >os2 | |
3755 | d_bsd="$undef" | |
3756 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null | |
3757 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
3758 | then | |
3759 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
3760 | echo exit 0 >osf1 | |
381aa1ff | 3761 | elif test `echo abc | $tr a-z A-Z` = Abc ; then |
e5e20432 JH |
3762 | xxx=`./loc addbib blurfl $pth` |
3763 | if $test -f $xxx; then | |
3764 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
3765 | echo exit 0 >bsd | |
3766 | echo exit 0 >usg | |
3767 | else | |
3768 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
3769 | echo "Looks kind of like an extended USG system, but we'll see..." | |
3770 | else | |
3771 | echo "Looks kind of like a USG system, but we'll see..." | |
3772 | fi | |
3773 | echo exit 0 >usg | |
3774 | fi | |
3775 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
3776 | echo "Looks kind of like a BSD system, but we'll see..." | |
3777 | d_bsd="$define" | |
3778 | echo exit 0 >bsd | |
3779 | else | |
3780 | echo "Looks kind of like a Version 7 system, but we'll see..." | |
3781 | echo exit 0 >v7 | |
3782 | fi | |
3783 | case "$eunicefix" in | |
3784 | *unixtovms*) | |
3785 | $cat <<'EOI' | |
3786 | There is, however, a strange, musty smell in the air that reminds me of | |
3787 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
3788 | EOI | |
3789 | echo exit 0 >eunice | |
3790 | d_eunice="$define" | |
3791 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
3792 | ;; | |
3793 | *) | |
3794 | echo " " | |
3795 | echo "Congratulations. You aren't running Eunice." | |
3796 | d_eunice="$undef" | |
3797 | ;; | |
3798 | esac | |
3799 | : Detect OS2. The p_ variable is set above in the Head.U unit. | |
3d5d58b1 JH |
3800 | : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses |
3801 | : semicolon as a patch separator | |
e5e20432 JH |
3802 | case "$p_" in |
3803 | :) ;; | |
3804 | *) | |
3805 | $cat <<'EOI' | |
3806 | I have the feeling something is not exactly right, however...don't tell me... | |
3807 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! | |
3d5d58b1 | 3808 | (Or you may be running DOS with DJGPP.) |
e5e20432 JH |
3809 | EOI |
3810 | echo exit 0 >os2 | |
3811 | ;; | |
3812 | esac | |
3813 | if test -f /xenix; then | |
3814 | echo "Actually, this looks more like a XENIX system..." | |
3815 | echo exit 0 >xenix | |
3816 | d_xenix="$define" | |
3817 | else | |
3818 | echo " " | |
3819 | echo "It's not Xenix..." | |
3820 | d_xenix="$undef" | |
3821 | fi | |
3822 | chmod +x xenix | |
3823 | $eunicefix xenix | |
3824 | if test -f /venix; then | |
3825 | echo "Actually, this looks more like a VENIX system..." | |
3826 | echo exit 0 >venix | |
3827 | else | |
3828 | echo " " | |
3829 | if ./xenix; then | |
3830 | : null | |
3831 | else | |
3832 | echo "Nor is it Venix..." | |
3833 | fi | |
3834 | fi | |
3835 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 | |
3836 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 | |
3837 | $rm -f foo | |
3838 | ||
5869b1f1 JH |
3839 | case "$cc" in |
3840 | '') dflt=cc;; | |
3841 | *) dflt="$cc";; | |
3842 | esac | |
3843 | rp="Use which C compiler?" | |
3844 | . ./myread | |
3845 | cc="$ans" | |
6b769f8f RB |
3846 | |
3847 | : See if they have not cc but they do have gcc | |
3848 | . ./trygcc | |
e5e20432 JH |
3849 | : Look for a hint-file generated 'call-back-unit'. Now that the |
3850 | : user has specified the compiler, we may need to set or change some | |
3851 | : other defaults. | |
3852 | if $test -f cc.cbu; then | |
3853 | . ./cc.cbu | |
3854 | fi | |
2573c5f9 | 3855 | . ./checkcc |
8a27cf78 | 3856 | |
e5e20432 JH |
3857 | echo " " |
3858 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
5440bc8e | 3859 | $cat >try.c <<EOM |
e5e20432 JH |
3860 | #include <stdio.h> |
3861 | int main() { | |
3862 | #ifdef __GNUC__ | |
3863 | #ifdef __VERSION__ | |
3864 | printf("%s\n", __VERSION__); | |
3865 | #else | |
3866 | printf("%s\n", "1"); | |
3867 | #endif | |
3868 | #endif | |
c04fee9e | 3869 | return(0); |
e5e20432 JH |
3870 | } |
3871 | EOM | |
5440bc8e JH |
3872 | if $cc -o try $ccflags $ldflags try.c; then |
3873 | gccversion=`$run ./try` | |
e5e20432 JH |
3874 | case "$gccversion" in |
3875 | '') echo "You are not using GNU cc." ;; | |
fc68435e | 3876 | *) echo "You are using GNU cc $gccversion." |
2493591f | 3877 | ccname=gcc |
fc68435e | 3878 | ;; |
e5e20432 JH |
3879 | esac |
3880 | else | |
3881 | echo " " | |
3882 | echo "*** WHOA THERE!!! ***" >&4 | |
3883 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
3884 | case "$knowitall" in | |
3885 | '') | |
3886 | echo " You'd better start hunting for one and let me know about it." >&4 | |
3887 | exit 1 | |
3888 | ;; | |
3889 | esac | |
3890 | fi | |
5440bc8e | 3891 | $rm -f try try.* |
e5e20432 JH |
3892 | case "$gccversion" in |
3893 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
3894 | esac | |
5b463ca7 KS |
3895 | case "$gccversion" in |
3896 | '') gccosandvers='' ;; | |
10b4ebb5 JH |
3897 | *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'` |
3898 | gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"` | |
3899 | gccshortvers='' | |
5b463ca7 | 3900 | case "$gccosandvers" in |
02903077 JH |
3901 | $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr |
3902 | $osname$osvers) ;; # looking good | |
5b463ca7 KS |
3903 | $osname*) cat <<EOM >&4 |
3904 | ||
3905 | *** WHOA THERE!!! *** | |
3906 | ||
3907 | Your gcc has not been compiled for the exact release of | |
3908 | your operating system ($gccosandvers versus $osname$osvers). | |
3909 | ||
3910 | In general it is a good idea to keep gcc synchronized with | |
3911 | the operating system because otherwise serious problems | |
3912 | may ensue when trying to compile software, like Perl. | |
3913 | ||
3914 | I'm trying to be optimistic here, though, and will continue. | |
3915 | If later during the configuration and build icky compilation | |
02903077 JH |
3916 | problems appear (headerfile conflicts being the most common |
3917 | manifestation), I suggest reinstalling the gcc to match | |
5b463ca7 KS |
3918 | your operating system release. |
3919 | ||
3920 | EOM | |
3921 | ;; | |
81575342 | 3922 | *) gccosandvers='' ;; # failed to parse, better be silent |
5b463ca7 KS |
3923 | esac |
3924 | ;; | |
3925 | esac | |
e723fc21 JH |
3926 | case "$ccname" in |
3927 | '') ccname="$cc" ;; | |
3928 | esac | |
e5e20432 | 3929 | |
5b7ea690 | 3930 | # gcc 3.* complain about adding -Idirectories that they already know about, |
76589481 JH |
3931 | # so we will take those off from locincpth. |
3932 | case "$gccversion" in | |
3933 | 3*) | |
3934 | echo "main(){}">try.c | |
5b7ea690 JH |
3935 | for incdir in $locincpth; do |
3936 | warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ | |
2493591f | 3937 | grep '^c[cp]p*[01]: warning: changing search order '` |
5b7ea690 | 3938 | if test "X$warn" != X; then |
44b94491 | 3939 | locincpth=`echo " $locincpth " | sed "s! $incdir ! !"` |
5b7ea690 | 3940 | fi |
76589481 JH |
3941 | done |
3942 | $rm -f try try.* | |
3943 | esac | |
640374d0 | 3944 | |
bd9b35c9 JH |
3945 | : decide how portable to be. Allow command line overrides. |
3946 | case "$d_portable" in | |
3947 | "$undef") ;; | |
3948 | *) d_portable="$define" ;; | |
104d25b7 | 3949 | esac |
85ab1d1d | 3950 | |
bd9b35c9 JH |
3951 | : set up shell script to do ~ expansion |
3952 | cat >filexp <<EOSS | |
3953 | $startsh | |
3954 | : expand filename | |
3955 | case "\$1" in | |
3956 | ~/*|~) | |
3957 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
3958 | ;; | |
3959 | ~*) | |
3960 | if $test -f /bin/csh; then | |
3961 | /bin/csh -f -c "glob \$1" | |
3962 | failed=\$? | |
3963 | echo "" | |
3964 | exit \$failed | |
e5e20432 | 3965 | else |
bd9b35c9 JH |
3966 | name=\`$expr x\$1 : '..\([^/]*\)'\` |
3967 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
3968 | if $test ! -d "\$dir"; then | |
3969 | me=\`basename \$0\` | |
3970 | echo "\$me: can't locate home directory for: \$name" >&2 | |
3971 | exit 1 | |
3972 | fi | |
3973 | case "\$1" in | |
3974 | */*) | |
3975 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
3976 | ;; | |
3977 | *) | |
3978 | echo \$dir | |
e5e20432 JH |
3979 | ;; |
3980 | esac | |
3981 | fi | |
b691c02f | 3982 | ;; |
4633a7c4 | 3983 | *) |
bd9b35c9 | 3984 | echo \$1 |
2304df62 AD |
3985 | ;; |
3986 | esac | |
4633a7c4 LW |
3987 | EOSS |
3988 | chmod +x filexp | |
3989 | $eunicefix filexp | |
2304df62 AD |
3990 | |
3991 | : now set up to get a file name | |
28757baa | 3992 | cat <<EOS >getfile |
3993 | $startsh | |
3994 | EOS | |
3995 | cat <<'EOSC' >>getfile | |
2304df62 AD |
3996 | tilde='' |
3997 | fullpath='' | |
3998 | already='' | |
3999 | skip='' | |
4000 | none_ok='' | |
4001 | exp_file='' | |
a0d0e21e | 4002 | nopath_ok='' |
2304df62 AD |
4003 | orig_rp="$rp" |
4004 | orig_dflt="$dflt" | |
b233458b JH |
4005 | case "$gfpth" in |
4006 | '') gfpth='.' ;; | |
4007 | esac | |
2304df62 AD |
4008 | |
4009 | case "$fn" in | |
ecfc5424 | 4010 | *\(*) |
d604bb53 JH |
4011 | : getfile will accept an answer from the comma-separated list |
4012 | : enclosed in parentheses even if it does not meet other criteria. | |
4013 | expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok | |
ecfc5424 AD |
4014 | fn=`echo $fn | sed 's/(.*)//'` |
4015 | ;; | |
4016 | esac | |
4017 | ||
4018 | case "$fn" in | |
a0d0e21e LW |
4019 | *:*) |
4020 | loc_file=`expr $fn : '.*:\(.*\)'` | |
4021 | fn=`expr $fn : '\(.*\):.*'` | |
4022 | ;; | |
4023 | esac | |
4024 | ||
4025 | case "$fn" in | |
2304df62 AD |
4026 | *~*) tilde=true;; |
4027 | esac | |
4028 | case "$fn" in | |
4029 | */*) fullpath=true;; | |
4030 | esac | |
4031 | case "$fn" in | |
4032 | *+*) skip=true;; | |
4033 | esac | |
4034 | case "$fn" in | |
4035 | *n*) none_ok=true;; | |
4036 | esac | |
4037 | case "$fn" in | |
4038 | *e*) exp_file=true;; | |
4039 | esac | |
a0d0e21e LW |
4040 | case "$fn" in |
4041 | *p*) nopath_ok=true;; | |
4042 | esac | |
2304df62 AD |
4043 | |
4044 | case "$fn" in | |
4045 | *f*) type='File';; | |
4046 | *d*) type='Directory';; | |
a0d0e21e | 4047 | *l*) type='Locate';; |
2304df62 AD |
4048 | esac |
4049 | ||
4050 | what="$type" | |
4051 | case "$what" in | |
4052 | Locate) what='File';; | |
4053 | esac | |
4054 | ||
4055 | case "$exp_file" in | |
4056 | '') | |
4057 | case "$d_portable" in | |
4058 | "$define") ;; | |
4059 | *) exp_file=true;; | |
4060 | esac | |
4061 | ;; | |
4062 | esac | |
4063 | ||
4064 | cd .. | |
4065 | while test "$type"; do | |
4066 | redo='' | |
4067 | rp="$orig_rp" | |
4068 | dflt="$orig_dflt" | |
4069 | case "$tilde" in | |
4070 | true) rp="$rp (~name ok)";; | |
4071 | esac | |
4072 | . UU/myread | |
ecfc5424 AD |
4073 | if test -f UU/getfile.ok && \ |
4074 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
4075 | then | |
4076 | value="$ans" | |
4077 | ansexp="$ans" | |
4078 | break | |
4079 | fi | |
2304df62 AD |
4080 | case "$ans" in |
4081 | none) | |
4082 | value='' | |
4083 | ansexp='' | |
4084 | case "$none_ok" in | |
4085 | true) type='';; | |
4086 | esac | |
4087 | ;; | |
4088 | *) | |
4089 | case "$tilde" in | |
4090 | '') value="$ans" | |
4091 | ansexp="$ans";; | |
4092 | *) | |
4093 | value=`UU/filexp $ans` | |
4094 | case $? in | |
4095 | 0) | |
4096 | if test "$ans" != "$value"; then | |
ecfc5424 | 4097 | echo "(That expands to $value on this system.)" |
2304df62 AD |
4098 | fi |
4099 | ;; | |
4100 | *) value="$ans";; | |
4101 | esac | |
4102 | ansexp="$value" | |
4103 | case "$exp_file" in | |
4104 | '') value="$ans";; | |
4105 | esac | |
4106 | ;; | |
4107 | esac | |
4108 | case "$fullpath" in | |
4109 | true) | |
4110 | case "$ansexp" in | |
4111 | /*) value="$ansexp" ;; | |
23da6c43 | 4112 | [a-zA-Z]:/*) value="$ansexp" ;; |
2304df62 AD |
4113 | *) |
4114 | redo=true | |
4115 | case "$already" in | |
4116 | true) | |
4117 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
4118 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
4119 | ;; | |
4120 | *) | |
4121 | echo "Please give a full path name, starting with slash." >&4 | |
4122 | case "$tilde" in | |
4123 | true) | |
4124 | echo "Note that using ~name is ok provided it expands well." >&4 | |
4125 | already=true | |
4126 | ;; | |
4127 | esac | |
4128 | esac | |
4129 | ;; | |
4130 | esac | |
4131 | ;; | |
4132 | esac | |
4133 | case "$redo" in | |
4134 | '') | |
4135 | case "$type" in | |
4136 | File) | |
b233458b JH |
4137 | for fp in $gfpth; do |
4138 | if test "X$fp" = X.; then | |
4139 | pf="$ansexp" | |
4140 | else | |
4141 | pf="$fp/$ansexp" | |
4142 | fi | |
4143 | if test -f "$pf"; then | |
4144 | type='' | |
4145 | elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 | |
4146 | then | |
4147 | echo "($value is not a plain file, but that's ok.)" | |
4148 | type='' | |
4149 | fi | |
4150 | if test X"$type" = X; then | |
4151 | value="$pf" | |
4152 | break | |
4153 | fi | |
4154 | done | |
2304df62 AD |
4155 | ;; |
4156 | Directory) | |
b233458b JH |
4157 | for fp in $gfpth; do |
4158 | if test "X$fp" = X.; then | |
f78bfc9c JH |
4159 | dir="$ans" |
4160 | direxp="$ansexp" | |
b233458b | 4161 | else |
dd858076 | 4162 | dir="$fp/$ansexp" |
f78bfc9c | 4163 | direxp="$fp/$ansexp" |
b233458b | 4164 | fi |
f78bfc9c | 4165 | if test -d "$direxp"; then |
b233458b | 4166 | type='' |
f78bfc9c | 4167 | value="$dir" |
b233458b JH |
4168 | break |
4169 | fi | |
4170 | done | |
2304df62 AD |
4171 | ;; |
4172 | Locate) | |
40000a8c | 4173 | if test -d "$ansexp"; then |
a0d0e21e LW |
4174 | echo "(Looking for $loc_file in directory $value.)" |
4175 | value="$value/$loc_file" | |
40000a8c | 4176 | ansexp="$ansexp/$loc_file" |
2304df62 | 4177 | fi |
40000a8c | 4178 | if test -f "$ansexp"; then |
2304df62 AD |
4179 | type='' |
4180 | fi | |
a0d0e21e LW |
4181 | case "$nopath_ok" in |
4182 | true) case "$value" in | |
4183 | */*) ;; | |
4184 | *) echo "Assuming $value will be in people's path." | |
4185 | type='' | |
4186 | ;; | |
4187 | esac | |
4188 | ;; | |
4189 | esac | |
2304df62 AD |
4190 | ;; |
4191 | esac | |
4192 | ||
4193 | case "$skip" in | |
4194 | true) type=''; | |
4195 | esac | |
4196 | ||
4197 | case "$type" in | |
4198 | '') ;; | |
4199 | *) | |
4200 | if test "$fastread" = yes; then | |
4201 | dflt=y | |
4202 | else | |
4203 | dflt=n | |
4204 | fi | |
4205 | rp="$what $value doesn't exist. Use that name anyway?" | |
4206 | . UU/myread | |
4207 | dflt='' | |
4208 | case "$ans" in | |
4209 | y*) type='';; | |
4210 | *) echo " ";; | |
4211 | esac | |
4212 | ;; | |
4213 | esac | |
4214 | ;; | |
4215 | esac | |
4216 | ;; | |
4217 | esac | |
4218 | done | |
4219 | cd UU | |
4220 | ans="$value" | |
4221 | rp="$orig_rp" | |
4222 | dflt="$orig_dflt" | |
ecfc5424 | 4223 | rm -f getfile.ok |
b233458b | 4224 | test "X$gfpthkeep" != Xy && gfpth="" |
2304df62 AD |
4225 | EOSC |
4226 | ||
bd9b35c9 JH |
4227 | : What should the include directory be ? |
4228 | echo " " | |
4229 | $echo $n "Hmm... $c" | |
4230 | dflt='/usr/include' | |
4231 | incpath='' | |
4232 | mips_type='' | |
4233 | if $test -f /bin/mips && /bin/mips; then | |
4234 | echo "Looks like a MIPS system..." | |
4235 | $cat >usr.c <<'EOCP' | |
4236 | #ifdef SYSTYPE_BSD43 | |
4237 | /bsd43 | |
4238 | #endif | |
4239 | EOCP | |
8a27cf78 | 4240 | if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then |
bd9b35c9 JH |
4241 | dflt='/bsd43/usr/include' |
4242 | incpath='/bsd43' | |
4243 | mips_type='BSD 4.3' | |
4244 | else | |
4245 | mips_type='System V' | |
4246 | fi | |
4247 | $rm -f usr.c usr.out | |
4248 | echo "and you're compiling with the $mips_type compiler and libraries." | |
4249 | xxx_prompt=y | |
4250 | echo "exit 0" >mips | |
4251 | else | |
4252 | echo "Doesn't look like a MIPS system." | |
4253 | xxx_prompt=n | |
4254 | echo "exit 1" >mips | |
4255 | fi | |
4256 | chmod +x mips | |
4257 | $eunicefix mips | |
4258 | case "$usrinc" in | |
4259 | '') ;; | |
4260 | *) dflt="$usrinc";; | |
4261 | esac | |
4262 | case "$xxx_prompt" in | |
4263 | y) fn=d/ | |
4264 | echo " " | |
4265 | rp='Where are the include files you want to use?' | |
4266 | . ./getfile | |
4267 | usrinc="$ans" | |
8e07c86e | 4268 | ;; |
bd9b35c9 | 4269 | *) usrinc="$dflt" |
8e07c86e AD |
4270 | ;; |
4271 | esac | |
2304df62 | 4272 | |
96056487 JH |
4273 | : see how we invoke the C preprocessor |
4274 | echo " " | |
4275 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 | |
4276 | cat <<'EOT' >testcpp.c | |
4277 | #define ABC abc | |
4278 | #define XYZ xyz | |
4279 | ABC.XYZ | |
4280 | EOT | |
4281 | cd .. | |
4282 | if test ! -f cppstdin; then | |
4283 | if test "X$osname" = "Xaix" -a "X$gccversion" = X; then | |
4284 | # AIX cc -E doesn't show the absolute headerfile | |
4285 | # locations but we'll cheat by using the -M flag. | |
4286 | echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin | |
4287 | else | |
4288 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
4289 | fi | |
4290 | else | |
4291 | echo "Keeping your $hint cppstdin wrapper." | |
4292 | fi | |
4293 | chmod 755 cppstdin | |
4294 | wrapper=`pwd`/cppstdin | |
4295 | ok='false' | |
4296 | cd UU | |
4297 | ||
4298 | if $test "X$cppstdin" != "X" && \ | |
4299 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
4300 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
4301 | then | |
4302 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
4303 | case "$cpprun" in | |
4304 | '') echo "But let's see if we can live without a wrapper..." ;; | |
4305 | *) | |
4306 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
4307 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
4308 | then | |
4309 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" | |
4310 | ok='true' | |
4311 | else | |
4312 | echo "(However, $cpprun $cpplast does not work, let's see...)" | |
4313 | fi | |
4314 | ;; | |
4315 | esac | |
4316 | else | |
4317 | case "$cppstdin" in | |
4318 | '') ;; | |
4319 | *) | |
4320 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
4321 | ;; | |
4322 | esac | |
4323 | fi | |
4324 | ||
4325 | if $ok; then | |
4326 | : nothing | |
4327 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
4328 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
4329 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4330 | echo "Yup, it does." | |
4331 | x_cpp="$cc -E" | |
4332 | x_minus=''; | |
4333 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
4334 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
4335 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4336 | echo "Yup, it does." | |
4337 | x_cpp="$cc -E" | |
4338 | x_minus='-'; | |
4339 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
4340 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
4341 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4342 | echo "Yipee, that works!" | |
4343 | x_cpp="$cc -P" | |
4344 | x_minus=''; | |
4345 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
4346 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
4347 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4348 | echo "At long last!" | |
4349 | x_cpp="$cc -P" | |
4350 | x_minus='-'; | |
4351 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
4352 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
4353 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4354 | echo "It works!" | |
4355 | x_cpp="$cpp" | |
4356 | x_minus=''; | |
4357 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
4358 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
4359 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4360 | echo "Hooray, it works! I was beginning to wonder." | |
4361 | x_cpp="$cpp" | |
4362 | x_minus='-'; | |
4363 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
4364 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
4365 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4366 | x_cpp="$wrapper" | |
4367 | x_minus='' | |
4368 | echo "Eureka!" | |
4369 | else | |
4370 | dflt='' | |
4371 | rp="No dice. I can't find a C preprocessor. Name one:" | |
4372 | . ./myread | |
4373 | x_cpp="$ans" | |
4374 | x_minus='' | |
4375 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
4376 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
4377 | echo "OK, that will do." >&4 | |
4378 | else | |
4379 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
4380 | exit 1 | |
4381 | fi | |
4382 | fi | |
4383 | ||
4384 | case "$ok" in | |
4385 | false) | |
4386 | cppstdin="$x_cpp" | |
4387 | cppminus="$x_minus" | |
4388 | cpprun="$x_cpp" | |
4389 | cpplast="$x_minus" | |
4390 | set X $x_cpp | |
4391 | shift | |
4392 | case "$1" in | |
4393 | "$cpp") | |
4394 | echo "Perhaps can we force $cc -E using a wrapper..." | |
4395 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
4396 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
4397 | then | |
4398 | echo "Yup, we can." | |
4399 | cppstdin="$wrapper" | |
4400 | cppminus=''; | |
4401 | else | |
4402 | echo "Nope, we'll have to live without it..." | |
4403 | fi | |
4404 | ;; | |
4405 | esac | |
4406 | case "$cpprun" in | |
4407 | "$wrapper") | |
4408 | cpprun='' | |
4409 | cpplast='' | |
4410 | ;; | |
4411 | esac | |
4412 | ;; | |
4413 | esac | |
4414 | ||
4415 | case "$cppstdin" in | |
4416 | "$wrapper"|'cppstdin') ;; | |
4417 | *) $rm -f $wrapper;; | |
4418 | esac | |
4419 | $rm -f testcpp.c testcpp.out | |
4420 | ||
bd9b35c9 JH |
4421 | : Set private lib path |
4422 | case "$plibpth" in | |
4423 | '') if ./mips; then | |
4424 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
4425 | fi;; | |
4426 | esac | |
4427 | case "$libpth" in | |
4428 | ' ') dlist='';; | |
4429 | '') dlist="$loclibpth $plibpth $glibpth";; | |
4430 | *) dlist="$libpth";; | |
4431 | esac | |
4432 | ||
4433 | : Now check and see which directories actually exist, avoiding duplicates | |
4434 | libpth='' | |
4435 | for xxx in $dlist | |
4436 | do | |
4437 | if $test -d $xxx; then | |
4438 | case " $libpth " in | |
4439 | *" $xxx "*) ;; | |
4440 | *) libpth="$libpth $xxx";; | |
4441 | esac | |
4442 | fi | |
4443 | done | |
4444 | $cat <<'EOM' | |
4445 | ||
4446 | Some systems have incompatible or broken versions of libraries. Among | |
4447 | the directories listed in the question below, please remove any you | |
4448 | know not to be holding relevant libraries, and add any that are needed. | |
4449 | Say "none" for none. | |
8e07c86e AD |
4450 | |
4451 | EOM | |
bd9b35c9 JH |
4452 | case "$libpth" in |
4453 | '') dflt='none';; | |
8e07c86e | 4454 | *) |
bd9b35c9 JH |
4455 | set X $libpth |
4456 | shift | |
4457 | dflt=${1+"$@"} | |
8e07c86e | 4458 | ;; |
a0d0e21e | 4459 | esac |
bd9b35c9 JH |
4460 | rp="Directories to use for library searches?" |
4461 | . ./myread | |
4462 | case "$ans" in | |
4463 | none) libpth=' ';; | |
4464 | *) libpth="$ans";; | |
4465 | esac | |
a0d0e21e | 4466 | |
bd9b35c9 JH |
4467 | : compute shared library extension |
4468 | case "$so" in | |
4469 | '') | |
4470 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
4471 | dflt='sl' | |
dd4e71fd | 4472 | else |
bd9b35c9 | 4473 | dflt='so' |
dd4e71fd JH |
4474 | fi |
4475 | ;; | |
bd9b35c9 | 4476 | *) dflt="$so";; |
dd4e71fd | 4477 | esac |
dd4e71fd JH |
4478 | $cat <<EOM |
4479 | ||
bd9b35c9 | 4480 | On some systems, shared libraries may be available. Answer 'none' if |
7f95ee77 | 4481 | you want to suppress searching of shared libraries for the remainder |
bd9b35c9 | 4482 | of this configuration. |
dd4e71fd JH |
4483 | |
4484 | EOM | |
bd9b35c9 JH |
4485 | rp='What is the file extension used for shared libraries?' |
4486 | . ./myread | |
4487 | so="$ans" | |
dd4e71fd | 4488 | |
bd9b35c9 JH |
4489 | : Define several unixisms. |
4490 | : Hints files or command line option can be used to override them. | |
4491 | : The convoluted testing is in case hints files set either the old | |
4492 | : or the new name. | |
4493 | case "$_exe" in | |
4494 | '') case "$exe_ext" in | |
1fef16b3 | 4495 | '') ;; |
bd9b35c9 | 4496 | *) _exe="$exe_ext" ;; |
dd4e71fd | 4497 | esac |
bd9b35c9 | 4498 | ;; |
bfb7748a | 4499 | esac |
bd9b35c9 JH |
4500 | case "$_a" in |
4501 | '') case "$lib_ext" in | |
4502 | '') _a='.a';; | |
4503 | *) _a="$lib_ext" ;; | |
dd4e71fd JH |
4504 | esac |
4505 | ;; | |
dd4e71fd | 4506 | esac |
bd9b35c9 JH |
4507 | case "$_o" in |
4508 | '') case "$obj_ext" in | |
4509 | '') _o='.o';; | |
4510 | *) _o="$obj_ext";; | |
4511 | esac | |
4512 | ;; | |
4513 | esac | |
4514 | case "$p_" in | |
4515 | '') case "$path_sep" in | |
4516 | '') p_=':';; | |
4517 | *) p_="$path_sep";; | |
4518 | esac | |
4519 | ;; | |
4520 | esac | |
4521 | exe_ext=$_exe | |
4522 | lib_ext=$_a | |
4523 | obj_ext=$_o | |
4524 | path_sep=$p_ | |
dd4e71fd | 4525 | |
b4eb6b3d JH |
4526 | : Which makefile gets called first. This is used by make depend. |
4527 | case "$firstmakefile" in | |
4528 | '') firstmakefile='makefile';; | |
4633a7c4 | 4529 | esac |
4633a7c4 | 4530 | |
5a29c6bc JH |
4531 | case "$ccflags" in |
4532 | *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;; | |
4533 | esac | |
4534 | ||
4535 | case "$uselongdouble" in | |
4536 | $define|true|[yY]*) dflt='y';; | |
4537 | *) dflt='n';; | |
4538 | esac | |
4539 | cat <<EOM | |
4540 | ||
4541 | Perl can be built to take advantage of long doubles which | |
4542 | (if available) may give more accuracy and range for floating point numbers. | |
4543 | ||
4544 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
4545 | EOM | |
4546 | rp='Try to use long doubles if available?' | |
4547 | . ./myread | |
4548 | case "$ans" in | |
4549 | y|Y) val="$define" ;; | |
4550 | *) val="$undef" ;; | |
4551 | esac | |
4552 | set uselongdouble | |
4553 | eval $setvar | |
4554 | ||
4555 | case "$uselongdouble" in | |
4556 | true|[yY]*) uselongdouble="$define" ;; | |
4557 | esac | |
4558 | ||
5a29c6bc JH |
4559 | : Look for a hint-file generated 'call-back-unit'. If the |
4560 | : user has specified that long doubles should be used, | |
4561 | : we may need to set or change some other defaults. | |
6bd2d01f NC |
4562 | if $test -f uselongdouble.cbu; then |
4563 | echo "Your platform has some specific hints regarding long doubles, using them..." | |
4564 | . ./uselongdouble.cbu | |
4565 | else | |
4566 | case "$uselongdouble" in | |
4567 | $define) | |
5a29c6bc | 4568 | $cat <<EOM |
6bd2d01f | 4569 | (Your platform does not have any specific hints for long doubles.) |
5a29c6bc | 4570 | EOM |
5a29c6bc | 4571 | ;; |
6bd2d01f NC |
4572 | esac |
4573 | fi | |
5a29c6bc | 4574 | |
bd9b35c9 JH |
4575 | : Looking for optional libraries |
4576 | echo " " | |
4577 | echo "Checking for optional libraries..." >&4 | |
4578 | case "$libs" in | |
4579 | ' '|'') dflt='';; | |
4580 | *) dflt="$libs";; | |
4581 | esac | |
4582 | case "$libswanted" in | |
4583 | '') libswanted='c_s';; | |
4584 | esac | |
4585 | case "$usesocks" in | |
923fc586 | 4586 | "$define") libswanted="$libswanted socks5 socks5_sh" ;; |
8e07c86e | 4587 | esac |
68435ea7 JH |
4588 | libsfound='' |
4589 | libsfiles='' | |
4590 | libsdirs='' | |
13b3f787 JH |
4591 | libspath='' |
4592 | for thisdir in $libpth $xlibpth; do | |
4593 | test -d $thisdir && libspath="$libspath $thisdir" | |
4594 | done | |
bd9b35c9 | 4595 | for thislib in $libswanted; do |
13b3f787 | 4596 | for thisdir in $libspath; do |
f7dd4e7f JH |
4597 | xxx='' |
4598 | if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then | |
eade9b71 | 4599 | xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'` |
f7dd4e7f JH |
4600 | $test -f "$xxx" && eval $libscheck |
4601 | $test -f "$xxx" && libstyle=shared | |
4602 | fi | |
4603 | if test ! -f "$xxx"; then | |
4604 | xxx=$thisdir/lib$thislib.$so | |
4605 | $test -f "$xxx" && eval $libscheck | |
4606 | $test -f "$xxx" && libstyle=shared | |
4607 | fi | |
4608 | if test ! -f "$xxx"; then | |
4609 | xxx=$thisdir/lib$thislib$_a | |
4610 | $test -f "$xxx" && eval $libscheck | |
4611 | $test -f "$xxx" && libstyle=static | |
4612 | fi | |
4613 | if test ! -f "$xxx"; then | |
4614 | xxx=$thisdir/$thislib$_a | |
4615 | $test -f "$xxx" && eval $libscheck | |
4616 | $test -f "$xxx" && libstyle=static | |
4617 | fi | |
4618 | if test ! -f "$xxx"; then | |
4619 | xxx=$thisdir/lib${thislib}_s$_a | |
4620 | $test -f "$xxx" && eval $libscheck | |
4621 | $test -f "$xxx" && libstyle=static | |
09ea5ba9 | 4622 | $test -f "$xxx" && thislib=${thislib}_s |
f7dd4e7f JH |
4623 | fi |
4624 | if test ! -f "$xxx"; then | |
4625 | xxx=$thisdir/Slib$thislib$_a | |
4626 | $test -f "$xxx" && eval $libscheck | |
4627 | $test -f "$xxx" && libstyle=static | |
4628 | fi | |
4629 | if $test -f "$xxx"; then | |
43999f95 | 4630 | case "$libstyle" in |
f7dd4e7f JH |
4631 | shared) echo "Found -l$thislib (shared)." ;; |
4632 | static) echo "Found -l$thislib." ;; | |
4633 | *) echo "Found -l$thislib ($libstyle)." ;; | |
43999f95 | 4634 | esac |
bd9b35c9 JH |
4635 | case " $dflt " in |
4636 | *"-l$thislib "*);; | |
f7dd4e7f | 4637 | *) dflt="$dflt -l$thislib" |
43999f95 JH |
4638 | libsfound="$libsfound $xxx" |
4639 | yyy=`basename $xxx` | |
4640 | libsfiles="$libsfiles $yyy" | |
1e127011 | 4641 | yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"` |
43999f95 JH |
4642 | case " $libsdirs " in |
4643 | *" $yyy "*) ;; | |
4644 | *) libsdirs="$libsdirs $yyy" ;; | |
4645 | esac | |
4646 | ;; | |
bd9b35c9 | 4647 | esac |
f7dd4e7f JH |
4648 | break |
4649 | fi | |
4650 | done | |
4651 | if $test ! -f "$xxx"; then | |
4652 | echo "No -l$thislib." | |
bd9b35c9 JH |
4653 | fi |
4654 | done | |
4655 | set X $dflt | |
4656 | shift | |
4657 | dflt="$*" | |
4658 | case "$libs" in | |
4659 | '') dflt="$dflt";; | |
4660 | *) dflt="$libs";; | |
4661 | esac | |
4662 | case "$dflt" in | |
4663 | ' '|'') dflt='none';; | |
4664 | esac | |
4633a7c4 | 4665 | |
bd9b35c9 | 4666 | $cat <<EOM |
4633a7c4 | 4667 | |
bd9b35c9 JH |
4668 | In order to compile $package on your machine, a number of libraries |
4669 | are usually needed. Include any other special libraries here as well. | |
4670 | Say "none" for none. The default list is almost always right. | |
8e07c86e | 4671 | EOM |
8e07c86e | 4672 | |
bd9b35c9 JH |
4673 | echo " " |
4674 | rp="What libraries to use?" | |
4675 | . ./myread | |
4676 | case "$ans" in | |
4677 | none) libs=' ';; | |
4678 | *) libs="$ans";; | |
4679 | esac | |
d71b2b6b | 4680 | |
bd9b35c9 JH |
4681 | : determine optimization, if desired, or use for debug flag also |
4682 | case "$optimize" in | |
4683 | ' '|$undef) dflt='none';; | |
4684 | '') dflt='-O';; | |
4685 | *) dflt="$optimize";; | |
4686 | esac | |
4687 | $cat <<EOH | |
d71b2b6b | 4688 | |
bd9b35c9 JH |
4689 | By default, $package compiles with the -O flag to use the optimizer. |
4690 | Alternately, you might want to use the symbolic debugger, which uses | |
4691 | the -g flag (on traditional Unix systems). Either flag can be | |
4692 | specified here. To use neither flag, specify the word "none". | |
d71b2b6b | 4693 | |
bd9b35c9 JH |
4694 | EOH |
4695 | rp="What optimizer/debugger flag should be used?" | |
4696 | . ./myread | |
4697 | optimize="$ans" | |
4698 | case "$optimize" in | |
4699 | 'none') optimize=" ";; | |
4700 | esac | |
4701 | ||
4702 | dflt='' | |
4703 | : We will not override a previous value, but we might want to | |
4704 | : augment a hint file | |
4705 | case "$hint" in | |
4706 | default|recommended) | |
4707 | case "$gccversion" in | |
4708 | 1*) dflt='-fpcc-struct-return' ;; | |
d71b2b6b | 4709 | esac |
bd9b35c9 JH |
4710 | case "$optimize" in |
4711 | *-g*) dflt="$dflt -DDEBUGGING";; | |
d71b2b6b | 4712 | esac |
bd9b35c9 JH |
4713 | case "$gccversion" in |
4714 | 2*) if test -d /etc/conf/kconfig.d && | |
4715 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
4716 | then | |
7db0018a | 4717 | # Interactive Systems (ISC) POSIX mode. |
bd9b35c9 JH |
4718 | dflt="$dflt -posix" |
4719 | fi | |
f0d04425 | 4720 | ;; |
bd9b35c9 JH |
4721 | esac |
4722 | case "$gccversion" in | |
4723 | 1*) ;; | |
4724 | 2.[0-8]*) ;; | |
4725 | ?*) echo " " | |
4726 | echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1 | |
4727 | echo 'int main(void) { return 0; }' > gcctest.c | |
4728 | if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then | |
4729 | echo "Yes, it does." 2>&1 | |
4730 | case "$ccflags" in | |
7db0018a | 4731 | *strict-aliasing*) |
bd9b35c9 JH |
4732 | echo "Leaving current flags $ccflags alone." 2>&1 |
4733 | ;; | |
4734 | *) dflt="$dflt -fno-strict-aliasing" ;; | |
4735 | esac | |
4736 | else | |
4737 | echo "Nope, it doesn't, but that's ok." 2>&1 | |
4738 | fi | |
f0d04425 | 4739 | ;; |
e5e20432 | 4740 | esac |
7db0018a AD |
4741 | # For gcc, adding -pipe speeds up compilations for some, but apparently |
4742 | # some assemblers can't read from stdin. (It also slows down compilations | |
4743 | # in other cases, but those are apparently rarer these days.) AD 5/2004. | |
4744 | case "$gccversion" in | |
4745 | ?*) echo " " | |
4746 | echo "Checking if your compiler accepts -pipe" 2>&1 | |
4747 | echo 'int main(void) { return 0; }' > gcctest.c | |
3bf3851b | 4748 | if $cc -pipe -o gcctest gcctest.c; then |
7db0018a AD |
4749 | echo "Yes, it does." 2>&1 |
4750 | case "$ccflags" in | |
4751 | *-pipe*) | |
4752 | echo "Leaving current flags $ccflags alone." 2>&1 | |
4753 | ;; | |
4754 | *) dflt="$dflt -pipe" ;; | |
4755 | esac | |
4756 | else | |
4757 | echo "Nope, it doesn't, but that's ok." 2>&1 | |
4758 | fi | |
3bf3851b NC |
4759 | |
4760 | echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1 | |
4761 | echo 'int main(void) { return 0; }' > gcctest.c | |
4762 | if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then | |
4763 | echo "Yes, it does." 2>&1 | |
4764 | case "$ccflags" in | |
4765 | *-Wdeclaration-after-statement*) | |
4766 | echo "Leaving current flags $ccflags alone." 2>&1 | |
4767 | ;; | |
4768 | *) dflt="$dflt -Wdeclaration-after-statement" ;; | |
4769 | esac | |
4770 | else | |
4771 | echo "Nope, it doesn't, but that's ok." 2>&1 | |
4772 | fi | |
7db0018a AD |
4773 | ;; |
4774 | esac | |
e5e20432 JH |
4775 | ;; |
4776 | esac | |
4777 | ||
bd9b35c9 JH |
4778 | case "$mips_type" in |
4779 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
4780 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
4781 | esac | |
4782 | for thisincl in $inclwanted; do | |
4783 | if $test -d $thisincl; then | |
4784 | if $test x$thisincl != x$usrinc; then | |
4785 | case "$dflt" in | |
7db0018a AD |
4786 | *" -I$thisincl "*);; |
4787 | *) dflt="$dflt -I$thisincl ";; | |
bd9b35c9 JH |
4788 | esac |
4789 | fi | |
4790 | fi | |
4791 | done | |
40a7a20a | 4792 | |
bd9b35c9 JH |
4793 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then |
4794 | xxx=true; | |
4795 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
4796 | xxx=true; | |
4797 | else | |
4798 | xxx=false; | |
4799 | fi; | |
4800 | if $xxx; then | |
4801 | case "$dflt" in | |
4802 | *$2*);; | |
4803 | *) dflt="$dflt -D$2";; | |
4804 | esac; | |
4805 | fi' | |
40a7a20a | 4806 | |
bd9b35c9 | 4807 | set signal.h LANGUAGE_C; eval $inctest |
40a7a20a | 4808 | |
bd9b35c9 JH |
4809 | case "$usesocks" in |
4810 | $define) | |
4811 | ccflags="$ccflags -DSOCKS" | |
4812 | ;; | |
4813 | esac | |
40a7a20a | 4814 | |
bd9b35c9 JH |
4815 | case "$hint" in |
4816 | default|recommended) dflt="$ccflags $dflt" ;; | |
4817 | *) dflt="$ccflags";; | |
4818 | esac | |
40a7a20a | 4819 | |
bd9b35c9 JH |
4820 | case "$dflt" in |
4821 | ''|' ') dflt=none;; | |
4822 | esac | |
422af00a | 4823 | |
bd9b35c9 | 4824 | $cat <<EOH |
40a7a20a | 4825 | |
bd9b35c9 JH |
4826 | Your C compiler may want other flags. For this question you should include |
4827 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
4828 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
4829 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
4830 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE. | |
40a7a20a | 4831 | |
bd9b35c9 | 4832 | To use no flags, specify the word "none". |
40a7a20a | 4833 | |
bd9b35c9 JH |
4834 | EOH |
4835 | set X $dflt | |
4836 | shift | |
4837 | dflt=${1+"$@"} | |
4838 | rp="Any additional cc flags?" | |
4839 | . ./myread | |
4840 | case "$ans" in | |
4841 | none) ccflags='';; | |
4842 | *) ccflags="$ans";; | |
4843 | esac | |
8e07c86e | 4844 | |
bd9b35c9 | 4845 | : the following weeds options from ccflags that are of no interest to cpp |
58e77565 JH |
4846 | case "$cppflags" in |
4847 | '') cppflags="$ccflags" ;; | |
4848 | *) cppflags="$cppflags $ccflags" ;; | |
4849 | esac | |
bd9b35c9 JH |
4850 | case "$gccversion" in |
4851 | 1*) cppflags="$cppflags -D__GNUC__" | |
4633a7c4 | 4852 | esac |
bd9b35c9 JH |
4853 | case "$mips_type" in |
4854 | '');; | |
4855 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
4856 | esac | |
4857 | case "$cppflags" in | |
4858 | '');; | |
4859 | *) | |
4860 | echo " " | |
4861 | echo "Let me guess what the preprocessor flags are..." >&4 | |
4862 | set X $cppflags | |
4863 | shift | |
4864 | cppflags='' | |
4865 | $cat >cpp.c <<'EOM' | |
4866 | #define BLURFL foo | |
8e07c86e | 4867 | |
bd9b35c9 JH |
4868 | BLURFL xx LFRULB |
4869 | EOM | |
4870 | previous='' | |
4871 | for flag in $* | |
4872 | do | |
4873 | case "$flag" in | |
4874 | -*) ftry="$flag";; | |
4875 | *) ftry="$previous $flag";; | |
4876 | esac | |
4877 | if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \ | |
4878 | >cpp1.out 2>/dev/null && \ | |
4879 | $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \ | |
4880 | >cpp2.out 2>/dev/null && \ | |
4881 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
4882 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
4883 | then | |
4884 | cppflags="$cppflags $ftry" | |
4885 | previous='' | |
4886 | else | |
4887 | previous="$flag" | |
4888 | fi | |
4889 | done | |
4890 | set X $cppflags | |
4891 | shift | |
4892 | cppflags=${1+"$@"} | |
4893 | case "$cppflags" in | |
4894 | *-*) echo "They appear to be: $cppflags";; | |
4895 | esac | |
4896 | $rm -f cpp.c cpp?.out | |
2afac517 | 4897 | ;; |
4898 | esac | |
8e07c86e | 4899 | |
bd9b35c9 JH |
4900 | : flags used in final linking phase |
4901 | case "$ldflags" in | |
4902 | '') if ./venix; then | |
4903 | dflt='-i -z' | |
10a23457 | 4904 | else |
bd9b35c9 | 4905 | dflt='' |
10a23457 | 4906 | fi |
bd9b35c9 JH |
4907 | case "$ccflags" in |
4908 | *-posix*) dflt="$dflt -posix" ;; | |
c4f23d77 | 4909 | esac |
bd9b35c9 JH |
4910 | ;; |
4911 | *) dflt="$ldflags";; | |
4912 | esac | |
4913 | ||
4914 | : Try to guess additional flags to pick up local libraries. | |
4915 | for thislibdir in $libpth; do | |
4916 | case " $loclibpth " in | |
4917 | *" $thislibdir "*) | |
7db0018a | 4918 | case "$dflt " in |
bd9b35c9 JH |
4919 | *"-L$thislibdir "*) ;; |
4920 | *) dflt="$dflt -L$thislibdir" ;; | |
4921 | esac | |
c4f23d77 AD |
4922 | ;; |
4923 | esac | |
bd9b35c9 | 4924 | done |
c4f23d77 | 4925 | |
bd9b35c9 JH |
4926 | case "$dflt" in |
4927 | '') dflt='none' ;; | |
4928 | esac | |
c4f23d77 | 4929 | |
bd9b35c9 JH |
4930 | $cat <<EOH |
4931 | ||
4932 | Your C linker may need flags. For this question you should | |
4933 | include -L/whatever and any other flags used by the C linker, but you | |
4934 | should NOT include libraries like -lwhatever. | |
4935 | ||
4936 | Make sure you include the appropriate -L/path flags if your C linker | |
4937 | does not normally search all of the directories you specified above, | |
4938 | namely | |
4939 | $libpth | |
4940 | To use no flags, specify the word "none". | |
4941 | ||
4942 | EOH | |
4943 | ||
4944 | rp="Any additional ld flags (NOT including libraries)?" | |
4945 | . ./myread | |
4946 | case "$ans" in | |
4947 | none) ldflags='';; | |
4948 | *) ldflags="$ans";; | |
4949 | esac | |
4950 | rmlist="$rmlist pdp11" | |
4951 | ||
4952 | : coherency check | |
4953 | echo " " | |
4954 | echo "Checking your choice of C compiler and flags for coherency..." >&4 | |
4955 | $cat > try.c <<'EOF' | |
4956 | #include <stdio.h> | |
5a29c6bc | 4957 | int main() { printf("Ok\n"); return(0); } |
bd9b35c9 | 4958 | EOF |
7a282f6d | 4959 | set X $cc -o try $optimize $ccflags $ldflags try.c $libs |
bd9b35c9 JH |
4960 | shift |
4961 | $cat >try.msg <<'EOM' | |
4962 | I've tried to compile and run the following simple program: | |
4963 | ||
4964 | EOM | |
4965 | $cat try.c >> try.msg | |
4966 | ||
4967 | $cat >> try.msg <<EOM | |
4968 | ||
4969 | I used the command: | |
4970 | ||
4971 | $* | |
5440bc8e | 4972 | $run ./try |
bd9b35c9 JH |
4973 | |
4974 | and I got the following output: | |
4975 | ||
4976 | EOM | |
4977 | dflt=y | |
73614538 | 4978 | if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then |
5440bc8e JH |
4979 | if $sh -c "$run ./try" >>try.msg 2>&1; then |
4980 | xxx=`$run ./try` | |
bd9b35c9 JH |
4981 | case "$xxx" in |
4982 | "Ok") dflt=n ;; | |
4983 | *) echo 'The program compiled OK, but produced no output.' >> try.msg | |
4984 | case " $libs " in | |
4985 | *" -lsfio "*) | |
4986 | cat >> try.msg <<'EOQS' | |
4987 | If $libs contains -lsfio, and sfio is mis-configured, then it | |
4988 | sometimes (apparently) runs and exits with a 0 status, but with no | |
4989 | output! It may have to do with sfio's use of _exit vs. exit. | |
4990 | ||
4991 | EOQS | |
4992 | rp="You have a big problem. Shall I abort Configure" | |
4993 | dflt=y | |
4994 | ;; | |
4995 | esac | |
4996 | ;; | |
4997 | esac | |
4998 | else | |
4999 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
5000 | rp="You have a problem. Shall I abort Configure" | |
5001 | dflt=y | |
5002 | fi | |
5003 | else | |
5004 | echo "I can't compile the test program." >>try.msg | |
5005 | rp="You have a BIG problem. Shall I abort Configure" | |
5006 | dflt=y | |
5007 | fi | |
5008 | case "$dflt" in | |
5009 | y) | |
5010 | $cat try.msg >&4 | |
5011 | case "$knowitall" in | |
5012 | '') | |
5013 | echo "(The supplied flags or libraries might be incorrect.)" | |
c4f23d77 | 5014 | ;; |
bd9b35c9 | 5015 | *) dflt=n;; |
c4f23d77 | 5016 | esac |
bd9b35c9 JH |
5017 | echo " " |
5018 | . ./myread | |
5019 | case "$ans" in | |
5020 | n*|N*) ;; | |
5021 | *) echo "Ok. Stopping Configure." >&4 | |
5022 | exit 1 | |
c4f23d77 AD |
5023 | ;; |
5024 | esac | |
5025 | ;; | |
bd9b35c9 | 5026 | n) echo "OK, that should do.";; |
c4f23d77 | 5027 | esac |
bd9b35c9 | 5028 | $rm -f try try.* core |
c4f23d77 | 5029 | |
bd9b35c9 JH |
5030 | : define a shorthand compile call |
5031 | compile=' | |
5032 | mc_file=$1; | |
5033 | shift; | |
08413ebc | 5034 | $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;' |
bd9b35c9 JH |
5035 | : define a shorthand compile call for compilations that should be ok. |
5036 | compile_ok=' | |
5037 | mc_file=$1; | |
5038 | shift; | |
7a282f6d | 5039 | $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;' |
8e07c86e | 5040 | |
8dfa8df9 JH |
5041 | : determine filename position in cpp output |
5042 | echo " " | |
5043 | echo "Computing filename position in cpp output for #include directives..." >&4 | |
a5a94ea5 JH |
5044 | case "$osname" in |
5045 | vos) testaccess=-e ;; | |
5046 | *) testaccess=-r ;; | |
5047 | esac | |
8dfa8df9 JH |
5048 | echo '#include <stdio.h>' > foo.c |
5049 | $cat >fieldn <<EOF | |
5050 | $startsh | |
5051 | $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \ | |
5052 | $grep '^[ ]*#.*stdio\.h' | \ | |
5053 | while read cline; do | |
5054 | pos=1 | |
5055 | set \$cline | |
5056 | while $test \$# -gt 0; do | |
a5a94ea5 | 5057 | if $test $testaccess \`echo \$1 | $tr -d '"'\`; then |
8dfa8df9 JH |
5058 | echo "\$pos" |
5059 | exit 0 | |
5060 | fi | |
5061 | shift | |
5062 | pos=\`expr \$pos + 1\` | |
5063 | done | |
5064 | done | |
5065 | EOF | |
5066 | chmod +x fieldn | |
5067 | fieldn=`./fieldn` | |
5068 | $rm -f foo.c fieldn | |
5069 | case $fieldn in | |
5070 | '') pos='???';; | |
5071 | 1) pos=first;; | |
5072 | 2) pos=second;; | |
5073 | 3) pos=third;; | |
5074 | *) pos="${fieldn}th";; | |
5075 | esac | |
5076 | echo "Your cpp writes the filename in the $pos field of the line." | |
5077 | ||
3c728e00 JH |
5078 | case "$osname" in |
5079 | vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is > | |
8257dec7 | 5080 | os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \ |
3c728e00 JH |
5081 | *) cppfilter='' ;; |
5082 | esac | |
8dfa8df9 JH |
5083 | : locate header file |
5084 | $cat >findhdr <<EOF | |
5085 | $startsh | |
5086 | wanted=\$1 | |
5087 | name='' | |
5088 | for usrincdir in $usrinc | |
5089 | do | |
5090 | if test -f \$usrincdir/\$wanted; then | |
5091 | echo "\$usrincdir/\$wanted" | |
5092 | exit 0 | |
5093 | fi | |
5094 | done | |
5095 | awkprg='{ print \$$fieldn }' | |
5096 | echo "#include <\$wanted>" > foo\$\$.c | |
5097 | $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ | |
3c728e00 | 5098 | $cppfilter $grep "^[ ]*#.*\$wanted" | \ |
8dfa8df9 JH |
5099 | while read cline; do |
5100 | name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` | |
5101 | case "\$name" in | |
5102 | *[/\\\\]\$wanted) echo "\$name"; exit 1;; | |
5103 | *[\\\\/]\$wanted) echo "\$name"; exit 1;; | |
5104 | *) exit 2;; | |
5105 | esac; | |
5106 | done; | |
5107 | # | |
5108 | # status = 0: grep returned 0 lines, case statement not executed | |
5109 | # status = 1: headerfile found | |
5110 | # status = 2: while loop executed, no headerfile found | |
5111 | # | |
5112 | status=\$? | |
5113 | $rm -f foo\$\$.c; | |
5114 | if test \$status -eq 1; then | |
5115 | exit 0; | |
5116 | fi | |
5117 | exit 1 | |
5118 | EOF | |
5119 | chmod +x findhdr | |
5120 | ||
5121 | : define an alternate in-header-list? function | |
5122 | inhdr='echo " "; td=$define; tu=$undef; yyy=$@; | |
5123 | cont=true; xxf="echo \"<\$1> found.\" >&4"; | |
5124 | case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; | |
5125 | *) xxnf="echo \"<\$1> NOT found, ...\" >&4";; | |
5126 | esac; | |
5127 | case $# in 4) instead=instead;; *) instead="at last";; esac; | |
5128 | while $test "$cont"; do | |
5129 | xxx=`./findhdr $1` | |
5130 | var=$2; eval "was=\$$2"; | |
5131 | if $test "$xxx" && $test -r "$xxx"; | |
5132 | then eval $xxf; | |
5133 | eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; | |
5134 | cont=""; | |
5135 | else eval $xxnf; | |
5136 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; | |
5137 | set $yyy; shift; shift; yyy=$@; | |
5138 | case $# in 0) cont="";; | |
5139 | 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; | |
5140 | xxnf="echo \"and I did not find <\$1> either.\" >&4";; | |
5141 | *) xxf="echo \"but I found <\$1\> instead.\" >&4"; | |
5142 | xxnf="echo \"there is no <\$1>, ...\" >&4";; | |
5143 | esac; | |
5144 | done; | |
5145 | while $test "$yyy"; | |
5146 | do set $yyy; var=$2; eval "was=\$$2"; | |
5147 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; | |
5148 | set $yyy; shift; shift; yyy=$@; | |
5149 | done' | |
5150 | ||
5ed858ef JH |
5151 | : see if stdlib is available |
5152 | set stdlib.h i_stdlib | |
5153 | eval $inhdr | |
5154 | ||
5155 | : check for lengths of integral types | |
5156 | echo " " | |
5157 | case "$intsize" in | |
5158 | '') | |
5159 | echo "Checking to see how big your integers are..." >&4 | |
2376c703 | 5160 | $cat >try.c <<EOCP |
5ed858ef JH |
5161 | #include <stdio.h> |
5162 | #$i_stdlib I_STDLIB | |
5163 | #ifdef I_STDLIB | |
5164 | #include <stdlib.h> | |
5165 | #endif | |
5166 | int main() | |
5167 | { | |
5168 | printf("intsize=%d;\n", (int)sizeof(int)); | |
5169 | printf("longsize=%d;\n", (int)sizeof(long)); | |
5170 | printf("shortsize=%d;\n", (int)sizeof(short)); | |
5171 | exit(0); | |
5172 | } | |
5173 | EOCP | |
5174 | set try | |
5175 | if eval $compile_ok && $run ./try > /dev/null; then | |
5176 | eval `$run ./try` | |
5177 | echo "Your integers are $intsize bytes long." | |
5178 | echo "Your long integers are $longsize bytes long." | |
5179 | echo "Your short integers are $shortsize bytes long." | |
5180 | else | |
5181 | $cat >&4 <<EOM | |
5182 | ! | |
5183 | Help! I can't compile and run the intsize test program: please enlighten me! | |
5184 | (This is probably a misconfiguration in your system or libraries, and | |
5185 | you really ought to fix it. Still, I'll try anyway.) | |
5186 | ! | |
5187 | EOM | |
5188 | dflt=4 | |
5189 | rp="What is the size of an integer (in bytes)?" | |
5190 | . ./myread | |
5191 | intsize="$ans" | |
5192 | dflt=$intsize | |
5193 | rp="What is the size of a long integer (in bytes)?" | |
5194 | . ./myread | |
5195 | longsize="$ans" | |
5196 | dflt=2 | |
5197 | rp="What is the size of a short integer (in bytes)?" | |
5198 | . ./myread | |
5199 | shortsize="$ans" | |
5200 | fi | |
5201 | ;; | |
5202 | esac | |
5203 | $rm -f try try.* | |
5204 | ||
5205 | : check for long long | |
5206 | echo " " | |
5207 | echo "Checking to see if you have long long..." >&4 | |
5208 | echo 'int main() { long long x = 7; return 0; }' > try.c | |
5209 | set try | |
5210 | if eval $compile; then | |
5211 | val="$define" | |
5212 | echo "You have long long." | |
5213 | else | |
5214 | val="$undef" | |
5215 | echo "You do not have long long." | |
5216 | fi | |
5217 | $rm try.* | |
5218 | set d_longlong | |
5219 | eval $setvar | |
5220 | ||
5221 | : check for length of long long | |
5222 | case "${d_longlong}${longlongsize}" in | |
5223 | $define) | |
5224 | echo " " | |
5225 | echo "Checking to see how big your long longs are..." >&4 | |
5226 | $cat >try.c <<'EOCP' | |
5227 | #include <stdio.h> | |
5228 | int main() | |
5229 | { | |
5230 | printf("%d\n", (int)sizeof(long long)); | |
5231 | return(0); | |
5232 | } | |
5233 | EOCP | |
5234 | set try | |
5235 | if eval $compile_ok; then | |
5236 | longlongsize=`$run ./try` | |
5237 | echo "Your long longs are $longlongsize bytes long." | |
5238 | else | |
5239 | dflt='8' | |
5240 | echo " " | |
5241 | echo "(I can't seem to compile the test program. Guessing...)" | |
5242 | rp="What is the size of a long long (in bytes)?" | |
5243 | . ./myread | |
5244 | longlongsize="$ans" | |
5245 | fi | |
5246 | if $test "X$longsize" = "X$longlongsize"; then | |
5247 | echo "(That isn't any different from an ordinary long.)" | |
5248 | fi | |
5249 | ;; | |
5250 | esac | |
5251 | $rm -f try.* try | |
5252 | ||
8dfa8df9 JH |
5253 | : see if inttypes.h is available |
5254 | : we want a real compile instead of Inhdr because some systems | |
5255 | : have an inttypes.h which includes non-existent headers | |
5256 | echo " " | |
5257 | $cat >try.c <<EOCP | |
5258 | #include <inttypes.h> | |
5259 | int main() { | |
5260 | static int32_t foo32 = 0x12345678; | |
5261 | } | |
5262 | EOCP | |
5263 | set try | |
5264 | if eval $compile; then | |
5265 | echo "<inttypes.h> found." >&4 | |
5266 | val="$define" | |
5267 | else | |
5268 | echo "<inttypes.h> NOT found." >&4 | |
5269 | val="$undef" | |
5270 | fi | |
5271 | $rm -f try.c try | |
5272 | set i_inttypes | |
5273 | eval $setvar | |
5274 | ||
5275 | : check for int64_t | |
5276 | echo " " | |
5277 | echo "Checking to see if you have int64_t..." >&4 | |
5278 | $cat >try.c <<EOCP | |
5279 | #include <sys/types.h> | |
5280 | #$i_inttypes I_INTTYPES | |
5281 | #ifdef I_INTTYPES | |
5282 | #include <inttypes.h> | |
5283 | #endif | |
5284 | int main() { int64_t x = 7; } | |
5285 | EOCP | |
5286 | set try | |
5287 | if eval $compile; then | |
5288 | val="$define" | |
5289 | echo "You have int64_t." | |
5290 | else | |
5291 | val="$undef" | |
5292 | echo "You do not have int64_t." | |
5293 | fi | |
5294 | $rm -f try try.* | |
5295 | set d_int64_t | |
5296 | eval $setvar | |
5297 | ||
5298 | ||
5299 | echo " " | |
5300 | echo "Checking which 64-bit integer type we could use..." >&4 | |
5301 | ||
5302 | case "$intsize" in | |
5303 | 8) val=int | |
5304 | set quadtype | |
5305 | eval $setvar | |
5306 | val='"unsigned int"' | |
5307 | set uquadtype | |
5308 | eval $setvar | |
5309 | quadkind=1 | |
5310 | ;; | |
5311 | *) case "$longsize" in | |
5312 | 8) val=long | |
5313 | set quadtype | |
5314 | eval $setvar | |
5315 | val='"unsigned long"' | |
5316 | set uquadtype | |
5317 | eval $setvar | |
5318 | quadkind=2 | |
5319 | ;; | |
5320 | *) case "$d_longlong:$longlongsize" in | |
5321 | define:8) | |
5322 | val='"long long"' | |
5323 | set quadtype | |
5324 | eval $setvar | |
5325 | val='"unsigned long long"' | |
5326 | set uquadtype | |
5327 | eval $setvar | |
5328 | quadkind=3 | |
5329 | ;; | |
5330 | *) case "$d_int64_t" in | |
5331 | define) | |
5332 | val=int64_t | |
5333 | set quadtype | |
5334 | eval $setvar | |
5335 | val=uint64_t | |
5336 | set uquadtype | |
5337 | eval $setvar | |
5338 | quadkind=4 | |
5339 | ;; | |
5340 | esac | |
5341 | ;; | |
5342 | esac | |
5343 | ;; | |
5344 | esac | |
5345 | ;; | |
5346 | esac | |
5347 | ||
5348 | case "$quadtype" in | |
5349 | '') echo "Alas, no 64-bit integer types in sight." >&4 | |
5350 | d_quad="$undef" | |
5351 | ;; | |
5352 | *) echo "We could use '$quadtype' for 64-bit integers." >&4 | |
5353 | d_quad="$define" | |
5354 | ;; | |
5355 | esac | |
5356 | ||
b4eb6b3d JH |
5357 | |
5358 | case "$uselonglong" in | |
5359 | "$define"|true|[yY]*) | |
5360 | cat <<EOM >&4 | |
5361 | ||
5362 | *** Configure -Duselonglong is deprecated, using -Duse64bitint instead. | |
5363 | EOM | |
5364 | use64bitint="$define" | |
5365 | ;; | |
5366 | esac | |
5367 | case "$use64bits" in | |
5368 | "$define"|true|[yY]*) | |
5369 | cat <<EOM >&4 | |
5370 | ||
5371 | *** Configure -Duse64bits is deprecated, using -Duse64bitint instead. | |
5372 | EOM | |
5373 | use64bitint="$define" | |
5374 | ;; | |
5375 | esac | |
5376 | case "$use64bitints" in | |
5377 | "$define"|true|[yY]*) | |
5378 | cat <<EOM >&4 | |
5379 | ||
5380 | *** There is no Configure -Duse64bitints, using -Duse64bitint instead. | |
5381 | EOM | |
5382 | use64bitint="$define" | |
5383 | ;; | |
5384 | esac | |
5385 | case "$use64bitsint" in | |
5386 | "$define"|true|[yY]*) | |
5387 | cat <<EOM >&4 | |
5388 | ||
5389 | *** There is no Configure -Duse64bitsint, using -Duse64bitint instead. | |
5390 | EOM | |
5391 | use64bitint="$define" | |
5392 | ;; | |
5393 | esac | |
5394 | case "$uselonglongs" in | |
5395 | "$define"|true|[yY]*) | |
5396 | cat <<EOM >&4 | |
5397 | ||
5398 | *** There is no Configure -Duselonglongs, using -Duse64bitint instead. | |
5399 | EOM | |
5400 | use64bitint="$define" | |
5401 | ;; | |
5402 | esac | |
5403 | case "$use64bitsall" in | |
5404 | "$define"|true|[yY]*) | |
5405 | cat <<EOM >&4 | |
5406 | ||
5407 | *** There is no Configure -Duse64bitsall, using -Duse64bitall instead. | |
5408 | EOM | |
5409 | use64bitall="$define" | |
5410 | ;; | |
5411 | esac | |
5412 | ||
5413 | case "$ccflags" in | |
5414 | *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";; | |
5415 | esac | |
5416 | case "$use64bitall" in | |
5417 | "$define"|true|[yY]*) use64bitint="$define" ;; | |
5418 | esac | |
5419 | ||
5420 | case "$longsize" in | |
5421 | 8) cat <<EOM | |
5422 | ||
5423 | You have natively 64-bit long integers. | |
5424 | EOM | |
5425 | val="$define" | |
5426 | ;; | |
5427 | *) case "$use64bitint" in | |
5428 | "$define"|true|[yY]*) dflt='y';; | |
5429 | *) dflt='n';; | |
5430 | esac | |
8dfa8df9 JH |
5431 | case "$d_quad" in |
5432 | "$define") ;; | |
5433 | *) dflt='n' ;; | |
5434 | esac | |
b4eb6b3d JH |
5435 | cat <<EOM |
5436 | ||
5437 | Perl can be built to take advantage of 64-bit integer types | |
5438 | on some systems. To do so, Configure can be run with -Duse64bitint. | |
5439 | Choosing this option will most probably introduce binary incompatibilities. | |
5440 | ||
5441 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
8dfa8df9 | 5442 | (The default has been chosen based on your configuration.) |
b4eb6b3d JH |
5443 | EOM |
5444 | rp='Try to use 64-bit integers, if available?' | |
5445 | . ./myread | |
5446 | case "$ans" in | |
5447 | [yY]*) val="$define" ;; | |
5448 | *) val="$undef" ;; | |
5449 | esac | |
5450 | ;; | |
5451 | esac | |
5452 | set use64bitint | |
5453 | eval $setvar | |
5454 | ||
5455 | case "$use64bitall" in | |
5456 | "$define"|true|[yY]*) dflt='y' ;; | |
5457 | *) case "$longsize" in | |
5458 | 8) dflt='y' ;; | |
5459 | *) dflt='n' ;; | |
5460 | esac | |
5461 | ;; | |
5462 | esac | |
5463 | cat <<EOM | |
5464 | ||
5465 | You may also choose to try maximal 64-bitness. It means using as much | |
5466 | 64-bitness as possible on the platform. This in turn means even more | |
5467 | binary incompatibilities. On the other hand, your platform may not | |
5468 | have any more 64-bitness available than what you already have chosen. | |
5469 | ||
5470 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
8dfa8df9 | 5471 | (The default has been chosen based on your configuration.) |
b4eb6b3d JH |
5472 | EOM |
5473 | rp='Try to use maximal 64-bit support, if available?' | |
5474 | . ./myread | |
5475 | case "$ans" in | |
5476 | [yY]*) val="$define" ;; | |
5477 | *) val="$undef" ;; | |
5478 | esac | |
5479 | set use64bitall | |
5480 | eval $setvar | |
5481 | case "$use64bitall" in | |
5482 | "$define") | |
5483 | case "$use64bitint" in | |
5484 | "$undef") | |
5485 | cat <<EOM | |
5486 | ||
5487 | Since you have chosen a maximally 64-bit build, I'm also turning on | |
5488 | the use of 64-bit integers. | |
5489 | EOM | |
5490 | use64bitint="$define" ;; | |
5491 | esac | |
5492 | ;; | |
5493 | esac | |
5494 | ||
b4eb6b3d JH |
5495 | : Look for a hint-file generated 'call-back-unit'. If the |
5496 | : user has specified that a 64-bit perl is to be built, | |
5497 | : we may need to set or change some other defaults. | |
c53af328 | 5498 | if $test -f use64bitint.cbu; then |
6bd2d01f | 5499 | echo "Your platform has some specific hints regarding 64-bit integers, using them..." |
c53af328 NC |
5500 | . ./use64bitint.cbu |
5501 | fi | |
6bd2d01f NC |
5502 | case "$use64bitint" in |
5503 | "$define"|true|[yY]*) | |
b4eb6b3d JH |
5504 | case "$longsize" in |
5505 | 4) case "$archname64" in | |
5506 | '') archname64=64int ;; | |
5507 | esac | |
5508 | ;; | |
5509 | esac | |
5510 | ;; | |
5511 | esac | |
5512 | ||
b4eb6b3d JH |
5513 | : Look for a hint-file generated 'call-back-unit'. If the |
5514 | : user has specified that a maximally 64-bit perl is to be built, | |
5515 | : we may need to set or change some other defaults. | |
c53af328 | 5516 | if $test -f use64bitall.cbu; then |
6bd2d01f | 5517 | echo "Your platform has some specific hints regarding 64-bit builds, using them..." |
c53af328 NC |
5518 | . ./use64bitall.cbu |
5519 | fi | |
6bd2d01f NC |
5520 | case "$use64bitall" in |
5521 | "$define"|true|[yY]*) | |
b4eb6b3d JH |
5522 | case "$longsize" in |
5523 | 4) case "$archname64" in | |
5524 | ''|64int) archname64=64all ;; | |
5525 | esac | |
5526 | ;; | |
5527 | esac | |
5528 | ;; | |
5529 | esac | |
5530 | ||
ff0950a8 JH |
5531 | case "$d_quad:$use64bitint" in |
5532 | $undef:$define) | |
5533 | cat >&4 <<EOF | |
5534 | ||
5535 | *** You have chosen to use 64-bit integers, | |
c53af328 | 5536 | *** but none can be found. |
ff0950a8 JH |
5537 | *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits. |
5538 | *** Cannot continue, aborting. | |
5539 | ||
5540 | EOF | |
5541 | exit 1 | |
5542 | ;; | |
5543 | esac | |
5544 | ||
5a29c6bc | 5545 | : check for length of double |
b4eb6b3d | 5546 | echo " " |
5a29c6bc JH |
5547 | case "$doublesize" in |
5548 | '') | |
5549 | echo "Checking to see how big your double precision numbers are..." >&4 | |
5550 | $cat >try.c <<EOCP | |
b4eb6b3d | 5551 | #include <stdio.h> |
5a29c6bc JH |
5552 | #$i_stdlib I_STDLIB |
5553 | #ifdef I_STDLIB | |
5554 | #include <stdlib.h> | |
b4eb6b3d | 5555 | #endif |
5a29c6bc JH |
5556 | int main() |
5557 | { | |
5558 | printf("%d\n", (int)sizeof(double)); | |
5559 | exit(0); | |
b4eb6b3d | 5560 | } |
5f6e0ee4 | 5561 | EOCP |
5a29c6bc JH |
5562 | set try |
5563 | if eval $compile_ok; then | |
5564 | doublesize=`$run ./try` | |
5565 | echo "Your double is $doublesize bytes long." | |
5566 | else | |
5567 | dflt='8' | |
5568 | echo "(I can't seem to compile the test program. Guessing...)" | |
5569 | rp="What is the size of a double precision number (in bytes)?" | |
5570 | . ./myread | |
5571 | doublesize="$ans" | |
5572 | fi | |
5573 | ;; | |
5574 | esac | |
5575 | $rm -f try.c try | |
5576 | ||
5577 | : check for long doubles | |
5578 | echo " " | |
5579 | echo "Checking to see if you have long double..." >&4 | |
5580 | echo 'int main() { long double x = 7.0; }' > try.c | |
5440bc8e | 5581 | set try |
5a29c6bc | 5582 | if eval $compile; then |
b4eb6b3d | 5583 | val="$define" |
5a29c6bc | 5584 | echo "You have long double." |
b4eb6b3d JH |
5585 | else |
5586 | val="$undef" | |
5a29c6bc | 5587 | echo "You do not have long double." |
b4eb6b3d | 5588 | fi |
5a29c6bc JH |
5589 | $rm try.* |
5590 | set d_longdbl | |
b4eb6b3d JH |
5591 | eval $setvar |
5592 | ||
5a29c6bc JH |
5593 | : check for length of long double |
5594 | case "${d_longdbl}${longdblsize}" in | |
5595 | $define) | |
5596 | echo " " | |
5597 | echo "Checking to see how big your long doubles are..." >&4 | |
5598 | $cat >try.c <<'EOCP' | |
5599 | #include <stdio.h> | |
5600 | int main() | |
5601 | { | |
5602 | printf("%d\n", sizeof(long double)); | |
5603 | } | |
5604 | EOCP | |
5605 | set try | |
5606 | set try | |
5607 | if eval $compile; then | |
5608 | longdblsize=`$run ./try` | |
5609 | echo "Your long doubles are $longdblsize bytes long." | |
c1a7f87b | 5610 | else |
5a29c6bc JH |
5611 | dflt='8' |
5612 | echo " " | |
5613 | echo "(I can't seem to compile the test program. Guessing...)" >&4 | |
5614 | rp="What is the size of a long double (in bytes)?" | |
5615 | . ./myread | |
5616 | longdblsize="$ans" | |
5617 | fi | |
5618 | if $test "X$doublesize" = "X$longdblsize"; then | |
5057be0e JH |
5619 | echo "That isn't any different from an ordinary double." |
5620 | echo "I'll keep your setting anyway, but you may see some" | |
5621 | echo "harmless compilation warnings." | |
5a29c6bc | 5622 | fi |
c1a7f87b JH |
5623 | ;; |
5624 | esac | |
5a29c6bc | 5625 | $rm -f try.* try |
8e07c86e | 5626 | |
5a29c6bc | 5627 | : determine the architecture name |
c1a7f87b | 5628 | echo " " |
5a29c6bc JH |
5629 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
5630 | tarch=`arch`"-$osname" | |
5631 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
5632 | if uname -m > tmparch 2>&1 ; then | |
5633 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ | |
5634 | -e 's/$/'"-$osname/" tmparch` | |
5635 | else | |
5636 | tarch="$osname" | |
5637 | fi | |
5638 | $rm -f tmparch | |
5639 | else | |
5640 | tarch="$osname" | |
5641 | fi | |
5642 | case "$myarchname" in | |
5643 | ''|"$tarch") ;; | |
5644 | *) | |
5645 | echo "(Your architecture name used to be $myarchname.)" | |
5646 | archname='' | |
ff935051 JH |
5647 | ;; |
5648 | esac | |
5a29c6bc | 5649 | case "$targetarch" in |
c1a7f87b | 5650 | '') ;; |
5a29c6bc JH |
5651 | *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; |
5652 | esac | |
5653 | myarchname="$tarch" | |
5654 | case "$archname" in | |
5655 | '') dflt="$tarch";; | |
5656 | *) dflt="$archname";; | |
5657 | esac | |
5658 | rp='What is your architecture name' | |
5659 | . ./myread | |
5660 | archname="$ans" | |
5661 | case "$usethreads" in | |
5662 | $define) | |
5663 | echo "Threads selected." >&4 | |
5664 | case "$archname" in | |
5665 | *-thread*) echo "...and architecture name already has -thread." >&4 | |
5666 | ;; | |
5667 | *) archname="$archname-thread" | |
5668 | echo "...setting architecture name to $archname." >&4 | |
5669 | ;; | |
5670 | esac | |
5671 | ;; | |
5672 | esac | |
5673 | case "$usemultiplicity" in | |
5674 | $define) | |
5675 | echo "Multiplicity selected." >&4 | |
5676 | case "$archname" in | |
5677 | *-multi*) echo "...and architecture name already has -multi." >&4 | |
5678 | ;; | |
5679 | *) archname="$archname-multi" | |
5680 | echo "...setting architecture name to $archname." >&4 | |
5681 | ;; | |
5682 | esac | |
5683 | ;; | |
5684 | esac | |
5685 | case "$use64bitint$use64bitall" in | |
5686 | *"$define"*) | |
5687 | case "$archname64" in | |
5688 | '') | |
5689 | echo "This architecture is naturally 64-bit, not changing architecture name." >&4 | |
c1a7f87b | 5690 | ;; |
5a29c6bc JH |
5691 | *) |
5692 | case "$use64bitint" in | |
5693 | "$define") echo "64 bit integers selected." >&4 ;; | |
5694 | esac | |
5695 | case "$use64bitall" in | |
5696 | "$define") echo "Maximal 64 bitness selected." >&4 ;; | |
5697 | esac | |
5698 | case "$archname" in | |
5699 | *-$archname64*) echo "...and architecture name already has $archname64." >&4 | |
5700 | ;; | |
5701 | *) archname="$archname-$archname64" | |
5702 | echo "...setting architecture name to $archname." >&4 | |
5703 | ;; | |
5704 | esac | |
5705 | ;; | |
5706 | esac | |
5707 | esac | |
5708 | case "$uselongdouble" in | |
5709 | $define) | |
5710 | echo "Long doubles selected." >&4 | |
5711 | case "$longdblsize" in | |
5712 | $doublesize) | |
5713 | echo "...but long doubles are equal to doubles, not changing architecture name." >&4 | |
5714 | ;; | |
5715 | *) | |
5716 | case "$archname" in | |
5717 | *-ld*) echo "...and architecture name already has -ld." >&4 | |
5718 | ;; | |
5719 | *) archname="$archname-ld" | |
5720 | echo "...setting architecture name to $archname." >&4 | |
5721 | ;; | |
5722 | esac | |
c1a7f87b | 5723 | ;; |
34d1710f | 5724 | esac |
4633a7c4 LW |
5725 | ;; |
5726 | esac | |
5a29c6bc JH |
5727 | case "$useperlio" in |
5728 | $define) | |
5729 | echo "Perlio selected." >&4 | |
c1a7f87b JH |
5730 | ;; |
5731 | *) | |
5a29c6bc JH |
5732 | echo "Perlio not selected, using stdio." >&4 |
5733 | case "$archname" in | |
5734 | *-stdio*) echo "...and architecture name already has -stdio." >&4 | |
5735 | ;; | |
5736 | *) archname="$archname-stdio" | |
5737 | echo "...setting architecture name to $archname." >&4 | |
5738 | ;; | |
5739 | esac | |
c1a7f87b | 5740 | ;; |
a4f3eea9 | 5741 | esac |
f3479639 JH |
5742 | if $test -f archname.cbu; then |
5743 | echo "Your platform has some specific hints for architecture name, using them..." | |
5744 | . ./archname.cbu | |
5745 | fi | |
5a29c6bc JH |
5746 | |
5747 | : determine root of directory hierarchy where package will be installed. | |
5748 | case "$prefix" in | |
5749 | '') | |
5750 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
5751 | ;; | |
5752 | *?/) | |
5753 | dflt=`echo "$prefix" | sed 's/.$//'` | |
5754 | ;; | |
5755 | *) | |
5756 | dflt="$prefix" | |
5757 | ;; | |
5758 | esac | |
5759 | $cat <<EOM | |
5760 | ||
5761 | By default, $package will be installed in $dflt/bin, manual pages | |
5762 | under $dflt/man, etc..., i.e. with $dflt as prefix for all | |
5763 | installation directories. Typically this is something like /usr/local. | |
5764 | If you wish to have binaries under /usr/bin but other parts of the | |
5765 | installation under /usr/local, that's ok: you will be prompted | |
5766 | separately for each of the installation directories, the prefix being | |
5767 | only used to set the defaults. | |
5768 | ||
5769 | EOM | |
5770 | fn=d~ | |
5771 | rp='Installation prefix to use?' | |
5772 | . ./getfile | |
5773 | oldprefix='' | |
5774 | case "$prefix" in | |
5775 | '') ;; | |
5776 | *) | |
5777 | case "$ans" in | |
5778 | "$prefix") ;; | |
5779 | *) oldprefix="$prefix";; | |
5780 | esac | |
5781 | ;; | |
5782 | esac | |
5783 | prefix="$ans" | |
5784 | prefixexp="$ansexp" | |
5785 | ||
5786 | case "$afsroot" in | |
5787 | '') afsroot=/afs ;; | |
5788 | *) afsroot=$afsroot ;; | |
5789 | esac | |
5790 | ||
5791 | : is AFS running? | |
5792 | echo " " | |
5793 | case "$afs" in | |
5794 | $define|true) afs=true ;; | |
5795 | $undef|false) afs=false ;; | |
5796 | *) if test -d $afsroot; then | |
5797 | afs=true | |
c1a7f87b | 5798 | else |
5a29c6bc | 5799 | afs=false |
c1a7f87b | 5800 | fi |
5a29c6bc JH |
5801 | ;; |
5802 | esac | |
5803 | if $afs; then | |
5804 | echo "AFS may be running... I'll be extra cautious then..." >&4 | |
5805 | else | |
5806 | echo "AFS does not seem to be running..." >&4 | |
c1a7f87b | 5807 | fi |
a4f3eea9 | 5808 | |
5a29c6bc JH |
5809 | : determine installation prefix for where package is to be installed. |
5810 | if $afs; then | |
5811 | $cat <<EOM | |
bd9b35c9 | 5812 | |
5a29c6bc JH |
5813 | Since you are running AFS, I need to distinguish the directory in which |
5814 | files will reside from the directory in which they are installed (and from | |
5815 | which they are presumably copied to the former directory by occult means). | |
a4f3eea9 | 5816 | |
c1a7f87b | 5817 | EOM |
5a29c6bc JH |
5818 | case "$installprefix" in |
5819 | '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;; | |
5820 | *) dflt="$installprefix";; | |
5821 | esac | |
5822 | else | |
5823 | $cat <<EOM | |
29209bc5 | 5824 | |
5a29c6bc JH |
5825 | In some special cases, particularly when building $package for distribution, |
5826 | it is convenient to distinguish the directory in which files should be | |
5827 | installed from the directory ($prefix) in which they will | |
5828 | eventually reside. For most users, these two directories are the same. | |
b4eb6b3d JH |
5829 | |
5830 | EOM | |
5831 | case "$installprefix" in | |
5832 | '') dflt=$prefix ;; | |
5833 | *) dflt=$installprefix;; | |
5834 | esac | |
5835 | fi | |
5836 | fn=d~ | |
5837 | rp='What installation prefix should I use for installing files?' | |
5838 | . ./getfile | |
5839 | installprefix="$ans" | |
5840 | installprefixexp="$ansexp" | |
5841 | ||
5842 | : set the prefixit variable, to compute a suitable default value | |
5843 | prefixit='case "$3" in | |
5844 | ""|none) | |
5845 | case "$oldprefix" in | |
5846 | "") eval "$1=\"\$$2\"";; | |
5847 | *) | |
5848 | case "$3" in | |
5849 | "") eval "$1=";; | |
5850 | none) | |
5851 | eval "tp=\"\$$2\""; | |
5852 | case "$tp" in | |
5853 | ""|" ") eval "$1=\"\$$2\"";; | |
5854 | *) eval "$1=";; | |
5855 | esac;; | |
5856 | esac;; | |
5857 | esac;; | |
5858 | *) | |
5859 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; | |
5860 | case "$tp" in | |
5861 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; | |
5862 | /*-$oldprefix/*|\~*-$oldprefix/*) | |
5863 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; | |
5864 | *) eval "$1=\"\$$2\"";; | |
5865 | esac;; | |
5866 | esac' | |
5867 | ||
b4eb6b3d JH |
5868 | : get the patchlevel |
5869 | echo " " | |
5870 | echo "Getting the current patchlevel..." >&4 | |
5871 | if $test -r $rsrc/patchlevel.h;then | |
5872 | revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` | |
5873 | patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` | |
5874 | subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` | |
5875 | api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` | |
5876 | api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` | |
5877 | api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` | |
151e6568 | 5878 | perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` |
b4eb6b3d JH |
5879 | else |
5880 | revision=0 | |
5881 | patchlevel=0 | |
5882 | subversion=0 | |
5883 | api_revision=0 | |
5884 | api_version=0 | |
5885 | api_subversion=0 | |
151e6568 MB |
5886 | perl_patchlevel=0 |
5887 | $echo "(You do not have patchlevel.h. Eek.)" | |
b4eb6b3d | 5888 | fi |
151e6568 MB |
5889 | if $test -r $rsrc/.patch ; then |
5890 | if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then | |
5891 | perl_patchlevel=`cat $rsrc/.patch` | |
5892 | fi | |
5893 | fi | |
861eb78d AD |
5894 | : Define a handy string here to avoid duplication in myconfig.SH and configpm. |
5895 | version_patchlevel_string="version $patchlevel subversion $subversion" | |
151e6568 | 5896 | case "$perl_patchlevel" in |
861eb78d AD |
5897 | 0|'') ;; |
5898 | *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;; | |
151e6568 | 5899 | esac |
861eb78d AD |
5900 | |
5901 | $echo "(You have $package $version_patchlevel_string.)" | |
5902 | ||
b4eb6b3d JH |
5903 | case "$osname" in |
5904 | dos|vms) | |
5905 | : XXX Should be a Configure test for double-dots in filenames. | |
5906 | version=`echo $revision $patchlevel $subversion | \ | |
5907 | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` | |
5908 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ | |
5909 | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` | |
5910 | ;; | |
5911 | *) | |
5912 | version=`echo $revision $patchlevel $subversion | \ | |
5913 | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` | |
5914 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ | |
5915 | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` | |
5916 | ;; | |
5917 | esac | |
5918 | : Special case the 5.005_xx maintenance series, which used 5.005 | |
5919 | : without any subversion label as a subdirectory in $sitelib | |
5920 | if test "${api_revision}${api_version}${api_subversion}" = "550"; then | |
5921 | api_versionstring='5.005' | |
5922 | fi | |
5923 | ||
5924 | : determine installation style | |
5925 | : For now, try to deduce it from prefix unless it is already set. | |
5926 | : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. | |
5927 | case "$installstyle" in | |
5928 | '') case "$prefix" in | |
5929 | *perl*) dflt='lib';; | |
5930 | *) dflt='lib/perl5' ;; | |
5931 | esac | |
5932 | ;; | |
5933 | *) dflt="$installstyle" ;; | |
5934 | esac | |
5935 | : Probably not worth prompting for this since we prompt for all | |
5936 | : the directories individually, and the prompt would be too long and | |
5937 | : confusing anyway. | |
5938 | installstyle=$dflt | |
5939 | ||
5940 | : determine where private library files go | |
5941 | : Usual default is /usr/local/lib/perl5/$version. | |
5942 | : Also allow things like /opt/perl/lib/$version, since | |
5943 | : /opt/perl/lib/perl5... would be redundant. | |
5944 | : The default "style" setting is made in installstyle.U | |
5945 | case "$installstyle" in | |
5946 | *lib/perl5*) set dflt privlib lib/$package/$version ;; | |
5947 | *) set dflt privlib lib/$version ;; | |
5948 | esac | |
5949 | eval $prefixit | |
5950 | $cat <<EOM | |
5951 | ||
5952 | There are some auxiliary files for $package that need to be put into a | |
5953 | private library directory that is accessible by everyone. | |
5954 | ||
5955 | EOM | |
5956 | fn=d~+ | |
5957 | rp='Pathname where the private library files will reside?' | |
5958 | . ./getfile | |
5959 | privlib="$ans" | |
5960 | privlibexp="$ansexp" | |
5961 | : Change installation prefix, if necessary. | |
5962 | if $test X"$prefix" != X"$installprefix"; then | |
5963 | installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"` | |
5964 | else | |
5965 | installprivlib="$privlibexp" | |
5966 | fi | |
5967 | ||
5968 | : set the prefixup variable, to restore leading tilda escape | |
5969 | prefixup='case "$prefixexp" in | |
5970 | "$prefix") ;; | |
5971 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; | |
5972 | esac' | |
5973 | ||
5974 | : determine where public architecture dependent libraries go | |
5975 | set archlib archlib | |
5976 | eval $prefixit | |
5977 | : privlib default is /usr/local/lib/$package/$version | |
5978 | : archlib default is /usr/local/lib/$package/$version/$archname | |
5979 | : privlib may have an optional trailing /share. | |
5980 | tdflt=`echo $privlib | $sed 's,/share$,,'` | |
5981 | tdflt=$tdflt/$archname | |
5982 | case "$archlib" in | |
5983 | '') dflt=$tdflt | |
5984 | ;; | |
5985 | *) dflt="$archlib" | |
5986 | ;; | |
5987 | esac | |
5988 | $cat <<EOM | |
5989 | ||
5990 | $spackage contains architecture-dependent library files. If you are | |
5991 | sharing libraries in a heterogeneous environment, you might store | |
5992 | these files in a separate location. Otherwise, you can just include | |
5993 | them with the rest of the public library files. | |
5994 | ||
5995 | EOM | |
5996 | fn=d+~ | |
5997 | rp='Where do you want to put the public architecture-dependent libraries?' | |
5998 | . ./getfile | |
5999 | archlib="$ans" | |
6000 | archlibexp="$ansexp" | |
6001 | if $test X"$archlib" = X"$privlib"; then | |
6002 | d_archlib="$undef" | |
6003 | else | |
6004 | d_archlib="$define" | |
6005 | fi | |
6006 | : Change installation prefix, if necessary. | |
6007 | if $test X"$prefix" != X"$installprefix"; then | |
6008 | installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"` | |
6009 | else | |
6010 | installarchlib="$archlibexp" | |
6011 | fi | |
6012 | ||
b4eb6b3d JH |
6013 | : see if setuid scripts can be secure |
6014 | $cat <<EOM | |
6015 | ||
6016 | Some kernels have a bug that prevents setuid #! scripts from being | |
6017 | secure. Some sites have disabled setuid #! scripts because of this. | |
6018 | ||
6019 | First let's decide if your kernel supports secure setuid #! scripts. | |
6020 | (If setuid #! scripts would be secure but have been disabled anyway, | |
6021 | don't say that they are secure if asked.) | |
6022 | ||
6023 | EOM | |
6024 | ||
6025 | val="$undef" | |
6026 | if $test -d /dev/fd; then | |
6027 | echo "#!$ls" >reflect | |
6028 | chmod +x,u+s reflect | |
6029 | ./reflect >flect 2>&1 | |
6030 | if $contains "/dev/fd" flect >/dev/null; then | |
6031 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 | |
6032 | val="$define" | |
6033 | else | |
6034 | $cat <<EOM | |
6035 | If you are not sure if they are secure, I can check but I'll need a | |
6036 | username and password different from the one you are using right now. | |
6037 | If you don't have such a username or don't want me to test, simply | |
6038 | enter 'none'. | |
6039 | ||
6040 | EOM | |
6041 | rp='Other username to test security of setuid scripts with?' | |
6042 | dflt='none' | |
6043 | . ./myread | |
6044 | case "$ans" in | |
6045 | n|none) | |
6046 | case "$d_suidsafe" in | |
6047 | '') echo "I'll assume setuid scripts are *not* secure." >&4 | |
6048 | dflt=n;; | |
6049 | "$undef") | |
6050 | echo "Well, the $hint value is *not* secure." >&4 | |
6051 | dflt=n;; | |
6052 | *) echo "Well, the $hint value *is* secure." >&4 | |
6053 | dflt=y;; | |
6054 | esac | |
c1a7f87b | 6055 | ;; |
b4eb6b3d JH |
6056 | *) |
6057 | $rm -f reflect flect | |
6058 | echo "#!$ls" >reflect | |
6059 | chmod +x,u+s reflect | |
6060 | echo >flect | |
6061 | chmod a+w flect | |
6062 | echo '"su" will (probably) prompt you for '"$ans's password." | |
6063 | su $ans -c './reflect >flect' | |
6064 | if $contains "/dev/fd" flect >/dev/null; then | |
6065 | echo "Okay, it looks like setuid scripts are secure." >&4 | |
6066 | dflt=y | |
6067 | else | |
6068 | echo "I don't think setuid scripts are secure." >&4 | |
6069 | dflt=n | |
6070 | fi | |
6071 | ;; | |
6072 | esac | |
6073 | rp='Does your kernel have *secure* setuid scripts?' | |
6074 | . ./myread | |
6075 | case "$ans" in | |
6076 | [yY]*) val="$define";; | |
6077 | *) val="$undef";; | |
6078 | esac | |
6079 | fi | |
6080 | else | |
6081 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 | |
6082 | echo "(That's for file descriptors, not floppy disks.)" | |
6083 | val="$undef" | |
6084 | fi | |
6085 | set d_suidsafe | |
6086 | eval $setvar | |
6087 | ||
6088 | $rm -f reflect flect | |
6089 | ||
6090 | : now see if they want to do setuid emulation | |
6091 | echo " " | |
6092 | val="$undef" | |
6093 | case "$d_suidsafe" in | |
6094 | "$define") | |
6095 | val="$undef" | |
3c728e00 | 6096 | echo "No need to emulate SUID scripts since they are secure here." >&4 |
b4eb6b3d JH |
6097 | ;; |
6098 | *) | |
6099 | $cat <<EOM | |
6100 | Some systems have disabled setuid scripts, especially systems where | |
6101 | setuid scripts cannot be secure. On systems where setuid scripts have | |
6102 | been disabled, the setuid/setgid bits on scripts are currently | |
6103 | useless. It is possible for $package to detect those bits and emulate | |
6104 | setuid/setgid in a secure fashion. This emulation will only work if | |
6105 | setuid scripts have been disabled in your kernel. | |
6106 | ||
6107 | EOM | |
6108 | case "$d_dosuid" in | |
6109 | "$define") dflt=y ;; | |
6110 | *) dflt=n ;; | |
6111 | esac | |
6112 | rp="Do you want to do setuid/setgid emulation?" | |
6113 | . ./myread | |
6114 | case "$ans" in | |
6115 | [yY]*) val="$define";; | |
6116 | *) val="$undef";; | |
6117 | esac | |
6118 | ;; | |
6119 | esac | |
6120 | set d_dosuid | |
6121 | eval $setvar | |
6122 | ||
b4eb6b3d | 6123 | : see if this is a malloc.h system |
e290198f JH |
6124 | : we want a real compile instead of Inhdr because some systems have a |
6125 | : malloc.h that just gives a compile error saying to use stdlib.h instead | |
6126 | echo " " | |
6127 | $cat >try.c <<EOCP | |
6128 | #include <stdlib.h> | |
6129 | #include <malloc.h> | |
6130 | int main () { return 0; } | |
6131 | EOCP | |
6132 | set try | |
6133 | if eval $compile; then | |
6134 | echo "<malloc.h> found." >&4 | |
6135 | val="$define" | |
6136 | else | |
6137 | echo "<malloc.h> NOT found." >&4 | |
6138 | val="$undef" | |
6139 | fi | |
6140 | $rm -f try.c try | |
6141 | set i_malloc | |
6142 | eval $setvar | |
b4eb6b3d | 6143 | |
c8b93cf9 JH |
6144 | : check for void type |
6145 | echo " " | |
6146 | echo "Checking to see how well your C compiler groks the void type..." >&4 | |
6147 | case "$voidflags" in | |
6148 | '') | |
511118e1 | 6149 | $cat >try.c <<EOCP |
5ed858ef JH |
6150 | #$i_stdlib I_STDLIB |
6151 | #ifdef I_STDLIB | |
6152 | #include <stdlib.h> | |
6153 | #endif | |
c8b93cf9 JH |
6154 | #if TRY & 1 |
6155 | void sub() { | |
6156 | #else | |
6157 | sub() { | |
6158 | #endif | |
6159 | extern void moo(); /* function returning void */ | |
6160 | void (*goo)(); /* ptr to func returning void */ | |
6161 | #if TRY & 8 | |
6162 | void *hue; /* generic ptr */ | |
6163 | #endif | |
6164 | #if TRY & 2 | |
6165 | void (*foo[10])(); | |
6166 | #endif | |
6167 | ||
6168 | #if TRY & 4 | |
6169 | if(goo == moo) { | |
6170 | exit(0); | |
6171 | } | |
6172 | #endif | |
6173 | exit(0); | |
6174 | } | |
6175 | int main() { sub(); } | |
6176 | EOCP | |
6177 | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then | |
6178 | voidflags=$defvoidused | |
6179 | echo "Good. It appears to support void to the level $package wants.">&4 | |
6180 | if $contains warning .out >/dev/null 2>&1; then | |
6181 | echo "However, you might get some warnings that look like this:" | |
6182 | $cat .out | |
6183 | fi | |
6184 | else | |
6185 | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 | |
6186 | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then | |
6187 | echo "It supports 1..." | |
6188 | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then | |
6189 | echo "It also supports 2..." | |
6190 | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then | |
6191 | voidflags=7 | |
6192 | echo "And it supports 4 but not 8 definitely." | |
6193 | else | |
6194 | echo "It doesn't support 4..." | |
6195 | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then | |
6196 | voidflags=11 | |
6197 | echo "But it supports 8." | |
6198 | else | |
6199 | voidflags=3 | |
6200 | echo "Neither does it support 8." | |
6201 | fi | |
6202 | fi | |
6203 | else | |
6204 | echo "It does not support 2..." | |
6205 | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then | |
6206 | voidflags=13 | |
6207 | echo "But it supports 4 and 8." | |
6208 | else | |
6209 | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then | |
6210 | voidflags=5 | |
6211 | echo "And it supports 4 but has not heard about 8." | |
6212 | else | |
6213 | echo "However it supports 8 but not 4." | |
6214 | fi | |
6215 | fi | |
6216 | fi | |
6217 | else | |
6218 | echo "There is no support at all for void." | |
6219 | voidflags=0 | |
6220 | fi | |
6221 | fi | |
6222 | esac | |
6223 | case "$voidflags" in | |
6224 | "$defvoidused") ;; | |
6225 | *) $cat >&4 <<'EOM' | |
6226 | Support flag bits are: | |
6227 | 1: basic void declarations. | |
6228 | 2: arrays of pointers to functions returning void. | |
6229 | 4: operations between pointers to and addresses of void functions. | |
6230 | 8: generic void pointers. | |
6231 | EOM | |
6232 | dflt="$voidflags"; | |
6233 | rp="Your void support flags add up to what?" | |
6234 | . ./myread | |
6235 | voidflags="$ans" | |
6236 | ;; | |
6237 | esac | |
6238 | $rm -f try.* .out | |
6239 | ||
6240 | : check for length of pointer | |
6241 | echo " " | |
6242 | case "$ptrsize" in | |
6243 | '') | |
6244 | echo "Checking to see how big your pointers are..." >&4 | |
6245 | if test "$voidflags" -gt 7; then | |
6246 | echo '#define VOID_PTR char *' > try.c | |
6247 | else | |
6248 | echo '#define VOID_PTR void *' > try.c | |
6249 | fi | |
ada8e391 | 6250 | $cat >>try.c <<EOCP |
c8b93cf9 | 6251 | #include <stdio.h> |
5ed858ef JH |
6252 | #$i_stdlib I_STDLIB |
6253 | #ifdef I_STDLIB | |
6254 | #include <stdlib.h> | |
6255 | #endif | |
c8b93cf9 JH |
6256 | int main() |
6257 | { | |
6258 | printf("%d\n", (int)sizeof(VOID_PTR)); | |
6259 | exit(0); | |
6260 | } | |
6261 | EOCP | |
6262 | set try | |
6263 | if eval $compile_ok; then | |
6264 | ptrsize=`$run ./try` | |
6265 | echo "Your pointers are $ptrsize bytes long." | |
6266 | else | |
6267 | dflt='4' | |
6268 | echo "(I can't seem to compile the test program. Guessing...)" >&4 | |
6269 | rp="What is the size of a pointer (in bytes)?" | |
6270 | . ./myread | |
6271 | ptrsize="$ans" | |
6272 | fi | |
6273 | ;; | |
6274 | esac | |
6275 | $rm -f try.c try | |
6276 | case "$use64bitall" in | |
6277 | "$define"|true|[yY]*) | |
6278 | case "$ptrsize" in | |
6279 | 4) cat <<EOM >&4 | |
6280 | ||
ff0950a8 JH |
6281 | *** You have chosen a maximally 64-bit build, |
6282 | *** but your pointers are only 4 bytes wide. | |
6283 | *** Please rerun Configure without -Duse64bitall. | |
c8b93cf9 | 6284 | EOM |
ff0950a8 JH |
6285 | case "$d_quad" in |
6286 | define) | |
6287 | cat <<EOM >&4 | |
6288 | *** Since you have quads, you could possibly try with -Duse64bitint. | |
c8b93cf9 | 6289 | EOM |
c8b93cf9 JH |
6290 | ;; |
6291 | esac | |
ff0950a8 JH |
6292 | cat <<EOM >&4 |
6293 | *** Cannot continue, aborting. | |
6294 | ||
6295 | EOM | |
6296 | ||
6297 | exit 1 | |
c8b93cf9 JH |
6298 | ;; |
6299 | esac | |
6300 | ;; | |
6301 | esac | |
6302 | ||
c53af328 | 6303 | |
1c6118a4 JH |
6304 | : determine whether to use malloc wrapping |
6305 | echo " " | |
6306 | case "$usemallocwrap" in | |
6307 | [yY]*|true|$define) dflt='y' ;; | |
6308 | [nN]*|false|$undef) dflt='n' ;; | |
6309 | *) case "$usedevel" in | |
6310 | [yY]*|true|$define) dflt='y' ;; | |
6311 | *) dflt='n' ;; | |
6312 | esac | |
6313 | ;; | |
6314 | esac | |
6315 | rp="Do you wish to wrap malloc calls to protect against potential overflows?" | |
6316 | . ./myread | |
6317 | usemallocwrap="$ans" | |
6318 | case "$ans" in | |
6319 | y*|true) | |
6320 | usemallocwrap="$define" ;; | |
6321 | *) | |
6322 | usemallocwrap="$undef" ;; | |
6323 | esac | |
c8b93cf9 | 6324 | |
b4eb6b3d JH |
6325 | : determine which malloc to compile in |
6326 | echo " " | |
6327 | case "$usemymalloc" in | |
c4163172 JH |
6328 | [yY]*|true|$define) dflt='y' ;; |
6329 | [nN]*|false|$undef) dflt='n' ;; | |
6330 | *) case "$ptrsize" in | |
6331 | 4) dflt='y' ;; | |
6332 | *) dflt='n' ;; | |
6333 | esac | |
6334 | ;; | |
8dfa8df9 | 6335 | esac |
b4eb6b3d JH |
6336 | rp="Do you wish to attempt to use the malloc that comes with $package?" |
6337 | . ./myread | |
6338 | usemymalloc="$ans" | |
6339 | case "$ans" in | |
6340 | y*|true) | |
6341 | usemymalloc='y' | |
6342 | mallocsrc='malloc.c' | |
6343 | mallocobj="malloc$_o" | |
6344 | d_mymalloc="$define" | |
6345 | case "$libs" in | |
6346 | *-lmalloc*) | |
6347 | : Remove malloc from list of libraries to use | |
6348 | echo "Removing unneeded -lmalloc from library list" >&4 | |
6349 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` | |
6350 | shift | |
6351 | libs="$*" | |
6352 | echo "libs = $libs" >&4 | |
6353 | ;; | |
6354 | esac | |
6355 | ;; | |
6356 | *) | |
6357 | usemymalloc='n' | |
6358 | mallocsrc='' | |
6359 | mallocobj='' | |
6360 | d_mymalloc="$undef" | |
6361 | ;; | |
6362 | esac | |
6363 | ||
6364 | : compute the return types of malloc and free | |
6365 | echo " " | |
6366 | $cat >malloc.c <<END | |
6367 | #$i_malloc I_MALLOC | |
6368 | #$i_stdlib I_STDLIB | |
6369 | #include <stdio.h> | |
6370 | #include <sys/types.h> | |
6371 | #ifdef I_MALLOC | |
6372 | #include <malloc.h> | |
6373 | #endif | |
6374 | #ifdef I_STDLIB | |
6375 | #include <stdlib.h> | |
6376 | #endif | |
6377 | #ifdef TRY_MALLOC | |
6378 | void *malloc(); | |
6379 | #endif | |
6380 | #ifdef TRY_FREE | |
6381 | void free(); | |
6382 | #endif | |
6383 | END | |
6384 | case "$malloctype" in | |
6385 | '') | |
6386 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then | |
6387 | malloctype='void *' | |
6388 | else | |
6389 | malloctype='char *' | |
6390 | fi | |
6391 | ;; | |
6392 | esac | |
6393 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 | |
6394 | ||
6395 | case "$freetype" in | |
6396 | '') | |
6397 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then | |
6398 | freetype='void' | |
6399 | else | |
6400 | freetype='int' | |
6401 | fi | |
6402 | ;; | |
6403 | esac | |
6404 | echo "Your system uses $freetype free(), it would seem." >&4 | |
6405 | $rm -f malloc.[co] | |
6406 | $cat <<EOM | |
6407 | ||
6408 | After $package is installed, you may wish to install various | |
6409 | add-on modules and utilities. Typically, these add-ons will | |
6410 | be installed under $prefix with the rest | |
6411 | of this package. However, you may wish to install such add-ons | |
6412 | elsewhere under a different prefix. | |
6413 | ||
6414 | If you do not wish to put everything under a single prefix, that's | |
6415 | ok. You will be prompted for the individual locations; this siteprefix | |
6416 | is only used to suggest the defaults. | |
6417 | ||
6418 | The default should be fine for most people. | |
6419 | ||
6420 | EOM | |
6421 | fn=d~+ | |
6422 | rp='Installation prefix to use for add-on modules and utilities?' | |
6423 | : XXX Here might be another good place for an installstyle setting. | |
6424 | case "$siteprefix" in | |
6425 | '') dflt=$prefix ;; | |
6426 | *) dflt=$siteprefix ;; | |
6427 | esac | |
6428 | . ./getfile | |
6429 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix | |
6430 | oldsiteprefix='' | |
6431 | case "$siteprefix" in | |
6432 | '') ;; | |
6433 | *) case "$ans" in | |
6434 | "$prefix") ;; | |
6435 | *) oldsiteprefix="$prefix";; | |
6436 | esac | |
6437 | ;; | |
6438 | esac | |
6439 | siteprefix="$ans" | |
6440 | siteprefixexp="$ansexp" | |
6441 | ||
6442 | : determine where site specific libraries go. | |
6443 | : Usual default is /usr/local/lib/perl5/site_perl/$version | |
6444 | : The default "style" setting is made in installstyle.U | |
6445 | : XXX No longer works with Prefixit stuff. | |
6446 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` | |
6447 | case "$sitelib" in | |
6448 | '') case "$installstyle" in | |
6449 | *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; | |
6450 | *) dflt=$siteprefix/lib/site_$prog/$version ;; | |
6451 | esac | |
6452 | ;; | |
6453 | *) dflt="$sitelib" | |
6454 | ;; | |
6455 | esac | |
6456 | $cat <<EOM | |
6457 | ||
6458 | The installation process will create a directory for | |
6459 | site-specific extensions and modules. Most users find it convenient | |
6460 | to place all site-specific files in this directory rather than in the | |
6461 | main distribution directory. | |
6462 | ||
6463 | EOM | |
6464 | fn=d~+ | |
6465 | rp='Pathname for the site-specific library files?' | |
6466 | . ./getfile | |
6467 | sitelib="$ans" | |
6468 | sitelibexp="$ansexp" | |
6469 | sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` | |
6470 | : Change installation prefix, if necessary. | |
6471 | if $test X"$prefix" != X"$installprefix"; then | |
6472 | installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"` | |
6473 | else | |
6474 | installsitelib="$sitelibexp" | |
6475 | fi | |
6476 | ||
6477 | : determine where site specific architecture-dependent libraries go. | |
6478 | : sitelib default is /usr/local/lib/perl5/site_perl/$version | |
6479 | : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname | |
6480 | : sitelib may have an optional trailing /share. | |
6481 | case "$sitearch" in | |
6482 | '') dflt=`echo $sitelib | $sed 's,/share$,,'` | |
6483 | dflt="$dflt/$archname" | |
6484 | ;; | |
6485 | *) dflt="$sitearch" | |
6486 | ;; | |
6487 | esac | |
6488 | set sitearch sitearch none | |
6489 | eval $prefixit | |
6490 | $cat <<EOM | |
6491 | ||
6492 | The installation process will also create a directory for | |
6493 | architecture-dependent site-specific extensions and modules. | |
6494 | ||
6495 | EOM | |
6496 | fn=d~+ | |
6497 | rp='Pathname for the site-specific architecture-dependent library files?' | |
6498 | . ./getfile | |
6499 | sitearch="$ans" | |
6500 | sitearchexp="$ansexp" | |
6501 | : Change installation prefix, if necessary. | |
6502 | if $test X"$prefix" != X"$installprefix"; then | |
6503 | installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"` | |
6504 | else | |
6505 | installsitearch="$sitearchexp" | |
6506 | fi | |
6507 | ||
6508 | $cat <<EOM | |
6509 | ||
6510 | The installation process will also create a directory for | |
6511 | vendor-supplied add-ons. Vendors who supply perl with their system | |
6512 | may find it convenient to place all vendor-supplied files in this | |
6513 | directory rather than in the main distribution directory. This will | |
6514 | ease upgrades between binary-compatible maintenance versions of perl. | |
6515 | ||
6516 | Of course you may also use these directories in whatever way you see | |
6517 | fit. For example, you might use them to access modules shared over a | |
6518 | company-wide network. | |
6519 | ||
6520 | The default answer should be fine for most people. | |
6521 | This causes further questions about vendor add-ons to be skipped | |
6522 | and no vendor-specific directories will be configured for perl. | |
6523 | ||
6524 | EOM | |
6525 | rp='Do you want to configure vendor-specific add-on directories?' | |
6526 | case "$usevendorprefix" in | |
6527 | define|true|[yY]*) dflt=y ;; | |
6528 | *) : User may have set vendorprefix directly on Configure command line. | |
6529 | case "$vendorprefix" in | |
6530 | ''|' ') dflt=n ;; | |
6531 | *) dflt=y ;; | |
6532 | esac | |
6533 | ;; | |
6534 | esac | |
6535 | . ./myread | |
6536 | case "$ans" in | |
6537 | [yY]*) fn=d~+ | |
6538 | rp='Installation prefix to use for vendor-supplied add-ons?' | |
6539 | case "$vendorprefix" in | |
6540 | '') dflt='' ;; | |
6541 | *) dflt=$vendorprefix ;; | |
6542 | esac | |
6543 | . ./getfile | |
6544 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix | |
6545 | oldvendorprefix='' | |
6546 | case "$vendorprefix" in | |
6547 | '') ;; | |
6548 | *) case "$ans" in | |
6549 | "$prefix") ;; | |
6550 | *) oldvendorprefix="$prefix";; | |
6551 | esac | |
6552 | ;; | |
6553 | esac | |
6554 | usevendorprefix="$define" | |
6555 | vendorprefix="$ans" | |
6556 | vendorprefixexp="$ansexp" | |
6557 | ;; | |
6558 | *) usevendorprefix="$undef" | |
6559 | vendorprefix='' | |
6560 | vendorprefixexp='' | |
6561 | ;; | |
6562 | esac | |
6563 | ||
6564 | case "$vendorprefix" in | |
6565 | '') d_vendorlib="$undef" | |
6566 | vendorlib='' | |
6567 | vendorlibexp='' | |
6568 | ;; | |
6569 | *) d_vendorlib="$define" | |
6570 | : determine where vendor-supplied modules go. | |
6571 | : Usual default is /usr/local/lib/perl5/vendor_perl/$version | |
6572 | case "$vendorlib" in | |
6573 | '') | |
6574 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` | |
6575 | case "$installstyle" in | |
6576 | *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; | |
6577 | *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; | |
6578 | esac | |
6579 | ;; | |
6580 | *) dflt="$vendorlib" | |
6581 | ;; | |
6582 | esac | |
6583 | fn=d~+ | |
6584 | rp='Pathname for the vendor-supplied library files?' | |
6585 | . ./getfile | |
6586 | vendorlib="$ans" | |
6587 | vendorlibexp="$ansexp" | |
6588 | ;; | |
6589 | esac | |
6590 | vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` | |
6591 | : Change installation prefix, if necessary. | |
6592 | if $test X"$prefix" != X"$installprefix"; then | |
6593 | installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"` | |
6594 | else | |
6595 | installvendorlib="$vendorlibexp" | |
6596 | fi | |
6597 | ||
6598 | case "$vendorprefix" in | |
6599 | '') d_vendorarch="$undef" | |
6600 | vendorarch='' | |
6601 | vendorarchexp='' | |
6602 | ;; | |
6603 | *) d_vendorarch="$define" | |
6604 | : determine where vendor-supplied architecture-dependent libraries go. | |
6605 | : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version | |
6606 | : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname | |
6607 | : vendorlib may have an optional trailing /share. | |
6608 | case "$vendorarch" in | |
6609 | '') dflt=`echo $vendorlib | $sed 's,/share$,,'` | |
6610 | dflt="$dflt/$archname" | |
6611 | ;; | |
6612 | *) dflt="$vendorarch" ;; | |
6613 | esac | |
6614 | fn=d~+ | |
6615 | rp='Pathname for vendor-supplied architecture-dependent files?' | |
6616 | . ./getfile | |
6617 | vendorarch="$ans" | |
6618 | vendorarchexp="$ansexp" | |
6619 | ;; | |
6620 | esac | |
6621 | : Change installation prefix, if necessary. | |
6622 | if $test X"$prefix" != X"$installprefix"; then | |
5a29c6bc JH |
6623 | installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"` |
6624 | else | |
6625 | installvendorarch="$vendorarchexp" | |
6626 | fi | |
6627 | ||
6628 | : Final catch-all directories to search | |
6629 | $cat <<EOM | |
6630 | ||
6631 | Lastly, you can have perl look in other directories for extensions and | |
6632 | modules in addition to those already specified. | |
6633 | These directories will be searched after | |
6634 | $sitearch | |
6635 | $sitelib | |
6636 | EOM | |
6637 | test X"$vendorlib" != "X" && echo ' ' $vendorlib | |
6638 | test X"$vendorarch" != "X" && echo ' ' $vendorarch | |
6639 | echo ' ' | |
6640 | case "$otherlibdirs" in | |
6641 | ''|' ') dflt='none' ;; | |
6642 | *) dflt="$otherlibdirs" ;; | |
6643 | esac | |
6644 | $cat <<EOM | |
6645 | Enter a colon-separated set of extra paths to include in perl's @INC | |
6646 | search path, or enter 'none' for no extra paths. | |
6647 | ||
6648 | EOM | |
6649 | ||
6650 | rp='Colon-separated list of additional directories for perl to search?' | |
6651 | . ./myread | |
6652 | case "$ans" in | |
6653 | ' '|''|none) otherlibdirs=' ' ;; | |
6654 | *) otherlibdirs="$ans" ;; | |
6655 | esac | |
6656 | case "$otherlibdirs" in | |
6657 | ' ') val=$undef ;; | |
6658 | *) val=$define ;; | |
6659 | esac | |
6660 | set d_perl_otherlibdirs | |
6661 | eval $setvar | |
6662 | ||
6663 | : Cruising for prototypes | |
6664 | echo " " | |
6665 | echo "Checking out function prototypes..." >&4 | |
6666 | $cat >prototype.c <<EOCP | |
6667 | #$i_stdlib I_STDLIB | |
6668 | #ifdef I_STDLIB | |
6669 | #include <stdlib.h> | |
6670 | #endif | |
6671 | int main(int argc, char *argv[]) { | |
6672 | exit(0);} | |
6673 | EOCP | |
6674 | if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then | |
6675 | echo "Your C compiler appears to support function prototypes." | |
6676 | val="$define" | |
6677 | else | |
6678 | echo "Your C compiler doesn't seem to understand function prototypes." | |
6679 | val="$undef" | |
6680 | fi | |
6681 | set prototype | |
6682 | eval $setvar | |
6683 | $rm -f prototype* | |
6684 | ||
6685 | case "$prototype" in | |
6686 | "$define") ;; | |
6687 | *) ansi2knr='ansi2knr' | |
6688 | echo " " | |
6689 | cat <<EOM >&4 | |
6690 | ||
6691 | $me: FATAL ERROR: | |
6692 | This version of $package can only be compiled by a compiler that | |
6693 | understands function prototypes. Unfortunately, your C compiler | |
6694 | $cc $ccflags | |
6695 | doesn't seem to understand them. Sorry about that. | |
6696 | ||
6697 | If GNU cc is available for your system, perhaps you could try that instead. | |
6698 | ||
6699 | Eventually, we hope to support building Perl with pre-ANSI compilers. | |
6700 | If you would like to help in that effort, please contact <perlbug@perl.org>. | |
6701 | ||
6702 | Aborting Configure now. | |
6703 | EOM | |
6704 | exit 2 | |
6705 | ;; | |
6706 | esac | |
6707 | ||
6708 | : determine where public executables go | |
6709 | echo " " | |
6710 | set dflt bin bin | |
6711 | eval $prefixit | |
6712 | fn=d~ | |
6713 | rp='Pathname where the public executables will reside?' | |
6714 | . ./getfile | |
6715 | if $test "X$ansexp" != "X$binexp"; then | |
6716 | installbin='' | |
6717 | fi | |
6718 | bin="$ans" | |
6719 | binexp="$ansexp" | |
6720 | : Change installation prefix, if necessary. | |
6721 | : XXX Bug? -- ignores Configure -Dinstallprefix setting. | |
6722 | if $test X"$prefix" != X"$installprefix"; then | |
6723 | installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"` | |
6724 | else | |
6725 | installbin="$binexp" | |
6726 | fi | |
6727 | ||
6728 | echo " " | |
6729 | case "$extras" in | |
6730 | '') dflt='n';; | |
6731 | *) dflt='y';; | |
6732 | esac | |
6733 | cat <<EOM | |
6734 | Perl can be built with extra modules or bundles of modules which | |
6735 | will be fetched from the CPAN and installed alongside Perl. | |
6736 | ||
6737 | Notice that you will need access to the CPAN; either via the Internet, | |
6738 | or a local copy, for example a CD-ROM or a local CPAN mirror. (You will | |
6739 | be asked later to configure the CPAN.pm module which will in turn do | |
6740 | the installation of the rest of the extra modules or bundles.) | |
6741 | ||
6742 | Notice also that if the modules require any external software such as | |
6743 | libraries and headers (the libz library and the zlib.h header for the | |
6744 | Compress::Zlib module, for example) you MUST have any such software | |
6745 | already installed, this configuration process will NOT install such | |
6746 | things for you. | |
6747 | ||
6748 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
6749 | EOM | |
6750 | rp='Install any extra modules (y or n)?' | |
6751 | . ./myread | |
6752 | case "$ans" in | |
6753 | y|Y) | |
6754 | cat <<EOM | |
6755 | ||
6756 | Please list any extra modules or bundles to be installed from CPAN, | |
6757 | with spaces between the names. The names can be in any format the | |
6758 | 'install' command of CPAN.pm will understand. (Answer 'none', | |
6759 | without the quotes, to install no extra modules or bundles.) | |
6760 | EOM | |
6761 | rp='Extras?' | |
6762 | dflt="$extras" | |
6763 | . ./myread | |
6764 | extras="$ans" | |
6765 | esac | |
6766 | case "$extras" in | |
6767 | ''|'none') | |
6768 | val='' | |
6769 | $rm -f ../extras.lst | |
6770 | ;; | |
6771 | *) echo "(Saving the list of extras for later...)" | |
6772 | echo "$extras" > ../extras.lst | |
6773 | val="'$extras'" | |
6774 | ;; | |
6775 | esac | |
6776 | set extras | |
6777 | eval $setvar | |
6778 | echo " " | |
6779 | ||
6780 | : determine where html pages for programs go | |
6781 | set html1dir html1dir none | |
6782 | eval $prefixit | |
6783 | $cat <<EOM | |
6784 | ||
6785 | If you wish to install html files for programs in $spackage, indicate | |
6786 | the appropriate directory here. To skip installing html files, | |
6787 | answer "none". | |
6788 | EOM | |
6789 | case "$html1dir" in | |
6790 | ''|none|$undef|' ') dflt=none ;; | |
6791 | *) dflt=$html1dir ;; | |
6792 | esac | |
6793 | fn=dn+~ | |
6794 | rp="Directory for the main $spackage html pages?" | |
6795 | . ./getfile | |
6796 | html1dir="$ans" | |
6797 | html1direxp="$ansexp" | |
6798 | : Use ' ' for none so value is preserved next time through Configure | |
6799 | $test X"$html1dir" = "X" && html1dir=' ' | |
6800 | : Change installation prefix, if necessary. | |
6801 | if $test X"$prefix" != X"$installprefix"; then | |
6802 | installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"` | |
6803 | else | |
6804 | installhtml1dir="$html1direxp" | |
6805 | fi | |
6806 | ||
6807 | : determine where html pages for libraries and modules go | |
6808 | set html3dir html3dir none | |
6809 | eval $prefixit | |
6810 | $cat <<EOM | |
6811 | ||
6812 | If you wish to install html files for modules associated with $spackage, | |
6813 | indicate the appropriate directory here. To skip installing html files, | |
6814 | answer "none". | |
6815 | EOM | |
6816 | : There is no obvious default. If they have specified html1dir, then | |
6817 | : try to key off that, possibly changing .../html1 into .../html3. | |
6818 | case "$html3dir" in | |
6819 | '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;; | |
6820 | *) dflt=$html3dir ;; | |
6821 | esac | |
6822 | fn=dn+~ | |
6823 | rp="Directory for the $spackage module html pages?" | |
6824 | . ./getfile | |
6825 | html3dir="$ans" | |
6826 | html3direxp="$ansexp" | |
6827 | : Use ' ' for none so value is preserved next time through Configure | |
6828 | $test X"$html3dir" = "X" && html3dir=' ' | |
6829 | : Change installation prefix, if necessary. | |
6830 | if $test X"$prefix" != X"$installprefix"; then | |
6831 | installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"` | |
b4eb6b3d | 6832 | else |
5a29c6bc | 6833 | installhtml3dir="$html3direxp" |
b4eb6b3d JH |
6834 | fi |
6835 | ||
5a29c6bc JH |
6836 | : Find perl5.005 or later. |
6837 | echo "Looking for a previously installed perl5.005 or later... " | |
6838 | case "$perl5" in | |
6839 | '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do | |
6840 | : Check if this perl is recent and can load a simple module | |
6841 | if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then | |
6842 | perl5=$tdir/perl | |
6843 | break; | |
6844 | elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then | |
6845 | perl5=$tdir/perl5 | |
6846 | break; | |
6847 | fi | |
6848 | done | |
6849 | ;; | |
6850 | *) perl5="$perl5" | |
6851 | ;; | |
6852 | esac | |
6853 | case "$perl5" in | |
6854 | '') echo "None found. That's ok.";; | |
6855 | *) echo "Using $perl5." ;; | |
6856 | esac | |
b4eb6b3d | 6857 | |
5a29c6bc JH |
6858 | : Determine list of previous versions to include in @INC |
6859 | $cat > getverlist <<EOPL | |
6860 | #!$perl5 -w | |
6861 | use File::Basename; | |
6862 | \$api_versionstring = "$api_versionstring"; | |
6863 | \$version = "$version"; | |
6864 | \$stem = "$sitelib_stem"; | |
6865 | \$archname = "$archname"; | |
6866 | EOPL | |
6867 | $cat >> getverlist <<'EOPL' | |
6868 | # Can't have leading @ because metaconfig interprets it as a command! | |
6869 | ;@inc_version_list=(); | |
6870 | # XXX Redo to do opendir/readdir? | |
6871 | if (-d $stem) { | |
6872 | chdir($stem); | |
6873 | ;@candidates = glob("5.*"); | |
6874 | } | |
6875 | else { | |
6876 | ;@candidates = (); | |
6877 | } | |
6878 | ||
6879 | # XXX ToDo: These comparisons must be reworked when two-digit | |
6880 | # subversions come along, so that 5.7.10 compares as greater than | |
6881 | # 5.7.3! By that time, hope that 5.6.x is sufficiently | |
6882 | # widespread that we can use the built-in version vectors rather | |
6883 | # than reinventing them here. For 5.6.0, however, we must | |
6884 | # assume this script will likely be run by 5.005_0x. --AD 1/2000. | |
6885 | foreach $d (@candidates) { | |
6886 | if ($d lt $version) { | |
6887 | if ($d ge $api_versionstring) { | |
6888 | unshift(@inc_version_list, grep { -d } "$d/$archname", $d); | |
6889 | } | |
6890 | elsif ($d ge "5.005") { | |
6891 | unshift(@inc_version_list, grep { -d } $d); | |
6892 | } | |
6893 | } | |
6894 | else { | |
6895 | # Skip newer version. I.e. don't look in | |
6896 | # 5.7.0 if we're installing 5.6.1. | |
6897 | } | |
6898 | } | |
6899 | ||
6900 | if (@inc_version_list) { | |
6901 | print join(' ', @inc_version_list); | |
6902 | } | |
6903 | else { | |
6904 | # Blank space to preserve value for next Configure run. | |
6905 | print " "; | |
6906 | } | |
6907 | EOPL | |
6908 | chmod +x getverlist | |
6909 | case "$inc_version_list" in | |
6910 | '') if test -x "$perl5$exe_ext"; then | |
6911 | dflt=`$perl5 getverlist` | |
6912 | else | |
6913 | dflt='none' | |
6914 | fi | |
6915 | ;; | |
6916 | $undef) dflt='none' ;; | |
6917 | *) eval dflt=\"$inc_version_list\" ;; | |
6918 | esac | |
6919 | case "$dflt" in | |
6920 | ''|' ') dflt=none ;; | |
6921 | esac | |
6922 | case "$dflt" in | |
6923 | 5.005) dflt=none ;; | |
b4eb6b3d JH |
6924 | esac |
6925 | $cat <<EOM | |
b4eb6b3d | 6926 | |
5a29c6bc JH |
6927 | In order to ease the process of upgrading, this version of perl |
6928 | can be configured to use modules built and installed with earlier | |
6929 | versions of perl that were installed under $prefix. Specify here | |
6930 | the list of earlier versions that this version of perl should check. | |
6931 | If Configure detected no earlier versions of perl installed under | |
6932 | $prefix, then the list will be empty. Answer 'none' to tell perl | |
6933 | to not search earlier versions. | |
6934 | ||
6935 | The default should almost always be sensible, so if you're not sure, | |
6936 | just accept the default. | |
b4eb6b3d JH |
6937 | EOM |
6938 | ||
5a29c6bc | 6939 | rp='List of earlier versions to include in @INC?' |
b4eb6b3d JH |
6940 | . ./myread |
6941 | case "$ans" in | |
3d46c0ef | 6942 | [Nn]one|''|' '|$undef) inc_version_list=' ' ;; |
5a29c6bc | 6943 | *) inc_version_list="$ans" ;; |
b4eb6b3d | 6944 | esac |
5a29c6bc JH |
6945 | case "$inc_version_list" in |
6946 | ''|' ') | |
6947 | inc_version_list_init='0';; | |
6948 | *) inc_version_list_init=`echo $inc_version_list | | |
6949 | $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` | |
6950 | ;; | |
b4eb6b3d | 6951 | esac |
5a29c6bc JH |
6952 | $rm -f getverlist |
6953 | ||
6954 | : determine whether to install perl also as /usr/bin/perl | |
b4eb6b3d | 6955 | |
b4eb6b3d | 6956 | echo " " |
5a29c6bc JH |
6957 | if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then |
6958 | $cat <<EOM | |
6959 | Many scripts expect perl to be installed as /usr/bin/perl. | |
b4eb6b3d | 6960 | |
5a29c6bc JH |
6961 | If you want to, I can install the perl you are about to compile |
6962 | as /usr/bin/perl (in addition to $bin/perl). | |
6963 | EOM | |
6964 | if test -f /usr/bin/perl; then | |
6965 | $cat <<EOM | |
b4eb6b3d | 6966 | |
5a29c6bc JH |
6967 | However, please note that because you already have a /usr/bin/perl, |
6968 | overwriting that with a new Perl would very probably cause problems. | |
6969 | Therefore I'm assuming you don't want to do that (unless you insist). | |
b4eb6b3d | 6970 | |
5a29c6bc JH |
6971 | EOM |
6972 | case "$installusrbinperl" in | |
6973 | "$define"|[yY]*) dflt='y';; | |
6974 | *) dflt='n';; | |
6975 | esac | |
6976 | else | |
6977 | $cat <<EOM | |
b4eb6b3d | 6978 | |
5a29c6bc | 6979 | Since you don't have a /usr/bin/perl I'm assuming creating one is okay. |
b4eb6b3d | 6980 | |
b4eb6b3d | 6981 | EOM |
5a29c6bc JH |
6982 | case "$installusrbinperl" in |
6983 | "$undef"|[nN]*) dflt='n';; | |
6984 | *) dflt='y';; | |
6985 | esac | |
6986 | fi | |
6987 | rp="Do you want to install perl as /usr/bin/perl?" | |
6988 | . ./myread | |
6989 | case "$ans" in | |
6990 | [yY]*) val="$define";; | |
6991 | *) val="$undef" ;; | |
6992 | esac | |
6993 | else | |
6994 | val="$undef" | |
6995 | fi | |
6996 | set installusrbinperl | |
6997 | eval $setvar | |
b4eb6b3d | 6998 | |
b4eb6b3d | 6999 | echo " " |
5a29c6bc JH |
7000 | echo "Checking for GNU C Library..." >&4 |
7001 | cat >try.c <<'EOCP' | |
7002 | /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__ | |
7003 | alone are insufficient to distinguish different versions, such as | |
7004 | 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in | |
7005 | libc version 2.1.0. A. Dougherty, June 3, 2002. | |
7006 | */ | |
7007 | #include <stdio.h> | |
7008 | int main(void) | |
7009 | { | |
7010 | #ifdef __GLIBC__ | |
7011 | # ifdef __GLIBC_MINOR__ | |
7012 | # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 | |
7013 | # include <gnu/libc-version.h> | |
7014 | printf("%s\n", gnu_get_libc_version()); | |
7015 | # else | |
7016 | printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__); | |
7017 | # endif | |
7018 | # else | |
7019 | printf("%d\n", __GLIBC__); | |
7020 | # endif | |
7021 | return 0; | |
7022 | #else | |
7023 | return 1; | |
7024 | #endif | |
7025 | } | |
7026 | EOCP | |
7027 | set try | |
7028 | if eval $compile_ok && $run ./try > glibc.ver; then | |
7029 | val="$define" | |
7030 | gnulibc_version=`$cat glibc.ver` | |
7031 | echo "You are using the GNU C Library version $gnulibc_version" | |
b4eb6b3d | 7032 | else |
5a29c6bc JH |
7033 | val="$undef" |
7034 | gnulibc_version='' | |
7035 | echo "You are not using the GNU C Library" | |
b4eb6b3d | 7036 | fi |
5a29c6bc JH |
7037 | $rm -f try try.* glibc.ver |
7038 | set d_gnulibc | |
7039 | eval $setvar | |
b4eb6b3d | 7040 | |
5a29c6bc JH |
7041 | : see if nm is to be used to determine whether a symbol is defined or not |
7042 | case "$usenm" in | |
7043 | '') | |
7044 | dflt='' | |
7045 | case "$d_gnulibc" in | |
7046 | "$define") | |
7047 | echo " " | |
7048 | echo "nm probably won't work on the GNU C Library." >&4 | |
7049 | dflt=n | |
7050 | ;; | |
7051 | esac | |
7052 | case "$dflt" in | |
7053 | '') | |
7054 | if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then | |
7055 | echo " " | |
7056 | echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 | |
7057 | echo "'nm' won't be sufficient on this sytem." >&4 | |
7058 | dflt=n | |
7059 | fi | |
7060 | ;; | |
7061 | esac | |
7062 | case "$dflt" in | |
7063 | '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` | |
7064 | if $test $dflt -gt 20; then | |
7065 | dflt=y | |
7066 | else | |
7067 | dflt=n | |
7068 | fi | |
7069 | ;; | |
7070 | esac | |
7071 | ;; | |
7072 | *) | |
7073 | case "$usenm" in | |
7074 | true|$define) dflt=y;; | |
7075 | *) dflt=n;; | |
7076 | esac | |
7077 | ;; | |
6fcddf3b | 7078 | esac |
5a29c6bc | 7079 | $cat <<EOM |
6fcddf3b | 7080 | |
5a29c6bc JH |
7081 | I can use $nm to extract the symbols from your C libraries. This |
7082 | is a time consuming task which may generate huge output on the disk (up | |
7083 | to 3 megabytes) but that should make the symbols extraction faster. The | |
7084 | alternative is to skip the 'nm' extraction part and to compile a small | |
7085 | test program instead to determine whether each symbol is present. If | |
7086 | you have a fast C compiler and/or if your 'nm' output cannot be parsed, | |
7087 | this may be the best solution. | |
6fcddf3b | 7088 | |
5a29c6bc | 7089 | You probably shouldn't let me use 'nm' if you are using the GNU C Library. |
6fcddf3b | 7090 | |
6fcddf3b | 7091 | EOM |
5a29c6bc | 7092 | rp="Shall I use $nm to extract C symbols from the libraries?" |
6fcddf3b JH |
7093 | . ./myread |
7094 | case "$ans" in | |
5a29c6bc JH |
7095 | [Nn]*) usenm=false;; |
7096 | *) usenm=true;; | |
6fcddf3b | 7097 | esac |
6fcddf3b | 7098 | |
5a29c6bc JH |
7099 | runnm=$usenm |
7100 | case "$reuseval" in | |
7101 | true) runnm=false;; | |
6e1038e0 | 7102 | esac |
6e1038e0 | 7103 | |
5a29c6bc JH |
7104 | : nm options which may be necessary |
7105 | case "$nm_opt" in | |
7106 | '') if $test -f /mach_boot; then | |
7107 | nm_opt='' # Mach | |
7108 | elif $test -d /usr/ccs/lib; then | |
7109 | nm_opt='-p' # Solaris (and SunOS?) | |
7110 | elif $test -f /dgux; then | |
7111 | nm_opt='-p' # DG-UX | |
7112 | elif $test -f /lib64/rld; then | |
7113 | nm_opt='-p' # 64-bit Irix | |
7114 | else | |
7115 | nm_opt='' | |
7116 | fi;; | |
7117 | esac | |
6e1038e0 | 7118 | |
5a29c6bc JH |
7119 | : nm options which may be necessary for shared libraries but illegal |
7120 | : for archive libraries. Thank you, Linux. | |
7121 | case "$nm_so_opt" in | |
7122 | '') case "$myuname" in | |
d20247fd | 7123 | *linux*|gnu*) |
5a29c6bc JH |
7124 | if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then |
7125 | nm_so_opt='--dynamic' | |
7126 | fi | |
7127 | ;; | |
7128 | esac | |
7129 | ;; | |
6e1038e0 | 7130 | esac |
6e1038e0 | 7131 | |
5a29c6bc JH |
7132 | case "$runnm" in |
7133 | true) | |
7134 | : get list of predefined functions in a handy place | |
7135 | echo " " | |
7136 | case "$libc" in | |
7137 | '') libc=unknown | |
7138 | case "$libs" in | |
7139 | *-lc_s*) libc=`./loc libc_s$_a $libc $libpth` | |
7140 | esac | |
7141 | ;; | |
7142 | esac | |
7143 | case "$libs" in | |
7144 | '') ;; | |
7145 | *) for thislib in $libs; do | |
7146 | case "$thislib" in | |
7147 | -lc|-lc_s) | |
7148 | : Handle C library specially below. | |
7149 | ;; | |
7150 | -l*) | |
7151 | thislib=`echo $thislib | $sed -e 's/^-l//'` | |
7152 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then | |
7153 | : | |
7154 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then | |
7155 | : | |
7156 | elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then | |
7157 | : | |
7158 | elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then | |
7159 | : | |
7160 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then | |
7161 | : | |
7162 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then | |
7163 | : | |
7164 | elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then | |
7165 | : | |
7166 | else | |
7167 | try='' | |
b4eb6b3d | 7168 | fi |
5a29c6bc JH |
7169 | libnames="$libnames $try" |
7170 | ;; | |
7171 | *) libnames="$libnames $thislib" ;; | |
7172 | esac | |
7173 | done | |
7174 | ;; | |
7175 | esac | |
7176 | xxx=normal | |
7177 | case "$libc" in | |
7178 | unknown) | |
7179 | set /lib/libc.$so | |
7180 | for xxx in $libpth; do | |
7181 | $test -r $1 || set $xxx/libc.$so | |
7182 | : The messy sed command sorts on library version numbers. | |
7183 | $test -r $1 || \ | |
7184 | set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ | |
7185 | tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e ' | |
7186 | h | |
7187 | s/[0-9][0-9]*/0000&/g | |
7188 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g | |
7189 | G | |
7190 | s/\n/ /' | \ | |
7191 | $sort | $sed -e 's/^.* //'` | |
7192 | eval set \$$# | |
b4eb6b3d | 7193 | done |
5a29c6bc JH |
7194 | $test -r $1 || set /usr/ccs/lib/libc.$so |
7195 | $test -r $1 || set /lib/libsys_s$_a | |
b4eb6b3d | 7196 | ;; |
5a29c6bc JH |
7197 | *) |
7198 | set blurfl | |
b4eb6b3d JH |
7199 | ;; |
7200 | esac | |
5a29c6bc JH |
7201 | if $test -r "$1"; then |
7202 | echo "Your (shared) C library seems to be in $1." | |
7203 | libc="$1" | |
7204 | elif $test -r /lib/libc && $test -r /lib/clib; then | |
7205 | echo "Your C library seems to be in both /lib/clib and /lib/libc." | |
7206 | xxx=apollo | |
7207 | libc='/lib/clib /lib/libc' | |
7208 | if $test -r /lib/syslib; then | |
7209 | echo "(Your math library is in /lib/syslib.)" | |
7210 | libc="$libc /lib/syslib" | |
7211 | fi | |
7212 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
7213 | echo "Your C library seems to be in $libc, as you said before." | |
7214 | elif $test -r $incpath/usr/lib/libc$_a; then | |
7215 | libc=$incpath/usr/lib/libc$_a; | |
7216 | echo "Your C library seems to be in $libc. That's fine." | |
7217 | elif $test -r /lib/libc$_a; then | |
7218 | libc=/lib/libc$_a; | |
7219 | echo "Your C library seems to be in $libc. You're normal." | |
7220 | else | |
7221 | if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then | |
7222 | : | |
7223 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then | |
7224 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` | |
7225 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then | |
7226 | : | |
7227 | elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then | |
7228 | : | |
7229 | elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then | |
7230 | : | |
b4eb6b3d | 7231 | else |
5a29c6bc | 7232 | tans=`./loc Llibc$_a blurfl/dyick $xlibpth` |
b4eb6b3d | 7233 | fi |
5a29c6bc JH |
7234 | if $test -r "$tans"; then |
7235 | echo "Your C library seems to be in $tans, of all places." | |
7236 | libc=$tans | |
7237 | else | |
7238 | libc='blurfl' | |
7239 | fi | |
7240 | fi | |
7241 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
7242 | dflt="$libc" | |
7243 | cat <<EOM | |
b4eb6b3d | 7244 | |
5a29c6bc JH |
7245 | If the guess above is wrong (which it might be if you're using a strange |
7246 | compiler, or your machine supports multiple models), you can override it here. | |
b4eb6b3d | 7247 | |
b4eb6b3d | 7248 | EOM |
5a29c6bc JH |
7249 | else |
7250 | dflt='' | |
7251 | echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath | |
7252 | cat >&4 <<EOM | |
7253 | I can't seem to find your C library. I've looked in the following places: | |
b4eb6b3d | 7254 | |
5a29c6bc JH |
7255 | EOM |
7256 | $sed 's/^/ /' libpath | |
7257 | cat <<EOM | |
b4eb6b3d | 7258 | |
5a29c6bc | 7259 | None of these seems to contain your C library. I need to get its name... |
5b7ea690 | 7260 | |
b4eb6b3d | 7261 | EOM |
5a29c6bc JH |
7262 | fi |
7263 | fn=f | |
7264 | rp='Where is your C library?' | |
7265 | . ./getfile | |
7266 | libc="$ans" | |
5b7ea690 | 7267 | |
5a29c6bc JH |
7268 | echo " " |
7269 | echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames | |
7270 | set X `cat libnames` | |
7271 | shift | |
7272 | xxx=files | |
7273 | case $# in 1) xxx=file; esac | |
7274 | echo "Extracting names from the following $xxx for later perusal:" >&4 | |
7275 | echo " " | |
7276 | $sed 's/^/ /' libnames >&4 | |
7277 | echo " " | |
7278 | $echo $n "This may take a while...$c" >&4 | |
5b7ea690 | 7279 | |
5a29c6bc JH |
7280 | for file in $*; do |
7281 | case $file in | |
7282 | *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;; | |
7283 | *) $nm $nm_opt $file 2>/dev/null;; | |
7284 | esac | |
7285 | done >libc.tmp | |
7286 | ||
7287 | $echo $n ".$c" | |
7288 | $grep fprintf libc.tmp > libc.ptf | |
7289 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' | |
7290 | xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4' | |
7291 | xxx='[ADTSIW]' | |
f7288ffb | 7292 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\ |
5a29c6bc JH |
7293 | eval $xscan;\ |
7294 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7295 | eval $xrun | |
7296 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ | |
7297 | eval $xscan;\ | |
7298 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7299 | eval $xrun | |
7300 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ | |
7301 | eval $xscan;\ | |
7302 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7303 | eval $xrun | |
7304 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ | |
7305 | eval $xscan;\ | |
7306 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7307 | eval $xrun | |
7308 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ | |
7309 | eval $xscan;\ | |
7310 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7311 | eval $xrun | |
7312 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ | |
7313 | eval $xscan;\ | |
7314 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7315 | eval $xrun | |
7316 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ | |
7317 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ | |
7318 | eval $xscan;\ | |
7319 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7320 | eval $xrun | |
7321 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ | |
7322 | eval $xscan;\ | |
7323 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7324 | eval $xrun | |
7325 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ | |
7326 | eval $xscan;\ | |
7327 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7328 | eval $xrun | |
7329 | elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ | |
7330 | eval $xscan;\ | |
7331 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7332 | eval $xrun | |
7333 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ | |
7334 | eval $xscan;\ | |
7335 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7336 | eval $xrun | |
7337 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ | |
7338 | eval $xscan;\ | |
7339 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7340 | eval $xrun | |
7341 | elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ | |
7342 | eval $xscan;\ | |
7343 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7344 | eval $xrun | |
7345 | elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\ | |
7346 | eval $xscan;\ | |
7347 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
7348 | eval $xrun | |
7349 | else | |
7350 | $nm -p $* 2>/dev/null >libc.tmp | |
7351 | $grep fprintf libc.tmp > libc.ptf | |
7352 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ | |
7353 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 | |
7354 | then | |
7355 | nm_opt='-p' | |
7356 | eval $xrun | |
5b7ea690 | 7357 | else |
5a29c6bc JH |
7358 | echo " " |
7359 | echo "$nm didn't seem to work right. Trying $ar instead..." >&4 | |
7360 | com='' | |
7361 | if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then | |
7362 | for thisname in $libnames $libc; do | |
7363 | $ar t $thisname >>libc.tmp | |
7364 | done | |
7365 | $sed -e "s/\\$_o\$//" < libc.tmp > libc.list | |
7366 | echo "Ok." >&4 | |
7367 | elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then | |
7368 | # Repeat libc to extract forwarders to DLL entries too | |
7369 | for thisname in $libnames $libc; do | |
7370 | $ar tv $thisname >>libc.tmp | |
7371 | # Revision 50 of EMX has bug in $ar. | |
7372 | # it will not extract forwarders to DLL entries | |
7373 | # Use emximp which will extract exactly them. | |
7374 | emximp -o tmp.imp $thisname \ | |
7375 | 2>/dev/null && \ | |
7376 | $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ | |
7377 | < tmp.imp >>libc.tmp | |
7378 | $rm tmp.imp | |
7379 | done | |
7380 | $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list | |
7381 | echo "Ok." >&4 | |
7382 | else | |
7383 | echo "$ar didn't seem to work right." >&4 | |
7384 | echo "Maybe this is a Cray...trying bld instead..." >&4 | |
7385 | if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list | |
7386 | then | |
7387 | for thisname in $libnames; do | |
7388 | bld t $libnames | \ | |
7389 | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list | |
7390 | $ar t $thisname >>libc.tmp | |
7391 | done | |
7392 | echo "Ok." >&4 | |
7393 | else | |
7394 | echo "That didn't work either. Giving up." >&4 | |
7395 | exit 1 | |
7396 | fi | |
7397 | fi | |
2d736872 | 7398 | fi |
b4eb6b3d | 7399 | fi |
5a29c6bc JH |
7400 | nm_extract="$com" |
7401 | case "$PASE" in | |
7402 | define) | |
7403 | echo " " | |
7404 | echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4 | |
7405 | dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list | |
7406 | ;; | |
7407 | *) if $test -f /lib/syscalls.exp; then | |
7408 | echo " " | |
7409 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 | |
7410 | $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list | |
7411 | fi | |
7412 | ;; | |
7413 | esac | |
7414 | ;; | |
7415 | esac | |
7416 | $rm -f libnames libpath | |
b4eb6b3d JH |
7417 | |
7418 | : see if dld is available | |
7419 | set dld.h i_dld | |
7420 | eval $inhdr | |
7421 | ||
5a29c6bc JH |
7422 | : is a C symbol defined? |
7423 | csym='tlook=$1; | |
7424 | case "$3" in | |
5057be0e JH |
7425 | -v) tf=libc.tmp; tdc="";; |
7426 | -a) tf=libc.tmp; tdc="[]";; | |
7427 | *) tlook="^$1\$"; tf=libc.list; tdc="()";; | |
5a29c6bc JH |
7428 | esac; |
7429 | tx=yes; | |
7430 | case "$reuseval-$4" in | |
7431 | true-) ;; | |
7432 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; | |
7433 | esac; | |
7434 | case "$tx" in | |
7435 | yes) | |
f7288ffb | 7436 | tval=false; |
bd43df42 JH |
7437 | if $test "$runnm" = true; then |
7438 | if $contains $tlook $tf >/dev/null 2>&1; then | |
f7288ffb | 7439 | tval=true; |
bd43df42 | 7440 | elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then |
5057be0e | 7441 | echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; |
bd43df42 | 7442 | $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true; |
5057be0e JH |
7443 | $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; }; |
7444 | $rm -f try$_exe try.c core core.* try.core; | |
5a29c6bc | 7445 | fi; |
bd43df42 | 7446 | else |
5057be0e | 7447 | echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c; |
bd43df42 | 7448 | $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true; |
5057be0e | 7449 | $rm -f try$_exe try.c; |
f7288ffb JH |
7450 | fi; |
7451 | ;; | |
5a29c6bc JH |
7452 | *) |
7453 | case "$tval" in | |
7454 | $define) tval=true;; | |
7455 | *) tval=false;; | |
f7288ffb JH |
7456 | esac; |
7457 | ;; | |
5a29c6bc JH |
7458 | esac; |
7459 | eval "$2=$tval"' | |
7460 | ||
7461 | : define an is-in-libc? function | |
7462 | inlibc='echo " "; td=$define; tu=$undef; | |
7463 | sym=$1; var=$2; eval "was=\$$2"; | |
7464 | tx=yes; | |
7465 | case "$reuseval$was" in | |
7466 | true) ;; | |
7467 | true*) tx=no;; | |
7468 | esac; | |
7469 | case "$tx" in | |
7470 | yes) | |
7471 | set $sym tres -f; | |
7472 | eval $csym; | |
7473 | case "$tres" in | |
7474 | true) | |
7475 | echo "$sym() found." >&4; | |
7476 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; | |
7477 | *) | |
7478 | echo "$sym() NOT found." >&4; | |
7479 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; | |
7480 | esac;; | |
7481 | *) | |
7482 | case "$was" in | |
7483 | $define) echo "$sym() found." >&4;; | |
7484 | *) echo "$sym() NOT found." >&4;; | |
7485 | esac;; | |
7486 | esac' | |
7487 | ||
b4eb6b3d JH |
7488 | : see if dlopen exists |
7489 | xxx_runnm="$runnm" | |
7490 | runnm=false | |
7491 | set dlopen d_dlopen | |
7492 | eval $inlibc | |
7493 | runnm="$xxx_runnm" | |
7494 | ||
7495 | : determine which dynamic loading, if any, to compile in | |
7496 | echo " " | |
7497 | dldir="ext/DynaLoader" | |
7498 | case "$usedl" in | |
7499 | $define|y|true) | |
7500 | dflt='y' | |
7501 | usedl="$define" | |
7502 | ;; | |
7503 | $undef|n|false) | |
7504 | dflt='n' | |
7505 | usedl="$undef" | |
7506 | ;; | |
7507 | *) | |
7508 | dflt='n' | |
7509 | case "$d_dlopen" in | |
7510 | $define) dflt='y' ;; | |
7511 | esac | |
7512 | case "$i_dld" in | |
7513 | $define) dflt='y' ;; | |
7514 | esac | |
7515 | : Does a dl_xxx.xs file exist for this operating system | |
7516 | $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y' | |
7517 | ;; | |
7518 | esac | |
7519 | rp="Do you wish to use dynamic loading?" | |
7520 | . ./myread | |
7521 | usedl="$ans" | |
7522 | case "$ans" in | |
7523 | y*) usedl="$define" | |
7524 | case "$dlsrc" in | |
7525 | '') | |
7526 | if $test -f $rsrc/$dldir/dl_${osname}.xs ; then | |
7527 | dflt="$dldir/dl_${osname}.xs" | |
7528 | elif $test "$d_dlopen" = "$define" ; then | |
7529 | dflt="$dldir/dl_dlopen.xs" | |
7530 | elif $test "$i_dld" = "$define" ; then | |
7531 | dflt="$dldir/dl_dld.xs" | |
7532 | else | |
7533 | dflt='' | |
7534 | fi | |
7535 | ;; | |
7536 | *) dflt="$dldir/$dlsrc" | |
7537 | ;; | |
7538 | esac | |
7539 | echo "The following dynamic loading files are available:" | |
7540 | : Can not go over to $dldir because getfile has path hard-coded in. | |
6904989c | 7541 | tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir" |
b4eb6b3d JH |
7542 | rp="Source file to use for dynamic loading" |
7543 | fn="fne" | |
7544 | gfpth="$src" | |
7545 | . ./getfile | |
7546 | usedl="$define" | |
7547 | : emulate basename | |
7548 | dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'` | |
7549 | ||
7550 | $cat << EOM | |
7551 | ||
7552 | Some systems may require passing special flags to $cc -c to | |
7553 | compile modules that will be used to create a shared library. | |
7554 | To use no flags, say "none". | |
7555 | ||
7556 | EOM | |
7557 | case "$cccdlflags" in | |
7558 | '') case "$gccversion" in | |
7559 | '') case "$osname" in | |
7560 | hpux) dflt='+z' ;; | |
7561 | next) dflt='none' ;; | |
7562 | irix*) dflt='-KPIC' ;; | |
48bcfe03 | 7563 | svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;; |
b4eb6b3d JH |
7564 | sunos) dflt='-pic' ;; |
7565 | *) dflt='none' ;; | |
7566 | esac | |
7567 | ;; | |
7568 | *) case "$osname" in | |
b6cc0f4c | 7569 | darwin) dflt='none' ;; |
48bcfe03 | 7570 | svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;; |
b4eb6b3d JH |
7571 | *) dflt='-fpic' ;; |
7572 | esac ;; | |
7573 | esac ;; | |
7574 | ' ') dflt='none' ;; | |
7575 | *) dflt="$cccdlflags" ;; | |
7576 | esac | |
7577 | rp="Any special flags to pass to $cc -c to compile shared library modules?" | |
7578 | . ./myread | |
7579 | case "$ans" in | |
7580 | none) cccdlflags=' ' ;; | |
7581 | *) cccdlflags="$ans" ;; | |
7582 | esac | |
7583 | ||
7584 | cat << EOM | |
7585 | ||
7586 | Some systems use ld to create libraries that can be dynamically loaded, | |
7587 | while other systems (such as those using ELF) use $cc. | |
7588 | ||
7589 | EOM | |
7590 | case "$ld" in | |
5a29c6bc | 7591 | '') $cat >try.c <<EOM |
b4eb6b3d JH |
7592 | /* Test for whether ELF binaries are produced */ |
7593 | #include <fcntl.h> | |
5a29c6bc JH |
7594 | #$i_stdlib I_STDLIB |
7595 | #ifdef I_STDLIB | |
b4eb6b3d | 7596 | #include <stdlib.h> |
5a29c6bc | 7597 | #endif |
b4eb6b3d JH |
7598 | int main() { |
7599 | char b[4]; | |
7600 | int i = open("a.out",O_RDONLY); | |
7601 | if(i == -1) | |
7602 | exit(1); /* fail */ | |
7603 | if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') | |
7604 | exit(0); /* succeed (yes, it's ELF) */ | |
7605 | else | |
7606 | exit(1); /* fail */ | |
7607 | } | |
7608 | EOM | |
5440bc8e | 7609 | if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then |
b4eb6b3d JH |
7610 | cat <<EOM |
7611 | You appear to have ELF support. I'll use $cc to build dynamic libraries. | |
7612 | EOM | |
7613 | dflt="$cc" | |
7614 | else | |
7615 | echo "I'll use ld to build dynamic libraries." | |
7616 | dflt='ld' | |
7617 | fi | |
7618 | rm -f try.c a.out | |
7619 | ;; | |
7620 | *) dflt="$ld" | |
7621 | ;; | |
7622 | esac | |
7623 | ||
7624 | rp="What command should be used to create dynamic libraries?" | |
7625 | . ./myread | |
7626 | ld="$ans" | |
7627 | ||
7628 | cat << EOM | |
7629 | ||
7630 | Some systems may require passing special flags to $ld to create a | |
7631 | library that can be dynamically loaded. If your ld flags include | |
7632 | -L/other/path options to locate libraries outside your loader's normal | |
7633 | search path, you may need to specify those -L options here as well. To | |
7634 | use no flags, say "none". | |
7635 | ||
7636 | EOM | |
7637 | case "$lddlflags" in | |
7638 | '') case "$osname" in | |
7639 | beos) dflt='-nostart' ;; | |
7640 | hpux) dflt='-b'; | |
7641 | case "$gccversion" in | |
7642 | '') dflt="$dflt +vnocompatwarnings" ;; | |
7643 | esac | |
7644 | ;; | |
d20247fd | 7645 | linux|irix*|gnu*) dflt='-shared' ;; |
b4eb6b3d JH |
7646 | next) dflt='none' ;; |
7647 | solaris) dflt='-G' ;; | |
7648 | sunos) dflt='-assert nodefinitions' ;; | |
48bcfe03 | 7649 | svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; |
b4eb6b3d JH |
7650 | *) dflt='none' ;; |
7651 | esac | |
7652 | ;; | |
7653 | *) dflt="$lddlflags" ;; | |
7654 | esac | |
7655 | ||
7656 | : Try to guess additional flags to pick up local libraries. | |
7657 | : Be careful not to append to a plain 'none' | |
7658 | case "$dflt" in | |
7659 | none) dflt='' ;; | |
7660 | esac | |
7661 | for thisflag in $ldflags; do | |
7662 | case "$thisflag" in | |
b5b9f165 | 7663 | -L*|-R*|-Wl,-R*) |
b4eb6b3d JH |
7664 | case " $dflt " in |
7665 | *" $thisflag "*) ;; | |
7666 | *) dflt="$dflt $thisflag" ;; | |
7667 | esac | |
7668 | ;; | |
7669 | esac | |
7670 | done | |
7671 | ||
7672 | case "$dflt" in | |
7673 | ''|' ') dflt='none' ;; | |
7674 | esac | |
7675 | ||
7676 | rp="Any special flags to pass to $ld to create a dynamically loaded library?" | |
7677 | . ./myread | |
7678 | case "$ans" in | |
7679 | none) lddlflags=' ' ;; | |
7680 | *) lddlflags="$ans" ;; | |
7681 | esac | |
7682 | ||
7683 | cat <<EOM | |
7684 | ||
7685 | Some systems may require passing special flags to $cc to indicate that | |
7686 | the resulting executable will use dynamic linking. To use no flags, | |
7687 | say "none". | |
7688 | ||
7689 | EOM | |
7690 | case "$ccdlflags" in | |
7691 | '') case "$osname" in | |
d20247fd | 7692 | linux|hpux|gnu*) dflt='-Wl,-E' ;; |
54b41212 NC |
7693 | next|sunos) dflt='none' ;; |
7694 | *) dflt='none' ;; | |
b4eb6b3d JH |
7695 | esac ;; |
7696 | ' ') dflt='none' ;; | |
7697 | *) dflt="$ccdlflags" ;; | |
7698 | esac | |
7699 | rp="Any special flags to pass to $cc to use dynamic linking?" | |
7700 | . ./myread | |
7701 | case "$ans" in | |
7702 | none) ccdlflags=' ' ;; | |
7703 | *) ccdlflags="$ans" ;; | |
7704 | esac | |
7705 | ;; | |
7706 | *) usedl="$undef" | |
7707 | ld='ld' | |
7708 | dlsrc='dl_none.xs' | |
7709 | lddlflags='' | |
7710 | ccdlflags='' | |
7711 | ;; | |
7712 | esac | |
7713 | ||
7714 | also='' | |
7715 | case "$usedl" in | |
7716 | $undef) | |
7717 | # No dynamic loading being used, so don't bother even to prompt. | |
7718 | useshrplib='false' | |
7719 | ;; | |
7720 | *) case "$useshrplib" in | |
7721 | '') case "$osname" in | |
48bcfe03 | 7722 | svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*) |
b4eb6b3d JH |
7723 | dflt=y |
7724 | also='Building a shared libperl is required for dynamic loading to work on your system.' | |
7725 | ;; | |
7726 | next*) | |
7727 | case "$osvers" in | |
7728 | 4*) dflt=y | |
7729 | also='Building a shared libperl is needed for MAB support.' | |
7730 | ;; | |
7731 | *) dflt=n | |
7732 | ;; | |
7733 | esac | |
7734 | ;; | |
7735 | *) dflt=n | |
7736 | ;; | |
7737 | esac | |
7738 | ;; | |
7739 | $define|true|[Yy]*) | |
7740 | dflt=y | |
7741 | ;; | |
7742 | *) dflt=n | |
7743 | ;; | |
7744 | esac | |
7745 | $cat << EOM | |
7746 | ||
7747 | The perl executable is normally obtained by linking perlmain.c with | |
7748 | libperl${_a}, any static extensions (usually just DynaLoader), and | |
7749 | any other libraries needed on this system (such as -lm, etc.). Since | |
7750 | your system supports dynamic loading, it is probably possible to build | |
7751 | a shared libperl.$so. If you will have more than one executable linked | |
7752 | to libperl.$so, this will significantly reduce the size of each | |
7753 | executable, but it may have a noticeable affect on performance. The | |
7754 | default is probably sensible for your system. | |
7755 | $also | |
7756 | ||
7757 | EOM | |
7758 | rp="Build a shared libperl.$so (y/n)" | |
7759 | . ./myread | |
7760 | case "$ans" in | |
7761 | true|$define|[Yy]*) | |
7762 | useshrplib='true' ;; | |
7763 | *) useshrplib='false' ;; | |
7764 | esac | |
7765 | ;; | |
7766 | esac | |
7767 | ||
7768 | case "$useshrplib" in | |
7769 | true) | |
7770 | case "$libperl" in | |
7771 | '') | |
7772 | # Figure out a good name for libperl.so. Since it gets stored in | |
7773 | # a version-specific architecture-dependent library, the version | |
7774 | # number isn't really that important, except for making cc/ld happy. | |
7775 | # | |
7776 | # A name such as libperl.so.3.1 | |
7777 | majmin="libperl.$so.$patchlevel.$subversion" | |
7778 | # A name such as libperl.so.301 | |
7779 | majonly=`echo $patchlevel $subversion | | |
7780 | $awk '{printf "%d%02d", $1, $2}'` | |
7781 | majonly=libperl.$so.$majonly | |
7782 | # I'd prefer to keep the os-specific stuff here to a minimum, and | |
7783 | # rely on figuring it out from the naming of libc. | |
7784 | case "${osname}${osvers}" in | |
7785 | next4*) | |
7786 | dflt=libperl.5.$so | |
7787 | # XXX How handle the --version stuff for MAB? | |
7788 | ;; | |
d20247fd | 7789 | linux*|gnu*) # ld won't link with a bare -lperl otherwise. |
b4eb6b3d JH |
7790 | dflt=libperl.$so |
7791 | ;; | |
b53432e4 GH |
7792 | cygwin*) # ld links against an importlib |
7793 | dflt=libperl$lib_ext | |
b4eb6b3d JH |
7794 | ;; |
7795 | *) # Try to guess based on whether libc has major.minor. | |
7796 | case "$libc" in | |
7797 | *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; | |
7798 | *libc.$so.[0-9]*) dflt=$majonly ;; | |
7799 | *) dflt=libperl.$so ;; | |
7800 | esac | |
7801 | ;; | |
7802 | esac | |
7803 | ;; | |
7804 | *) dflt=$libperl | |
7805 | ;; | |
7806 | esac | |
7807 | cat << EOM | |
7808 | ||
7809 | I need to select a good name for the shared libperl. If your system uses | |
7810 | library names with major and minor numbers, then you might want something | |
7811 | like $majmin. Alternatively, if your system uses a single version | |
7812 | number for shared libraries, then you might want to use $majonly. | |
7813 | Or, your system might be quite happy with a simple libperl.$so. | |
7814 | ||
7815 | Since the shared libperl will get installed into a version-specific | |
7816 | architecture-dependent directory, the version number of the shared perl | |
7817 | library probably isn't important, so the default should be o.k. | |
7818 | ||
7819 | EOM | |
7820 | rp='What name do you want to give to the shared libperl?' | |
7821 | . ./myread | |
7822 | libperl=$ans | |
7823 | echo "Ok, I'll use $libperl" | |
7824 | ;; | |
7825 | *) | |
7826 | libperl="libperl${_a}" | |
7827 | ;; | |
7828 | esac | |
7829 | ||
7830 | # Detect old use of shrpdir via undocumented Configure -Dshrpdir | |
7831 | case "$shrpdir" in | |
7832 | '') ;; | |
7833 | *) $cat >&4 <<EOM | |
7834 | WARNING: Use of the shrpdir variable for the installation location of | |
7835 | the shared $libperl is not supported. It was never documented and | |
7836 | will not work in this version. Let me (perlbug@perl.org) | |
7837 | know of any problems this may cause. | |
7838 | ||
7839 | EOM | |
7840 | case "$shrpdir" in | |
7841 | "$archlibexp/CORE") | |
7842 | $cat >&4 <<EOM | |
7843 | But your current setting of $shrpdir is | |
7844 | the default anyway, so it's harmless. | |
7845 | EOM | |
7846 | ;; | |
7847 | *) | |
7848 | $cat >&4 <<EOM | |
7849 | Further, your current attempted setting of $shrpdir | |
7850 | conflicts with the value of $archlibexp/CORE | |
7851 | that installperl will use. | |
7852 | EOM | |
7853 | ;; | |
7854 | esac | |
7855 | ;; | |
7856 | esac | |
7857 | ||
7858 | # How will the perl executable find the installed shared $libperl? | |
7859 | # Add $xxx to ccdlflags. | |
7860 | # If we can't figure out a command-line option, use $shrpenv to | |
7861 | # set env LD_RUN_PATH. The main perl makefile uses this. | |
7862 | shrpdir=$archlibexp/CORE | |
7863 | xxx='' | |
7864 | tmp_shrpenv='' | |
7865 | if "$useshrplib"; then | |
7866 | case "$osname" in | |
7867 | aix) | |
7868 | # We'll set it in Makefile.SH... | |
7869 | ;; | |
b5b9f165 | 7870 | solaris) |
b4eb6b3d JH |
7871 | xxx="-R $shrpdir" |
7872 | ;; | |
80512072 | 7873 | freebsd|netbsd|openbsd|interix) |
b4eb6b3d JH |
7874 | xxx="-Wl,-R$shrpdir" |
7875 | ;; | |
d20247fd | 7876 | bsdos|linux|irix*|dec_osf|gnu*) |
b4eb6b3d JH |
7877 | xxx="-Wl,-rpath,$shrpdir" |
7878 | ;; | |
7879 | next) | |
7880 | # next doesn't like the default... | |
7881 | ;; | |
7882 | beos) | |
7883 | # beos doesn't like the default, either. | |
7884 | ;; | |
7885 | hpux*) | |
7886 | # hpux doesn't like the default, either. | |
7887 | tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" | |
7888 | ;; | |
7889 | *) | |
7890 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" | |
7891 | ;; | |
7892 | esac | |
7893 | case "$xxx" in | |
7894 | '') ;; | |
7895 | *) | |
7896 | # Only add $xxx if it isn't already in ccdlflags. | |
7897 | case " $ccdlflags " in | |
7898 | *" $xxx "*) ;; | |
7899 | *) ccdlflags="$ccdlflags $xxx" | |
7900 | cat <<EOM >&4 | |
7901 | ||
7902 | Adding $xxx to the flags | |
7903 | passed to $ld so that the perl executable will find the | |
7904 | installed shared $libperl. | |
7905 | ||
7906 | EOM | |
7907 | ;; | |
7908 | esac | |
7909 | ;; | |
7910 | esac | |
7911 | fi | |
7912 | # Fix ccdlflags in AIX for building external extensions. | |
7913 | # (For building Perl itself bare -bE:perl.exp is needed, | |
7914 | # Makefile.SH takes care of this.) | |
7915 | case "$osname" in | |
7916 | aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;; | |
7917 | esac | |
7918 | # Respect a hint or command-line value. | |
7919 | case "$shrpenv" in | |
7920 | '') shrpenv="$tmp_shrpenv" ;; | |
7921 | esac | |
7922 | case "$ldlibpthname" in | |
7923 | '') ldlibpthname=LD_LIBRARY_PATH ;; | |
7924 | none) ldlibpthname='' ;; | |
7925 | esac | |
7926 | ||
7927 | : determine where manual pages are on this system | |
7928 | echo " " | |
7929 | case "$sysman" in | |
7930 | '') | |
4a0a3829 SD |
7931 | syspath='/usr/share/man/man1 /usr/man/man1' |
7932 | syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1" | |
7933 | syspath="$syspath /usr/man/u_man/man1" | |
b4eb6b3d JH |
7934 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" |
7935 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
7936 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" | |
7937 | sysman=`./loc . /usr/man/man1 $syspath` | |
7938 | ;; | |
7939 | esac | |
7940 | if $test -d "$sysman"; then | |
7941 | echo "System manual is in $sysman." >&4 | |
7942 | else | |
7943 | echo "Could not find manual pages in source form." >&4 | |
7944 | fi | |
7945 | ||
7946 | : determine where manual pages go | |
7947 | set man1dir man1dir none | |
7948 | eval $prefixit | |
7949 | $cat <<EOM | |
7950 | ||
7951 | $spackage has manual pages available in source form. | |
7952 | EOM | |
7953 | case "$nroff" in | |
7954 | nroff) | |
7955 | echo "However, you don't have nroff, so they're probably useless to you." | |
7956 | case "$man1dir" in | |
7957 | '') man1dir="none";; | |
7958 | esac;; | |
7959 | esac | |
7960 | echo "If you don't want the manual sources installed, answer 'none'." | |
7961 | case "$man1dir" in | |
7962 | ' ') dflt=none | |
7963 | ;; | |
7964 | '') | |
4a0a3829 SD |
7965 | lookpath="$prefixexp/share/man/man1" |
7966 | lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1" | |
b4eb6b3d JH |
7967 | lookpath="$lookpath $prefixexp/man/p_man/man1" |
7968 | lookpath="$lookpath $prefixexp/man/u_man/man1" | |
7969 | lookpath="$lookpath $prefixexp/man/man.1" | |
7970 | case "$sysman" in | |
7971 | */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;; | |
7972 | *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;; | |
7973 | esac | |
7974 | set dflt | |
7975 | eval $prefixup | |
7976 | ;; | |
7977 | *) dflt="$man1dir" | |
7978 | ;; | |
7979 | esac | |
7980 | echo " " | |
7981 | fn=dn+~ | |
7982 | rp="Where do the main $spackage manual pages (source) go?" | |
7983 | . ./getfile | |
7984 | if $test "X$man1direxp" != "X$ansexp"; then | |
7985 | installman1dir='' | |
7986 | fi | |
7987 | man1dir="$ans" | |
7988 | man1direxp="$ansexp" | |
7989 | case "$man1dir" in | |
7990 | '') man1dir=' ' | |
7991 | installman1dir='';; | |
7992 | esac | |
7993 | ||
7994 | : Change installation prefix, if necessary. | |
7995 | if $test X"$prefix" != X"$installprefix"; then | |
7996 | installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"` | |
7997 | else | |
7998 | installman1dir="$man1direxp" | |
7999 | fi | |
8000 | ||
8001 | : What suffix to use on installed man pages | |
8002 | ||
8003 | case "$man1dir" in | |
8004 | ' ') | |
8005 | man1ext='0' | |
8006 | ;; | |
8007 | *) | |
8008 | rp="What suffix should be used for the main $spackage man pages?" | |
8009 | case "$man1ext" in | |
8010 | '') case "$man1dir" in | |
8011 | *1) dflt=1 ;; | |
8012 | *1p) dflt=1p ;; | |
8013 | *1pm) dflt=1pm ;; | |
8014 | *l) dflt=l;; | |
8015 | *n) dflt=n;; | |
8016 | *o) dflt=o;; | |
8017 | *p) dflt=p;; | |
8018 | *C) dflt=C;; | |
8019 | *L) dflt=L;; | |
8020 | *L1) dflt=L1;; | |
8021 | *) dflt=1;; | |
8022 | esac | |
8023 | ;; | |
8024 | *) dflt="$man1ext";; | |
8025 | esac | |
8026 | . ./myread | |
8027 | man1ext="$ans" | |
8028 | ;; | |
8029 | esac | |
8030 | ||
8031 | : see if we can have long filenames | |
8032 | echo " " | |
8033 | first=123456789abcdef | |
8034 | $rm -f $first | |
8035 | if (echo hi >$first) 2>/dev/null; then | |
8036 | if $test -f 123456789abcde; then | |
8037 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
8038 | val="$undef" | |
8039 | else | |
8040 | echo 'You can have filenames longer than 14 characters.'>&4 | |
8041 | val="$define" | |
8042 | fi | |
8043 | else | |
8044 | $cat <<'EOM' | |
8045 | You can't have filenames longer than 14 chars. | |
8046 | You can't even think about them! | |
8047 | EOM | |
8048 | val="$undef" | |
8049 | fi | |
8050 | set d_flexfnam | |
8051 | eval $setvar | |
8052 | $rm -rf 123456789abcde* | |
8053 | ||
8054 | : determine where library module manual pages go | |
8055 | set man3dir man3dir none | |
8056 | eval $prefixit | |
8057 | $cat <<EOM | |
8058 | ||
8059 | $spackage has manual pages for many of the library modules. | |
8060 | EOM | |
8061 | ||
8062 | case "$nroff" in | |
8063 | nroff) | |
8064 | $cat <<'EOM' | |
8065 | However, you don't have nroff, so they're probably useless to you. | |
8066 | EOM | |
8067 | case "$man3dir" in | |
8068 | '') man3dir="none";; | |
8069 | esac;; | |
8070 | esac | |
8071 | ||
8072 | case "$d_flexfnam" in | |
8073 | undef) | |
8074 | $cat <<'EOM' | |
8075 | However, your system can't handle the long file names like File::Basename.3. | |
8076 | EOM | |
8077 | case "$man3dir" in | |
8078 | '') man3dir="none";; | |
8079 | esac;; | |
8080 | esac | |
8081 | ||
8082 | echo "If you don't want the manual sources installed, answer 'none'." | |
8083 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` | |
8084 | case "$man3dir" in | |
8085 | '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` | |
8086 | if $test -d "$privlib/man/man3"; then | |
8087 | cat <<EOM >&4 | |
8088 | ||
8089 | WARNING: Previous versions of perl installed man3 pages into | |
8090 | $privlib/man/man3. This version will suggest a | |
8091 | new default of $dflt. | |
8092 | EOM | |
8093 | tdflt=$dflt | |
8094 | dflt='n' | |
8095 | rp='Do you wish to preserve the old behavior?(y/n)' | |
8096 | . ./myread | |
8097 | case "$ans" in | |
8098 | y*) dflt="$privlib/man/man3" ;; | |
8099 | *) dflt=$tdflt ;; | |
8100 | esac | |
8101 | fi | |
8102 | ;; | |
8103 | *) dflt="$man3dir" ;; | |
8104 | esac | |
8105 | case "$dflt" in | |
8106 | ' ') dflt=none ;; | |
8107 | esac | |
8108 | echo " " | |
8109 | fn=dn+~ | |
8110 | rp="Where do the $package library man pages (source) go?" | |
8111 | . ./getfile | |
8112 | man3dir="$ans" | |
8113 | man3direxp="$ansexp" | |
8114 | case "$man3dir" in | |
8115 | '') man3dir=' ' | |
8116 | installman3dir='';; | |
8117 | esac | |
8118 | ||
8119 | : Change installation prefix, if necessary. | |
8120 | if $test X"$prefix" != X"$installprefix"; then | |
8121 | installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"` | |
8122 | else | |
8123 | installman3dir="$man3direxp" | |
8124 | fi | |
8125 | ||
8126 | : What suffix to use on installed man pages | |
8127 | case "$man3dir" in | |
8128 | ' ') | |
8129 | man3ext='0' | |
8130 | ;; | |
8131 | *) | |
8132 | rp="What suffix should be used for the $package library man pages?" | |
8133 | case "$man3ext" in | |
8134 | '') case "$man3dir" in | |
8135 | *3) dflt=3 ;; | |
8136 | *3p) dflt=3p ;; | |
8137 | *3pm) dflt=3pm ;; | |
8138 | *l) dflt=l;; | |
8139 | *n) dflt=n;; | |
8140 | *o) dflt=o;; | |
8141 | *p) dflt=p;; | |
8142 | *C) dflt=C;; | |
8143 | *L) dflt=L;; | |
8144 | *L3) dflt=L3;; | |
8145 | *) dflt=3;; | |
8146 | esac | |
8147 | ;; | |
8148 | *) dflt="$man3ext";; | |
8149 | esac | |
8150 | . ./myread | |
8151 | man3ext="$ans" | |
8152 | ;; | |
8153 | esac | |
8154 | ||
8155 | : see if we have to deal with yellow pages, now NIS. | |
0384a54a | 8156 | if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then |
b4eb6b3d JH |
8157 | if $test -f /usr/etc/nibindd; then |
8158 | echo " " | |
8159 | echo "I'm fairly confident you're on a NeXT." | |
8160 | echo " " | |
8161 | rp='Do you get the hosts file via NetInfo?' | |
8162 | dflt=y | |
8163 | case "$hostcat" in | |
8164 | nidump*) ;; | |
8165 | '') ;; | |
8166 | *) dflt=n;; | |
8167 | esac | |
8168 | . ./myread | |
8169 | case "$ans" in | |
8170 | y*) hostcat='nidump hosts .';; | |
8171 | *) case "$hostcat" in | |
8172 | nidump*) hostcat='';; | |
8173 | esac | |
8174 | ;; | |
8175 | esac | |
8176 | fi | |
8177 | case "$hostcat" in | |
8178 | nidump*) ;; | |
8179 | *) | |
8180 | case "$hostcat" in | |
8181 | *ypcat*) dflt=y;; | |
8182 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
8183 | dflt=y | |
8184 | else | |
8185 | dflt=n | |
8186 | fi;; | |
8187 | *) dflt=n;; | |
8188 | esac | |
8189 | echo " " | |
8190 | rp='Are you getting the hosts file via yellow pages?' | |
8191 | . ./myread | |
8192 | case "$ans" in | |
8193 | y*) hostcat='ypcat hosts';; | |
8194 | *) hostcat='cat /etc/hosts';; | |
8195 | esac | |
8196 | ;; | |
8197 | esac | |
8198 | fi | |
8199 | case "$hostcat" in | |
8200 | '') test -f /etc/hosts && hostcat='cat /etc/hosts';; | |
8201 | esac | |
8202 | case "$groupcat" in | |
8203 | '') test -f /etc/group && groupcat='cat /etc/group';; | |
8204 | esac | |
8205 | case "$passcat" in | |
8206 | '') test -f /etc/passwd && passcat='cat /etc/passwd';; | |
8207 | esac | |
8208 | ||
8209 | : now get the host name | |
8210 | echo " " | |
8211 | echo "Figuring out host name..." >&4 | |
8212 | case "$myhostname" in | |
8213 | '') cont=true | |
8214 | echo 'Maybe "hostname" will work...' | |
73614538 | 8215 | if tans=`sh -c hostname 2>&1` ; then |
b4eb6b3d JH |
8216 | myhostname=$tans |
8217 | phostname=hostname | |
8218 | cont='' | |
8219 | fi | |
8220 | ;; | |
8221 | *) cont='';; | |
8222 | esac | |
8223 | if $test "$cont"; then | |
8224 | if ./xenix; then | |
8225 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' | |
8226 | if tans=`cat /etc/systemid 2>&1` ; then | |
8227 | myhostname=$tans | |
8228 | phostname='cat /etc/systemid' | |
8229 | echo "Whadyaknow. Xenix always was a bit strange..." | |
8230 | cont='' | |
8231 | fi | |
8232 | elif $test -r /etc/systemid; then | |
8233 | echo "(What is a non-Xenix system doing with /etc/systemid?)" | |
8234 | fi | |
8235 | fi | |
8236 | if $test "$cont"; then | |
8237 | echo 'No, maybe "uuname -l" will work...' | |
73614538 | 8238 | if tans=`sh -c 'uuname -l' 2>&1` ; then |
b4eb6b3d JH |
8239 | myhostname=$tans |
8240 | phostname='uuname -l' | |
8241 | else | |
8242 | echo 'Strange. Maybe "uname -n" will work...' | |
73614538 | 8243 | if tans=`sh -c 'uname -n' 2>&1` ; then |
b4eb6b3d JH |
8244 | myhostname=$tans |
8245 | phostname='uname -n' | |
8246 | else | |
8247 | echo 'Oh well, maybe I can mine it out of whoami.h...' | |
73614538 | 8248 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then |
b4eb6b3d JH |
8249 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` |
8250 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" | |
8251 | else | |
8252 | case "$myhostname" in | |
8253 | '') echo "Does this machine have an identity crisis or something?" | |
8254 | phostname='';; | |
8255 | *) | |
8256 | echo "Well, you said $myhostname before..." | |
8257 | phostname='echo $myhostname';; | |
8258 | esac | |
8259 | fi | |
8260 | fi | |
8261 | fi | |
8262 | fi | |
52a549d0 JH |
8263 | case "$myhostname" in |
8264 | '') myhostname=noname ;; | |
8265 | esac | |
b4eb6b3d JH |
8266 | : you do not want to know about this |
8267 | set $myhostname | |
8268 | myhostname=$1 | |
8269 | ||
8270 | : verify guess | |
8271 | if $test "$myhostname" ; then | |
8272 | dflt=y | |
8273 | rp='Your host name appears to be "'$myhostname'".'" Right?" | |
8274 | . ./myread | |
8275 | case "$ans" in | |
8276 | y*) ;; | |
8277 | *) myhostname='';; | |
8278 | esac | |
8279 | fi | |
8280 | ||
8281 | : bad guess or no guess | |
8282 | while $test "X$myhostname" = X ; do | |
8283 | dflt='' | |
8284 | rp="Please type the (one word) name of your host:" | |
8285 | . ./myread | |
8286 | myhostname="$ans" | |
8287 | done | |
8288 | ||
8289 | : translate upper to lower if necessary | |
8290 | case "$myhostname" in | |
8291 | *[A-Z]*) | |
8292 | echo "(Normalizing case in your host name)" | |
8293 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` | |
8294 | ;; | |
8295 | esac | |
8296 | ||
8297 | case "$myhostname" in | |
8298 | *.*) | |
8299 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` | |
8300 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` | |
8301 | echo "(Trimming domain name from host name--host name is now $myhostname)" | |
8302 | ;; | |
8303 | *) case "$mydomain" in | |
8304 | '') | |
8305 | { | |
8306 | test "X$hostcat" = "Xypcat hosts" && | |
8307 | ypmatch "$myhostname" hosts 2>/dev/null |\ | |
8308 | $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ | |
8309 | $test -s hosts | |
8310 | } || { | |
8311 | test "X$hostcat" != "X" && | |
8312 | $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / | |
8313 | /[ ]$myhostname[ . ]/p" > hosts | |
8314 | } | |
8315 | tmp_re="[ . ]" | |
f08cbdd1 PP |
8316 | if $test -f hosts; then |
8317 | $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } | |
b4eb6b3d | 8318 | END { print sum }" hosts` = x1 || tmp_re="[ ]" |
f08cbdd1 PP |
8319 | dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ |
8320 | hosts | $sort | $uniq | \ | |
8321 | $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` | |
8322 | case `$echo X$dflt` in | |
8323 | X*\ *) echo "(Several hosts in the database matched hostname)" | |
8324 | dflt=. | |
8325 | ;; | |
8326 | X.) echo "(You do not have fully-qualified names in the hosts database)" | |
8327 | ;; | |
8328 | esac | |
8329 | else | |
8330 | echo "(I cannot locate a hosts database anywhere)" | |
b4eb6b3d | 8331 | dflt=. |
f08cbdd1 | 8332 | fi |
b4eb6b3d JH |
8333 | case "$dflt" in |
8334 | .) | |
8335 | tans=`./loc resolv.conf X /etc /usr/etc` | |
8336 | if $test -f "$tans"; then | |
8337 | echo "(Attempting domain name extraction from $tans)" | |
8338 | dflt=.`$sed -n -e 's/ / /g' \ | |
8339 | -e 's/^search *\([^ ]*\).*/\1/p' $tans \ | |
8340 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` | |
8341 | case "$dflt" in | |
8342 | .) dflt=.`$sed -n -e 's/ / /g' \ | |
8343 | -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ | |
8344 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` | |
8345 | ;; | |
8346 | esac | |
8347 | fi | |
8348 | ;; | |
8349 | esac | |
8350 | case "$dflt" in | |
8351 | .) echo "(No help from resolv.conf either -- attempting clever guess)" | |
73614538 | 8352 | dflt=.`sh -c domainname 2>/dev/null` |
b4eb6b3d JH |
8353 | case "$dflt" in |
8354 | '') dflt='.';; | |
8355 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; | |
8356 | esac | |
8357 | ;; | |
8358 | esac | |
59c9e5d6 PP |
8359 | case "$dflt$osname" in |
8360 | .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')" | |
caf85fe8 | 8361 | dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null` |
59c9e5d6 PP |
8362 | ;; |
8363 | esac | |
b4eb6b3d JH |
8364 | case "$dflt" in |
8365 | .) echo "(Lost all hope -- silly guess then)" | |
52a549d0 | 8366 | dflt='.nonet' |
b4eb6b3d JH |
8367 | ;; |
8368 | esac | |
8369 | $rm -f hosts | |
8370 | ;; | |
8371 | *) dflt="$mydomain";; | |
8372 | esac;; | |
8373 | esac | |
8374 | echo " " | |
8375 | rp="What is your domain name?" | |
8376 | . ./myread | |
8377 | tans="$ans" | |
8378 | case "$ans" in | |
8379 | '') ;; | |
8380 | .*) ;; | |
8381 | *) tans=".$tans";; | |
8382 | esac | |
8383 | mydomain="$tans" | |
8384 | ||
8385 | : translate upper to lower if necessary | |
8386 | case "$mydomain" in | |
8387 | *[A-Z]*) | |
8388 | echo "(Normalizing case in your domain name)" | |
8389 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` | |
8390 | ;; | |
8391 | esac | |
8392 | ||
8393 | : a little sanity check here | |
8394 | case "$phostname" in | |
8395 | '') ;; | |
8396 | *) | |
8397 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in | |
8398 | $myhostname$mydomain|$myhostname) ;; | |
8399 | *) | |
8400 | case "$phostname" in | |
8401 | sed*) | |
8402 | echo "(That doesn't agree with your whoami.h file, by the way.)" | |
8403 | ;; | |
8404 | *) | |
8405 | echo "(That doesn't agree with your $phostname command, by the way.)" | |
8406 | ;; | |
8407 | esac | |
8408 | ;; | |
8409 | esac | |
8410 | ;; | |
8411 | esac | |
8412 | ||
8413 | $cat <<EOM | |
8414 | ||
8415 | I need to get your e-mail address in Internet format if possible, i.e. | |
8416 | something like user@host.domain. Please answer accurately since I have | |
8417 | no easy means to double check it. The default value provided below | |
8418 | is most probably close to reality but may not be valid from outside | |
8419 | your organization... | |
8420 | ||
8421 | EOM | |
8422 | cont=x | |
8423 | while test "$cont"; do | |
8424 | case "$cf_email" in | |
8425 | '') dflt="$cf_by@$myhostname$mydomain";; | |
8426 | *) dflt="$cf_email";; | |
8427 | esac | |
8428 | rp='What is your e-mail address?' | |
8429 | . ./myread | |
8430 | cf_email="$ans" | |
8431 | case "$cf_email" in | |
8432 | *@*.*) cont='' ;; | |
8433 | *) | |
8434 | rp='Address does not look like an Internet one. Use it anyway?' | |
8435 | case "$fastread" in | |
8436 | yes) dflt=y ;; | |
8437 | *) dflt=n ;; | |
8438 | esac | |
8439 | . ./myread | |
8440 | case "$ans" in | |
8441 | y*) cont='' ;; | |
8442 | *) echo " " ;; | |
8443 | esac | |
8444 | ;; | |
8445 | esac | |
8446 | done | |
8447 | ||
8448 | $cat <<EOM | |
8449 | ||
8450 | If you or somebody else will be maintaining perl at your site, please | |
8451 | fill in the correct e-mail address here so that they may be contacted | |
8452 | if necessary. Currently, the "perlbug" program included with perl | |
8453 | will send mail to this address in addition to perlbug@perl.org. You may | |
8454 | enter "none" for no administrator. | |
8455 | ||
8456 | EOM | |
8457 | case "$perladmin" in | |
8458 | '') dflt="$cf_email";; | |
8459 | *) dflt="$perladmin";; | |
8460 | esac | |
8461 | rp='Perl administrator e-mail address' | |
8462 | . ./myread | |
8463 | perladmin="$ans" | |
8464 | ||
674912d7 RB |
8465 | : determine whether to only install version-specific parts. |
8466 | echo " " | |
8467 | $cat <<EOM | |
8468 | Do you want to install only the version-specific parts of the perl | |
8469 | distribution? Usually you do *not* want to do this. | |
8470 | EOM | |
8471 | case "$versiononly" in | |
8472 | "$define"|[Yy]*|true) dflt='y' ;; | |
8473 | *) dflt='n'; | |
8474 | esac | |
8475 | rp="Do you want to install only the version-specific parts of perl?" | |
8476 | . ./myread | |
8477 | case "$ans" in | |
8478 | [yY]*) val="$define";; | |
8479 | *) val="$undef" ;; | |
8480 | esac | |
8481 | set versiononly | |
8482 | eval $setvar | |
8483 | ||
ad493445 MB |
8484 | case "$versiononly" in |
8485 | "$define") inc_version_list='' | |
8486 | inc_version_list_init=0 | |
8487 | ;; | |
8488 | esac | |
8489 | ||
b4eb6b3d JH |
8490 | : figure out how to guarantee perl startup |
8491 | case "$startperl" in | |
8492 | '') | |
8493 | case "$sharpbang" in | |
8494 | *!) | |
8495 | $cat <<EOH | |
8496 | ||
8497 | I can use the #! construct to start perl on your system. This will | |
8498 | make startup of perl scripts faster, but may cause problems if you | |
8499 | want to share those scripts and perl is not in a standard place | |
8500 | ($binexp/perl) on all your platforms. The alternative is to force | |
8501 | a shell by starting the script with a single ':' character. | |
8502 | ||
8503 | EOH | |
674912d7 RB |
8504 | case "$versiononly" in |
8505 | "$define") dflt="$binexp/perl$version";; | |
8506 | *) dflt="$binexp/perl";; | |
8507 | esac | |
b4eb6b3d JH |
8508 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' |
8509 | . ./myread | |
8510 | case "$ans" in | |
8511 | none) startperl=": # use perl";; | |
8512 | *) startperl="#!$ans" | |
8513 | if $test 30 -lt `echo "$ans" | wc -c`; then | |
8514 | $cat >&4 <<EOM | |
8515 | ||
8516 | WARNING: Some systems limit the #! command to 32 characters. | |
8517 | If you experience difficulty running Perl scripts with #!, try | |
8518 | installing Perl in a directory with a shorter pathname. | |
8519 | ||
8520 | EOM | |
8521 | fi ;; | |
8522 | esac | |
8523 | ;; | |
8524 | *) startperl=": # use perl" | |
8525 | ;; | |
8526 | esac | |
8527 | ;; | |
8528 | esac | |
8529 | echo "I'll use $startperl to start perl scripts." | |
8530 | ||
8531 | : figure best path for perl in scripts | |
8532 | case "$perlpath" in | |
8533 | '') | |
5e20a8ca RGS |
8534 | case "$versiononly" in |
8535 | "$define") perlpath="$binexp/perl$version";; | |
8536 | *) perlpath="$binexp/perl";; | |
8537 | esac | |
b4eb6b3d JH |
8538 | case "$startperl" in |
8539 | *!*) ;; | |
8540 | *) | |
8541 | $cat <<EOH | |
8542 | ||
8543 | I will use the "eval 'exec'" idiom to start Perl on your system. | |
8544 | I can use the full path of your Perl binary for this purpose, but | |
8545 | doing so may cause problems if you want to share those scripts and | |
8546 | Perl is not always in a standard place ($binexp/perl). | |
8547 | ||
8548 | EOH | |
8549 | dflt="$binexp/perl" | |
8550 | rp="What path shall I use in \"eval 'exec'\"?" | |
8551 | . ./myread | |
8552 | perlpath="$ans" | |
8553 | ;; | |
8554 | esac | |
8555 | ;; | |
8556 | esac | |
8557 | case "$startperl" in | |
8558 | *!*) ;; | |
8559 | *) echo "I'll use $perlpath in \"eval 'exec'\"" ;; | |
8560 | esac | |
8561 | ||
8562 | : determine where public executable scripts go | |
8563 | set scriptdir scriptdir | |
8564 | eval $prefixit | |
8565 | case "$scriptdir" in | |
8566 | '') | |
8567 | dflt="$bin" | |
8568 | : guess some guesses | |
8569 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
8570 | $test -d /usr/share/bin && dflt=/usr/share/bin | |
8571 | $test -d /usr/local/script && dflt=/usr/local/script | |
8572 | $test -d /usr/local/scripts && dflt=/usr/local/scripts | |
8573 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
8574 | set dflt | |
8575 | eval $prefixup | |
8576 | ;; | |
8577 | *) dflt="$scriptdir" | |
8578 | ;; | |
8579 | esac | |
8580 | $cat <<EOM | |
8581 | ||
8582 | Some installations have a separate directory just for executable scripts so | |
8583 | that they can mount it across multiple architectures but keep the scripts in | |
8584 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
8585 | Or you might just lump your scripts in with all your other executables. | |
8586 | ||
8587 | EOM | |
8588 | fn=d~ | |
8589 | rp='Where do you keep publicly executable scripts?' | |
8590 | . ./getfile | |
8591 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
8592 | installscript='' | |
8593 | fi | |
8594 | scriptdir="$ans" | |
8595 | scriptdirexp="$ansexp" | |
8596 | : Change installation prefix, if necessary. | |
8597 | if $test X"$prefix" != X"$installprefix"; then | |
8598 | installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"` | |
8599 | else | |
8600 | installscript="$scriptdirexp" | |
8601 | fi | |
8602 | ||
8603 | : determine where add-on public executables go | |
8604 | case "$sitebin" in | |
8605 | '') dflt=$siteprefix/bin ;; | |
8606 | *) dflt=$sitebin ;; | |
8607 | esac | |
8608 | fn=d~ | |
8609 | rp='Pathname where the add-on public executables should be installed?' | |
8610 | . ./getfile | |
8611 | sitebin="$ans" | |
8612 | sitebinexp="$ansexp" | |
8613 | : Change installation prefix, if necessary. | |
8614 | if $test X"$prefix" != X"$installprefix"; then | |
8615 | installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"` | |
8616 | else | |
8617 | installsitebin="$sitebinexp" | |
8618 | fi | |
8619 | ||
6e1038e0 | 8620 | : determine where add-on html pages go |
3bb95762 | 8621 | : There is no standard location, so try to copy the previously-selected |
6e1038e0 | 8622 | : directory structure for the core html pages. |
3bb95762 JH |
8623 | case "$sitehtml1dir" in |
8624 | '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;; | |
8625 | *) dflt=$sitehtml1dir ;; | |
6e1038e0 MB |
8626 | esac |
8627 | case "$dflt" in | |
8628 | ''|' ') dflt=none ;; | |
8629 | esac | |
8630 | fn=dn+~ | |
8631 | rp='Pathname where the site-specific html pages should be installed?' | |
8632 | . ./getfile | |
3bb95762 JH |
8633 | sitehtml1dir="$ans" |
8634 | sitehtml1direxp="$ansexp" | |
6e1038e0 MB |
8635 | : Change installation prefix, if necessary. |
8636 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 8637 | installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 8638 | else |
3bb95762 | 8639 | installsitehtml1dir="$sitehtml1direxp" |
6e1038e0 MB |
8640 | fi |
8641 | ||
8642 | : determine where add-on library html pages go | |
8643 | : There is no standard location, so try to copy the previously-selected | |
8644 | : directory structure for the core html pages. | |
3bb95762 JH |
8645 | case "$sitehtml3dir" in |
8646 | '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;; | |
8647 | *) dflt=$sitehtml3dir ;; | |
6e1038e0 MB |
8648 | esac |
8649 | case "$dflt" in | |
8650 | ''|' ') dflt=none ;; | |
8651 | esac | |
8652 | fn=dn+~ | |
8653 | rp='Pathname where the site-specific library html pages should be installed?' | |
8654 | . ./getfile | |
3bb95762 JH |
8655 | sitehtml3dir="$ans" |
8656 | sitehtml3direxp="$ansexp" | |
6e1038e0 MB |
8657 | : Change installation prefix, if necessary. |
8658 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 8659 | installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 8660 | else |
3bb95762 | 8661 | installsitehtml3dir="$sitehtml3direxp" |
6e1038e0 MB |
8662 | fi |
8663 | ||
8664 | : determine where add-on manual pages go | |
3bb95762 JH |
8665 | case "$siteman1dir" in |
8666 | '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;; | |
8667 | *) dflt=$siteman1dir ;; | |
6e1038e0 | 8668 | esac |
c061b110 JH |
8669 | case "$dflt" in |
8670 | ''|' ') dflt=none ;; | |
8671 | esac | |
6e1038e0 MB |
8672 | fn=dn+~ |
8673 | rp='Pathname where the site-specific manual pages should be installed?' | |
8674 | . ./getfile | |
3bb95762 JH |
8675 | siteman1dir="$ans" |
8676 | siteman1direxp="$ansexp" | |
6e1038e0 MB |
8677 | : Change installation prefix, if necessary. |
8678 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 8679 | installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 8680 | else |
3bb95762 | 8681 | installsiteman1dir="$siteman1direxp" |
6e1038e0 MB |
8682 | fi |
8683 | ||
8684 | : determine where add-on library man pages go | |
3bb95762 JH |
8685 | case "$siteman3dir" in |
8686 | '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;; | |
8687 | *) dflt=$siteman3dir ;; | |
6e1038e0 | 8688 | esac |
c061b110 JH |
8689 | case "$dflt" in |
8690 | ''|' ') dflt=none ;; | |
8691 | esac | |
6e1038e0 MB |
8692 | fn=dn+~ |
8693 | rp='Pathname where the site-specific library manual pages should be installed?' | |
8694 | . ./getfile | |
3bb95762 JH |
8695 | siteman3dir="$ans" |
8696 | siteman3direxp="$ansexp" | |
6e1038e0 MB |
8697 | : Change installation prefix, if necessary. |
8698 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 8699 | installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 8700 | else |
3bb95762 | 8701 | installsiteman3dir="$siteman3direxp" |
6e1038e0 MB |
8702 | fi |
8703 | ||
8704 | : determine where add-on public executable scripts go | |
8705 | case "$sitescript" in | |
8706 | '') dflt=$siteprefix/script | |
8707 | $test -d $dflt || dflt=$sitebin ;; | |
8708 | *) dflt="$sitescript" ;; | |
8709 | esac | |
8710 | fn=d~+ | |
8711 | rp='Pathname where add-on public executable scripts should be installed?' | |
8712 | . ./getfile | |
8713 | sitescript="$ans" | |
8714 | sitescriptexp="$ansexp" | |
8715 | : Change installation prefix, if necessary. | |
8716 | if $test X"$prefix" != X"$installprefix"; then | |
8717 | installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"` | |
8718 | else | |
8719 | installsitescript="$sitescriptexp" | |
8720 | fi | |
8721 | ||
ff0950a8 JH |
8722 | case "$usefaststdio" in |
8723 | $define|true|[yY]*|'') | |
8724 | xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` | |
8725 | case "$xversion" in | |
8726 | [68]) dflt='y' ;; | |
8727 | *) dflt='n' ;; | |
8728 | esac | |
8729 | ;; | |
8730 | *) dflt='n';; | |
8731 | esac | |
8732 | cat <<EOM | |
8733 | ||
8734 | Perl can be built to use 'fast stdio', which means using the stdio | |
8735 | library but also directly manipulating the stdio buffers to enable | |
8736 | faster I/O. Using stdio is better for backward compatibility (especially | |
8737 | for Perl extensions), but on the other hand since Perl 5.8 the 'perlio' | |
8738 | interface has been preferred instead of stdio. | |
8739 | ||
8740 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
8741 | EOM | |
8742 | rp='Use the "fast stdio" if available?' | |
8743 | . ./myread | |
8744 | case "$ans" in | |
8745 | y|Y) val="$define" ;; | |
8746 | *) val="$undef" ;; | |
8747 | esac | |
8748 | set usefaststdio | |
8749 | eval $setvar | |
8750 | ||
8751 | ||
96056487 JH |
8752 | : define an is-a-typedef? function |
8753 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
8754 | case "$inclist" in | |
8755 | "") inclist="sys/types.h";; | |
8756 | esac; | |
8757 | eval "varval=\$$var"; | |
8758 | case "$varval" in | |
8759 | "") | |
8760 | $rm -f temp.c; | |
8761 | for inc in $inclist; do | |
8762 | echo "#include <$inc>" >>temp.c; | |
8763 | done; | |
8764 | echo "#ifdef $type" >> temp.c; | |
8765 | echo "printf(\"We have $type\");" >> temp.c; | |
8766 | echo "#endif" >> temp.c; | |
8767 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
8768 | if $contains $type temp.E >/dev/null 2>&1; then | |
8769 | eval "$var=\$type"; | |
8770 | else | |
8771 | eval "$var=\$def"; | |
8772 | fi; | |
8773 | $rm -f temp.?;; | |
8774 | *) eval "$var=\$varval";; | |
8775 | esac' | |
8776 | ||
8777 | : define an is-a-typedef? function that prompts if the type is not available. | |
8778 | typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
8779 | case "$inclist" in | |
8780 | "") inclist="sys/types.h";; | |
8781 | esac; | |
8782 | eval "varval=\$$var"; | |
8783 | case "$varval" in | |
8784 | "") | |
8785 | $rm -f temp.c; | |
8786 | for inc in $inclist; do | |
8787 | echo "#include <$inc>" >>temp.c; | |
8788 | done; | |
8789 | echo "#ifdef $type" >> temp.c; | |
8790 | echo "printf(\"We have $type\");" >> temp.c; | |
8791 | echo "#endif" >> temp.c; | |
8792 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
8793 | echo " " ; | |
8794 | echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./"; | |
8795 | if $contains $type temp.E >/dev/null 2>&1; then | |
8796 | echo "$type found." >&4; | |
8797 | eval "$var=\$type"; | |
8798 | else | |
8799 | echo "$type NOT found." >&4; | |
8800 | dflt="$def"; | |
8801 | . ./myread ; | |
8802 | eval "$var=\$ans"; | |
8803 | fi; | |
8804 | $rm -f temp.?;; | |
8805 | *) eval "$var=\$varval";; | |
8806 | esac' | |
8807 | ||
8808 | : see what type lseek is declared as in the kernel | |
8809 | rp="What is the type used for lseek's offset on this system?" | |
8810 | set off_t lseektype long stdio.h sys/types.h | |
8811 | eval $typedef_ask | |
8812 | ||
8813 | echo " " | |
8814 | echo "Checking to see how big your file offsets are..." >&4 | |
8815 | $cat >try.c <<EOCP | |
8816 | #include <sys/types.h> | |
8817 | #include <stdio.h> | |
8818 | int main() | |
8819 | { | |
8820 | printf("%d\n", (int)sizeof($lseektype)); | |
8821 | return(0); | |
8822 | } | |
8823 | EOCP | |
8824 | set try | |
8825 | if eval $compile_ok; then | |
8826 | lseeksize=`$run ./try` | |
8827 | echo "Your file offsets are $lseeksize bytes long." | |
8828 | else | |
8829 | dflt=$longsize | |
8830 | echo " " | |
8831 | echo "(I can't seem to compile the test program. Guessing...)" | |
8832 | rp="What is the size of your file offsets (in bytes)?" | |
8833 | . ./myread | |
8834 | lseeksize="$ans" | |
8835 | fi | |
8836 | $rm -f try.c try | |
8837 | ||
8838 | : see what type file positions are declared as in the library | |
8839 | rp="What is the type for file position used by fsetpos()?" | |
8840 | set fpos_t fpostype long stdio.h sys/types.h | |
8841 | eval $typedef_ask | |
8842 | ||
8843 | echo " " | |
8844 | case "$fpostype" in | |
8845 | *_t) zzz="$fpostype" ;; | |
8846 | *) zzz="fpos_t" ;; | |
8847 | esac | |
8848 | echo "Checking the size of $zzz..." >&4 | |
8849 | cat > try.c <<EOCP | |
8850 | #include <sys/types.h> | |
8851 | #include <stdio.h> | |
5ed858ef JH |
8852 | #$i_stdlib I_STDLIB |
8853 | #ifdef I_STDLIB | |
8854 | #include <stdlib.h> | |
8855 | #endif | |
96056487 JH |
8856 | int main() { |
8857 | printf("%d\n", (int)sizeof($fpostype)); | |
8858 | exit(0); | |
8859 | } | |
8860 | EOCP | |
8861 | set try | |
8862 | if eval $compile_ok; then | |
8863 | yyy=`$run ./try` | |
8864 | case "$yyy" in | |
8865 | '') fpossize=4 | |
8866 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 | |
8867 | ;; | |
8868 | *) fpossize=$yyy | |
8869 | echo "Your $zzz is $fpossize bytes long." | |
8870 | ;; | |
8871 | esac | |
8872 | else | |
8873 | dflt="$longsize" | |
8874 | echo " " >&4 | |
8875 | echo "(I can't compile the test program. Guessing...)" >&4 | |
8876 | rp="What is the size of your file positions (in bytes)?" | |
8877 | . ./myread | |
8878 | fpossize="$ans" | |
8879 | fi | |
8880 | ||
96056487 JH |
8881 | # Backward compatibility (uselfs is deprecated). |
8882 | case "$uselfs" in | |
8883 | "$define"|true|[yY]*) | |
8884 | cat <<EOM >&4 | |
8885 | ||
8886 | *** Configure -Duselfs is deprecated, using -Duselargefiles instead. | |
8887 | EOM | |
8888 | uselargefiles="$define" | |
8889 | ;; | |
8890 | esac | |
8891 | ||
8892 | case "$lseeksize:$fpossize" in | |
8893 | 8:8) cat <<EOM | |
8894 | ||
8895 | You can have files larger than 2 gigabytes. | |
8896 | EOM | |
8897 | val="$define" ;; | |
8898 | *) case "$uselargefiles" in | |
8899 | "$undef"|false|[nN]*) dflt='n' ;; | |
8900 | *) dflt='y' ;; | |
8901 | esac | |
8902 | cat <<EOM | |
8903 | ||
8904 | Perl can be built to understand large files (files larger than 2 gigabytes) | |
8905 | on some systems. To do so, Configure can be run with -Duselargefiles. | |
8906 | ||
8907 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
8908 | EOM | |
8909 | rp='Try to understand large files, if available?' | |
8910 | . ./myread | |
8911 | case "$ans" in | |
8912 | y|Y) val="$define" ;; | |
8913 | *) val="$undef" ;; | |
8914 | esac | |
8915 | ;; | |
8916 | esac | |
8917 | set uselargefiles | |
8918 | eval $setvar | |
96056487 JH |
8919 | : Look for a hint-file generated 'call-back-unit'. If the |
8920 | : user has specified that a large files perl is to be built, | |
8921 | : we may need to set or change some other defaults. | |
6bd2d01f NC |
8922 | if $test -f uselargefiles.cbu; then |
8923 | echo "Your platform has some specific hints regarding large file builds, using them..." | |
8924 | . ./uselargefiles.cbu | |
8925 | fi | |
8926 | case "$uselargefiles" in | |
8927 | "$define") | |
96056487 | 8928 | if $test -f uselargefiles.cbu; then |
96056487 JH |
8929 | echo " " |
8930 | echo "Rechecking to see how big your file offsets are..." >&4 | |
8931 | $cat >try.c <<EOCP | |
8932 | #include <sys/types.h> | |
8933 | #include <stdio.h> | |
8934 | int main() | |
8935 | { | |
8936 | printf("%d\n", (int)sizeof($lseektype)); | |
8937 | return(0); | |
8938 | } | |
8939 | EOCP | |
8940 | set try | |
8941 | if eval $compile_ok; then | |
8942 | lseeksize=`$run ./try` | |
8943 | $echo "Your file offsets are now $lseeksize bytes long." | |
8944 | else | |
8945 | dflt="$lseeksize" | |
8946 | echo " " | |
8947 | echo "(I can't seem to compile the test program. Guessing...)" | |
8948 | rp="What is the size of your file offsets (in bytes)?" | |
8949 | . ./myread | |
8950 | lseeksize="$ans" | |
8951 | fi | |
8952 | case "$fpostype" in | |
8953 | *_t) zzz="$fpostype" ;; | |
8954 | *) zzz="fpos_t" ;; | |
8955 | esac | |
8956 | $echo $n "Rechecking the size of $zzz...$c" >&4 | |
8957 | $cat > try.c <<EOCP | |
8958 | #include <sys/types.h> | |
8959 | #include <stdio.h> | |
5a29c6bc JH |
8960 | #$i_stdlib I_STDLIB |
8961 | #ifdef I_STDLIB | |
8962 | #include <stdlib.h> | |
8963 | #endif | |
96056487 JH |
8964 | int main() { |
8965 | printf("%d\n", (int)sizeof($fpostype)); | |
c04fee9e | 8966 | return(0); |
96056487 JH |
8967 | } |
8968 | EOCP | |
8969 | set try | |
8970 | if eval $compile_ok; then | |
8971 | yyy=`$run ./try` | |
8972 | dflt="$lseeksize" | |
8973 | case "$yyy" in | |
8974 | '') echo " " | |
8975 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 | |
8976 | ;; | |
8977 | *) fpossize=$yyy | |
8978 | echo " $fpossize bytes." >&4 | |
8979 | ;; | |
8980 | esac | |
8981 | else | |
8982 | dflt="$fpossize" | |
8983 | echo " " | |
8984 | echo "(I can't compile the test program. Guessing...)" >&4 | |
8985 | rp="What is the size of your file positions (in bytes)?" | |
8986 | . ./myread | |
8987 | fpossize="$ans" | |
8988 | fi | |
8989 | $rm -f try.c try | |
8990 | fi | |
8991 | ;; | |
8992 | esac | |
8993 | ||
b4eb6b3d JH |
8994 | case "$vendorprefix" in |
8995 | '') d_vendorbin="$undef" | |
8996 | vendorbin='' | |
8997 | vendorbinexp='' | |
8998 | ;; | |
8999 | *) d_vendorbin="$define" | |
9000 | : determine where vendor-supplied executables go. | |
9001 | case "$vendorbin" in | |
9002 | '') dflt=$vendorprefix/bin ;; | |
9003 | *) dflt="$vendorbin" ;; | |
9004 | esac | |
9005 | fn=d~+ | |
9006 | rp='Pathname for the vendor-supplied executables directory?' | |
9007 | . ./getfile | |
9008 | vendorbin="$ans" | |
9009 | vendorbinexp="$ansexp" | |
9010 | ;; | |
9011 | esac | |
9012 | : Change installation prefix, if necessary. | |
9013 | if $test X"$prefix" != X"$installprefix"; then | |
9014 | installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"` | |
9015 | else | |
9016 | installvendorbin="$vendorbinexp" | |
9017 | fi | |
9018 | ||
6e1038e0 | 9019 | case "$vendorprefix" in |
3bb95762 JH |
9020 | '') vendorhtml1dir='' |
9021 | vendorhtml1direxp='' | |
6e1038e0 MB |
9022 | ;; |
9023 | *) : determine where vendor-supplied html pages go. | |
9024 | : There is no standard location, so try to copy the previously-selected | |
9025 | : directory structure for the core html pages. | |
9026 | : XXX Better default suggestions would be welcome. | |
3bb95762 | 9027 | case "$vendorhtml1dir" in |
6e1038e0 | 9028 | '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
3bb95762 | 9029 | *) dflt=$vendorhtml1dir ;; |
6e1038e0 MB |
9030 | esac |
9031 | case "$dflt" in | |
9032 | ''|' ') dflt=none ;; | |
9033 | esac | |
9034 | fn=dn+~ | |
9035 | rp='Pathname for the vendor-supplied html pages?' | |
9036 | . ./getfile | |
3bb95762 JH |
9037 | vendorhtml1dir="$ans" |
9038 | vendorhtml1direxp="$ansexp" | |
6e1038e0 MB |
9039 | ;; |
9040 | esac | |
9041 | : Use ' ' for none so value is preserved next time through Configure | |
3bb95762 | 9042 | $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' ' |
6e1038e0 MB |
9043 | : Change installation prefix, if necessary. |
9044 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 9045 | installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 9046 | else |
3bb95762 | 9047 | installvendorhtml1dir="$vendorhtml1direxp" |
6e1038e0 MB |
9048 | fi |
9049 | ||
9050 | case "$vendorprefix" in | |
3bb95762 JH |
9051 | '') vendorhtml3dir='' |
9052 | vendorhtml3direxp='' | |
6e1038e0 MB |
9053 | ;; |
9054 | *) : determine where vendor-supplied module html pages go. | |
9055 | : There is no standard location, so try to copy the previously-selected | |
9056 | : directory structure for the core html pages. | |
9057 | : XXX Better default suggestions would be welcome. | |
3bb95762 | 9058 | case "$vendorhtml3dir" in |
6e1038e0 | 9059 | '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
3bb95762 | 9060 | *) dflt=$vendorhtml3dir ;; |
6e1038e0 MB |
9061 | esac |
9062 | case "$dflt" in | |
9063 | ''|' ') dflt=none ;; | |
9064 | esac | |
9065 | fn=dn+~ | |
9066 | rp='Pathname for the vendor-supplied html pages?' | |
9067 | . ./getfile | |
3bb95762 JH |
9068 | vendorhtml3dir="$ans" |
9069 | vendorhtml3direxp="$ansexp" | |
6e1038e0 MB |
9070 | ;; |
9071 | esac | |
9072 | : Use ' ' for none so value is preserved next time through Configure | |
3bb95762 | 9073 | $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' ' |
6e1038e0 MB |
9074 | : Change installation prefix, if necessary. |
9075 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 9076 | installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 9077 | else |
3bb95762 | 9078 | installvendorhtml3dir="$vendorhtml3direxp" |
6e1038e0 MB |
9079 | fi |
9080 | ||
9081 | case "$vendorprefix" in | |
3bb95762 JH |
9082 | '') vendorman1dir='' |
9083 | vendorman1direxp='' | |
6e1038e0 MB |
9084 | ;; |
9085 | *) : determine where vendor-supplied manual pages go. | |
3bb95762 | 9086 | case "$vendorman1dir" in |
6e1038e0 | 9087 | '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
3bb95762 | 9088 | *) dflt=$vendorman1dir ;; |
6e1038e0 MB |
9089 | esac |
9090 | case "$dflt" in | |
9091 | ''|' ') dflt=none ;; | |
9092 | esac | |
9093 | fn=nd~+ | |
9094 | rp='Pathname for the vendor-supplied manual section 1 pages?' | |
9095 | . ./getfile | |
3bb95762 JH |
9096 | vendorman1dir="$ans" |
9097 | vendorman1direxp="$ansexp" | |
6e1038e0 MB |
9098 | ;; |
9099 | esac | |
9100 | : Use ' ' for none so value is preserved next time through Configure | |
3bb95762 | 9101 | $test X"$vendorman1dir" = "X" && vendorman1dir=' ' |
6e1038e0 MB |
9102 | : Change installation prefix, if necessary. |
9103 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 9104 | installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 9105 | else |
3bb95762 | 9106 | installvendorman1dir="$vendorman1direxp" |
6e1038e0 MB |
9107 | fi |
9108 | ||
9109 | case "$vendorprefix" in | |
3bb95762 JH |
9110 | '') vendorman3dir='' |
9111 | vendorman3direxp='' | |
6e1038e0 MB |
9112 | ;; |
9113 | *) : determine where vendor-supplied module manual pages go. | |
3bb95762 | 9114 | case "$vendorman3dir" in |
6e1038e0 | 9115 | '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;; |
3bb95762 | 9116 | *) dflt=$vendorman3dir ;; |
6e1038e0 MB |
9117 | esac |
9118 | case "$dflt" in | |
9119 | ''|' ') dflt=none ;; | |
9120 | esac | |
9121 | fn=nd~+ | |
9122 | rp='Pathname for the vendor-supplied manual section 3 pages?' | |
9123 | . ./getfile | |
3bb95762 JH |
9124 | vendorman3dir="$ans" |
9125 | vendorman3direxp="$ansexp" | |
6e1038e0 MB |
9126 | ;; |
9127 | esac | |
9128 | : Use ' ' for none so value is preserved next time through Configure | |
3bb95762 | 9129 | $test X"$vendorman3dir" = "X" && vendorman3dir=' ' |
6e1038e0 MB |
9130 | : Change installation prefix, if necessary. |
9131 | if $test X"$prefix" != X"$installprefix"; then | |
3bb95762 | 9132 | installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"` |
6e1038e0 | 9133 | else |
3bb95762 | 9134 | installvendorman3dir="$vendorman3direxp" |
6e1038e0 MB |
9135 | fi |
9136 | ||
9137 | case "$vendorprefix" in | |
9138 | '') d_vendorscript="$undef" | |
9139 | vendorscript='' | |
9140 | vendorscriptexp='' | |
9141 | ;; | |
9142 | *) d_vendorscript="$define" | |
9143 | : determine where vendor-supplied scripts go. | |
9144 | case "$vendorscript" in | |
9145 | '') dflt=$vendorprefix/script | |
9146 | $test -d $dflt || dflt=$vendorbin ;; | |
9147 | *) dflt="$vendorscript" ;; | |
9148 | esac | |
9149 | $cat <<EOM | |
9150 | ||
9151 | The installation process will create a directory for | |
9152 | vendor-supplied scripts. | |
9153 | ||
9154 | EOM | |
9155 | fn=d~+ | |
9156 | rp='Pathname for the vendor-supplied scripts directory?' | |
9157 | . ./getfile | |
9158 | vendorscript="$ans" | |
9159 | vendorscriptexp="$ansexp" | |
9160 | ;; | |
9161 | esac | |
9162 | : Change installation prefix, if necessary. | |
9163 | if $test X"$prefix" != X"$installprefix"; then | |
9164 | installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"` | |
9165 | else | |
5a29c6bc JH |
9166 | installvendorscript="$vendorscriptexp" |
9167 | fi | |
9168 | ||
9169 | : see if qgcvt exists | |
9170 | set qgcvt d_qgcvt | |
9171 | eval $inlibc | |
9172 | ||
9173 | echo " " | |
9174 | ||
9175 | if $test X"$d_longdbl" = X"$define"; then | |
9176 | ||
9177 | echo "Checking how to print long doubles..." >&4 | |
9178 | ||
9179 | if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then | |
9180 | $cat >try.c <<'EOCP' | |
9181 | #include <sys/types.h> | |
9182 | #include <stdio.h> | |
9183 | int main() { | |
9184 | double d = 123.456; | |
9185 | printf("%.3f\n", d); | |
9186 | } | |
9187 | EOCP | |
9188 | set try | |
9189 | if eval $compile; then | |
9190 | yyy=`$run ./try` | |
9191 | case "$yyy" in | |
9192 | 123.456) | |
9193 | sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; | |
9194 | sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"'; | |
9195 | echo "We will use %f." | |
9196 | ;; | |
9197 | esac | |
9198 | fi | |
9199 | fi | |
9200 | ||
9201 | if $test X"$sPRIfldbl" = X; then | |
9202 | $cat >try.c <<'EOCP' | |
9203 | #include <sys/types.h> | |
9204 | #include <stdio.h> | |
9205 | int main() { | |
9206 | long double d = 123.456; | |
9207 | printf("%.3Lf\n", d); | |
9208 | } | |
9209 | EOCP | |
9210 | set try | |
9211 | if eval $compile; then | |
9212 | yyy=`$run ./try` | |
9213 | case "$yyy" in | |
9214 | 123.456) | |
9215 | sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; | |
9216 | sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"'; | |
9217 | echo "We will use %Lf." | |
9218 | ;; | |
9219 | esac | |
9220 | fi | |
9221 | fi | |
9222 | ||
9223 | if $test X"$sPRIfldbl" = X; then | |
9224 | $cat >try.c <<'EOCP' | |
9225 | #include <sys/types.h> | |
9226 | #include <stdio.h> | |
9227 | int main() { | |
9228 | long double d = 123.456; | |
9229 | printf("%.3llf\n", d); | |
9230 | } | |
9231 | EOCP | |
9232 | set try | |
9233 | if eval $compile; then | |
9234 | yyy=`$run ./try` | |
9235 | case "$yyy" in | |
9236 | 123.456) | |
9237 | sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; | |
9238 | sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"'; | |
9239 | echo "We will use %llf." | |
9240 | ;; | |
9241 | esac | |
9242 | fi | |
9243 | fi | |
9244 | ||
9245 | if $test X"$sPRIfldbl" = X; then | |
9246 | $cat >try.c <<'EOCP' | |
9247 | #include <sys/types.h> | |
9248 | #include <stdio.h> | |
9249 | int main() { | |
9250 | long double d = 123.456; | |
9251 | printf("%.3lf\n", d); | |
9252 | } | |
9253 | EOCP | |
9254 | set try | |
9255 | if eval $compile; then | |
9256 | yyy=`$run ./try` | |
9257 | case "$yyy" in | |
9258 | 123.456) | |
9259 | sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; | |
9260 | sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"'; | |
9261 | echo "We will use %lf." | |
9262 | ;; | |
9263 | esac | |
9264 | fi | |
9265 | fi | |
9266 | ||
9267 | if $test X"$sPRIfldbl" = X; then | |
9268 | echo "Cannot figure out how to print long doubles." >&4 | |
9269 | else | |
9270 | sSCNfldbl=$sPRIfldbl # expect consistency | |
6e1038e0 MB |
9271 | fi |
9272 | ||
5a29c6bc JH |
9273 | $rm -f try try.* |
9274 | ||
9275 | fi # d_longdbl | |
9276 | ||
9277 | case "$sPRIfldbl" in | |
9278 | '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; | |
9279 | d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef"; | |
9280 | d_SCNfldbl="$undef"; | |
9281 | ;; | |
9282 | *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; | |
9283 | d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define"; | |
9284 | d_SCNfldbl="$define"; | |
9285 | ;; | |
9286 | esac | |
b4eb6b3d | 9287 | |
b4eb6b3d | 9288 | : Check how to convert floats to strings. |
a5b10d80 YST |
9289 | |
9290 | if test "X$d_Gconvert" = X; then | |
9291 | ||
b4eb6b3d JH |
9292 | echo " " |
9293 | echo "Checking for an efficient way to convert floats to strings." | |
9294 | echo " " > try.c | |
9295 | case "$uselongdouble" in | |
9296 | "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;; | |
9297 | esac | |
9298 | case "$d_longdbl" in | |
9299 | "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;; | |
9300 | esac | |
9301 | case "$d_PRIgldbl" in | |
9302 | "$define") echo "#define HAS_PRIgldbl" >>try.c ;; | |
9303 | esac | |
9304 | $cat >>try.c <<EOP | |
9305 | #ifdef TRY_gconvert | |
9306 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) | |
9307 | char *myname = "gconvert"; | |
9308 | #endif | |
9309 | #ifdef TRY_gcvt | |
9310 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) | |
9311 | char *myname = "gcvt"; | |
9312 | #endif | |
9313 | #ifdef TRY_qgcvt | |
9314 | #define Gconvert(x,n,t,b) qgcvt((x),(n),(b)) | |
9315 | char *myname = "qgcvt"; | |
9316 | #define DOUBLETYPE long double | |
9317 | #endif | |
9318 | #ifdef TRY_sprintf | |
a5b10d80 YST |
9319 | #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) |
9320 | #ifdef HAS_PRIgldbl | |
b4eb6b3d JH |
9321 | #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x)) |
9322 | #else | |
a5b10d80 YST |
9323 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x)) |
9324 | #endif | |
9325 | #else | |
b4eb6b3d JH |
9326 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) |
9327 | #endif | |
9328 | char *myname = "sprintf"; | |
9329 | #endif | |
9330 | ||
9331 | #ifndef DOUBLETYPE | |
9332 | #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) | |
9333 | #define DOUBLETYPE long double | |
9334 | #else | |
9335 | #define DOUBLETYPE double | |
9336 | #endif | |
9337 | #endif | |
9338 | ||
9339 | #include <stdio.h> | |
9340 | ||
9341 | #define I_STDLIB $i_stdlib | |
9342 | #ifdef I_STDLIB | |
9343 | #include <stdlib.h> | |
9344 | #endif | |
9345 | ||
9346 | int | |
9347 | checkit(expect, got) | |
9348 | char *expect; | |
9349 | char *got; | |
9350 | { | |
9351 | if (strcmp(expect, got)) { | |
9352 | printf("%s oddity: Expected %s, got %s\n", | |
9353 | myname, expect, got); | |
9354 | exit(1); | |
9355 | } | |
9356 | } | |
9357 | ||
9358 | int main() | |
9359 | { | |
9360 | char buf[64]; | |
9361 | buf[63] = '\0'; | |
9362 | ||
9363 | /* This must be 1st test on (which?) platform */ | |
9364 | /* Alan Burlison <AlanBurlsin@unn.unisys.com> */ | |
9365 | Gconvert((DOUBLETYPE)0.1, 8, 0, buf); | |
9366 | checkit("0.1", buf); | |
9367 | ||
a5b10d80 YST |
9368 | Gconvert((DOUBLETYPE)0.01, 8, 0, buf); |
9369 | checkit("0.01", buf); | |
9370 | ||
9371 | Gconvert((DOUBLETYPE)0.001, 8, 0, buf); | |
9372 | checkit("0.001", buf); | |
9373 | ||
9374 | Gconvert((DOUBLETYPE)0.0001, 8, 0, buf); | |
9375 | checkit("0.0001", buf); | |
9376 | ||
9377 | Gconvert((DOUBLETYPE)0.00009, 8, 0, buf); | |
9378 | if (strlen(buf) > 5) | |
9379 | checkit("9e-005", buf); /* for Microsoft ?? */ | |
9380 | else | |
9381 | checkit("9e-05", buf); | |
9382 | ||
b4eb6b3d JH |
9383 | Gconvert((DOUBLETYPE)1.0, 8, 0, buf); |
9384 | checkit("1", buf); | |
9385 | ||
9386 | Gconvert((DOUBLETYPE)1.1, 8, 0, buf); | |
9387 | checkit("1.1", buf); | |
9388 | ||
9389 | Gconvert((DOUBLETYPE)1.01, 8, 0, buf); | |
9390 | checkit("1.01", buf); | |
9391 | ||
9392 | Gconvert((DOUBLETYPE)1.001, 8, 0, buf); | |
9393 | checkit("1.001", buf); | |
9394 | ||
9395 | Gconvert((DOUBLETYPE)1.0001, 8, 0, buf); | |
9396 | checkit("1.0001", buf); | |
9397 | ||
9398 | Gconvert((DOUBLETYPE)1.00001, 8, 0, buf); | |
9399 | checkit("1.00001", buf); | |
9400 | ||
9401 | Gconvert((DOUBLETYPE)1.000001, 8, 0, buf); | |
9402 | checkit("1.000001", buf); | |
9403 | ||
9404 | Gconvert((DOUBLETYPE)0.0, 8, 0, buf); | |
9405 | checkit("0", buf); | |
9406 | ||
9407 | Gconvert((DOUBLETYPE)-1.0, 8, 0, buf); | |
9408 | checkit("-1", buf); | |
9409 | ||
9410 | /* Some Linux gcvt's give 1.e+5 here. */ | |
9411 | Gconvert((DOUBLETYPE)100000.0, 8, 0, buf); | |
9412 | checkit("100000", buf); | |
9413 | ||
9414 | /* Some Linux gcvt's give -1.e+5 here. */ | |
9415 | Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf); | |
9416 | checkit("-100000", buf); | |
9417 | ||
9418 | Gconvert((DOUBLETYPE)123.456, 8, 0, buf); | |
9419 | checkit("123.456", buf); | |
9420 | ||
ab6ca9f4 | 9421 | /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */ |
94b339ad YST |
9422 | Gconvert((DOUBLETYPE)1e34, 8, 0, buf); |
9423 | /* 34 should be enough to scare even long double | |
9424 | * places into using the e notation. */ | |
ab6ca9f4 | 9425 | if (strlen(buf) > 5) |
94b339ad | 9426 | checkit("1e+034", buf); /* for Microsoft */ |
ab6ca9f4 | 9427 | else |
94b339ad | 9428 | checkit("1e+34", buf); |
8e2a5ede | 9429 | |
d1eb8299 YST |
9430 | /* For Perl, if you add additional tests here, also add them to |
9431 | * t/base/num.t for benefit of platforms not using Configure or | |
9432 | * overriding d_Gconvert */ | |
9433 | ||
b4eb6b3d JH |
9434 | exit(0); |
9435 | } | |
9436 | EOP | |
ab6ca9f4 | 9437 | : first add preferred functions to our list |
a5b10d80 | 9438 | xxx_list="" |
ab6ca9f4 | 9439 | for xxx_convert in $gconvert_preference; do |
a5b10d80 YST |
9440 | case $xxx_convert in |
9441 | gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;; | |
ab6ca9f4 | 9442 | *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;; |
a5b10d80 YST |
9443 | esac |
9444 | done | |
9445 | : then add any others | |
9446 | for xxx_convert in gconvert gcvt sprintf; do | |
9447 | case "$xxx_list" in | |
9448 | *$xxx_convert*) ;; | |
9449 | *) xxx_list="$xxx_list $xxx_convert" ;; | |
9450 | esac | |
9451 | done | |
9452 | ||
9453 | case "$d_longdbl$uselongdouble" in | |
9454 | "$define$define") | |
9455 | : again, add prefered functions to our list first | |
9456 | xxx_ld_list="" | |
ab6ca9f4 | 9457 | for xxx_convert in $gconvert_ld_preference; do |
a5b10d80 YST |
9458 | case $xxx_convert in |
9459 | qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;; | |
ab6ca9f4 | 9460 | *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;; |
a5b10d80 YST |
9461 | esac |
9462 | done | |
9463 | : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt | |
9464 | for xxx_convert in qgcvt sprintf $xxx_list; do | |
9465 | case "$xxx_ld_list" in | |
9466 | $xxx_convert*|*" $xxx_convert"*) ;; | |
9467 | *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;; | |
9468 | esac | |
9469 | done | |
9470 | : if sprintf cannot do long doubles, move it to the end | |
9471 | if test "$d_PRIgldbl" != "$define"; then | |
9472 | xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf" | |
9473 | fi | |
9474 | : if no qgcvt, remove it | |
9475 | if test "$d_qgcvt" != "$define"; then | |
9476 | xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`" | |
9477 | fi | |
9478 | : use the ld_list | |
9479 | xxx_list="$xxx_ld_list" | |
b4eb6b3d JH |
9480 | ;; |
9481 | esac | |
9482 | ||
9483 | for xxx_convert in $xxx_list; do | |
9484 | echo "Trying $xxx_convert..." | |
9485 | $rm -f try try$_o | |
9486 | set try -DTRY_$xxx_convert | |
9487 | if eval $compile; then | |
9488 | echo "$xxx_convert() found." >&4 | |
5440bc8e | 9489 | if $run ./try; then |
b4eb6b3d JH |
9490 | echo "I'll use $xxx_convert to convert floats into a string." >&4 |
9491 | break; | |
9492 | else | |
9493 | echo "...But $xxx_convert didn't work as I expected." | |
a5b10d80 | 9494 | xxx_convert='' |
b4eb6b3d JH |
9495 | fi |
9496 | else | |
9497 | echo "$xxx_convert NOT found." >&4 | |
9498 | fi | |
9499 | done | |
ab6ca9f4 | 9500 | |
a5b10d80 YST |
9501 | if test X$xxx_convert = X; then |
9502 | echo "*** WHOA THERE!!! ***" >&4 | |
9503 | echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4 | |
9504 | xxx_convert=sprintf | |
9505 | fi | |
9506 | ||
b4eb6b3d JH |
9507 | case "$xxx_convert" in |
9508 | gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; | |
9509 | gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; | |
9510 | qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; | |
9511 | *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in | |
9512 | "$define$define$define") | |
9513 | d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;; | |
a5b10d80 YST |
9514 | "$define$define$undef") |
9515 | d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;; | |
b4eb6b3d JH |
9516 | *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; |
9517 | esac | |
9518 | ;; | |
9519 | esac | |
9520 | ||
a5b10d80 YST |
9521 | fi |
9522 | ||
74cac757 JH |
9523 | : see if _fwalk exists |
9524 | set fwalk d__fwalk | |
9525 | eval $inlibc | |
9526 | ||
b4eb6b3d JH |
9527 | : Initialize h_fcntl |
9528 | h_fcntl=false | |
9529 | ||
9530 | : Initialize h_sysfile | |
9531 | h_sysfile=false | |
9532 | ||
9533 | : access call always available on UNIX | |
9534 | set access d_access | |
9535 | eval $inlibc | |
9536 | ||
9537 | : locate the flags for 'access()' | |
9538 | case "$d_access" in | |
9539 | "$define") | |
9540 | echo " " | |
5a29c6bc | 9541 | $cat >access.c <<EOCP |
b4eb6b3d JH |
9542 | #include <sys/types.h> |
9543 | #ifdef I_FCNTL | |
9544 | #include <fcntl.h> | |
9545 | #endif | |
9546 | #ifdef I_SYS_FILE | |
9547 | #include <sys/file.h> | |
9548 | #endif | |
9549 | #ifdef I_UNISTD | |
9550 | #include <unistd.h> | |
9551 | #endif | |
5a29c6bc JH |
9552 | #$i_stdlib I_STDLIB |
9553 | #ifdef I_STDLIB | |
9554 | #include <stdlib.h> | |
9555 | #endif | |
b4eb6b3d JH |
9556 | int main() { |
9557 | exit(R_OK); | |
9558 | } | |
9559 | EOCP | |
9560 | : check sys/file.h first, no particular reason here | |
9561 | if $test `./findhdr sys/file.h` && \ | |
7a282f6d | 9562 | $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then |
b4eb6b3d JH |
9563 | h_sysfile=true; |
9564 | echo "<sys/file.h> defines the *_OK access constants." >&4 | |
9565 | elif $test `./findhdr fcntl.h` && \ | |
7a282f6d | 9566 | $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then |
b4eb6b3d JH |
9567 | h_fcntl=true; |
9568 | echo "<fcntl.h> defines the *_OK access constants." >&4 | |
9569 | elif $test `./findhdr unistd.h` && \ | |
7a282f6d | 9570 | $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then |
b4eb6b3d JH |
9571 | echo "<unistd.h> defines the *_OK access constants." >&4 |
9572 | else | |
9573 | echo "I can't find the four *_OK access constants--I'll use mine." >&4 | |
9574 | fi | |
9575 | ;; | |
9576 | esac | |
9577 | $rm -f access* | |
9578 | ||
9579 | : see if accessx exists | |
9580 | set accessx d_accessx | |
9581 | eval $inlibc | |
9582 | ||
5a29c6bc JH |
9583 | : see if aintl exists |
9584 | set aintl d_aintl | |
9585 | eval $inlibc | |
9586 | ||
b4eb6b3d JH |
9587 | : see if alarm exists |
9588 | set alarm d_alarm | |
9589 | eval $inlibc | |
9590 | ||
a9dade78 JH |
9591 | : see if POSIX threads are available |
9592 | set pthread.h i_pthread | |
9593 | eval $inhdr | |
9594 | ||
10bc17b6 JH |
9595 | : define a fucntion to check prototypes |
9596 | $cat > protochk <<EOSH | |
9597 | $startsh | |
9598 | cc="$cc" | |
9599 | optimize="$optimize" | |
9600 | ccflags="$ccflags" | |
9601 | prototype="$prototype" | |
9602 | define="$define" | |
9603 | rm=$rm | |
a9dade78 JH |
9604 | usethreads=$usethreads |
9605 | i_pthread=$i_pthread | |
9606 | pthread_h_first=$pthread_h_first | |
10bc17b6 JH |
9607 | EOSH |
9608 | ||
9609 | $cat >> protochk <<'EOSH' | |
9610 | ||
9611 | $rm -f try.c | |
9612 | foo="$1" | |
9613 | shift | |
9614 | while test $# -ge 2; do | |
9615 | case "$1" in | |
9616 | $define) echo "#include <$2>" >> try.c ;; | |
9617 | literal) echo "$2" >> try.c ;; | |
9618 | esac | |
cce6a207 MB |
9619 | # Extra magic for the benefit of systems that need pthread.h |
9620 | # to be included early to correctly detect threadsafe functions. | |
9621 | # Such functions must guarantee themselves, though, that the usethreads | |
9622 | # and i_pthread have been defined, before calling protochk. | |
9623 | if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then | |
9624 | echo "#include <pthread.h>" >> try.c | |
9625 | pthread_h_done=yes | |
9626 | fi | |
10bc17b6 JH |
9627 | shift 2 |
9628 | done | |
9629 | test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c | |
9630 | cat >> try.c <<'EOCP' | |
9631 | #ifdef CAN_PROTOTYPE | |
9632 | #define _(args) args | |
9633 | #else | |
9634 | #define _(args) () | |
9635 | #endif | |
9636 | EOCP | |
9637 | echo "$foo" >> try.c | |
9638 | echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c | |
9639 | $cc $optimize $ccflags -c try.c > /dev/null 2>&1 | |
9640 | status=$? | |
9641 | $rm -f try.[co] | |
9642 | exit $status | |
9643 | EOSH | |
9644 | chmod +x protochk | |
9645 | $eunicefix protochk | |
9646 | ||
5a29c6bc JH |
9647 | hasproto='varname=$1; func=$2; shift; shift; |
9648 | while $test $# -ge 2; do | |
9649 | case "$1" in | |
9650 | $define) echo "#include <$2>";; | |
9651 | esac ; | |
9652 | shift 2; | |
9653 | done > try.c; | |
9654 | $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null; | |
9655 | if $contains "$func.*(" tryout.c >/dev/null 2>&1; then | |
9656 | echo "$func() prototype found."; | |
9657 | val="$define"; | |
9658 | else | |
9659 | echo "$func() prototype NOT found."; | |
9660 | val="$undef"; | |
9661 | fi; | |
9662 | set $varname; | |
9663 | eval $setvar; | |
9664 | $rm -f try.c tryout.c' | |
9665 | ||
10bc17b6 JH |
9666 | : see if sys/types.h has to be included |
9667 | set sys/types.h i_systypes | |
9668 | eval $inhdr | |
9669 | ||
9670 | : see if sys/select.h has to be included | |
9671 | set sys/select.h i_sysselct | |
9672 | eval $inhdr | |
9673 | ||
9674 | hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; | |
9675 | while $test $# -ge 2; do | |
9676 | case "$1" in | |
9677 | $define) echo "#include <$2>";; | |
9678 | esac ; | |
9679 | shift 2; | |
9680 | done > try.c; | |
9681 | echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c; | |
9682 | set try; | |
9683 | if eval $compile; then | |
9684 | val="$define"; | |
9685 | else | |
9686 | val="$undef"; | |
9687 | fi; | |
9688 | set $varname; | |
9689 | eval $setvar; | |
9690 | $rm -f try.c try.o' | |
9691 | ||
9692 | : see if we should include time.h, sys/time.h, or both | |
9693 | echo " " | |
9694 | if test "X$timeincl" = X; then | |
9695 | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 | |
9696 | $echo $n "I'm now running the test program...$c" | |
5a29c6bc | 9697 | $cat >try.c <<EOCP |
10bc17b6 JH |
9698 | #include <sys/types.h> |
9699 | #ifdef I_TIME | |
9700 | #include <time.h> | |
9701 | #endif | |
9702 | #ifdef I_SYSTIME | |
9703 | #ifdef SYSTIMEKERNEL | |
9704 | #define KERNEL | |
9705 | #endif | |
9706 | #include <sys/time.h> | |
9707 | #endif | |
9708 | #ifdef I_SYSSELECT | |
9709 | #include <sys/select.h> | |
9710 | #endif | |
5a29c6bc JH |
9711 | #$i_stdlib I_STDLIB |
9712 | #ifdef I_STDLIB | |
9713 | #include <stdlib.h> | |
9714 | #endif | |
10bc17b6 JH |
9715 | int main() |
9716 | { | |
9717 | struct tm foo; | |
9718 | #ifdef S_TIMEVAL | |
9719 | struct timeval bar; | |
9720 | #endif | |
9721 | #ifdef S_TIMEZONE | |
9722 | struct timezone tzp; | |
9723 | #endif | |
9724 | if (foo.tm_sec == foo.tm_sec) | |
9725 | exit(0); | |
9726 | #ifdef S_TIMEVAL | |
9727 | if (bar.tv_sec == bar.tv_sec) | |
9728 | exit(0); | |
9729 | #endif | |
9730 | exit(1); | |
9731 | } | |
9732 | EOCP | |
9733 | flags='' | |
9734 | for s_timezone in '-DS_TIMEZONE' ''; do | |
9735 | sysselect='' | |
9736 | for s_timeval in '-DS_TIMEVAL' ''; do | |
9737 | for i_systimek in '' '-DSYSTIMEKERNEL'; do | |
9738 | for i_time in '' '-DI_TIME'; do | |
9739 | for i_systime in '-DI_SYSTIME' ''; do | |
9740 | case "$flags" in | |
9741 | '') $echo $n ".$c" | |
9742 | set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone | |
9743 | if eval $compile; then | |
9744 | set X $i_time $i_systime $i_systimek $sysselect $s_timeval | |
9745 | shift | |
9746 | flags="$*" | |
9747 | echo " " | |
9748 | $echo $n "Succeeded with $flags$c" | |
9749 | fi | |
9750 | ;; | |
9751 | esac | |
9752 | done | |
9753 | done | |
9754 | done | |
9755 | done | |
9756 | done | |
9757 | timeincl='' | |
9758 | echo " " | |
9759 | case "$flags" in | |
9760 | *SYSTIMEKERNEL*) i_systimek="$define" | |
9761 | timeincl=`./findhdr sys/time.h` | |
9762 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; | |
9763 | *) i_systimek="$undef";; | |
9764 | esac | |
9765 | case "$flags" in | |
9766 | *I_TIME*) i_time="$define" | |
9767 | timeincl=`./findhdr time.h`" $timeincl" | |
9768 | echo "We'll include <time.h>." >&4;; | |
9769 | *) i_time="$undef";; | |
9770 | esac | |
9771 | case "$flags" in | |
9772 | *I_SYSTIME*) i_systime="$define" | |
9773 | timeincl=`./findhdr sys/time.h`" $timeincl" | |
9774 | echo "We'll include <sys/time.h>." >&4;; | |
9775 | *) i_systime="$undef";; | |
9776 | esac | |
9777 | $rm -f try.c try | |
9778 | fi | |
9779 | : see if struct tm knows about tm_zone | |
9780 | case "$i_systime$i_time" in | |
9781 | *$define*) | |
9782 | echo " " | |
9783 | echo "Checking to see if your struct tm has tm_zone field..." >&4 | |
9784 | set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h | |
9785 | eval $hasfield | |
9786 | ;; | |
9787 | *) val="$undef" | |
9788 | set d_tm_tm_zone | |
9789 | eval $setvar | |
9790 | ;; | |
9791 | esac | |
9792 | case "$d_tm_tm_zone" in | |
9793 | "$define") echo "Yes, it does." ;; | |
9794 | *) echo "No, it doesn't." ;; | |
9795 | esac | |
9796 | : see if struct tm knows about tm_gmtoff | |
9797 | case "$i_systime$i_time" in | |
9798 | *$define*) | |
9799 | echo " " | |
9800 | echo "Checking to see if your struct tm has tm_gmtoff field..." >&4 | |
9801 | set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h | |
9802 | eval $hasfield | |
9803 | ;; | |
9804 | *) val="$undef" | |
9805 | set d_tm_tm_gmtoff | |
9806 | eval $setvar | |
9807 | ;; | |
9808 | esac | |
9809 | case "$d_tm_tm_gmtoff" in | |
9810 | "$define") echo "Yes, it does." ;; | |
9811 | *) echo "No, it doesn't." ;; | |
9812 | esac | |
9813 | ||
9814 | : see if asctime_r exists | |
9815 | set asctime_r d_asctime_r | |
9816 | eval $inlibc | |
9817 | case "$d_asctime_r" in | |
9818 | "$define") | |
d63eadf0 | 9819 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
c18e646a JH |
9820 | case "$d_asctime_r_proto:$usethreads" in |
9821 | ":define") d_asctime_r_proto=define | |
a48ec845 JH |
9822 | set d_asctime_r_proto asctime_r $hdrs |
9823 | eval $hasproto ;; | |
9824 | *) ;; | |
9825 | esac | |
9826 | case "$d_asctime_r_proto" in | |
9827 | define) | |
10bc17b6 JH |
9828 | case "$asctime_r_proto" in |
9829 | ''|0) try='char* asctime_r(const struct tm*, char*);' | |
9830 | ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;; | |
9831 | esac | |
9832 | case "$asctime_r_proto" in | |
9833 | ''|0) try='char* asctime_r(const struct tm*, char*, int);' | |
9834 | ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;; | |
9835 | esac | |
9836 | case "$asctime_r_proto" in | |
9837 | ''|0) try='int asctime_r(const struct tm*, char*);' | |
9838 | ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;; | |
9839 | esac | |
9840 | case "$asctime_r_proto" in | |
9841 | ''|0) try='int asctime_r(const struct tm*, char*, int);' | |
9842 | ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;; | |
9843 | esac | |
9844 | case "$asctime_r_proto" in | |
90e831dc | 9845 | ''|0) d_asctime_r=undef |
10bc17b6 | 9846 | asctime_r_proto=0 |
a48ec845 | 9847 | echo "Disabling asctime_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
9848 | * ) case "$asctime_r_proto" in |
9849 | REENTRANT_PROTO*) ;; | |
9850 | *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;; | |
9851 | esac | |
9852 | echo "Prototype: $try" ;; | |
9853 | esac | |
9854 | ;; | |
c18e646a JH |
9855 | *) case "$usethreads" in |
9856 | define) echo "asctime_r has no prototype, not using it." >&4 ;; | |
9857 | esac | |
90e831dc SB |
9858 | d_asctime_r=undef |
9859 | asctime_r_proto=0 | |
c18e646a | 9860 | ;; |
a48ec845 JH |
9861 | esac |
9862 | ;; | |
10bc17b6 JH |
9863 | *) asctime_r_proto=0 |
9864 | ;; | |
9865 | esac | |
9866 | ||
b4eb6b3d JH |
9867 | : see if atolf exists |
9868 | set atolf d_atolf | |
9869 | eval $inlibc | |
9870 | ||
9871 | : see if atoll exists | |
9872 | set atoll d_atoll | |
9873 | eval $inlibc | |
9874 | ||
9875 | : Look for GNU-cc style attribute checking | |
80512072 NC |
9876 | case "$d_attribut" in |
9877 | '') | |
b4eb6b3d JH |
9878 | echo " " |
9879 | echo "Checking whether your compiler can handle __attribute__ ..." >&4 | |
9880 | $cat >attrib.c <<'EOCP' | |
9881 | #include <stdio.h> | |
f7288ffb | 9882 | void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn)); |
b4eb6b3d JH |
9883 | EOCP |
9884 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then | |
9885 | if $contains 'warning' attrib.out >/dev/null 2>&1; then | |
9886 | echo "Your C compiler doesn't fully support __attribute__." | |
9887 | val="$undef" | |
9888 | else | |
9889 | echo "Your C compiler supports __attribute__." | |
9890 | val="$define" | |
9891 | fi | |
9892 | else | |
9893 | echo "Your C compiler doesn't seem to understand __attribute__ at all." | |
9894 | val="$undef" | |
9895 | fi | |
80512072 NC |
9896 | ;; |
9897 | *) val="$d_attribut" ;; | |
9898 | esac | |
b4eb6b3d JH |
9899 | set d_attribut |
9900 | eval $setvar | |
9901 | $rm -f attrib* | |
9902 | ||
9903 | : see if bcmp exists | |
9904 | set bcmp d_bcmp | |
9905 | eval $inlibc | |
9906 | ||
9907 | : see if bcopy exists | |
9908 | set bcopy d_bcopy | |
9909 | eval $inlibc | |
9910 | ||
9911 | : see if this is a unistd.h system | |
9912 | set unistd.h i_unistd | |
9913 | eval $inhdr | |
9914 | ||
9915 | : see if getpgrp exists | |
9916 | set getpgrp d_getpgrp | |
9917 | eval $inlibc | |
9918 | ||
9919 | case "$d_getpgrp" in | |
9920 | "$define") | |
9921 | echo " " | |
9922 | echo "Checking to see which flavor of getpgrp is in use..." | |
5440bc8e | 9923 | $cat >try.c <<EOP |
b4eb6b3d JH |
9924 | #$i_unistd I_UNISTD |
9925 | #include <sys/types.h> | |
9926 | #ifdef I_UNISTD | |
9927 | # include <unistd.h> | |
9928 | #endif | |
5a29c6bc JH |
9929 | #$i_stdlib I_STDLIB |
9930 | #ifdef I_STDLIB | |
9931 | #include <stdlib.h> | |
9932 | #endif | |
b4eb6b3d JH |
9933 | int main() |
9934 | { | |
9935 | if (getuid() == 0) { | |
9936 | printf("(I see you are running Configure as super-user...)\n"); | |
9937 | setuid(1); | |
9938 | } | |
9939 | #ifdef TRY_BSD_PGRP | |
9940 | if (getpgrp(1) == 0) | |
9941 | exit(0); | |
9942 | #else | |
9943 | if (getpgrp() > 0) | |
9944 | exit(0); | |
9945 | #endif | |
9946 | exit(1); | |
9947 | } | |
9948 | EOP | |
5440bc8e | 9949 | if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
b4eb6b3d JH |
9950 | echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 |
9951 | val="$define" | |
5440bc8e | 9952 | elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
b4eb6b3d JH |
9953 | echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 |
9954 | val="$undef" | |
9955 | else | |
9956 | echo "I can't seem to compile and run the test program." | |
9957 | if ./usg; then | |
9958 | xxx="a USG one, i.e. you use getpgrp()." | |
9959 | else | |
9960 | # SVR4 systems can appear rather BSD-ish. | |
9961 | case "$i_unistd" in | |
9962 | $undef) | |
9963 | xxx="a BSD one, i.e. you use getpgrp(pid)." | |
9964 | val="$define" | |
9965 | ;; | |
9966 | $define) | |
9967 | xxx="probably a USG one, i.e. you use getpgrp()." | |
9968 | val="$undef" | |
9969 | ;; | |
9970 | esac | |
9971 | fi | |
9972 | echo "Assuming your getpgrp is $xxx" >&4 | |
9973 | fi | |
9974 | ;; | |
9975 | *) val="$undef";; | |
9976 | esac | |
9977 | set d_bsdgetpgrp | |
9978 | eval $setvar | |
5440bc8e | 9979 | $rm -f try try.* |
b4eb6b3d JH |
9980 | |
9981 | : see if setpgrp exists | |
9982 | set setpgrp d_setpgrp | |
9983 | eval $inlibc | |
9984 | ||
9985 | case "$d_setpgrp" in | |
9986 | "$define") | |
9987 | echo " " | |
9988 | echo "Checking to see which flavor of setpgrp is in use..." | |
5440bc8e | 9989 | $cat >try.c <<EOP |
b4eb6b3d JH |
9990 | #$i_unistd I_UNISTD |
9991 | #include <sys/types.h> | |
9992 | #ifdef I_UNISTD | |
9993 | # include <unistd.h> | |
9994 | #endif | |
5a29c6bc JH |
9995 | #$i_stdlib I_STDLIB |
9996 | #ifdef I_STDLIB | |
9997 | #include <stdlib.h> | |
9998 | #endif | |
b4eb6b3d JH |
9999 | int main() |
10000 | { | |
10001 | if (getuid() == 0) { | |
10002 | printf("(I see you are running Configure as super-user...)\n"); | |
10003 | setuid(1); | |
10004 | } | |
10005 | #ifdef TRY_BSD_PGRP | |
10006 | if (-1 == setpgrp(1, 1)) | |
10007 | exit(0); | |
10008 | #else | |
10009 | if (setpgrp() != -1) | |
10010 | exit(0); | |
10011 | #endif | |
10012 | exit(1); | |
10013 | } | |
10014 | EOP | |
5440bc8e | 10015 | if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
b4eb6b3d JH |
10016 | echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 |
10017 | val="$define" | |
5440bc8e | 10018 | elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then |
b4eb6b3d JH |
10019 | echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 |
10020 | val="$undef" | |
10021 | else | |
10022 | echo "(I can't seem to compile and run the test program.)" | |
10023 | if ./usg; then | |
10024 | xxx="a USG one, i.e. you use setpgrp()." | |
10025 | else | |
10026 | # SVR4 systems can appear rather BSD-ish. | |
10027 | case "$i_unistd" in | |
10028 | $undef) | |
10029 | xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." | |
10030 | val="$define" | |
10031 | ;; | |
10032 | $define) | |
10033 | xxx="probably a USG one, i.e. you use setpgrp()." | |
10034 | val="$undef" | |
10035 | ;; | |
10036 | esac | |
10037 | fi | |
10038 | echo "Assuming your setpgrp is $xxx" >&4 | |
10039 | fi | |
10040 | ;; | |
10041 | *) val="$undef";; | |
10042 | esac | |
10043 | set d_bsdsetpgrp | |
10044 | eval $setvar | |
5440bc8e | 10045 | $rm -f try try.* |
b4eb6b3d JH |
10046 | : see if bzero exists |
10047 | set bzero d_bzero | |
10048 | eval $inlibc | |
10049 | ||
10050 | : see if signal is declared as pointer to function returning int or void | |
10051 | echo " " | |
10052 | xxx=`./findhdr signal.h` | |
10053 | $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null | |
10054 | if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
10055 | echo "You have int (*signal())() instead of void." >&4 | |
10056 | val="$undef" | |
10057 | elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
10058 | echo "You have void (*signal())()." >&4 | |
10059 | val="$define" | |
10060 | elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then | |
10061 | echo "You have int (*signal())() instead of void." >&4 | |
10062 | val="$undef" | |
10063 | elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then | |
10064 | echo "You have void (*signal())()." >&4 | |
10065 | val="$define" | |
10066 | else | |
10067 | case "$d_voidsig" in | |
10068 | '') | |
10069 | echo "I can't determine whether signal handler returns void or int..." >&4 | |
10070 | dflt=void | |
10071 | rp="What type does your signal handler return?" | |
10072 | . ./myread | |
10073 | case "$ans" in | |
10074 | v*) val="$define";; | |
10075 | *) val="$undef";; | |
10076 | esac;; | |
10077 | "$define") | |
10078 | echo "As you already told me, signal handler returns void." >&4 | |
10079 | val="$define" | |
10080 | ;; | |
10081 | *) echo "As you already told me, signal handler returns int." >&4 | |
10082 | val="$undef" | |
10083 | ;; | |
10084 | esac | |
10085 | fi | |
10086 | set d_voidsig | |
10087 | eval $setvar | |
10088 | case "$d_voidsig" in | |
10089 | "$define") signal_t="void";; | |
10090 | *) signal_t="int";; | |
10091 | esac | |
10092 | $rm -f $$.tmp | |
10093 | ||
10094 | : check for ability to cast large floats to 32-bit ints. | |
10095 | echo " " | |
10096 | echo 'Checking whether your C compiler can cast large floats to int32.' >&4 | |
10097 | if $test "$intsize" -ge 4; then | |
10098 | xxx=int | |
10099 | else | |
10100 | xxx=long | |
10101 | fi | |
10102 | $cat >try.c <<EOCP | |
10103 | #include <stdio.h> | |
5ed858ef JH |
10104 | #$i_stdlib I_STDLIB |
10105 | #ifdef I_STDLIB | |
10106 | #include <stdlib.h> | |
10107 | #endif | |
b4eb6b3d JH |
10108 | #include <sys/types.h> |
10109 | #include <signal.h> | |
10110 | $signal_t blech(s) int s; { exit(3); } | |
10111 | int main() | |
10112 | { | |
10113 | $xxx i32; | |
10114 | double f, g; | |
10115 | int result = 0; | |
10116 | char str[16]; | |
10117 | signal(SIGFPE, blech); | |
10118 | ||
10119 | /* Don't let compiler optimize the test away. Store the number | |
10120 | in a writable string for gcc to pass to sscanf under HP/UX. | |
10121 | */ | |
10122 | sprintf(str, "2147483647"); | |
10123 | sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */ | |
10124 | g = 10 * f; | |
10125 | i32 = ($xxx) g; | |
10126 | ||
10127 | /* x86 processors will probably give 0x8000 0000, which is a | |
7db0018a | 10128 | sign change. We don't want that. We want to mimic SPARC |
b4eb6b3d JH |
10129 | behavior here, which is to preserve the sign and give |
10130 | back 0x7fff ffff. | |
10131 | */ | |
10132 | if (i32 != ($xxx) f) | |
10133 | result |= 1; | |
10134 | exit(result); | |
10135 | } | |
10136 | EOCP | |
10137 | set try | |
10138 | if eval $compile_ok; then | |
5440bc8e | 10139 | $run ./try |
b4eb6b3d JH |
10140 | yyy=$? |
10141 | else | |
10142 | echo "(I can't seem to compile the test program--assuming it can't)" | |
10143 | yyy=1 | |
10144 | fi | |
10145 | case "$yyy" in | |
10146 | 0) val="$define" | |
10147 | echo "Yup, it can." | |
10148 | ;; | |
10149 | *) val="$undef" | |
10150 | echo "Nope, it can't." | |
10151 | ;; | |
10152 | esac | |
10153 | set d_casti32 | |
10154 | eval $setvar | |
10155 | $rm -f try try.* | |
10156 | ||
10157 | : check for ability to cast negative floats to unsigned | |
10158 | echo " " | |
10159 | echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 | |
10160 | $cat >try.c <<EOCP | |
10161 | #include <stdio.h> | |
5ed858ef JH |
10162 | #$i_stdlib I_STDLIB |
10163 | #ifdef I_STDLIB | |
10164 | #include <stdlib.h> | |
10165 | #endif | |
b4eb6b3d JH |
10166 | #include <sys/types.h> |
10167 | #include <signal.h> | |
10168 | $signal_t blech(s) int s; { exit(7); } | |
10169 | $signal_t blech_in_list(s) int s; { exit(4); } | |
10170 | unsigned long dummy_long(p) unsigned long p; { return p; } | |
10171 | unsigned int dummy_int(p) unsigned int p; { return p; } | |
10172 | unsigned short dummy_short(p) unsigned short p; { return p; } | |
10173 | int main() | |
10174 | { | |
10175 | double f; | |
10176 | unsigned long along; | |
10177 | unsigned int aint; | |
10178 | unsigned short ashort; | |
10179 | int result = 0; | |
10180 | char str[16]; | |
10181 | ||
10182 | /* Frustrate gcc-2.7.2's optimizer which failed this test with | |
10183 | a direct f = -123. assignment. gcc-2.8.0 reportedly | |
10184 | optimized the whole file away | |
10185 | */ | |
10186 | /* Store the number in a writable string for gcc to pass to | |
10187 | sscanf under HP/UX. | |
10188 | */ | |
10189 | sprintf(str, "-123"); | |
10190 | sscanf(str, "%lf", &f); /* f = -123.; */ | |
10191 | ||
10192 | signal(SIGFPE, blech); | |
10193 | along = (unsigned long)f; | |
10194 | aint = (unsigned int)f; | |
10195 | ashort = (unsigned short)f; | |
10196 | if (along != (unsigned long)-123) | |
10197 | result |= 1; | |
10198 | if (aint != (unsigned int)-123) | |
10199 | result |= 1; | |
10200 | if (ashort != (unsigned short)-123) | |
10201 | result |= 1; | |
10202 | sprintf(str, "1073741824."); | |
10203 | sscanf(str, "%lf", &f); /* f = (double)0x40000000; */ | |
10204 | f = f + f; | |
10205 | along = 0; | |
10206 | along = (unsigned long)f; | |
10207 | if (along != 0x80000000) | |
10208 | result |= 2; | |
10209 | f -= 1.; | |
10210 | along = 0; | |
10211 | along = (unsigned long)f; | |
10212 | if (along != 0x7fffffff) | |
10213 | result |= 1; | |
10214 | f += 2.; | |
10215 | along = 0; | |
10216 | along = (unsigned long)f; | |
10217 | if (along != 0x80000001) | |
10218 | result |= 2; | |
10219 | if (result) | |
10220 | exit(result); | |
10221 | signal(SIGFPE, blech_in_list); | |
10222 | sprintf(str, "123."); | |
10223 | sscanf(str, "%lf", &f); /* f = 123.; */ | |
10224 | along = dummy_long((unsigned long)f); | |
10225 | aint = dummy_int((unsigned int)f); | |
10226 | ashort = dummy_short((unsigned short)f); | |
10227 | if (along != (unsigned long)123) | |
10228 | result |= 4; | |
10229 | if (aint != (unsigned int)123) | |
10230 | result |= 4; | |
10231 | if (ashort != (unsigned short)123) | |
10232 | result |= 4; | |
10233 | exit(result); | |
10234 | ||
10235 | } | |
10236 | EOCP | |
10237 | set try | |
10238 | if eval $compile_ok; then | |
5440bc8e | 10239 | $run ./try |
b4eb6b3d JH |
10240 | castflags=$? |
10241 | else | |
10242 | echo "(I can't seem to compile the test program--assuming it can't)" | |
10243 | castflags=7 | |
10244 | fi | |
10245 | case "$castflags" in | |
10246 | 0) val="$define" | |
10247 | echo "Yup, it can." | |
10248 | ;; | |
10249 | *) val="$undef" | |
10250 | echo "Nope, it can't." | |
10251 | ;; | |
10252 | esac | |
10253 | set d_castneg | |
10254 | eval $setvar | |
10255 | $rm -f try.* | |
10256 | ||
10257 | : see if vprintf exists | |
10258 | echo " " | |
10259 | if set vprintf val -f d_vprintf; eval $csym; $val; then | |
10260 | echo 'vprintf() found.' >&4 | |
10261 | val="$define" | |
5a29c6bc | 10262 | $cat >try.c <<EOF |
b4eb6b3d | 10263 | #include <varargs.h> |
5a29c6bc JH |
10264 | #$i_stdlib I_STDLIB |
10265 | #ifdef I_STDLIB | |
10266 | #include <stdlib.h> | |
10267 | #endif | |
b4eb6b3d JH |
10268 | |
10269 | int main() { xxx("foo"); } | |
10270 | ||
10271 | xxx(va_alist) | |
10272 | va_dcl | |
10273 | { | |
10274 | va_list args; | |
10275 | char buf[10]; | |
10276 | ||
10277 | va_start(args); | |
10278 | exit((unsigned long)vsprintf(buf,"%s",args) > 10L); | |
10279 | } | |
10280 | EOF | |
5440bc8e JH |
10281 | set try |
10282 | if eval $compile && $run ./try; then | |
b4eb6b3d JH |
10283 | echo "Your vsprintf() returns (int)." >&4 |
10284 | val2="$undef" | |
10285 | else | |
10286 | echo "Your vsprintf() returns (char*)." >&4 | |
10287 | val2="$define" | |
10288 | fi | |
10289 | else | |
10290 | echo 'vprintf() NOT found.' >&4 | |
10291 | val="$undef" | |
10292 | val2="$undef" | |
10293 | fi | |
5440bc8e | 10294 | $rm -f try try.* |
b4eb6b3d JH |
10295 | set d_vprintf |
10296 | eval $setvar | |
10297 | val=$val2 | |
10298 | set d_charvspr | |
10299 | eval $setvar | |
10300 | ||
10301 | : see if chown exists | |
10302 | set chown d_chown | |
10303 | eval $inlibc | |
10304 | ||
10305 | : see if chroot exists | |
10306 | set chroot d_chroot | |
10307 | eval $inlibc | |
10308 | ||
10309 | : see if chsize exists | |
10310 | set chsize d_chsize | |
10311 | eval $inlibc | |
10312 | ||
758a5d79 JH |
10313 | : see if class exists |
10314 | set class d_class | |
10315 | eval $inlibc | |
10316 | ||
4e0554ec JH |
10317 | hasstruct='varname=$1; struct=$2; shift; shift; |
10318 | while $test $# -ge 2; do | |
10319 | case "$1" in | |
10320 | $define) echo "#include <$2>";; | |
10321 | esac ; | |
10322 | shift 2; | |
10323 | done > try.c; | |
10324 | echo "int main () { struct $struct foo; }" >> try.c; | |
10325 | set try; | |
10326 | if eval $compile; then | |
10327 | val="$define"; | |
10328 | else | |
10329 | val="$undef"; | |
10330 | fi; | |
10331 | set $varname; | |
10332 | eval $setvar; | |
10333 | $rm -f try.c try.o' | |
10334 | ||
4e0554ec JH |
10335 | socketlib='' |
10336 | sockethdr='' | |
10337 | : see whether socket exists | |
10338 | echo " " | |
10339 | $echo $n "Hmm... $c" >&4 | |
10340 | if set socket val -f d_socket; eval $csym; $val; then | |
10341 | echo "Looks like you have Berkeley networking support." >&4 | |
10342 | d_socket="$define" | |
10343 | if set setsockopt val -f; eval $csym; $val; then | |
10344 | d_oldsock="$undef" | |
10345 | else | |
10346 | echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4 | |
10347 | d_oldsock="$define" | |
10348 | fi | |
10349 | else | |
10350 | if $contains socklib libc.list >/dev/null 2>&1; then | |
10351 | echo "Looks like you have Berkeley networking support." >&4 | |
10352 | d_socket="$define" | |
10353 | : we will have to assume that it supports the 4.2 BSD interface | |
10354 | d_oldsock="$undef" | |
10355 | else | |
10356 | echo "You don't have Berkeley networking in libc$_a..." >&4 | |
10357 | if test "X$d_socket" = "X$define"; then | |
10358 | echo "...but you seem to believe that you have sockets." >&4 | |
10359 | else | |
10360 | for net in net socket | |
10361 | do | |
10362 | if test -f /usr/lib/lib$net$_a; then | |
10363 | ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \ | |
10364 | $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list | |
10365 | if $contains socket libc.list >/dev/null 2>&1; then | |
10366 | d_socket="$define" | |
10367 | socketlib="-l$net" | |
10368 | case "$net" in | |
10369 | net) | |
10370 | echo "...but the Wollongong group seems to have hacked it in." >&4 | |
10371 | sockethdr="-I/usr/netinclude" | |
10372 | ;; | |
10373 | esac | |
3c728e00 | 10374 | echo "Found Berkeley sockets interface in lib$net." >&4 |
4e0554ec JH |
10375 | if $contains setsockopt libc.list >/dev/null 2>&1; then |
10376 | d_oldsock="$undef" | |
10377 | else | |
10378 | echo "...using the old BSD 4.1c interface, rather than 4.2." >&4 | |
10379 | d_oldsock="$define" | |
10380 | fi | |
10381 | break | |
10382 | fi | |
10383 | fi | |
10384 | done | |
10385 | if test "X$d_socket" != "X$define"; then | |
10386 | echo "or anywhere else I see." >&4 | |
10387 | d_socket="$undef" | |
10388 | d_oldsock="$undef" | |
10389 | fi | |
10390 | fi | |
10391 | fi | |
10392 | fi | |
10393 | ||
10394 | : see if socketpair exists | |
10395 | set socketpair d_sockpair | |
10396 | eval $inlibc | |
10397 | ||
10398 | ||
10399 | echo " " | |
3c728e00 | 10400 | echo "Checking the availability of certain socket constants..." >&4 |
4e0554ec JH |
10401 | for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do |
10402 | enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` | |
10403 | $cat >try.c <<EOF | |
10404 | #include <sys/types.h> | |
10405 | #include <sys/socket.h> | |
10406 | int main() { | |
10407 | int i = $ENUM; | |
10408 | } | |
10409 | EOF | |
10410 | val="$undef" | |
10411 | set try; if eval $compile; then | |
10412 | val="$define" | |
10413 | fi | |
10414 | set d_${enum}; eval $setvar | |
10415 | $rm -f try.c try | |
10416 | done | |
10417 | ||
10418 | : see if this is a sys/uio.h system | |
10419 | set sys/uio.h i_sysuio | |
10420 | eval $inhdr | |
10421 | ||
10422 | ||
10423 | echo " " | |
10424 | echo "Checking to see if your system supports struct cmsghdr..." >&4 | |
10425 | set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h | |
10426 | eval $hasstruct | |
10427 | case "$d_cmsghdr_s" in | |
10428 | "$define") echo "Yes, it does." ;; | |
10429 | *) echo "No, it doesn't." ;; | |
10430 | esac | |
10431 | ||
10432 | ||
b4eb6b3d JH |
10433 | : check for const keyword |
10434 | echo " " | |
10435 | echo 'Checking to see if your C compiler knows about "const"...' >&4 | |
10436 | $cat >const.c <<'EOCP' | |
10437 | typedef struct spug { int drokk; } spug; | |
10438 | int main() | |
10439 | { | |
10440 | const char *foo; | |
10441 | const spug y; | |
10442 | } | |
10443 | EOCP | |
10444 | if $cc -c $ccflags const.c >/dev/null 2>&1 ; then | |
10445 | val="$define" | |
10446 | echo "Yup, it does." | |
10447 | else | |
10448 | val="$undef" | |
10449 | echo "Nope, it doesn't." | |
10450 | fi | |
10451 | set d_const | |
10452 | eval $setvar | |
10453 | ||
5a29c6bc JH |
10454 | : see if copysignl exists |
10455 | set copysignl d_copysignl | |
10456 | eval $inlibc | |
10457 | ||
b4eb6b3d JH |
10458 | : see if crypt exists |
10459 | echo " " | |
a5a94ea5 JH |
10460 | set crypt d_crypt |
10461 | eval $inlibc | |
10462 | case "$d_crypt" in | |
10463 | $define) cryptlib='' ;; | |
10464 | *) if set crypt val -f d_crypt; eval $csym; $val; then | |
10465 | echo 'crypt() found.' >&4 | |
b4eb6b3d | 10466 | val="$define" |
a5a94ea5 JH |
10467 | cryptlib='' |
10468 | else | |
10469 | cryptlib=`./loc Slibcrypt$_a "" $xlibpth` | |
10470 | if $test -z "$cryptlib"; then | |
10471 | cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` | |
10472 | else | |
10473 | cryptlib=-lcrypt | |
10474 | fi | |
10475 | if $test -z "$cryptlib"; then | |
10476 | cryptlib=`./loc Llibcrypt$_a "" $xlibpth` | |
10477 | else | |
10478 | cryptlib=-lcrypt | |
10479 | fi | |
10480 | if $test -z "$cryptlib"; then | |
10481 | cryptlib=`./loc libcrypt$_a "" $libpth` | |
10482 | else | |
10483 | cryptlib=-lcrypt | |
10484 | fi | |
10485 | if $test -z "$cryptlib"; then | |
10486 | echo 'crypt() NOT found.' >&4 | |
10487 | val="$undef" | |
10488 | else | |
10489 | val="$define" | |
10490 | fi | |
b4eb6b3d | 10491 | fi |
a5a94ea5 JH |
10492 | set d_crypt |
10493 | eval $setvar | |
10494 | ;; | |
10495 | esac | |
b4eb6b3d | 10496 | |
10bc17b6 JH |
10497 | : see if this is a crypt.h system |
10498 | set crypt.h i_crypt | |
10499 | eval $inhdr | |
10500 | ||
10501 | : see if crypt_r exists | |
10502 | set crypt_r d_crypt_r | |
10503 | eval $inlibc | |
10504 | case "$d_crypt_r" in | |
10505 | "$define") | |
10506 | hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h" | |
c18e646a JH |
10507 | case "$d_crypt_r_proto:$usethreads" in |
10508 | ":define") d_crypt_r_proto=define | |
a48ec845 JH |
10509 | set d_crypt_r_proto crypt_r $hdrs |
10510 | eval $hasproto ;; | |
10511 | *) ;; | |
10512 | esac | |
10513 | case "$d_crypt_r_proto" in | |
10514 | define) | |
10bc17b6 JH |
10515 | case "$crypt_r_proto" in |
10516 | ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);' | |
10517 | ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;; | |
10518 | esac | |
10519 | case "$crypt_r_proto" in | |
b430fd04 JH |
10520 | ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);' |
10521 | ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;; | |
10522 | esac | |
10523 | case "$crypt_r_proto" in | |
90e831dc | 10524 | ''|0) d_crypt_r=undef |
10bc17b6 | 10525 | crypt_r_proto=0 |
a48ec845 | 10526 | echo "Disabling crypt_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
10527 | * ) case "$crypt_r_proto" in |
10528 | REENTRANT_PROTO*) ;; | |
10529 | *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;; | |
10530 | esac | |
10531 | echo "Prototype: $try" ;; | |
10532 | esac | |
10533 | ;; | |
c18e646a JH |
10534 | *) case "$usethreads" in |
10535 | define) echo "crypt_r has no prototype, not using it." >&4 ;; | |
10536 | esac | |
90e831dc SB |
10537 | d_crypt_r=undef |
10538 | crypt_r_proto=0 | |
c18e646a | 10539 | ;; |
a48ec845 JH |
10540 | esac |
10541 | ;; | |
10bc17b6 JH |
10542 | *) crypt_r_proto=0 |
10543 | ;; | |
10544 | esac | |
10545 | ||
b4eb6b3d JH |
10546 | : get csh whereabouts |
10547 | case "$csh" in | |
10548 | 'csh') val="$undef" ;; | |
10549 | *) val="$define" ;; | |
10550 | esac | |
10551 | set d_csh | |
10552 | eval $setvar | |
10553 | : Respect a hint or command line value for full_csh. | |
10554 | case "$full_csh" in | |
10555 | '') full_csh=$csh ;; | |
10556 | esac | |
10557 | ||
10bc17b6 JH |
10558 | : see if ctermid_r exists |
10559 | set ctermid_r d_ctermid_r | |
10560 | eval $inlibc | |
10561 | case "$d_ctermid_r" in | |
10562 | "$define") | |
31ee0cb7 | 10563 | hdrs="$i_systypes sys/types.h define stdio.h " |
c18e646a JH |
10564 | case "$d_ctermid_r_proto:$usethreads" in |
10565 | ":define") d_ctermid_r_proto=define | |
a48ec845 JH |
10566 | set d_ctermid_r_proto ctermid_r $hdrs |
10567 | eval $hasproto ;; | |
10568 | *) ;; | |
10569 | esac | |
10570 | case "$d_ctermid_r_proto" in | |
10571 | define) | |
10bc17b6 JH |
10572 | case "$ctermid_r_proto" in |
10573 | ''|0) try='char* ctermid_r(char*);' | |
10574 | ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;; | |
10575 | esac | |
10576 | case "$ctermid_r_proto" in | |
90e831dc | 10577 | ''|0) d_ctermid_r=undef |
10bc17b6 | 10578 | ctermid_r_proto=0 |
a48ec845 | 10579 | echo "Disabling ctermid_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
10580 | * ) case "$ctermid_r_proto" in |
10581 | REENTRANT_PROTO*) ;; | |
10582 | *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;; | |
10583 | esac | |
10584 | echo "Prototype: $try" ;; | |
10585 | esac | |
10586 | ;; | |
c18e646a JH |
10587 | *) case "$usethreads" in |
10588 | define) echo "ctermid_r has no prototype, not using it." >&4 ;; | |
10589 | esac | |
90e831dc SB |
10590 | d_ctermid_r=undef |
10591 | ctermid_r_proto=0 | |
c18e646a | 10592 | ;; |
a48ec845 JH |
10593 | esac |
10594 | ;; | |
10bc17b6 JH |
10595 | *) ctermid_r_proto=0 |
10596 | ;; | |
10597 | esac | |
10598 | ||
10599 | : see if ctime_r exists | |
10600 | set ctime_r d_ctime_r | |
10601 | eval $inlibc | |
10602 | case "$d_ctime_r" in | |
10603 | "$define") | |
d63eadf0 | 10604 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
c18e646a JH |
10605 | case "$d_ctime_r_proto:$usethreads" in |
10606 | ":define") d_ctime_r_proto=define | |
a48ec845 JH |
10607 | set d_ctime_r_proto ctime_r $hdrs |
10608 | eval $hasproto ;; | |
10609 | *) ;; | |
10610 | esac | |
10611 | case "$d_ctime_r_proto" in | |
10612 | define) | |
10bc17b6 JH |
10613 | case "$ctime_r_proto" in |
10614 | ''|0) try='char* ctime_r(const time_t*, char*);' | |
10615 | ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;; | |
10616 | esac | |
10617 | case "$ctime_r_proto" in | |
10618 | ''|0) try='char* ctime_r(const time_t*, char*, int);' | |
10619 | ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;; | |
10620 | esac | |
10621 | case "$ctime_r_proto" in | |
10622 | ''|0) try='int ctime_r(const time_t*, char*);' | |
10623 | ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;; | |
10624 | esac | |
10625 | case "$ctime_r_proto" in | |
10626 | ''|0) try='int ctime_r(const time_t*, char*, int);' | |
10627 | ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;; | |
10628 | esac | |
10629 | case "$ctime_r_proto" in | |
90e831dc | 10630 | ''|0) d_ctime_r=undef |
10bc17b6 | 10631 | ctime_r_proto=0 |
a48ec845 | 10632 | echo "Disabling ctime_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
10633 | * ) case "$ctime_r_proto" in |
10634 | REENTRANT_PROTO*) ;; | |
10635 | *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;; | |
10636 | esac | |
10637 | echo "Prototype: $try" ;; | |
10638 | esac | |
10639 | ;; | |
c18e646a JH |
10640 | *) case "$usethreads" in |
10641 | define) echo "ctime_r has no prototype, not using it." >&4 ;; | |
10642 | esac | |
90e831dc SB |
10643 | d_ctime_r=undef |
10644 | ctime_r_proto=0 | |
c18e646a | 10645 | ;; |
a48ec845 JH |
10646 | esac |
10647 | ;; | |
10bc17b6 JH |
10648 | *) ctime_r_proto=0 |
10649 | ;; | |
10650 | esac | |
10651 | ||
b4eb6b3d JH |
10652 | : see if cuserid exists |
10653 | set cuserid d_cuserid | |
10654 | eval $inlibc | |
10655 | ||
10656 | : see if this is a limits.h system | |
10657 | set limits.h i_limits | |
10658 | eval $inhdr | |
10659 | ||
10660 | : see if this is a float.h system | |
10661 | set float.h i_float | |
10662 | eval $inhdr | |
10663 | ||
10664 | : See if number of significant digits in a double precision number is known | |
10665 | echo " " | |
10666 | $cat >dbl_dig.c <<EOM | |
10667 | #$i_limits I_LIMITS | |
10668 | #$i_float I_FLOAT | |
10669 | #ifdef I_LIMITS | |
10670 | #include <limits.h> | |
10671 | #endif | |
10672 | #ifdef I_FLOAT | |
10673 | #include <float.h> | |
10674 | #endif | |
10675 | #ifdef DBL_DIG | |
10676 | printf("Contains DBL_DIG"); | |
10677 | #endif | |
10678 | EOM | |
10679 | $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null | |
10680 | if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then | |
10681 | echo "DBL_DIG found." >&4 | |
10682 | val="$define" | |
10683 | else | |
10684 | echo "DBL_DIG NOT found." >&4 | |
10685 | val="$undef" | |
10686 | fi | |
10687 | $rm -f dbl_dig.? | |
10688 | set d_dbl_dig | |
10689 | eval $setvar | |
10690 | ||
2ef53570 JH |
10691 | : see if dbm.h is available |
10692 | : see if dbmclose exists | |
10693 | set dbmclose d_dbmclose | |
10694 | eval $inlibc | |
10695 | ||
10696 | case "$d_dbmclose" in | |
10697 | $define) | |
10698 | set dbm.h i_dbm | |
10699 | eval $inhdr | |
10700 | case "$i_dbm" in | |
10701 | $define) | |
10702 | val="$undef" | |
10703 | set i_rpcsvcdbm | |
10704 | eval $setvar | |
10705 | ;; | |
10706 | *) set rpcsvc/dbm.h i_rpcsvcdbm | |
10707 | eval $inhdr | |
10708 | ;; | |
10709 | esac | |
10710 | ;; | |
10711 | *) echo "We won't be including <dbm.h>" | |
10712 | val="$undef" | |
10713 | set i_dbm | |
10714 | eval $setvar | |
10715 | val="$undef" | |
10716 | set i_rpcsvcdbm | |
10717 | eval $setvar | |
10718 | ;; | |
10719 | esac | |
10720 | ||
10721 | : see if prototype for dbminit is available | |
10722 | echo " " | |
10723 | set d_dbminitproto dbminit $i_dbm dbm.h | |
10724 | eval $hasproto | |
10725 | ||
b4eb6b3d JH |
10726 | : see if difftime exists |
10727 | set difftime d_difftime | |
10728 | eval $inlibc | |
10729 | ||
10730 | : see if this is a dirent system | |
10731 | echo " " | |
10732 | if xinc=`./findhdr dirent.h`; $test "$xinc"; then | |
10733 | val="$define" | |
10734 | echo "<dirent.h> found." >&4 | |
10735 | else | |
10736 | val="$undef" | |
10737 | if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then | |
10738 | echo "<sys/dir.h> found." >&4 | |
10739 | echo " " | |
10740 | else | |
10741 | xinc=`./findhdr sys/ndir.h` | |
10742 | fi | |
10743 | echo "<dirent.h> NOT found." >&4 | |
10744 | fi | |
10745 | set i_dirent | |
10746 | eval $setvar | |
10747 | ||
10748 | : Look for type of directory structure. | |
10749 | echo " " | |
10750 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
10751 | ||
10752 | case "$direntrytype" in | |
10753 | ''|' ') | |
10754 | case "$i_dirent" in | |
10755 | $define) guess1='struct dirent' ;; | |
10756 | *) guess1='struct direct' ;; | |
10757 | esac | |
10758 | ;; | |
10759 | *) guess1="$direntrytype" | |
10760 | ;; | |
10761 | esac | |
10762 | ||
10763 | case "$guess1" in | |
10764 | 'struct dirent') guess2='struct direct' ;; | |
10765 | *) guess2='struct dirent' ;; | |
10766 | esac | |
10767 | ||
10768 | if $contains "$guess1" try.c >/dev/null 2>&1; then | |
10769 | direntrytype="$guess1" | |
10770 | echo "Your directory entries are $direntrytype." >&4 | |
10771 | elif $contains "$guess2" try.c >/dev/null 2>&1; then | |
10772 | direntrytype="$guess2" | |
10773 | echo "Your directory entries seem to be $direntrytype." >&4 | |
10774 | else | |
10775 | echo "I don't recognize your system's directory entries." >&4 | |
10776 | rp="What type is used for directory entries on this system?" | |
10777 | dflt="$guess1" | |
10778 | . ./myread | |
10779 | direntrytype="$ans" | |
10780 | fi | |
10781 | $rm -f try.c | |
10782 | ||
10783 | ||
10784 | : see if the directory entry stores field length | |
10785 | echo " " | |
10786 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
10787 | if $contains 'd_namlen' try.c >/dev/null 2>&1; then | |
10788 | echo "Good, your directory entry keeps length information in d_namlen." >&4 | |
10789 | val="$define" | |
10790 | else | |
10791 | echo "Your directory entry does not know about the d_namlen field." >&4 | |
10792 | val="$undef" | |
10793 | fi | |
10794 | set d_dirnamlen | |
10795 | eval $setvar | |
10796 | $rm -f try.c | |
10797 | ||
ae0e3d3b JH |
10798 | : see if this is an sysdir system |
10799 | set sys/dir.h i_sysdir | |
10800 | eval $inhdr | |
10801 | ||
10802 | : see if this is an sysndir system | |
10803 | set sys/ndir.h i_sysndir | |
10804 | eval $inhdr | |
10805 | ||
10806 | : Look for dirfd | |
10807 | echo " " | |
10808 | $cat >dirfd.c <<EOM | |
10809 | #include <stdio.h> | |
5a29c6bc JH |
10810 | #$i_stdlib I_STDLIB |
10811 | #ifdef I_STDLIB | |
10812 | #include <stdlib.h> | |
10813 | #endif | |
ae0e3d3b JH |
10814 | #$i_dirent I_DIRENT /**/ |
10815 | #$i_sysdir I_SYS_DIR /**/ | |
10816 | #$i_sysndir I_SYS_NDIR /**/ | |
10817 | #$i_systypes I_SYS_TYPES /**/ | |
10818 | #if defined(I_SYS_TYPES) | |
10819 | #include <sys/types.h> | |
10820 | #endif | |
10821 | #if defined(I_DIRENT) | |
10822 | #include <dirent.h> | |
10823 | #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ | |
10824 | #include <sys/dir.h> | |
10825 | #endif | |
10826 | #else | |
10827 | #ifdef I_SYS_NDIR | |
10828 | #include <sys/ndir.h> | |
10829 | #else | |
10830 | #ifdef I_SYS_DIR | |
10831 | #ifdef hp9000s500 | |
10832 | #include <ndir.h> /* may be wrong in the future */ | |
10833 | #else | |
10834 | #include <sys/dir.h> | |
10835 | #endif | |
10836 | #endif | |
10837 | #endif | |
10838 | #endif | |
10839 | int main() { | |
10840 | DIR *dirp = opendir("."); | |
10841 | if (dirfd(dirp) >= 0) | |
10842 | exit(0); | |
10843 | else | |
10844 | exit(1); | |
10845 | } | |
10846 | EOM | |
10847 | set dirfd | |
10848 | if eval $compile; then | |
10849 | val="$define" | |
10850 | fi | |
10851 | case "$val" in | |
10852 | $define) echo "dirfd() found." >&4 ;; | |
10853 | *) echo "dirfd() NOT found." >&4 ;; | |
10854 | esac | |
10855 | set d_dirfd | |
10856 | eval $setvar | |
10857 | $rm -f dirfd* | |
10858 | ||
b4eb6b3d JH |
10859 | : see if dlerror exists |
10860 | xxx_runnm="$runnm" | |
10861 | runnm=false | |
10862 | set dlerror d_dlerror | |
10863 | eval $inlibc | |
10864 | runnm="$xxx_runnm" | |
10865 | ||
10866 | : see if dlfcn is available | |
10867 | set dlfcn.h i_dlfcn | |
10868 | eval $inhdr | |
10869 | ||
10870 | case "$usedl" in | |
10871 | $define|y|true) | |
10872 | $cat << EOM | |
10873 | ||
10874 | On a few systems, the dynamically loaded modules that perl generates and uses | |
10875 | will need a different extension than shared libs. The default will probably | |
10876 | be appropriate. | |
10877 | ||
10878 | EOM | |
10879 | case "$dlext" in | |
10880 | '') dflt="$so" ;; | |
10881 | *) dflt="$dlext" ;; | |
10882 | esac | |
10883 | rp='What is the extension of dynamically loaded modules' | |
10884 | . ./myread | |
10885 | dlext="$ans" | |
10886 | ;; | |
10887 | *) | |
10888 | dlext="none" | |
10889 | ;; | |
10890 | esac | |
10891 | ||
10892 | : Check if dlsym need a leading underscore | |
10893 | echo " " | |
10894 | val="$undef" | |
10895 | ||
10896 | case "$dlsrc" in | |
10897 | dl_dlopen.xs) | |
10898 | echo "Checking whether your dlsym() needs a leading underscore ..." >&4 | |
10899 | $cat >dyna.c <<'EOM' | |
10900 | fred () { } | |
10901 | EOM | |
10902 | ||
10903 | $cat >fred.c<<EOM | |
10904 | ||
10905 | #include <stdio.h> | |
5a29c6bc JH |
10906 | #$i_stdlib I_STDLIB |
10907 | #ifdef I_STDLIB | |
10908 | #include <stdlib.h> | |
10909 | #endif | |
b4eb6b3d JH |
10910 | #$i_dlfcn I_DLFCN |
10911 | #ifdef I_DLFCN | |
5440bc8e | 10912 | #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */ |
b4eb6b3d JH |
10913 | #else |
10914 | #include <sys/types.h> | |
10915 | #include <nlist.h> | |
10916 | #include <link.h> | |
10917 | #endif | |
10918 | ||
10919 | extern int fred() ; | |
10920 | ||
10921 | int main() | |
10922 | { | |
10923 | void * handle ; | |
10924 | void * symbol ; | |
10925 | #ifndef RTLD_LAZY | |
10926 | int mode = 1 ; | |
10927 | #else | |
10928 | int mode = RTLD_LAZY ; | |
10929 | #endif | |
10930 | handle = dlopen("./dyna.$dlext", mode) ; | |
10931 | if (handle == NULL) { | |
10932 | printf ("1\n") ; | |
10933 | fflush (stdout) ; | |
10934 | exit(0); | |
10935 | } | |
10936 | symbol = dlsym(handle, "fred") ; | |
10937 | if (symbol == NULL) { | |
10938 | /* try putting a leading underscore */ | |
10939 | symbol = dlsym(handle, "_fred") ; | |
10940 | if (symbol == NULL) { | |
10941 | printf ("2\n") ; | |
10942 | fflush (stdout) ; | |
10943 | exit(0); | |
10944 | } | |
10945 | printf ("3\n") ; | |
10946 | } | |
10947 | else | |
10948 | printf ("4\n") ; | |
10949 | fflush (stdout) ; | |
10950 | exit(0); | |
10951 | } | |
10952 | EOM | |
10953 | : Call the object file tmp-dyna.o in case dlext=o. | |
10954 | if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && | |
10955 | mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && | |
e4778687 | 10956 | $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 && |
5440bc8e JH |
10957 | $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then |
10958 | xxx=`$run ./fred` | |
b4eb6b3d JH |
10959 | case $xxx in |
10960 | 1) echo "Test program failed using dlopen." >&4 | |
10961 | echo "Perhaps you should not use dynamic loading." >&4;; | |
10962 | 2) echo "Test program failed using dlsym." >&4 | |
10963 | echo "Perhaps you should not use dynamic loading." >&4;; | |
10964 | 3) echo "dlsym needs a leading underscore" >&4 | |
10965 | val="$define" ;; | |
10966 | 4) echo "dlsym doesn't need a leading underscore." >&4;; | |
10967 | esac | |
10968 | else | |
10969 | echo "I can't compile and run the test program." >&4 | |
10970 | echo "I'm guessing that dlsym doesn't need a leading underscore." >&4 | |
10971 | fi | |
10972 | ;; | |
10973 | esac | |
10974 | ||
3c728e00 | 10975 | $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.* |
b4eb6b3d JH |
10976 | |
10977 | set d_dlsymun | |
10978 | eval $setvar | |
10979 | ||
10bc17b6 JH |
10980 | : see if drand48_r exists |
10981 | set drand48_r d_drand48_r | |
10982 | eval $inlibc | |
10983 | case "$d_drand48_r" in | |
10984 | "$define") | |
10985 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" | |
c18e646a JH |
10986 | case "$d_drand48_r_proto:$usethreads" in |
10987 | ":define") d_drand48_r_proto=define | |
a48ec845 JH |
10988 | set d_drand48_r_proto drand48_r $hdrs |
10989 | eval $hasproto ;; | |
10990 | *) ;; | |
10991 | esac | |
10992 | case "$d_drand48_r_proto" in | |
10993 | define) | |
10bc17b6 JH |
10994 | case "$drand48_r_proto" in |
10995 | ''|0) try='int drand48_r(struct drand48_data*, double*);' | |
10996 | ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;; | |
10997 | esac | |
10998 | case "$drand48_r_proto" in | |
90e831dc | 10999 | ''|0) d_drand48_r=undef |
10bc17b6 | 11000 | drand48_r_proto=0 |
a48ec845 | 11001 | echo "Disabling drand48_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11002 | * ) case "$drand48_r_proto" in |
11003 | REENTRANT_PROTO*) ;; | |
11004 | *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;; | |
11005 | esac | |
11006 | echo "Prototype: $try" ;; | |
11007 | esac | |
11008 | ;; | |
c18e646a JH |
11009 | *) case "$usethreads" in |
11010 | define) echo "drand48_r has no prototype, not using it." >&4 ;; | |
11011 | esac | |
90e831dc SB |
11012 | d_drand48_r=undef |
11013 | drand48_r_proto=0 | |
c18e646a | 11014 | ;; |
a48ec845 JH |
11015 | esac |
11016 | ;; | |
10bc17b6 JH |
11017 | *) drand48_r_proto=0 |
11018 | ;; | |
11019 | esac | |
11020 | ||
11021 | : see if prototype for drand48 is available | |
11022 | echo " " | |
11023 | set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h | |
11024 | eval $hasproto | |
11025 | ||
b4eb6b3d JH |
11026 | : see if dup2 exists |
11027 | set dup2 d_dup2 | |
11028 | eval $inlibc | |
11029 | ||
11030 | : see if eaccess exists | |
11031 | set eaccess d_eaccess | |
11032 | eval $inlibc | |
11033 | ||
11034 | : see if endgrent exists | |
11035 | set endgrent d_endgrent | |
11036 | eval $inlibc | |
11037 | ||
10bc17b6 JH |
11038 | : see if this is an grp system |
11039 | set grp.h i_grp | |
11040 | eval $inhdr | |
11041 | ||
11042 | case "$i_grp" in | |
11043 | $define) | |
11044 | xxx=`./findhdr grp.h` | |
11045 | $cppstdin $cppflags $cppminus < $xxx >$$.h | |
11046 | ||
11047 | if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then | |
11048 | val="$define" | |
11049 | else | |
11050 | val="$undef" | |
11051 | fi | |
11052 | set d_grpasswd | |
11053 | eval $setvar | |
11054 | ||
11055 | $rm -f $$.h | |
11056 | ;; | |
11057 | *) | |
11058 | val="$undef"; | |
11059 | set d_grpasswd; eval $setvar | |
11060 | ;; | |
11061 | esac | |
11062 | ||
11063 | : see if endgrent_r exists | |
11064 | set endgrent_r d_endgrent_r | |
11065 | eval $inlibc | |
11066 | case "$d_endgrent_r" in | |
11067 | "$define") | |
11068 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" | |
c18e646a JH |
11069 | case "$d_endgrent_r_proto:$usethreads" in |
11070 | ":define") d_endgrent_r_proto=define | |
a48ec845 JH |
11071 | set d_endgrent_r_proto endgrent_r $hdrs |
11072 | eval $hasproto ;; | |
11073 | *) ;; | |
11074 | esac | |
11075 | case "$d_endgrent_r_proto" in | |
11076 | define) | |
10bc17b6 JH |
11077 | case "$endgrent_r_proto" in |
11078 | ''|0) try='int endgrent_r(FILE**);' | |
11079 | ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;; | |
11080 | esac | |
11081 | case "$endgrent_r_proto" in | |
11082 | ''|0) try='void endgrent_r(FILE**);' | |
11083 | ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;; | |
11084 | esac | |
11085 | case "$endgrent_r_proto" in | |
90e831dc | 11086 | ''|0) d_endgrent_r=undef |
10bc17b6 | 11087 | endgrent_r_proto=0 |
a48ec845 | 11088 | echo "Disabling endgrent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11089 | * ) case "$endgrent_r_proto" in |
11090 | REENTRANT_PROTO*) ;; | |
11091 | *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;; | |
11092 | esac | |
11093 | echo "Prototype: $try" ;; | |
11094 | esac | |
11095 | ;; | |
c18e646a JH |
11096 | *) case "$usethreads" in |
11097 | define) echo "endgrent_r has no prototype, not using it." >&4 ;; | |
11098 | esac | |
90e831dc SB |
11099 | d_endgrent_r=undef |
11100 | endgrent_r_proto=0 | |
c18e646a | 11101 | ;; |
a48ec845 JH |
11102 | esac |
11103 | ;; | |
10bc17b6 JH |
11104 | *) endgrent_r_proto=0 |
11105 | ;; | |
11106 | esac | |
11107 | ||
b4eb6b3d JH |
11108 | : see if endhostent exists |
11109 | set endhostent d_endhent | |
11110 | eval $inlibc | |
11111 | ||
10bc17b6 JH |
11112 | : see if this is a netdb.h system |
11113 | set netdb.h i_netdb | |
11114 | eval $inhdr | |
11115 | ||
11116 | : see if endhostent_r exists | |
11117 | set endhostent_r d_endhostent_r | |
11118 | eval $inlibc | |
11119 | case "$d_endhostent_r" in | |
11120 | "$define") | |
11121 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
11122 | case "$d_endhostent_r_proto:$usethreads" in |
11123 | ":define") d_endhostent_r_proto=define | |
a48ec845 JH |
11124 | set d_endhostent_r_proto endhostent_r $hdrs |
11125 | eval $hasproto ;; | |
11126 | *) ;; | |
11127 | esac | |
11128 | case "$d_endhostent_r_proto" in | |
11129 | define) | |
10bc17b6 JH |
11130 | case "$endhostent_r_proto" in |
11131 | ''|0) try='int endhostent_r(struct hostent_data*);' | |
31ee0cb7 | 11132 | ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;; |
10bc17b6 JH |
11133 | esac |
11134 | case "$endhostent_r_proto" in | |
11135 | ''|0) try='void endhostent_r(struct hostent_data*);' | |
31ee0cb7 | 11136 | ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;; |
10bc17b6 JH |
11137 | esac |
11138 | case "$endhostent_r_proto" in | |
90e831dc | 11139 | ''|0) d_endhostent_r=undef |
10bc17b6 | 11140 | endhostent_r_proto=0 |
a48ec845 | 11141 | echo "Disabling endhostent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11142 | * ) case "$endhostent_r_proto" in |
11143 | REENTRANT_PROTO*) ;; | |
11144 | *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;; | |
11145 | esac | |
11146 | echo "Prototype: $try" ;; | |
11147 | esac | |
11148 | ;; | |
c18e646a JH |
11149 | *) case "$usethreads" in |
11150 | define) echo "endhostent_r has no prototype, not using it." >&4 ;; | |
11151 | esac | |
90e831dc SB |
11152 | d_endhostent_r=undef |
11153 | endhostent_r_proto=0 | |
c18e646a | 11154 | ;; |
a48ec845 JH |
11155 | esac |
11156 | ;; | |
10bc17b6 JH |
11157 | *) endhostent_r_proto=0 |
11158 | ;; | |
11159 | esac | |
11160 | ||
b4eb6b3d JH |
11161 | : see if endnetent exists |
11162 | set endnetent d_endnent | |
11163 | eval $inlibc | |
11164 | ||
10bc17b6 JH |
11165 | : see if endnetent_r exists |
11166 | set endnetent_r d_endnetent_r | |
11167 | eval $inlibc | |
11168 | case "$d_endnetent_r" in | |
11169 | "$define") | |
11170 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
11171 | case "$d_endnetent_r_proto:$usethreads" in |
11172 | ":define") d_endnetent_r_proto=define | |
a48ec845 JH |
11173 | set d_endnetent_r_proto endnetent_r $hdrs |
11174 | eval $hasproto ;; | |
11175 | *) ;; | |
11176 | esac | |
11177 | case "$d_endnetent_r_proto" in | |
11178 | define) | |
10bc17b6 JH |
11179 | case "$endnetent_r_proto" in |
11180 | ''|0) try='int endnetent_r(struct netent_data*);' | |
31ee0cb7 | 11181 | ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;; |
10bc17b6 JH |
11182 | esac |
11183 | case "$endnetent_r_proto" in | |
11184 | ''|0) try='void endnetent_r(struct netent_data*);' | |
31ee0cb7 | 11185 | ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;; |
10bc17b6 JH |
11186 | esac |
11187 | case "$endnetent_r_proto" in | |
90e831dc | 11188 | ''|0) d_endnetent_r=undef |
10bc17b6 | 11189 | endnetent_r_proto=0 |
a48ec845 | 11190 | echo "Disabling endnetent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11191 | * ) case "$endnetent_r_proto" in |
11192 | REENTRANT_PROTO*) ;; | |
11193 | *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;; | |
11194 | esac | |
11195 | echo "Prototype: $try" ;; | |
11196 | esac | |
11197 | ;; | |
c18e646a JH |
11198 | *) case "$usethreads" in |
11199 | define) echo "endnetent_r has no prototype, not using it." >&4 ;; | |
11200 | esac | |
90e831dc SB |
11201 | d_endnetent_r=undef |
11202 | endnetent_r_proto=0 | |
c18e646a | 11203 | ;; |
a48ec845 JH |
11204 | esac |
11205 | ;; | |
10bc17b6 JH |
11206 | *) endnetent_r_proto=0 |
11207 | ;; | |
11208 | esac | |
11209 | ||
b4eb6b3d JH |
11210 | : see if endprotoent exists |
11211 | set endprotoent d_endpent | |
11212 | eval $inlibc | |
11213 | ||
10bc17b6 JH |
11214 | : see if endprotoent_r exists |
11215 | set endprotoent_r d_endprotoent_r | |
11216 | eval $inlibc | |
11217 | case "$d_endprotoent_r" in | |
11218 | "$define") | |
11219 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
11220 | case "$d_endprotoent_r_proto:$usethreads" in |
11221 | ":define") d_endprotoent_r_proto=define | |
a48ec845 JH |
11222 | set d_endprotoent_r_proto endprotoent_r $hdrs |
11223 | eval $hasproto ;; | |
11224 | *) ;; | |
11225 | esac | |
11226 | case "$d_endprotoent_r_proto" in | |
11227 | define) | |
10bc17b6 JH |
11228 | case "$endprotoent_r_proto" in |
11229 | ''|0) try='int endprotoent_r(struct protoent_data*);' | |
31ee0cb7 | 11230 | ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;; |
10bc17b6 JH |
11231 | esac |
11232 | case "$endprotoent_r_proto" in | |
11233 | ''|0) try='void endprotoent_r(struct protoent_data*);' | |
31ee0cb7 | 11234 | ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;; |
10bc17b6 JH |
11235 | esac |
11236 | case "$endprotoent_r_proto" in | |
90e831dc | 11237 | ''|0) d_endprotoent_r=undef |
10bc17b6 | 11238 | endprotoent_r_proto=0 |
a48ec845 | 11239 | echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11240 | * ) case "$endprotoent_r_proto" in |
11241 | REENTRANT_PROTO*) ;; | |
11242 | *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;; | |
11243 | esac | |
11244 | echo "Prototype: $try" ;; | |
11245 | esac | |
11246 | ;; | |
c18e646a JH |
11247 | *) case "$usethreads" in |
11248 | define) echo "endprotoent_r has no prototype, not using it." >&4 ;; | |
11249 | esac | |
90e831dc SB |
11250 | d_endprotoent_r=undef |
11251 | endprotoent_r_proto=0 | |
c18e646a | 11252 | ;; |
a48ec845 JH |
11253 | esac |
11254 | ;; | |
10bc17b6 JH |
11255 | *) endprotoent_r_proto=0 |
11256 | ;; | |
11257 | esac | |
11258 | ||
b4eb6b3d JH |
11259 | : see if endpwent exists |
11260 | set endpwent d_endpwent | |
11261 | eval $inlibc | |
11262 | ||
10bc17b6 JH |
11263 | : see if this is a pwd.h system |
11264 | set pwd.h i_pwd | |
11265 | eval $inhdr | |
11266 | ||
11267 | case "$i_pwd" in | |
11268 | $define) | |
11269 | xxx=`./findhdr pwd.h` | |
11270 | $cppstdin $cppflags $cppminus < $xxx >$$.h | |
11271 | ||
11272 | if $contains 'pw_quota' $$.h >/dev/null 2>&1; then | |
11273 | val="$define" | |
11274 | else | |
11275 | val="$undef" | |
11276 | fi | |
11277 | set d_pwquota | |
11278 | eval $setvar | |
11279 | ||
11280 | if $contains 'pw_age' $$.h >/dev/null 2>&1; then | |
11281 | val="$define" | |
11282 | else | |
11283 | val="$undef" | |
11284 | fi | |
11285 | set d_pwage | |
11286 | eval $setvar | |
11287 | ||
11288 | if $contains 'pw_change' $$.h >/dev/null 2>&1; then | |
11289 | val="$define" | |
11290 | else | |
11291 | val="$undef" | |
11292 | fi | |
11293 | set d_pwchange | |
11294 | eval $setvar | |
11295 | ||
11296 | if $contains 'pw_class' $$.h >/dev/null 2>&1; then | |
11297 | val="$define" | |
11298 | else | |
11299 | val="$undef" | |
11300 | fi | |
11301 | set d_pwclass | |
11302 | eval $setvar | |
11303 | ||
11304 | if $contains 'pw_expire' $$.h >/dev/null 2>&1; then | |
11305 | val="$define" | |
11306 | else | |
11307 | val="$undef" | |
11308 | fi | |
11309 | set d_pwexpire | |
11310 | eval $setvar | |
11311 | ||
11312 | if $contains 'pw_comment' $$.h >/dev/null 2>&1; then | |
11313 | val="$define" | |
11314 | else | |
11315 | val="$undef" | |
11316 | fi | |
11317 | set d_pwcomment | |
11318 | eval $setvar | |
11319 | ||
11320 | if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then | |
11321 | val="$define" | |
11322 | else | |
11323 | val="$undef" | |
11324 | fi | |
11325 | set d_pwgecos | |
11326 | eval $setvar | |
11327 | ||
11328 | if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then | |
11329 | val="$define" | |
11330 | else | |
11331 | val="$undef" | |
11332 | fi | |
11333 | set d_pwpasswd | |
11334 | eval $setvar | |
11335 | ||
11336 | $rm -f $$.h | |
11337 | ;; | |
11338 | *) | |
11339 | val="$undef"; | |
11340 | set d_pwquota; eval $setvar | |
11341 | set d_pwage; eval $setvar | |
11342 | set d_pwchange; eval $setvar | |
11343 | set d_pwclass; eval $setvar | |
11344 | set d_pwexpire; eval $setvar | |
11345 | set d_pwcomment; eval $setvar | |
11346 | set d_pwgecos; eval $setvar | |
11347 | set d_pwpasswd; eval $setvar | |
11348 | ;; | |
11349 | esac | |
11350 | ||
11351 | : see if endpwent_r exists | |
11352 | set endpwent_r d_endpwent_r | |
11353 | eval $inlibc | |
11354 | case "$d_endpwent_r" in | |
11355 | "$define") | |
11356 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" | |
c18e646a JH |
11357 | case "$d_endpwent_r_proto:$usethreads" in |
11358 | ":define") d_endpwent_r_proto=define | |
a48ec845 JH |
11359 | set d_endpwent_r_proto endpwent_r $hdrs |
11360 | eval $hasproto ;; | |
11361 | *) ;; | |
11362 | esac | |
11363 | case "$d_endpwent_r_proto" in | |
11364 | define) | |
10bc17b6 JH |
11365 | case "$endpwent_r_proto" in |
11366 | ''|0) try='int endpwent_r(FILE**);' | |
11367 | ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;; | |
11368 | esac | |
11369 | case "$endpwent_r_proto" in | |
11370 | ''|0) try='void endpwent_r(FILE**);' | |
11371 | ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;; | |
11372 | esac | |
11373 | case "$endpwent_r_proto" in | |
90e831dc | 11374 | ''|0) d_endpwent_r=undef |
10bc17b6 | 11375 | endpwent_r_proto=0 |
a48ec845 | 11376 | echo "Disabling endpwent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11377 | * ) case "$endpwent_r_proto" in |
11378 | REENTRANT_PROTO*) ;; | |
11379 | *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;; | |
11380 | esac | |
11381 | echo "Prototype: $try" ;; | |
11382 | esac | |
11383 | ;; | |
c18e646a JH |
11384 | *) case "$usethreads" in |
11385 | define) echo "endpwent_r has no prototype, not using it." >&4 ;; | |
11386 | esac | |
90e831dc SB |
11387 | d_endpwent_r=undef |
11388 | endpwent_r_proto=0 | |
c18e646a | 11389 | ;; |
a48ec845 JH |
11390 | esac |
11391 | ;; | |
10bc17b6 JH |
11392 | *) endpwent_r_proto=0 |
11393 | ;; | |
11394 | esac | |
11395 | ||
b4eb6b3d JH |
11396 | : see if endservent exists |
11397 | set endservent d_endsent | |
11398 | eval $inlibc | |
11399 | ||
10bc17b6 JH |
11400 | : see if endservent_r exists |
11401 | set endservent_r d_endservent_r | |
11402 | eval $inlibc | |
11403 | case "$d_endservent_r" in | |
11404 | "$define") | |
11405 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
11406 | case "$d_endservent_r_proto:$usethreads" in |
11407 | ":define") d_endservent_r_proto=define | |
a48ec845 JH |
11408 | set d_endservent_r_proto endservent_r $hdrs |
11409 | eval $hasproto ;; | |
11410 | *) ;; | |
11411 | esac | |
11412 | case "$d_endservent_r_proto" in | |
11413 | define) | |
10bc17b6 JH |
11414 | case "$endservent_r_proto" in |
11415 | ''|0) try='int endservent_r(struct servent_data*);' | |
31ee0cb7 | 11416 | ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;; |
10bc17b6 JH |
11417 | esac |
11418 | case "$endservent_r_proto" in | |
11419 | ''|0) try='void endservent_r(struct servent_data*);' | |
31ee0cb7 | 11420 | ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;; |
10bc17b6 JH |
11421 | esac |
11422 | case "$endservent_r_proto" in | |
90e831dc | 11423 | ''|0) d_endservent_r=undef |
10bc17b6 | 11424 | endservent_r_proto=0 |
a48ec845 | 11425 | echo "Disabling endservent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
11426 | * ) case "$endservent_r_proto" in |
11427 | REENTRANT_PROTO*) ;; | |
11428 | *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;; | |
11429 | esac | |
11430 | echo "Prototype: $try" ;; | |
11431 | esac | |
11432 | ;; | |
c18e646a JH |
11433 | *) case "$usethreads" in |
11434 | define) echo "endservent_r has no prototype, not using it." >&4 ;; | |
11435 | esac | |
90e831dc SB |
11436 | d_endservent_r=undef |
11437 | endservent_r_proto=0 | |
c18e646a | 11438 | ;; |
a48ec845 JH |
11439 | esac |
11440 | ;; | |
10bc17b6 JH |
11441 | *) endservent_r_proto=0 |
11442 | ;; | |
11443 | esac | |
11444 | ||
b4eb6b3d JH |
11445 | : Locate the flags for 'open()' |
11446 | echo " " | |
5a29c6bc | 11447 | $cat >try.c <<EOCP |
b4eb6b3d JH |
11448 | #include <sys/types.h> |
11449 | #ifdef I_FCNTL | |
11450 | #include <fcntl.h> | |
11451 | #endif | |
11452 | #ifdef I_SYS_FILE | |
11453 | #include <sys/file.h> | |
11454 | #endif | |
5a29c6bc JH |
11455 | #$i_stdlib I_STDLIB |
11456 | #ifdef I_STDLIB | |
11457 | #include <stdlib.h> | |
11458 | #endif | |
b4eb6b3d JH |
11459 | int main() { |
11460 | if(O_RDONLY); | |
11461 | #ifdef O_TRUNC | |
11462 | exit(0); | |
11463 | #else | |
11464 | exit(1); | |
11465 | #endif | |
11466 | } | |
11467 | EOCP | |
11468 | : check sys/file.h first to get FREAD on Sun | |
11469 | if $test `./findhdr sys/file.h` && \ | |
5440bc8e | 11470 | set try -DI_SYS_FILE && eval $compile; then |
b4eb6b3d JH |
11471 | h_sysfile=true; |
11472 | echo "<sys/file.h> defines the O_* constants..." >&4 | |
5440bc8e | 11473 | if $run ./try; then |
b4eb6b3d JH |
11474 | echo "and you have the 3 argument form of open()." >&4 |
11475 | val="$define" | |
11476 | else | |
11477 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
11478 | val="$undef" | |
11479 | fi | |
11480 | elif $test `./findhdr fcntl.h` && \ | |
5440bc8e | 11481 | set try -DI_FCNTL && eval $compile; then |
b4eb6b3d JH |
11482 | h_fcntl=true; |
11483 | echo "<fcntl.h> defines the O_* constants..." >&4 | |
5440bc8e | 11484 | if $run ./try; then |
b4eb6b3d JH |
11485 | echo "and you have the 3 argument form of open()." >&4 |
11486 | val="$define" | |
11487 | else | |
11488 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
11489 | val="$undef" | |
11490 | fi | |
11491 | else | |
11492 | val="$undef" | |
11493 | echo "I can't find the O_* constant definitions! You got problems." >&4 | |
11494 | fi | |
11495 | set d_open3 | |
11496 | eval $setvar | |
5440bc8e | 11497 | $rm -f try try.* |
b4eb6b3d JH |
11498 | |
11499 | : see which of string.h or strings.h is needed | |
11500 | echo " " | |
11501 | strings=`./findhdr string.h` | |
11502 | if $test "$strings" && $test -r "$strings"; then | |
11503 | echo "Using <string.h> instead of <strings.h>." >&4 | |
11504 | val="$define" | |
11505 | else | |
11506 | val="$undef" | |
11507 | strings=`./findhdr strings.h` | |
11508 | if $test "$strings" && $test -r "$strings"; then | |
11509 | echo "Using <strings.h> instead of <string.h>." >&4 | |
11510 | else | |
11511 | echo "No string header found -- You'll surely have problems." >&4 | |
11512 | fi | |
11513 | fi | |
11514 | set i_string | |
11515 | eval $setvar | |
11516 | case "$i_string" in | |
11517 | "$undef") strings=`./findhdr strings.h`;; | |
11518 | *) strings=`./findhdr string.h`;; | |
11519 | esac | |
11520 | ||
3c728e00 JH |
11521 | : see if this is a sys/file.h system |
11522 | val='' | |
11523 | set sys/file.h val | |
11524 | eval $inhdr | |
11525 | ||
11526 | : do we need to include sys/file.h ? | |
11527 | case "$val" in | |
11528 | "$define") | |
11529 | echo " " | |
11530 | if $h_sysfile; then | |
11531 | val="$define" | |
11532 | echo "We'll be including <sys/file.h>." >&4 | |
11533 | else | |
11534 | val="$undef" | |
11535 | echo "We won't be including <sys/file.h>." >&4 | |
11536 | fi | |
11537 | ;; | |
11538 | *) | |
11539 | h_sysfile=false | |
11540 | ;; | |
11541 | esac | |
11542 | set i_sysfile | |
11543 | eval $setvar | |
11544 | ||
11545 | : see if fcntl.h is there | |
11546 | val='' | |
11547 | set fcntl.h val | |
11548 | eval $inhdr | |
11549 | ||
11550 | : see if we can include fcntl.h | |
11551 | case "$val" in | |
11552 | "$define") | |
11553 | echo " " | |
11554 | if $h_fcntl; then | |
11555 | val="$define" | |
11556 | echo "We'll be including <fcntl.h>." >&4 | |
11557 | else | |
11558 | val="$undef" | |
11559 | if $h_sysfile; then | |
11560 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 | |
11561 | else | |
11562 | echo "We won't be including <fcntl.h>." >&4 | |
11563 | fi | |
11564 | fi | |
11565 | ;; | |
11566 | *) | |
11567 | h_fcntl=false | |
11568 | val="$undef" | |
11569 | ;; | |
11570 | esac | |
11571 | set i_fcntl | |
11572 | eval $setvar | |
11573 | ||
b4eb6b3d JH |
11574 | : check for non-blocking I/O stuff |
11575 | case "$h_sysfile" in | |
a0acbdc3 JH |
11576 | true) echo "#include <sys/file.h>" > head.c;; |
11577 | *) | |
11578 | case "$h_fcntl" in | |
11579 | true) echo "#include <fcntl.h>" > head.c;; | |
11580 | *) echo "#include <sys/fcntl.h>" > head.c;; | |
11581 | esac | |
11582 | ;; | |
b4eb6b3d JH |
11583 | esac |
11584 | echo " " | |
11585 | echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 | |
11586 | case "$o_nonblock" in | |
11587 | '') | |
11588 | $cat head.c > try.c | |
3c728e00 | 11589 | $cat >>try.c <<EOCP |
b4eb6b3d | 11590 | #include <stdio.h> |
5a29c6bc JH |
11591 | #$i_stdlib I_STDLIB |
11592 | #ifdef I_STDLIB | |
80b3ef99 | 11593 | #include <stdlib.h> |
5a29c6bc | 11594 | #endif |
3c728e00 JH |
11595 | #$i_fcntl I_FCNTL |
11596 | #ifdef I_FCNTL | |
11597 | #include <fcntl.h> | |
11598 | #endif | |
b4eb6b3d JH |
11599 | int main() { |
11600 | #ifdef O_NONBLOCK | |
11601 | printf("O_NONBLOCK\n"); | |
11602 | exit(0); | |
11603 | #endif | |
11604 | #ifdef O_NDELAY | |
11605 | printf("O_NDELAY\n"); | |
11606 | exit(0); | |
11607 | #endif | |
11608 | #ifdef FNDELAY | |
11609 | printf("FNDELAY\n"); | |
11610 | exit(0); | |
11611 | #endif | |
11612 | exit(0); | |
11613 | } | |
11614 | EOCP | |
11615 | set try | |
11616 | if eval $compile_ok; then | |
5440bc8e | 11617 | o_nonblock=`$run ./try` |
b4eb6b3d JH |
11618 | case "$o_nonblock" in |
11619 | '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; | |
11620 | *) echo "Seems like we can use $o_nonblock.";; | |
11621 | esac | |
11622 | else | |
11623 | echo "(I can't compile the test program; pray O_NONBLOCK is right!)" | |
11624 | fi | |
11625 | ;; | |
11626 | *) echo "Using $hint value $o_nonblock.";; | |
11627 | esac | |
11628 | $rm -f try try.* .out core | |
11629 | ||
11630 | echo " " | |
11631 | echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 | |
11632 | case "$eagain" in | |
11633 | '') | |
11634 | $cat head.c > try.c | |
11635 | $cat >>try.c <<EOCP | |
11636 | #include <errno.h> | |
11637 | #include <sys/types.h> | |
11638 | #include <signal.h> | |
11639 | #include <stdio.h> | |
5a29c6bc JH |
11640 | #$i_stdlib I_STDLIB |
11641 | #ifdef I_STDLIB | |
11642 | #include <stdlib.h> | |
11643 | #endif | |
1deb0a86 JH |
11644 | #$i_fcntl I_FCNTL |
11645 | #ifdef I_FCNTL | |
11646 | #include <fcntl.h> | |
11647 | #endif | |
b4eb6b3d JH |
11648 | #define MY_O_NONBLOCK $o_nonblock |
11649 | #ifndef errno /* XXX need better Configure test */ | |
11650 | extern int errno; | |
11651 | #endif | |
11652 | #$i_unistd I_UNISTD | |
11653 | #ifdef I_UNISTD | |
11654 | #include <unistd.h> | |
11655 | #endif | |
11656 | #$i_string I_STRING | |
11657 | #ifdef I_STRING | |
11658 | #include <string.h> | |
11659 | #else | |
11660 | #include <strings.h> | |
11661 | #endif | |
11662 | $signal_t blech(x) int x; { exit(3); } | |
11663 | EOCP | |
11664 | $cat >> try.c <<'EOCP' | |
11665 | int main() | |
11666 | { | |
11667 | int pd[2]; | |
11668 | int pu[2]; | |
11669 | char buf[1]; | |
11670 | char string[100]; | |
11671 | ||
11672 | pipe(pd); /* Down: child -> parent */ | |
11673 | pipe(pu); /* Up: parent -> child */ | |
11674 | if (0 != fork()) { | |
11675 | int ret; | |
11676 | close(pd[1]); /* Parent reads from pd[0] */ | |
11677 | close(pu[0]); /* Parent writes (blocking) to pu[1] */ | |
a0acbdc3 | 11678 | #ifdef F_SETFL |
b4eb6b3d JH |
11679 | if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) |
11680 | exit(1); | |
a0acbdc3 JH |
11681 | #else |
11682 | exit(4); | |
11683 | #endif | |
b4eb6b3d JH |
11684 | signal(SIGALRM, blech); |
11685 | alarm(5); | |
11686 | if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ | |
11687 | exit(2); | |
11688 | sprintf(string, "%d\n", ret); | |
11689 | write(2, string, strlen(string)); | |
11690 | alarm(0); | |
11691 | #ifdef EAGAIN | |
11692 | if (errno == EAGAIN) { | |
11693 | printf("EAGAIN\n"); | |
11694 | goto ok; | |
11695 | } | |
11696 | #endif | |
11697 | #ifdef EWOULDBLOCK | |
11698 | if (errno == EWOULDBLOCK) | |
11699 | printf("EWOULDBLOCK\n"); | |
11700 | #endif | |
11701 | ok: | |
11702 | write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ | |
11703 | sleep(2); /* Give it time to close our pipe */ | |
11704 | alarm(5); | |
11705 | ret = read(pd[0], buf, 1); /* Should read EOF */ | |
11706 | alarm(0); | |
11707 | sprintf(string, "%d\n", ret); | |
868439a2 | 11708 | write(4, string, strlen(string)); |
b4eb6b3d JH |
11709 | exit(0); |
11710 | } | |
11711 | ||
11712 | close(pd[0]); /* We write to pd[1] */ | |
11713 | close(pu[1]); /* We read from pu[0] */ | |
11714 | read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ | |
11715 | close(pd[1]); /* Pipe pd is now fully closed! */ | |
11716 | exit(0); /* Bye bye, thank you for playing! */ | |
11717 | } | |
11718 | EOCP | |
11719 | set try | |
11720 | if eval $compile_ok; then | |
11721 | echo "$startsh" >mtry | |
868439a2 | 11722 | echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry |
b4eb6b3d JH |
11723 | chmod +x mtry |
11724 | ./mtry >/dev/null 2>&1 | |
11725 | case $? in | |
11726 | 0) eagain=`$cat try.out`;; | |
11727 | 1) echo "Could not perform non-blocking setting!";; | |
11728 | 2) echo "I did a successful read() for something that was not there!";; | |
11729 | 3) echo "Hmm... non-blocking I/O does not seem to be working!";; | |
a0acbdc3 | 11730 | 4) echo "Could not find F_SETFL!";; |
b4eb6b3d JH |
11731 | *) echo "Something terribly wrong happened during testing.";; |
11732 | esac | |
11733 | rd_nodata=`$cat try.ret` | |
11734 | echo "A read() system call with no data present returns $rd_nodata." | |
11735 | case "$rd_nodata" in | |
11736 | 0|-1) ;; | |
11737 | *) | |
11738 | echo "(That's peculiar, fixing that to be -1.)" | |
11739 | rd_nodata=-1 | |
11740 | ;; | |
11741 | esac | |
11742 | case "$eagain" in | |
11743 | '') | |
11744 | echo "Forcing errno EAGAIN on read() with no data available." | |
11745 | eagain=EAGAIN | |
11746 | ;; | |
11747 | *) | |
11748 | echo "Your read() sets errno to $eagain when no data is available." | |
11749 | ;; | |
11750 | esac | |
11751 | status=`$cat try.err` | |
11752 | case "$status" in | |
11753 | 0) echo "And it correctly returns 0 to signal EOF.";; | |
11754 | -1) echo "But it also returns -1 to signal EOF, so be careful!";; | |
11755 | *) echo "However, your read() returns '$status' on EOF??";; | |
11756 | esac | |
11757 | val="$define" | |
11758 | if test "$status" = "$rd_nodata"; then | |
11759 | echo "WARNING: you can't distinguish between EOF and no data!" | |
11760 | val="$undef" | |
11761 | fi | |
11762 | else | |
11763 | echo "I can't compile the test program--assuming errno EAGAIN will do." | |
11764 | eagain=EAGAIN | |
11765 | fi | |
11766 | set d_eofnblk | |
11767 | eval $setvar | |
11768 | ;; | |
11769 | *) | |
11770 | echo "Using $hint value $eagain." | |
11771 | echo "Your read() returns $rd_nodata when no data is present." | |
11772 | case "$d_eofnblk" in | |
11773 | "$define") echo "And you can see EOF because read() returns 0.";; | |
11774 | "$undef") echo "But you can't see EOF status from read() returned value.";; | |
11775 | *) | |
11776 | echo "(Assuming you can't see EOF status from read anyway.)" | |
11777 | d_eofnblk=$undef | |
11778 | ;; | |
11779 | esac | |
11780 | ;; | |
11781 | esac | |
11782 | $rm -f try try.* .out core head.c mtry | |
11783 | ||
ff0950a8 JH |
11784 | : see if _ptr and _cnt from stdio act std |
11785 | echo " " | |
b4eb6b3d | 11786 | |
ff0950a8 JH |
11787 | if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then |
11788 | echo "(Looks like you have stdio.h from BSD.)" | |
11789 | case "$stdio_ptr" in | |
11790 | '') stdio_ptr='((fp)->_p)' | |
11791 | ptr_lval=$define | |
11792 | ;; | |
11793 | *) ptr_lval=$d_stdio_ptr_lval;; | |
11794 | esac | |
11795 | case "$stdio_cnt" in | |
11796 | '') stdio_cnt='((fp)->_r)' | |
11797 | cnt_lval=$define | |
11798 | ;; | |
11799 | *) cnt_lval=$d_stdio_cnt_lval;; | |
11800 | esac | |
11801 | case "$stdio_base" in | |
11802 | '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';; | |
11803 | esac | |
11804 | case "$stdio_bufsiz" in | |
11805 | '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';; | |
11806 | esac | |
11807 | elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then | |
11808 | echo "(Looks like you have stdio.h from Linux.)" | |
11809 | case "$stdio_ptr" in | |
11810 | '') stdio_ptr='((fp)->_IO_read_ptr)' | |
11811 | ptr_lval=$define | |
11812 | ;; | |
11813 | *) ptr_lval=$d_stdio_ptr_lval;; | |
11814 | esac | |
11815 | case "$stdio_cnt" in | |
11816 | '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' | |
11817 | cnt_lval=$undef | |
11818 | ;; | |
11819 | *) cnt_lval=$d_stdio_cnt_lval;; | |
11820 | esac | |
11821 | case "$stdio_base" in | |
11822 | '') stdio_base='((fp)->_IO_read_base)';; | |
11823 | esac | |
11824 | case "$stdio_bufsiz" in | |
11825 | '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; | |
11826 | esac | |
11827 | else | |
11828 | case "$stdio_ptr" in | |
11829 | '') stdio_ptr='((fp)->_ptr)' | |
11830 | ptr_lval=$define | |
11831 | ;; | |
11832 | *) ptr_lval=$d_stdio_ptr_lval;; | |
11833 | esac | |
11834 | case "$stdio_cnt" in | |
11835 | '') stdio_cnt='((fp)->_cnt)' | |
11836 | cnt_lval=$define | |
11837 | ;; | |
11838 | *) cnt_lval=$d_stdio_cnt_lval;; | |
11839 | esac | |
11840 | case "$stdio_base" in | |
11841 | '') stdio_base='((fp)->_base)';; | |
11842 | esac | |
11843 | case "$stdio_bufsiz" in | |
11844 | '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; | |
11845 | esac | |
11846 | fi | |
b4eb6b3d | 11847 | |
ff0950a8 JH |
11848 | : test whether _ptr and _cnt really work |
11849 | echo "Checking how std your stdio is..." >&4 | |
11850 | $cat >try.c <<EOP | |
11851 | #include <stdio.h> | |
5a29c6bc JH |
11852 | #$i_stdlib I_STDLIB |
11853 | #ifdef I_STDLIB | |
9d9004a9 | 11854 | #include <stdlib.h> |
5a29c6bc | 11855 | #endif |
ff0950a8 JH |
11856 | #define FILE_ptr(fp) $stdio_ptr |
11857 | #define FILE_cnt(fp) $stdio_cnt | |
9d9004a9 | 11858 | int main() { |
ff0950a8 JH |
11859 | FILE *fp = fopen("try.c", "r"); |
11860 | char c = getc(fp); | |
11861 | if ( | |
11862 | 18 <= FILE_cnt(fp) && | |
11863 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 | |
11864 | ) | |
11865 | exit(0); | |
11866 | exit(1); | |
9d9004a9 | 11867 | } |
ff0950a8 JH |
11868 | EOP |
11869 | val="$undef" | |
11870 | set try | |
11871 | if eval $compile && $to try.c; then | |
11872 | if $run ./try; then | |
11873 | echo "Your stdio acts pretty std." | |
11874 | val="$define" | |
9d9004a9 | 11875 | else |
ff0950a8 | 11876 | echo "Your stdio isn't very std." |
9d9004a9 | 11877 | fi |
ff0950a8 JH |
11878 | else |
11879 | echo "Your stdio doesn't appear very std." | |
11880 | fi | |
11881 | $rm -f try.c try | |
11882 | ||
11883 | # glibc 2.2.90 and above apparently change stdio streams so Perl's | |
11884 | # direct buffer manipulation no longer works. The Configure tests | |
11885 | # should be changed to correctly detect this, but until then, | |
11886 | # the following check should at least let perl compile and run. | |
11887 | # (This quick fix should be updated before 5.8.1.) | |
11888 | # To be defensive, reject all unknown versions, and all versions > 2.2.9. | |
11889 | # A. Dougherty, June 3, 2002. | |
11890 | case "$d_gnulibc" in | |
11891 | $define) | |
11892 | case "$gnulibc_version" in | |
11893 | 2.[01]*) ;; | |
11894 | 2.2) ;; | |
11895 | 2.2.[0-9]) ;; | |
11896 | *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers." | |
11897 | val="$undef" | |
11898 | ;; | |
11899 | esac | |
9d9004a9 AD |
11900 | ;; |
11901 | esac | |
ff0950a8 | 11902 | set d_stdstdio |
9d9004a9 | 11903 | eval $setvar |
9d9004a9 | 11904 | |
ff0950a8 JH |
11905 | : Can _ptr be used as an lvalue? |
11906 | case "$d_stdstdio$ptr_lval" in | |
11907 | $define$define) val=$define ;; | |
11908 | *) val=$undef ;; | |
11909 | esac | |
11910 | set d_stdio_ptr_lval | |
11911 | eval $setvar | |
9d9004a9 | 11912 | |
ff0950a8 JH |
11913 | : Can _cnt be used as an lvalue? |
11914 | case "$d_stdstdio$cnt_lval" in | |
11915 | $define$define) val=$define ;; | |
11916 | *) val=$undef ;; | |
11917 | esac | |
11918 | set d_stdio_cnt_lval | |
11919 | eval $setvar | |
b4eb6b3d | 11920 | |
ff0950a8 JH |
11921 | |
11922 | : test whether setting _ptr sets _cnt as a side effect | |
11923 | d_stdio_ptr_lval_sets_cnt="$undef" | |
11924 | d_stdio_ptr_lval_nochange_cnt="$undef" | |
11925 | case "$d_stdio_ptr_lval$d_stdstdio" in | |
11926 | $define$define) | |
11927 | echo "Checking to see what happens if we set the stdio ptr..." >&4 | |
11928 | $cat >try.c <<EOP | |
11929 | #include <stdio.h> | |
11930 | /* Can we scream? */ | |
11931 | /* Eat dust sed :-) */ | |
11932 | /* In the buffer space, no one can hear you scream. */ | |
5a29c6bc JH |
11933 | #$i_stdlib I_STDLIB |
11934 | #ifdef I_STDLIB | |
11935 | #include <stdlib.h> | |
11936 | #endif | |
ff0950a8 JH |
11937 | #define FILE_ptr(fp) $stdio_ptr |
11938 | #define FILE_cnt(fp) $stdio_cnt | |
b4eb6b3d | 11939 | #include <sys/types.h> |
ff0950a8 JH |
11940 | int main() { |
11941 | FILE *fp = fopen("try.c", "r"); | |
11942 | int c; | |
11943 | char *ptr; | |
11944 | size_t cnt; | |
11945 | if (!fp) { | |
11946 | puts("Fail even to read"); | |
11947 | exit(1); | |
11948 | } | |
11949 | c = getc(fp); /* Read away the first # */ | |
11950 | if (c == EOF) { | |
11951 | puts("Fail even to read"); | |
11952 | exit(1); | |
11953 | } | |
11954 | if (!( | |
11955 | 18 <= FILE_cnt(fp) && | |
11956 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 | |
11957 | )) { | |
11958 | puts("Fail even to read"); | |
11959 | exit (1); | |
11960 | } | |
11961 | ptr = (char*) FILE_ptr(fp); | |
11962 | cnt = (size_t)FILE_cnt(fp); | |
11963 | ||
11964 | FILE_ptr(fp) += 42; | |
11965 | ||
11966 | if ((char*)FILE_ptr(fp) != (ptr + 42)) { | |
11967 | printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42)); | |
11968 | exit (1); | |
11969 | } | |
11970 | if (FILE_cnt(fp) <= 20) { | |
11971 | printf ("Fail (<20 chars to test)"); | |
11972 | exit (1); | |
11973 | } | |
11974 | if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) { | |
11975 | puts("Fail compare"); | |
11976 | exit (1); | |
11977 | } | |
11978 | if (cnt == FILE_cnt(fp)) { | |
11979 | puts("Pass_unchanged"); | |
11980 | exit (0); | |
11981 | } | |
11982 | if (FILE_cnt(fp) == (cnt - 42)) { | |
11983 | puts("Pass_changed"); | |
11984 | exit (0); | |
11985 | } | |
11986 | printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp)); | |
11987 | return 1; | |
11988 | ||
11989 | } | |
11990 | EOP | |
11991 | set try | |
11992 | if eval $compile && $to try.c; then | |
11993 | case `$run ./try` in | |
11994 | Pass_changed) | |
11995 | echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4 | |
11996 | d_stdio_ptr_lval_sets_cnt="$define" ;; | |
11997 | Pass_unchanged) | |
11998 | echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4 | |
11999 | d_stdio_ptr_lval_nochange_cnt="$define" ;; | |
12000 | Fail*) | |
12001 | echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;; | |
12002 | *) | |
12003 | echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;; | |
12004 | esac | |
12005 | else | |
12006 | echo "It seems we can't set ptr in your stdio. Nevermind." >&4 | |
12007 | fi | |
12008 | $rm -f try.c try | |
12009 | ;; | |
12010 | esac | |
12011 | ||
12012 | : see if _base is also standard | |
12013 | val="$undef" | |
12014 | case "$d_stdstdio" in | |
12015 | $define) | |
12016 | $cat >try.c <<EOP | |
12017 | #include <stdio.h> | |
12018 | #$i_stdlib I_STDLIB | |
12019 | #ifdef I_STDLIB | |
12020 | #include <stdlib.h> | |
12021 | #endif | |
12022 | #define FILE_base(fp) $stdio_base | |
12023 | #define FILE_bufsiz(fp) $stdio_bufsiz | |
12024 | int main() { | |
12025 | FILE *fp = fopen("try.c", "r"); | |
12026 | char c = getc(fp); | |
12027 | if ( | |
12028 | 19 <= FILE_bufsiz(fp) && | |
12029 | strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0 | |
12030 | ) | |
12031 | exit(0); | |
12032 | exit(1); | |
12033 | } | |
12034 | EOP | |
12035 | set try | |
12036 | if eval $compile && $to try.c; then | |
12037 | if $run ./try; then | |
12038 | echo "And its _base field acts std." | |
12039 | val="$define" | |
12040 | else | |
12041 | echo "But its _base field isn't std." | |
12042 | fi | |
12043 | else | |
12044 | echo "However, it seems to be lacking the _base field." | |
12045 | fi | |
12046 | $rm -f try.c try | |
12047 | ;; | |
12048 | esac | |
12049 | set d_stdiobase | |
12050 | eval $setvar | |
12051 | ||
12052 | : see if fast_stdio exists | |
12053 | val="$undef" | |
12054 | case "$d_stdstdio:$d_stdio_ptr_lval" in | |
12055 | "$define:$define") | |
12056 | case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in | |
12057 | *$define*) | |
12058 | echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4 | |
12059 | val="$define" | |
12060 | ;; | |
12061 | esac | |
12062 | ;; | |
12063 | esac | |
12064 | set d_faststdio | |
12065 | eval $setvar | |
12066 | ||
12067 | ||
12068 | ||
12069 | : see if fchdir exists | |
12070 | set fchdir d_fchdir | |
12071 | eval $inlibc | |
12072 | ||
12073 | : see if fchmod exists | |
12074 | set fchmod d_fchmod | |
12075 | eval $inlibc | |
12076 | ||
12077 | : see if fchown exists | |
12078 | set fchown d_fchown | |
12079 | eval $inlibc | |
12080 | ||
12081 | : see if this is an fcntl system | |
12082 | set fcntl d_fcntl | |
12083 | eval $inlibc | |
12084 | ||
12085 | echo " " | |
12086 | : See if fcntl-based locking works. | |
12087 | $cat >try.c <<EOCP | |
12088 | #$i_stdlib I_STDLIB | |
12089 | #ifdef I_STDLIB | |
12090 | #include <stdlib.h> | |
12091 | #endif | |
12092 | #include <unistd.h> | |
12093 | #include <fcntl.h> | |
12094 | #include <signal.h> | |
12095 | $signal_t blech(x) int x; { exit(3); } | |
12096 | int main() { | |
12097 | #if defined(F_SETLK) && defined(F_SETLKW) | |
12098 | struct flock flock; | |
12099 | int retval, fd; | |
12100 | fd = open("try.c", O_RDONLY); | |
12101 | flock.l_type = F_RDLCK; | |
12102 | flock.l_whence = SEEK_SET; | |
12103 | flock.l_start = flock.l_len = 0; | |
12104 | signal(SIGALRM, blech); | |
12105 | alarm(10); | |
12106 | retval = fcntl(fd, F_SETLK, &flock); | |
12107 | close(fd); | |
12108 | (retval < 0 ? exit(2) : exit(0)); | |
12109 | #else | |
12110 | exit(2); | |
12111 | #endif | |
12112 | } | |
12113 | EOCP | |
12114 | echo "Checking if fcntl-based file locking works... " | |
12115 | case "$d_fcntl" in | |
12116 | "$define") | |
12117 | set try | |
12118 | if eval $compile_ok; then | |
12119 | if $run ./try; then | |
12120 | echo "Yes, it seems to work." | |
12121 | val="$define" | |
12122 | else | |
12123 | echo "Nope, it didn't work." | |
12124 | val="$undef" | |
12125 | case "$?" in | |
12126 | 3) $cat >&4 <<EOM | |
12127 | *** | |
12128 | *** I had to forcibly timeout from fcntl(..., F_SETLK, ...). | |
12129 | *** This is (almost) impossible. | |
12130 | *** If your NFS lock daemons are not feeling well, something like | |
12131 | *** this may happen, please investigate. Cannot continue, aborting. | |
12132 | *** | |
12133 | EOM | |
12134 | exit 1 | |
12135 | ;; | |
12136 | esac | |
12137 | fi | |
12138 | else | |
12139 | echo "I'm unable to compile the test program, so I'll assume not." | |
12140 | val="$undef" | |
12141 | fi | |
12142 | ;; | |
12143 | *) val="$undef"; | |
12144 | echo "Nope, since you don't even have fcntl()." | |
12145 | ;; | |
12146 | esac | |
12147 | set d_fcntl_can_lock | |
12148 | eval $setvar | |
12149 | $rm -f try* | |
12150 | ||
12151 | ||
12152 | : check for fd_set items | |
12153 | $cat <<EOM | |
12154 | ||
12155 | Checking to see how well your C compiler handles fd_set and friends ... | |
12156 | EOM | |
12157 | $cat >try.c <<EOCP | |
12158 | #$i_stdlib I_STDLIB | |
12159 | #ifdef I_STDLIB | |
12160 | #include <stdlib.h> | |
12161 | #endif | |
12162 | #$i_systime I_SYS_TIME | |
12163 | #$i_sysselct I_SYS_SELECT | |
12164 | #$d_socket HAS_SOCKET | |
12165 | #include <sys/types.h> | |
12166 | #ifdef HAS_SOCKET | |
12167 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
12168 | #endif | |
12169 | #ifdef I_SYS_TIME | |
12170 | #include <sys/time.h> | |
12171 | #endif | |
12172 | #ifdef I_SYS_SELECT | |
12173 | #include <sys/select.h> | |
b4eb6b3d JH |
12174 | #endif |
12175 | int main() { | |
12176 | fd_set fds; | |
12177 | ||
12178 | #ifdef TRYBITS | |
12179 | if(fds.fds_bits); | |
12180 | #endif | |
12181 | ||
12182 | #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) | |
12183 | exit(0); | |
12184 | #else | |
12185 | exit(1); | |
12186 | #endif | |
12187 | } | |
12188 | EOCP | |
5440bc8e | 12189 | set try -DTRYBITS |
b4eb6b3d JH |
12190 | if eval $compile; then |
12191 | d_fds_bits="$define" | |
12192 | d_fd_set="$define" | |
12193 | echo "Well, your system knows about the normal fd_set typedef..." >&4 | |
5440bc8e | 12194 | if $run ./try; then |
b4eb6b3d JH |
12195 | echo "and you have the normal fd_set macros (just as I'd expect)." >&4 |
12196 | d_fd_macros="$define" | |
12197 | else | |
12198 | $cat >&4 <<'EOM' | |
12199 | but not the normal fd_set macros! Gaaack! I'll have to cover for you. | |
12200 | EOM | |
12201 | d_fd_macros="$undef" | |
12202 | fi | |
12203 | else | |
12204 | $cat <<'EOM' | |
12205 | Hmm, your compiler has some difficulty with fd_set. Checking further... | |
12206 | EOM | |
5440bc8e | 12207 | set try |
b4eb6b3d JH |
12208 | if eval $compile; then |
12209 | d_fds_bits="$undef" | |
12210 | d_fd_set="$define" | |
12211 | echo "Well, your system has some sort of fd_set available..." >&4 | |
5440bc8e | 12212 | if $run ./try; then |
b4eb6b3d JH |
12213 | echo "and you have the normal fd_set macros." >&4 |
12214 | d_fd_macros="$define" | |
12215 | else | |
12216 | $cat <<'EOM' | |
12217 | but not the normal fd_set macros! Gross! More work for me... | |
12218 | EOM | |
12219 | d_fd_macros="$undef" | |
12220 | fi | |
12221 | else | |
12222 | echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 | |
12223 | d_fd_set="$undef" | |
12224 | d_fds_bits="$undef" | |
12225 | d_fd_macros="$undef" | |
12226 | fi | |
12227 | fi | |
5440bc8e | 12228 | $rm -f try try.* |
b4eb6b3d JH |
12229 | |
12230 | : see if fgetpos exists | |
12231 | set fgetpos d_fgetpos | |
12232 | eval $inlibc | |
12233 | ||
758a5d79 JH |
12234 | : see if finite exists |
12235 | set finite d_finite | |
12236 | eval $inlibc | |
12237 | ||
12238 | : see if finitel exists | |
12239 | set finitel d_finitel | |
12240 | eval $inlibc | |
12241 | ||
b4eb6b3d JH |
12242 | : see if flock exists |
12243 | set flock d_flock | |
12244 | eval $inlibc | |
12245 | ||
2ef53570 JH |
12246 | : see if prototype for flock is available |
12247 | echo " " | |
12248 | set d_flockproto flock $i_sysfile sys/file.h | |
12249 | eval $hasproto | |
12250 | ||
b4eb6b3d JH |
12251 | : see if fork exists |
12252 | set fork d_fork | |
12253 | eval $inlibc | |
12254 | ||
758a5d79 JH |
12255 | : see if fp_class exists |
12256 | set fp_class d_fp_class | |
12257 | eval $inlibc | |
12258 | ||
b4eb6b3d JH |
12259 | : see if pathconf exists |
12260 | set pathconf d_pathconf | |
12261 | eval $inlibc | |
12262 | ||
12263 | : see if fpathconf exists | |
12264 | set fpathconf d_fpathconf | |
12265 | eval $inlibc | |
12266 | ||
758a5d79 JH |
12267 | : see if fpclass exists |
12268 | set fpclass d_fpclass | |
12269 | eval $inlibc | |
12270 | ||
12271 | : see if fpclassify exists | |
12272 | set fpclassify d_fpclassify | |
12273 | eval $inlibc | |
12274 | ||
12275 | : see if fpclassl exists | |
12276 | set fpclassl d_fpclassl | |
12277 | eval $inlibc | |
12278 | ||
b4eb6b3d JH |
12279 | |
12280 | : check for fpos64_t | |
12281 | echo " " | |
12282 | echo "Checking to see if you have fpos64_t..." >&4 | |
12283 | $cat >try.c <<EOCP | |
12284 | #include <stdio.h> | |
12285 | int main() { fpos64_t x = 7; } | |
12286 | EOCP | |
12287 | set try | |
12288 | if eval $compile; then | |
12289 | val="$define" | |
12290 | echo "You have fpos64_t." | |
12291 | else | |
12292 | val="$undef" | |
12293 | echo "You do not have fpos64_t." | |
12294 | case "$fpossize" in | |
12295 | 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;; | |
12296 | esac | |
12297 | fi | |
12298 | $rm -f try.* try | |
12299 | set d_fpos64_t | |
12300 | eval $setvar | |
12301 | ||
12302 | : see if frexpl exists | |
12303 | set frexpl d_frexpl | |
12304 | eval $inlibc | |
12305 | ||
b4eb6b3d JH |
12306 | : see if this is a sys/param system |
12307 | set sys/param.h i_sysparam | |
12308 | eval $inhdr | |
12309 | ||
12310 | : see if this is a sys/mount.h system | |
12311 | set sys/mount.h i_sysmount | |
12312 | eval $inhdr | |
12313 | ||
b4eb6b3d JH |
12314 | |
12315 | echo " " | |
12316 | echo "Checking to see if your system supports struct fs_data..." >&4 | |
12317 | set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h | |
12318 | eval $hasstruct | |
12319 | case "$d_fs_data_s" in | |
12320 | "$define") echo "Yes, it does." ;; | |
12321 | *) echo "No, it doesn't." ;; | |
12322 | esac | |
12323 | ||
12324 | : see if fseeko exists | |
12325 | set fseeko d_fseeko | |
12326 | eval $inlibc | |
12327 | case "$longsize" in | |
12328 | 8) echo "(Your long is 64 bits, so you could use fseek.)" ;; | |
12329 | esac | |
12330 | ||
12331 | : see if fsetpos exists | |
12332 | set fsetpos d_fsetpos | |
12333 | eval $inlibc | |
12334 | ||
12335 | ||
12336 | : see if fstatfs exists | |
12337 | set fstatfs d_fstatfs | |
12338 | eval $inlibc | |
12339 | ||
12340 | ||
12341 | : see if statvfs exists | |
12342 | set statvfs d_statvfs | |
12343 | eval $inlibc | |
12344 | ||
12345 | : see if fstatvfs exists | |
12346 | set fstatvfs d_fstatvfs | |
12347 | eval $inlibc | |
12348 | ||
12349 | ||
411ab01c JH |
12350 | : see if fsync exists |
12351 | set fsync d_fsync | |
12352 | eval $inlibc | |
12353 | ||
b4eb6b3d JH |
12354 | : see if ftello exists |
12355 | set ftello d_ftello | |
12356 | eval $inlibc | |
12357 | case "$longsize" in | |
12358 | 8) echo "(Your long is 64 bits, so you could use ftell.)" ;; | |
12359 | esac | |
12360 | ||
12361 | : see if getcwd exists | |
12362 | set getcwd d_getcwd | |
12363 | eval $inlibc | |
12364 | ||
12365 | : see if getespwnam exists | |
12366 | set getespwnam d_getespwnam | |
12367 | eval $inlibc | |
12368 | ||
12369 | ||
12370 | : see if getfsstat exists | |
12371 | set getfsstat d_getfsstat | |
12372 | eval $inlibc | |
12373 | ||
12374 | : see if getgrent exists | |
12375 | set getgrent d_getgrent | |
12376 | eval $inlibc | |
12377 | ||
10bc17b6 JH |
12378 | : see if getgrent_r exists |
12379 | set getgrent_r d_getgrent_r | |
12380 | eval $inlibc | |
12381 | case "$d_getgrent_r" in | |
12382 | "$define") | |
12383 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" | |
c18e646a JH |
12384 | case "$d_getgrent_r_proto:$usethreads" in |
12385 | ":define") d_getgrent_r_proto=define | |
a48ec845 JH |
12386 | set d_getgrent_r_proto getgrent_r $hdrs |
12387 | eval $hasproto ;; | |
12388 | *) ;; | |
12389 | esac | |
12390 | case "$d_getgrent_r_proto" in | |
12391 | define) | |
10bc17b6 JH |
12392 | case "$getgrent_r_proto" in |
12393 | ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);' | |
12394 | ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;; | |
12395 | esac | |
12396 | case "$getgrent_r_proto" in | |
12397 | ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);' | |
12398 | ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;; | |
12399 | esac | |
12400 | case "$getgrent_r_proto" in | |
12401 | ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);' | |
12402 | ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;; | |
12403 | esac | |
12404 | case "$getgrent_r_proto" in | |
12405 | ''|0) try='struct group* getgrent_r(struct group*, char*, int);' | |
12406 | ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;; | |
12407 | esac | |
12408 | case "$getgrent_r_proto" in | |
12409 | ''|0) try='int getgrent_r(struct group*, char*, int);' | |
12410 | ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;; | |
12411 | esac | |
12412 | case "$getgrent_r_proto" in | |
12413 | ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);' | |
12414 | ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;; | |
12415 | esac | |
12416 | case "$getgrent_r_proto" in | |
90e831dc | 12417 | ''|0) d_getgrent_r=undef |
10bc17b6 | 12418 | getgrent_r_proto=0 |
a48ec845 | 12419 | echo "Disabling getgrent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12420 | * ) case "$getgrent_r_proto" in |
12421 | REENTRANT_PROTO*) ;; | |
12422 | *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;; | |
12423 | esac | |
12424 | echo "Prototype: $try" ;; | |
12425 | esac | |
12426 | ;; | |
c18e646a JH |
12427 | *) case "$usethreads" in |
12428 | define) echo "getgrent_r has no prototype, not using it." >&4 ;; | |
12429 | esac | |
90e831dc SB |
12430 | d_getgrent_r=undef |
12431 | getgrent_r_proto=0 | |
c18e646a | 12432 | ;; |
a48ec845 JH |
12433 | esac |
12434 | ;; | |
10bc17b6 JH |
12435 | *) getgrent_r_proto=0 |
12436 | ;; | |
12437 | esac | |
12438 | ||
12439 | : see if getgrgid_r exists | |
12440 | set getgrgid_r d_getgrgid_r | |
12441 | eval $inlibc | |
12442 | case "$d_getgrgid_r" in | |
12443 | "$define") | |
12444 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" | |
c18e646a JH |
12445 | case "$d_getgrgid_r_proto:$usethreads" in |
12446 | ":define") d_getgrgid_r_proto=define | |
a48ec845 JH |
12447 | set d_getgrgid_r_proto getgrgid_r $hdrs |
12448 | eval $hasproto ;; | |
12449 | *) ;; | |
12450 | esac | |
12451 | case "$d_getgrgid_r_proto" in | |
12452 | define) | |
10bc17b6 JH |
12453 | case "$getgrgid_r_proto" in |
12454 | ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);' | |
12455 | ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;; | |
12456 | esac | |
12457 | case "$getgrgid_r_proto" in | |
12458 | ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);' | |
12459 | ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;; | |
12460 | esac | |
12461 | case "$getgrgid_r_proto" in | |
12462 | ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);' | |
12463 | ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;; | |
12464 | esac | |
12465 | case "$getgrgid_r_proto" in | |
12466 | ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);' | |
12467 | ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;; | |
12468 | esac | |
12469 | case "$getgrgid_r_proto" in | |
90e831dc | 12470 | ''|0) d_getgrgid_r=undef |
10bc17b6 | 12471 | getgrgid_r_proto=0 |
a48ec845 | 12472 | echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12473 | * ) case "$getgrgid_r_proto" in |
12474 | REENTRANT_PROTO*) ;; | |
12475 | *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;; | |
12476 | esac | |
12477 | echo "Prototype: $try" ;; | |
12478 | esac | |
12479 | ;; | |
c18e646a JH |
12480 | *) case "$usethreads" in |
12481 | define) echo "getgrgid_r has no prototype, not using it." >&4 ;; | |
12482 | esac | |
90e831dc SB |
12483 | d_getgrgid_r=undef |
12484 | getgrgid_r_proto=0 | |
c18e646a | 12485 | ;; |
a48ec845 JH |
12486 | esac |
12487 | ;; | |
10bc17b6 JH |
12488 | *) getgrgid_r_proto=0 |
12489 | ;; | |
12490 | esac | |
12491 | ||
12492 | : see if getgrnam_r exists | |
12493 | set getgrnam_r d_getgrnam_r | |
12494 | eval $inlibc | |
12495 | case "$d_getgrnam_r" in | |
12496 | "$define") | |
12497 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" | |
c18e646a JH |
12498 | case "$d_getgrnam_r_proto:$usethreads" in |
12499 | ":define") d_getgrnam_r_proto=define | |
a48ec845 JH |
12500 | set d_getgrnam_r_proto getgrnam_r $hdrs |
12501 | eval $hasproto ;; | |
12502 | *) ;; | |
12503 | esac | |
12504 | case "$d_getgrnam_r_proto" in | |
12505 | define) | |
10bc17b6 JH |
12506 | case "$getgrnam_r_proto" in |
12507 | ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);' | |
12508 | ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;; | |
12509 | esac | |
12510 | case "$getgrnam_r_proto" in | |
12511 | ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);' | |
12512 | ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;; | |
12513 | esac | |
12514 | case "$getgrnam_r_proto" in | |
12515 | ''|0) try='struct group* getgrnam_r(const char*, char*, int);' | |
12516 | ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;; | |
12517 | esac | |
12518 | case "$getgrnam_r_proto" in | |
12519 | ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);' | |
12520 | ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;; | |
12521 | esac | |
12522 | case "$getgrnam_r_proto" in | |
12523 | ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);' | |
12524 | ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;; | |
12525 | esac | |
12526 | case "$getgrnam_r_proto" in | |
90e831dc | 12527 | ''|0) d_getgrnam_r=undef |
10bc17b6 | 12528 | getgrnam_r_proto=0 |
a48ec845 | 12529 | echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12530 | * ) case "$getgrnam_r_proto" in |
12531 | REENTRANT_PROTO*) ;; | |
12532 | *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;; | |
12533 | esac | |
12534 | echo "Prototype: $try" ;; | |
12535 | esac | |
12536 | ;; | |
c18e646a JH |
12537 | *) case "$usethreads" in |
12538 | define) echo "getgrnam_r has no prototype, not using it." >&4 ;; | |
12539 | esac | |
90e831dc SB |
12540 | d_getgrnam_r=undef |
12541 | getgrnam_r_proto=0 | |
c18e646a | 12542 | ;; |
a48ec845 JH |
12543 | esac |
12544 | ;; | |
10bc17b6 JH |
12545 | *) getgrnam_r_proto=0 |
12546 | ;; | |
12547 | esac | |
12548 | ||
b4eb6b3d JH |
12549 | : see if gethostbyaddr exists |
12550 | set gethostbyaddr d_gethbyaddr | |
12551 | eval $inlibc | |
12552 | ||
12553 | : see if gethostbyname exists | |
12554 | set gethostbyname d_gethbyname | |
12555 | eval $inlibc | |
12556 | ||
12557 | : see if gethostent exists | |
12558 | set gethostent d_gethent | |
12559 | eval $inlibc | |
12560 | ||
12561 | : see how we will look up host name | |
12562 | echo " " | |
12563 | call='' | |
12564 | if set gethostname val -f d_gethname; eval $csym; $val; then | |
12565 | echo 'gethostname() found.' >&4 | |
12566 | d_gethname="$define" | |
12567 | call=gethostname | |
12568 | fi | |
12569 | if set uname val -f d_uname; eval $csym; $val; then | |
12570 | if ./xenix; then | |
12571 | $cat <<'EOM' | |
12572 | uname() was found, but you're running xenix, and older versions of xenix | |
12573 | have a broken uname(). If you don't really know whether your xenix is old | |
12574 | enough to have a broken system call, use the default answer. | |
12575 | ||
12576 | EOM | |
12577 | dflt=y | |
12578 | case "$d_uname" in | |
12579 | "$define") dflt=n;; | |
12580 | esac | |
12581 | rp='Is your uname() broken?' | |
12582 | . ./myread | |
12583 | case "$ans" in | |
12584 | n*) d_uname="$define"; call=uname;; | |
12585 | esac | |
12586 | else | |
12587 | echo 'uname() found.' >&4 | |
12588 | d_uname="$define" | |
12589 | case "$call" in | |
12590 | '') call=uname ;; | |
12591 | esac | |
12592 | fi | |
12593 | fi | |
12594 | case "$d_gethname" in | |
12595 | '') d_gethname="$undef";; | |
12596 | esac | |
12597 | case "$d_uname" in | |
12598 | '') d_uname="$undef";; | |
12599 | esac | |
12600 | case "$d_uname$d_gethname" in | |
12601 | *define*) | |
12602 | dflt=n | |
12603 | cat <<EOM | |
12604 | ||
12605 | Every now and then someone has a $call() that lies about the hostname | |
12606 | but can't be fixed for political or economic reasons. If you wish, I can | |
12607 | pretend $call() isn't there and maybe compute hostname at run-time | |
12608 | thanks to the '$phostname' command. | |
12609 | ||
12610 | EOM | |
12611 | rp="Shall I ignore $call() from now on?" | |
12612 | . ./myread | |
12613 | case "$ans" in | |
12614 | y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";; | |
12615 | esac;; | |
12616 | esac | |
12617 | case "$phostname" in | |
12618 | '') aphostname='';; | |
12619 | *) case "$aphostname" in | |
12620 | /*) ;; | |
12621 | *) set X $phostname | |
12622 | shift | |
12623 | file=$1 | |
12624 | shift | |
12625 | file=`./loc $file $file $pth` | |
12626 | aphostname=`echo $file $*` | |
12627 | ;; | |
12628 | esac | |
12629 | ;; | |
12630 | esac | |
12631 | case "$d_uname$d_gethname" in | |
12632 | *define*) ;; | |
12633 | *) | |
12634 | case "$phostname" in | |
12635 | '') | |
12636 | echo "There will be no way for $package to get your hostname." >&4;; | |
12637 | *) | |
12638 | echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4 | |
12639 | ;; | |
12640 | esac;; | |
12641 | esac | |
12642 | case "$d_phostname" in | |
12643 | '') d_phostname="$undef";; | |
12644 | esac | |
12645 | ||
10bc17b6 JH |
12646 | : see if gethostbyaddr_r exists |
12647 | set gethostbyaddr_r d_gethostbyaddr_r | |
12648 | eval $inlibc | |
12649 | case "$d_gethostbyaddr_r" in | |
12650 | "$define") | |
12651 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
12652 | case "$d_gethostbyaddr_r_proto:$usethreads" in |
12653 | ":define") d_gethostbyaddr_r_proto=define | |
a48ec845 JH |
12654 | set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs |
12655 | eval $hasproto ;; | |
12656 | *) ;; | |
12657 | esac | |
12658 | case "$d_gethostbyaddr_r_proto" in | |
12659 | define) | |
10bc17b6 JH |
12660 | case "$gethostbyaddr_r_proto" in |
12661 | ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);' | |
12662 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;; | |
12663 | esac | |
12664 | case "$gethostbyaddr_r_proto" in | |
12665 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);' | |
12666 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;; | |
12667 | esac | |
12668 | case "$gethostbyaddr_r_proto" in | |
12669 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);' | |
12670 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;; | |
12671 | esac | |
12672 | case "$gethostbyaddr_r_proto" in | |
12673 | ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);' | |
12674 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;; | |
12675 | esac | |
12676 | case "$gethostbyaddr_r_proto" in | |
12677 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);' | |
12678 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;; | |
12679 | esac | |
12680 | case "$gethostbyaddr_r_proto" in | |
12681 | ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);' | |
12682 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;; | |
12683 | esac | |
12684 | case "$gethostbyaddr_r_proto" in | |
12685 | ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);' | |
12686 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;; | |
12687 | esac | |
12688 | case "$gethostbyaddr_r_proto" in | |
12689 | ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);' | |
12690 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;; | |
12691 | esac | |
12692 | case "$gethostbyaddr_r_proto" in | |
12693 | ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);' | |
12694 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;; | |
12695 | esac | |
12696 | case "$gethostbyaddr_r_proto" in | |
12697 | ''|0) try='int gethostbyaddr_r(const char*, int, int);' | |
12698 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;; | |
12699 | esac | |
12700 | case "$gethostbyaddr_r_proto" in | |
c71a3471 JH |
12701 | ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);' |
12702 | ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;; | |
12703 | esac | |
12704 | case "$gethostbyaddr_r_proto" in | |
90e831dc | 12705 | ''|0) d_gethostbyaddr_r=undef |
10bc17b6 | 12706 | gethostbyaddr_r_proto=0 |
a48ec845 | 12707 | echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12708 | * ) case "$gethostbyaddr_r_proto" in |
12709 | REENTRANT_PROTO*) ;; | |
12710 | *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;; | |
12711 | esac | |
12712 | echo "Prototype: $try" ;; | |
12713 | esac | |
12714 | ;; | |
c18e646a JH |
12715 | *) case "$usethreads" in |
12716 | define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;; | |
12717 | esac | |
90e831dc SB |
12718 | d_gethostbyaddr_r=undef |
12719 | gethostbyaddr_r_proto=0 | |
c18e646a | 12720 | ;; |
a48ec845 JH |
12721 | esac |
12722 | ;; | |
10bc17b6 JH |
12723 | *) gethostbyaddr_r_proto=0 |
12724 | ;; | |
12725 | esac | |
12726 | ||
12727 | : see if gethostbyname_r exists | |
12728 | set gethostbyname_r d_gethostbyname_r | |
12729 | eval $inlibc | |
12730 | case "$d_gethostbyname_r" in | |
12731 | "$define") | |
12732 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
12733 | case "$d_gethostbyname_r_proto:$usethreads" in |
12734 | ":define") d_gethostbyname_r_proto=define | |
a48ec845 JH |
12735 | set d_gethostbyname_r_proto gethostbyname_r $hdrs |
12736 | eval $hasproto ;; | |
12737 | *) ;; | |
12738 | esac | |
12739 | case "$d_gethostbyname_r_proto" in | |
12740 | define) | |
10bc17b6 JH |
12741 | case "$gethostbyname_r_proto" in |
12742 | ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);' | |
12743 | ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;; | |
12744 | esac | |
12745 | case "$gethostbyname_r_proto" in | |
12746 | ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);' | |
12747 | ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;; | |
12748 | esac | |
12749 | case "$gethostbyname_r_proto" in | |
12750 | ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);' | |
12751 | ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;; | |
12752 | esac | |
12753 | case "$gethostbyname_r_proto" in | |
90e831dc | 12754 | ''|0) d_gethostbyname_r=undef |
10bc17b6 | 12755 | gethostbyname_r_proto=0 |
a48ec845 | 12756 | echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12757 | * ) case "$gethostbyname_r_proto" in |
12758 | REENTRANT_PROTO*) ;; | |
12759 | *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;; | |
12760 | esac | |
12761 | echo "Prototype: $try" ;; | |
12762 | esac | |
12763 | ;; | |
c18e646a JH |
12764 | *) case "$usethreads" in |
12765 | define) echo "gethostbyname_r has no prototype, not using it." >&4 ;; | |
12766 | esac | |
90e831dc SB |
12767 | d_gethostbyname_r=undef |
12768 | gethostbyname_r_proto=0 | |
c18e646a | 12769 | ;; |
a48ec845 JH |
12770 | esac |
12771 | ;; | |
10bc17b6 JH |
12772 | *) gethostbyname_r_proto=0 |
12773 | ;; | |
12774 | esac | |
12775 | ||
12776 | : see if gethostent_r exists | |
12777 | set gethostent_r d_gethostent_r | |
12778 | eval $inlibc | |
12779 | case "$d_gethostent_r" in | |
12780 | "$define") | |
12781 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
12782 | case "$d_gethostent_r_proto:$usethreads" in |
12783 | ":define") d_gethostent_r_proto=define | |
a48ec845 JH |
12784 | set d_gethostent_r_proto gethostent_r $hdrs |
12785 | eval $hasproto ;; | |
12786 | *) ;; | |
12787 | esac | |
12788 | case "$d_gethostent_r_proto" in | |
12789 | define) | |
10bc17b6 JH |
12790 | case "$gethostent_r_proto" in |
12791 | ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);' | |
12792 | ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;; | |
12793 | esac | |
12794 | case "$gethostent_r_proto" in | |
12795 | ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);' | |
12796 | ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;; | |
12797 | esac | |
12798 | case "$gethostent_r_proto" in | |
12799 | ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);' | |
12800 | ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;; | |
12801 | esac | |
12802 | case "$gethostent_r_proto" in | |
12803 | ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);' | |
12804 | ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;; | |
12805 | esac | |
12806 | case "$gethostent_r_proto" in | |
12807 | ''|0) try='int gethostent_r(struct hostent*, char*, int);' | |
12808 | ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;; | |
12809 | esac | |
12810 | case "$gethostent_r_proto" in | |
12811 | ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);' | |
12812 | ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;; | |
12813 | esac | |
12814 | case "$gethostent_r_proto" in | |
90e831dc | 12815 | ''|0) d_gethostent_r=undef |
10bc17b6 | 12816 | gethostent_r_proto=0 |
a48ec845 | 12817 | echo "Disabling gethostent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12818 | * ) case "$gethostent_r_proto" in |
12819 | REENTRANT_PROTO*) ;; | |
12820 | *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;; | |
12821 | esac | |
12822 | echo "Prototype: $try" ;; | |
12823 | esac | |
12824 | ;; | |
c18e646a JH |
12825 | *) case "$usethreads" in |
12826 | define) echo "gethostent_r has no prototype, not using it." >&4 ;; | |
12827 | esac | |
90e831dc SB |
12828 | d_gethostent_r=undef |
12829 | gethostent_r_proto=0 | |
c18e646a | 12830 | ;; |
a48ec845 JH |
12831 | esac |
12832 | ;; | |
10bc17b6 JH |
12833 | *) gethostent_r_proto=0 |
12834 | ;; | |
12835 | esac | |
b4eb6b3d JH |
12836 | |
12837 | : see if prototypes for various gethostxxx netdb.h functions are available | |
12838 | echo " " | |
12839 | set d_gethostprotos gethostent $i_netdb netdb.h | |
12840 | eval $hasproto | |
12841 | ||
4e0554ec JH |
12842 | : see if getitimer exists |
12843 | set getitimer d_getitimer | |
12844 | eval $inlibc | |
12845 | ||
b4eb6b3d JH |
12846 | : see if getlogin exists |
12847 | set getlogin d_getlogin | |
12848 | eval $inlibc | |
12849 | ||
10bc17b6 JH |
12850 | : see if getlogin_r exists |
12851 | set getlogin_r d_getlogin_r | |
12852 | eval $inlibc | |
12853 | case "$d_getlogin_r" in | |
12854 | "$define") | |
12855 | hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h" | |
c18e646a JH |
12856 | case "$d_getlogin_r_proto:$usethreads" in |
12857 | ":define") d_getlogin_r_proto=define | |
a48ec845 JH |
12858 | set d_getlogin_r_proto getlogin_r $hdrs |
12859 | eval $hasproto ;; | |
12860 | *) ;; | |
12861 | esac | |
12862 | case "$d_getlogin_r_proto" in | |
12863 | define) | |
10bc17b6 JH |
12864 | case "$getlogin_r_proto" in |
12865 | ''|0) try='int getlogin_r(char*, size_t);' | |
12866 | ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;; | |
12867 | esac | |
12868 | case "$getlogin_r_proto" in | |
12869 | ''|0) try='int getlogin_r(char*, int);' | |
12870 | ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;; | |
12871 | esac | |
12872 | case "$getlogin_r_proto" in | |
12873 | ''|0) try='char* getlogin_r(char*, size_t);' | |
12874 | ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;; | |
12875 | esac | |
12876 | case "$getlogin_r_proto" in | |
12877 | ''|0) try='char* getlogin_r(char*, int);' | |
12878 | ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;; | |
12879 | esac | |
12880 | case "$getlogin_r_proto" in | |
90e831dc | 12881 | ''|0) d_getlogin_r=undef |
10bc17b6 | 12882 | getlogin_r_proto=0 |
a48ec845 | 12883 | echo "Disabling getlogin_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12884 | * ) case "$getlogin_r_proto" in |
12885 | REENTRANT_PROTO*) ;; | |
12886 | *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;; | |
12887 | esac | |
12888 | echo "Prototype: $try" ;; | |
12889 | esac | |
12890 | ;; | |
c18e646a JH |
12891 | *) case "$usethreads" in |
12892 | define) echo "getlogin_r has no prototype, not using it." >&4 ;; | |
12893 | esac | |
90e831dc SB |
12894 | d_getlogin_r=undef |
12895 | getlogin_r_proto=0 | |
c18e646a | 12896 | ;; |
a48ec845 JH |
12897 | esac |
12898 | ;; | |
10bc17b6 JH |
12899 | *) getlogin_r_proto=0 |
12900 | ;; | |
12901 | esac | |
12902 | ||
b4eb6b3d JH |
12903 | : see if getmnt exists |
12904 | set getmnt d_getmnt | |
12905 | eval $inlibc | |
12906 | ||
12907 | : see if getmntent exists | |
12908 | set getmntent d_getmntent | |
12909 | eval $inlibc | |
12910 | ||
12911 | : see if getnetbyaddr exists | |
12912 | set getnetbyaddr d_getnbyaddr | |
12913 | eval $inlibc | |
12914 | ||
12915 | : see if getnetbyname exists | |
12916 | set getnetbyname d_getnbyname | |
12917 | eval $inlibc | |
12918 | ||
12919 | : see if getnetent exists | |
12920 | set getnetent d_getnent | |
12921 | eval $inlibc | |
12922 | ||
10bc17b6 JH |
12923 | : see if getnetbyaddr_r exists |
12924 | set getnetbyaddr_r d_getnetbyaddr_r | |
12925 | eval $inlibc | |
12926 | case "$d_getnetbyaddr_r" in | |
12927 | "$define") | |
12928 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
12929 | case "$d_getnetbyaddr_r_proto:$usethreads" in |
12930 | ":define") d_getnetbyaddr_r_proto=define | |
a48ec845 JH |
12931 | set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs |
12932 | eval $hasproto ;; | |
12933 | *) ;; | |
12934 | esac | |
12935 | case "$d_getnetbyaddr_r_proto" in | |
12936 | define) | |
10bc17b6 JH |
12937 | case "$getnetbyaddr_r_proto" in |
12938 | ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);' | |
12939 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;; | |
12940 | esac | |
12941 | case "$getnetbyaddr_r_proto" in | |
12942 | ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);' | |
12943 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;; | |
12944 | esac | |
12945 | case "$getnetbyaddr_r_proto" in | |
12946 | ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);' | |
12947 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;; | |
12948 | esac | |
12949 | case "$getnetbyaddr_r_proto" in | |
12950 | ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);' | |
12951 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;; | |
12952 | esac | |
12953 | case "$getnetbyaddr_r_proto" in | |
12954 | ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);' | |
12955 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;; | |
12956 | esac | |
12957 | case "$getnetbyaddr_r_proto" in | |
12958 | ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);' | |
12959 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;; | |
12960 | esac | |
12961 | case "$getnetbyaddr_r_proto" in | |
12962 | ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);' | |
12963 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;; | |
12964 | esac | |
12965 | case "$getnetbyaddr_r_proto" in | |
c71a3471 JH |
12966 | ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);' |
12967 | ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;; | |
12968 | esac | |
12969 | case "$getnetbyaddr_r_proto" in | |
90e831dc | 12970 | ''|0) d_getnetbyaddr_r=undef |
10bc17b6 | 12971 | getnetbyaddr_r_proto=0 |
a48ec845 | 12972 | echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
12973 | * ) case "$getnetbyaddr_r_proto" in |
12974 | REENTRANT_PROTO*) ;; | |
12975 | *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;; | |
12976 | esac | |
12977 | echo "Prototype: $try" ;; | |
12978 | esac | |
12979 | ;; | |
c18e646a JH |
12980 | *) case "$usethreads" in |
12981 | define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;; | |
12982 | esac | |
90e831dc SB |
12983 | d_getnetbyaddr_r=undef |
12984 | getnetbyaddr_r_proto=0 | |
c18e646a | 12985 | ;; |
a48ec845 JH |
12986 | esac |
12987 | ;; | |
10bc17b6 JH |
12988 | *) getnetbyaddr_r_proto=0 |
12989 | ;; | |
12990 | esac | |
12991 | ||
12992 | : see if getnetbyname_r exists | |
12993 | set getnetbyname_r d_getnetbyname_r | |
12994 | eval $inlibc | |
12995 | case "$d_getnetbyname_r" in | |
12996 | "$define") | |
12997 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
12998 | case "$d_getnetbyname_r_proto:$usethreads" in |
12999 | ":define") d_getnetbyname_r_proto=define | |
a48ec845 JH |
13000 | set d_getnetbyname_r_proto getnetbyname_r $hdrs |
13001 | eval $hasproto ;; | |
13002 | *) ;; | |
13003 | esac | |
13004 | case "$d_getnetbyname_r_proto" in | |
13005 | define) | |
10bc17b6 JH |
13006 | case "$getnetbyname_r_proto" in |
13007 | ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);' | |
13008 | ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;; | |
13009 | esac | |
13010 | case "$getnetbyname_r_proto" in | |
13011 | ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);' | |
13012 | ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;; | |
13013 | esac | |
13014 | case "$getnetbyname_r_proto" in | |
13015 | ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);' | |
13016 | ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;; | |
13017 | esac | |
13018 | case "$getnetbyname_r_proto" in | |
13019 | ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);' | |
13020 | ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;; | |
13021 | esac | |
13022 | case "$getnetbyname_r_proto" in | |
90e831dc | 13023 | ''|0) d_getnetbyname_r=undef |
10bc17b6 | 13024 | getnetbyname_r_proto=0 |
a48ec845 | 13025 | echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13026 | * ) case "$getnetbyname_r_proto" in |
13027 | REENTRANT_PROTO*) ;; | |
13028 | *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;; | |
13029 | esac | |
13030 | echo "Prototype: $try" ;; | |
13031 | esac | |
13032 | ;; | |
c18e646a JH |
13033 | *) case "$usethreads" in |
13034 | define) echo "getnetbyname_r has no prototype, not using it." >&4 ;; | |
13035 | esac | |
90e831dc SB |
13036 | d_getnetbyname_r=undef |
13037 | getnetbyname_r_proto=0 | |
c18e646a | 13038 | ;; |
a48ec845 JH |
13039 | esac |
13040 | ;; | |
10bc17b6 JH |
13041 | *) getnetbyname_r_proto=0 |
13042 | ;; | |
13043 | esac | |
13044 | ||
13045 | : see if getnetent_r exists | |
13046 | set getnetent_r d_getnetent_r | |
13047 | eval $inlibc | |
13048 | case "$d_getnetent_r" in | |
13049 | "$define") | |
13050 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13051 | case "$d_getnetent_r_proto:$usethreads" in |
13052 | ":define") d_getnetent_r_proto=define | |
a48ec845 JH |
13053 | set d_getnetent_r_proto getnetent_r $hdrs |
13054 | eval $hasproto ;; | |
13055 | *) ;; | |
13056 | esac | |
13057 | case "$d_getnetent_r_proto" in | |
13058 | define) | |
10bc17b6 JH |
13059 | case "$getnetent_r_proto" in |
13060 | ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);' | |
13061 | ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;; | |
13062 | esac | |
13063 | case "$getnetent_r_proto" in | |
13064 | ''|0) try='int getnetent_r(struct netent*, char*, int, int*);' | |
13065 | ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;; | |
13066 | esac | |
13067 | case "$getnetent_r_proto" in | |
13068 | ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);' | |
13069 | ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;; | |
13070 | esac | |
13071 | case "$getnetent_r_proto" in | |
13072 | ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);' | |
13073 | ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;; | |
13074 | esac | |
13075 | case "$getnetent_r_proto" in | |
13076 | ''|0) try='int getnetent_r(struct netent*, char*, int);' | |
13077 | ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;; | |
13078 | esac | |
13079 | case "$getnetent_r_proto" in | |
13080 | ''|0) try='int getnetent_r(struct netent*, struct netent_data*);' | |
13081 | ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;; | |
13082 | esac | |
13083 | case "$getnetent_r_proto" in | |
90e831dc | 13084 | ''|0) d_getnetent_r=undef |
10bc17b6 | 13085 | getnetent_r_proto=0 |
a48ec845 | 13086 | echo "Disabling getnetent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13087 | * ) case "$getnetent_r_proto" in |
13088 | REENTRANT_PROTO*) ;; | |
13089 | *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;; | |
13090 | esac | |
13091 | echo "Prototype: $try" ;; | |
13092 | esac | |
13093 | ;; | |
c18e646a JH |
13094 | *) case "$usethreads" in |
13095 | define) echo "getnetent_r has no prototype, not using it." >&4 ;; | |
13096 | esac | |
90e831dc SB |
13097 | d_getnetent_r=undef |
13098 | getnetent_r_proto=0 | |
c18e646a | 13099 | ;; |
a48ec845 JH |
13100 | esac |
13101 | ;; | |
10bc17b6 JH |
13102 | *) getnetent_r_proto=0 |
13103 | ;; | |
13104 | esac | |
13105 | ||
b4eb6b3d JH |
13106 | : see if prototypes for various getnetxxx netdb.h functions are available |
13107 | echo " " | |
13108 | set d_getnetprotos getnetent $i_netdb netdb.h | |
13109 | eval $hasproto | |
13110 | ||
0c0643d0 JH |
13111 | : see if getpagesize exists |
13112 | set getpagesize d_getpagsz | |
13113 | eval $inlibc | |
13114 | ||
b4eb6b3d JH |
13115 | |
13116 | : see if getprotobyname exists | |
13117 | set getprotobyname d_getpbyname | |
13118 | eval $inlibc | |
13119 | ||
13120 | : see if getprotobynumber exists | |
13121 | set getprotobynumber d_getpbynumber | |
13122 | eval $inlibc | |
13123 | ||
13124 | : see if getprotoent exists | |
13125 | set getprotoent d_getpent | |
13126 | eval $inlibc | |
13127 | ||
13128 | : see if getpgid exists | |
13129 | set getpgid d_getpgid | |
13130 | eval $inlibc | |
13131 | ||
13132 | : see if getpgrp2 exists | |
13133 | set getpgrp2 d_getpgrp2 | |
13134 | eval $inlibc | |
13135 | ||
13136 | : see if getppid exists | |
13137 | set getppid d_getppid | |
13138 | eval $inlibc | |
13139 | ||
13140 | : see if getpriority exists | |
13141 | set getpriority d_getprior | |
13142 | eval $inlibc | |
13143 | ||
10bc17b6 JH |
13144 | : see if getprotobyname_r exists |
13145 | set getprotobyname_r d_getprotobyname_r | |
13146 | eval $inlibc | |
13147 | case "$d_getprotobyname_r" in | |
13148 | "$define") | |
13149 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13150 | case "$d_getprotobyname_r_proto:$usethreads" in |
13151 | ":define") d_getprotobyname_r_proto=define | |
a48ec845 JH |
13152 | set d_getprotobyname_r_proto getprotobyname_r $hdrs |
13153 | eval $hasproto ;; | |
13154 | *) ;; | |
13155 | esac | |
13156 | case "$d_getprotobyname_r_proto" in | |
13157 | define) | |
10bc17b6 JH |
13158 | case "$getprotobyname_r_proto" in |
13159 | ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);' | |
13160 | ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;; | |
13161 | esac | |
13162 | case "$getprotobyname_r_proto" in | |
13163 | ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);' | |
13164 | ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;; | |
13165 | esac | |
13166 | case "$getprotobyname_r_proto" in | |
13167 | ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);' | |
13168 | ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;; | |
13169 | esac | |
13170 | case "$getprotobyname_r_proto" in | |
90e831dc | 13171 | ''|0) d_getprotobyname_r=undef |
10bc17b6 | 13172 | getprotobyname_r_proto=0 |
a48ec845 | 13173 | echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13174 | * ) case "$getprotobyname_r_proto" in |
13175 | REENTRANT_PROTO*) ;; | |
13176 | *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;; | |
13177 | esac | |
13178 | echo "Prototype: $try" ;; | |
13179 | esac | |
13180 | ;; | |
c18e646a JH |
13181 | *) case "$usethreads" in |
13182 | define) echo "getprotobyname_r has no prototype, not using it." >&4 ;; | |
13183 | esac | |
90e831dc SB |
13184 | d_getprotobyname_r=undef |
13185 | getprotobyname_r_proto=0 | |
c18e646a | 13186 | ;; |
a48ec845 JH |
13187 | esac |
13188 | ;; | |
10bc17b6 JH |
13189 | *) getprotobyname_r_proto=0 |
13190 | ;; | |
13191 | esac | |
13192 | ||
13193 | : see if getprotobynumber_r exists | |
13194 | set getprotobynumber_r d_getprotobynumber_r | |
13195 | eval $inlibc | |
13196 | case "$d_getprotobynumber_r" in | |
13197 | "$define") | |
13198 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13199 | case "$d_getprotobynumber_r_proto:$usethreads" in |
13200 | ":define") d_getprotobynumber_r_proto=define | |
a48ec845 JH |
13201 | set d_getprotobynumber_r_proto getprotobynumber_r $hdrs |
13202 | eval $hasproto ;; | |
13203 | *) ;; | |
13204 | esac | |
13205 | case "$d_getprotobynumber_r_proto" in | |
13206 | define) | |
10bc17b6 JH |
13207 | case "$getprotobynumber_r_proto" in |
13208 | ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);' | |
13209 | ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;; | |
13210 | esac | |
13211 | case "$getprotobynumber_r_proto" in | |
13212 | ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);' | |
13213 | ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;; | |
13214 | esac | |
13215 | case "$getprotobynumber_r_proto" in | |
13216 | ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);' | |
13217 | ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;; | |
13218 | esac | |
13219 | case "$getprotobynumber_r_proto" in | |
90e831dc | 13220 | ''|0) d_getprotobynumber_r=undef |
10bc17b6 | 13221 | getprotobynumber_r_proto=0 |
a48ec845 | 13222 | echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13223 | * ) case "$getprotobynumber_r_proto" in |
13224 | REENTRANT_PROTO*) ;; | |
13225 | *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;; | |
13226 | esac | |
13227 | echo "Prototype: $try" ;; | |
13228 | esac | |
13229 | ;; | |
c18e646a JH |
13230 | *) case "$usethreads" in |
13231 | define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;; | |
13232 | esac | |
90e831dc SB |
13233 | d_getprotobynumber_r=undef |
13234 | getprotobynumber_r_proto=0 | |
c18e646a | 13235 | ;; |
a48ec845 JH |
13236 | esac |
13237 | ;; | |
10bc17b6 JH |
13238 | *) getprotobynumber_r_proto=0 |
13239 | ;; | |
13240 | esac | |
13241 | ||
13242 | : see if getprotoent_r exists | |
13243 | set getprotoent_r d_getprotoent_r | |
13244 | eval $inlibc | |
13245 | case "$d_getprotoent_r" in | |
13246 | "$define") | |
13247 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13248 | case "$d_getprotoent_r_proto:$usethreads" in |
13249 | ":define") d_getprotoent_r_proto=define | |
a48ec845 JH |
13250 | set d_getprotoent_r_proto getprotoent_r $hdrs |
13251 | eval $hasproto ;; | |
13252 | *) ;; | |
13253 | esac | |
13254 | case "$d_getprotoent_r_proto" in | |
13255 | define) | |
10bc17b6 JH |
13256 | case "$getprotoent_r_proto" in |
13257 | ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);' | |
13258 | ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;; | |
13259 | esac | |
13260 | case "$getprotoent_r_proto" in | |
13261 | ''|0) try='int getprotoent_r(struct protoent*, char*, int);' | |
13262 | ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;; | |
13263 | esac | |
13264 | case "$getprotoent_r_proto" in | |
13265 | ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);' | |
13266 | ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;; | |
13267 | esac | |
13268 | case "$getprotoent_r_proto" in | |
13269 | ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);' | |
13270 | ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;; | |
13271 | esac | |
13272 | case "$getprotoent_r_proto" in | |
90e831dc | 13273 | ''|0) d_getprotoent_r=undef |
10bc17b6 | 13274 | getprotoent_r_proto=0 |
a48ec845 | 13275 | echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13276 | * ) case "$getprotoent_r_proto" in |
13277 | REENTRANT_PROTO*) ;; | |
13278 | *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;; | |
13279 | esac | |
13280 | echo "Prototype: $try" ;; | |
13281 | esac | |
13282 | ;; | |
c18e646a JH |
13283 | *) case "$usethreads" in |
13284 | define) echo "getprotoent_r has no prototype, not using it." >&4 ;; | |
13285 | esac | |
90e831dc SB |
13286 | d_getprotoent_r=undef |
13287 | getprotoent_r_proto=0 | |
c18e646a | 13288 | ;; |
a48ec845 JH |
13289 | esac |
13290 | ;; | |
10bc17b6 JH |
13291 | *) getprotoent_r_proto=0 |
13292 | ;; | |
13293 | esac | |
13294 | ||
b4eb6b3d JH |
13295 | : see if prototypes for various getprotoxxx netdb.h functions are available |
13296 | echo " " | |
13297 | set d_getprotoprotos getprotoent $i_netdb netdb.h | |
13298 | eval $hasproto | |
13299 | ||
13300 | : see if getprpwnam exists | |
13301 | set getprpwnam d_getprpwnam | |
13302 | eval $inlibc | |
13303 | ||
13304 | : see if getpwent exists | |
13305 | set getpwent d_getpwent | |
13306 | eval $inlibc | |
13307 | ||
10bc17b6 JH |
13308 | : see if getpwent_r exists |
13309 | set getpwent_r d_getpwent_r | |
13310 | eval $inlibc | |
13311 | case "$d_getpwent_r" in | |
13312 | "$define") | |
13313 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" | |
c18e646a JH |
13314 | case "$d_getpwent_r_proto:$usethreads" in |
13315 | ":define") d_getpwent_r_proto=define | |
a48ec845 JH |
13316 | set d_getpwent_r_proto getpwent_r $hdrs |
13317 | eval $hasproto ;; | |
13318 | *) ;; | |
13319 | esac | |
13320 | case "$d_getpwent_r_proto" in | |
13321 | define) | |
10bc17b6 JH |
13322 | case "$getpwent_r_proto" in |
13323 | ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);' | |
13324 | ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;; | |
13325 | esac | |
13326 | case "$getpwent_r_proto" in | |
13327 | ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);' | |
13328 | ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;; | |
13329 | esac | |
13330 | case "$getpwent_r_proto" in | |
13331 | ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);' | |
13332 | ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;; | |
13333 | esac | |
13334 | case "$getpwent_r_proto" in | |
13335 | ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);' | |
13336 | ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;; | |
13337 | esac | |
13338 | case "$getpwent_r_proto" in | |
13339 | ''|0) try='int getpwent_r(struct passwd*, char*, int);' | |
13340 | ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;; | |
13341 | esac | |
13342 | case "$getpwent_r_proto" in | |
13343 | ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);' | |
13344 | ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;; | |
13345 | esac | |
13346 | case "$getpwent_r_proto" in | |
90e831dc | 13347 | ''|0) d_getpwent_r=undef |
10bc17b6 | 13348 | getpwent_r_proto=0 |
a48ec845 | 13349 | echo "Disabling getpwent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13350 | * ) case "$getpwent_r_proto" in |
13351 | REENTRANT_PROTO*) ;; | |
13352 | *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;; | |
13353 | esac | |
13354 | echo "Prototype: $try" ;; | |
13355 | esac | |
13356 | ;; | |
c18e646a JH |
13357 | *) case "$usethreads" in |
13358 | define) echo "getpwent_r has no prototype, not using it." >&4 ;; | |
13359 | esac | |
90e831dc SB |
13360 | d_getpwent_r=undef |
13361 | getpwent_r_proto=0 | |
c18e646a | 13362 | ;; |
a48ec845 JH |
13363 | esac |
13364 | ;; | |
10bc17b6 JH |
13365 | *) getpwent_r_proto=0 |
13366 | ;; | |
13367 | esac | |
13368 | ||
13369 | : see if getpwnam_r exists | |
13370 | set getpwnam_r d_getpwnam_r | |
13371 | eval $inlibc | |
13372 | case "$d_getpwnam_r" in | |
13373 | "$define") | |
13374 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" | |
c18e646a JH |
13375 | case "$d_getpwnam_r_proto:$usethreads" in |
13376 | ":define") d_getpwnam_r_proto=define | |
a48ec845 JH |
13377 | set d_getpwnam_r_proto getpwnam_r $hdrs |
13378 | eval $hasproto ;; | |
13379 | *) ;; | |
13380 | esac | |
13381 | case "$d_getpwnam_r_proto" in | |
13382 | define) | |
10bc17b6 JH |
13383 | case "$getpwnam_r_proto" in |
13384 | ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);' | |
13385 | ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;; | |
13386 | esac | |
13387 | case "$getpwnam_r_proto" in | |
13388 | ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);' | |
13389 | ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;; | |
13390 | esac | |
13391 | case "$getpwnam_r_proto" in | |
13392 | ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);' | |
13393 | ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;; | |
13394 | esac | |
13395 | case "$getpwnam_r_proto" in | |
13396 | ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);' | |
13397 | ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;; | |
13398 | esac | |
13399 | case "$getpwnam_r_proto" in | |
90e831dc | 13400 | ''|0) d_getpwnam_r=undef |
10bc17b6 | 13401 | getpwnam_r_proto=0 |
a48ec845 | 13402 | echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13403 | * ) case "$getpwnam_r_proto" in |
13404 | REENTRANT_PROTO*) ;; | |
13405 | *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;; | |
13406 | esac | |
13407 | echo "Prototype: $try" ;; | |
13408 | esac | |
13409 | ;; | |
c18e646a JH |
13410 | *) case "$usethreads" in |
13411 | define) echo "getpwnam_r has no prototype, not using it." >&4 ;; | |
13412 | esac | |
90e831dc SB |
13413 | d_getpwnam_r=undef |
13414 | getpwnam_r_proto=0 | |
c18e646a | 13415 | ;; |
a48ec845 JH |
13416 | esac |
13417 | ;; | |
10bc17b6 JH |
13418 | *) getpwnam_r_proto=0 |
13419 | ;; | |
13420 | esac | |
13421 | ||
13422 | : see if getpwuid_r exists | |
13423 | set getpwuid_r d_getpwuid_r | |
13424 | eval $inlibc | |
13425 | case "$d_getpwuid_r" in | |
13426 | "$define") | |
13427 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" | |
c18e646a JH |
13428 | case "$d_getpwuid_r_proto:$usethreads" in |
13429 | ":define") d_getpwuid_r_proto=define | |
a48ec845 JH |
13430 | set d_getpwuid_r_proto getpwuid_r $hdrs |
13431 | eval $hasproto ;; | |
13432 | *) ;; | |
13433 | esac | |
13434 | case "$d_getpwuid_r_proto" in | |
13435 | define) | |
10bc17b6 JH |
13436 | case "$getpwuid_r_proto" in |
13437 | ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);' | |
13438 | ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;; | |
13439 | esac | |
13440 | case "$getpwuid_r_proto" in | |
13441 | ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);' | |
13442 | ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;; | |
13443 | esac | |
13444 | case "$getpwuid_r_proto" in | |
13445 | ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);' | |
13446 | ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;; | |
13447 | esac | |
13448 | case "$getpwuid_r_proto" in | |
13449 | ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);' | |
13450 | ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;; | |
13451 | esac | |
13452 | case "$getpwuid_r_proto" in | |
90e831dc | 13453 | ''|0) d_getpwuid_r=undef |
10bc17b6 | 13454 | getpwuid_r_proto=0 |
a48ec845 | 13455 | echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13456 | * ) case "$getpwuid_r_proto" in |
13457 | REENTRANT_PROTO*) ;; | |
13458 | *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;; | |
13459 | esac | |
13460 | echo "Prototype: $try" ;; | |
13461 | esac | |
13462 | ;; | |
c18e646a JH |
13463 | *) case "$usethreads" in |
13464 | define) echo "getpwuid_r has no prototype, not using it." >&4 ;; | |
13465 | esac | |
90e831dc SB |
13466 | d_getpwuid_r=undef |
13467 | getpwuid_r_proto=0 | |
c18e646a | 13468 | ;; |
a48ec845 JH |
13469 | esac |
13470 | ;; | |
10bc17b6 JH |
13471 | *) getpwuid_r_proto=0 |
13472 | ;; | |
13473 | esac | |
13474 | ||
b4eb6b3d JH |
13475 | |
13476 | : see if getservbyname exists | |
13477 | set getservbyname d_getsbyname | |
13478 | eval $inlibc | |
13479 | ||
13480 | : see if getservbyport exists | |
13481 | set getservbyport d_getsbyport | |
13482 | eval $inlibc | |
13483 | ||
13484 | : see if getservent exists | |
13485 | set getservent d_getsent | |
13486 | eval $inlibc | |
13487 | ||
10bc17b6 JH |
13488 | : see if getservbyname_r exists |
13489 | set getservbyname_r d_getservbyname_r | |
13490 | eval $inlibc | |
13491 | case "$d_getservbyname_r" in | |
13492 | "$define") | |
13493 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13494 | case "$d_getservbyname_r_proto:$usethreads" in |
13495 | ":define") d_getservbyname_r_proto=define | |
a48ec845 JH |
13496 | set d_getservbyname_r_proto getservbyname_r $hdrs |
13497 | eval $hasproto ;; | |
13498 | *) ;; | |
13499 | esac | |
13500 | case "$d_getservbyname_r_proto" in | |
13501 | define) | |
10bc17b6 JH |
13502 | case "$getservbyname_r_proto" in |
13503 | ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);' | |
13504 | ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;; | |
13505 | esac | |
13506 | case "$getservbyname_r_proto" in | |
13507 | ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);' | |
13508 | ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;; | |
13509 | esac | |
13510 | case "$getservbyname_r_proto" in | |
13511 | ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);' | |
13512 | ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;; | |
13513 | esac | |
13514 | case "$getservbyname_r_proto" in | |
90e831dc | 13515 | ''|0) d_getservbyname_r=undef |
10bc17b6 | 13516 | getservbyname_r_proto=0 |
a48ec845 | 13517 | echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13518 | * ) case "$getservbyname_r_proto" in |
13519 | REENTRANT_PROTO*) ;; | |
13520 | *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;; | |
13521 | esac | |
13522 | echo "Prototype: $try" ;; | |
13523 | esac | |
13524 | ;; | |
c18e646a JH |
13525 | *) case "$usethreads" in |
13526 | define) echo "getservbyname_r has no prototype, not using it." >&4 ;; | |
13527 | esac | |
90e831dc SB |
13528 | d_getservbyname_r=undef |
13529 | getservbyname_r_proto=0 | |
c18e646a | 13530 | ;; |
a48ec845 JH |
13531 | esac |
13532 | ;; | |
10bc17b6 JH |
13533 | *) getservbyname_r_proto=0 |
13534 | ;; | |
13535 | esac | |
13536 | ||
13537 | : see if getservbyport_r exists | |
13538 | set getservbyport_r d_getservbyport_r | |
13539 | eval $inlibc | |
13540 | case "$d_getservbyport_r" in | |
13541 | "$define") | |
13542 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13543 | case "$d_getservbyport_r_proto:$usethreads" in |
13544 | ":define") d_getservbyport_r_proto=define | |
a48ec845 JH |
13545 | set d_getservbyport_r_proto getservbyport_r $hdrs |
13546 | eval $hasproto ;; | |
13547 | *) ;; | |
13548 | esac | |
13549 | case "$d_getservbyport_r_proto" in | |
13550 | define) | |
10bc17b6 JH |
13551 | case "$getservbyport_r_proto" in |
13552 | ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);' | |
13553 | ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;; | |
13554 | esac | |
13555 | case "$getservbyport_r_proto" in | |
13556 | ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);' | |
13557 | ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;; | |
13558 | esac | |
13559 | case "$getservbyport_r_proto" in | |
13560 | ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);' | |
13561 | ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;; | |
13562 | esac | |
13563 | case "$getservbyport_r_proto" in | |
90e831dc | 13564 | ''|0) d_getservbyport_r=undef |
10bc17b6 | 13565 | getservbyport_r_proto=0 |
a48ec845 | 13566 | echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13567 | * ) case "$getservbyport_r_proto" in |
13568 | REENTRANT_PROTO*) ;; | |
13569 | *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;; | |
13570 | esac | |
13571 | echo "Prototype: $try" ;; | |
13572 | esac | |
13573 | ;; | |
c18e646a JH |
13574 | *) case "$usethreads" in |
13575 | define) echo "getservbyport_r has no prototype, not using it." >&4 ;; | |
13576 | esac | |
90e831dc SB |
13577 | d_getservbyport_r=undef |
13578 | getservbyport_r_proto=0 | |
c18e646a | 13579 | ;; |
a48ec845 JH |
13580 | esac |
13581 | ;; | |
10bc17b6 JH |
13582 | *) getservbyport_r_proto=0 |
13583 | ;; | |
13584 | esac | |
13585 | ||
13586 | : see if getservent_r exists | |
13587 | set getservent_r d_getservent_r | |
13588 | eval $inlibc | |
13589 | case "$d_getservent_r" in | |
13590 | "$define") | |
13591 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
13592 | case "$d_getservent_r_proto:$usethreads" in |
13593 | ":define") d_getservent_r_proto=define | |
a48ec845 JH |
13594 | set d_getservent_r_proto getservent_r $hdrs |
13595 | eval $hasproto ;; | |
13596 | *) ;; | |
13597 | esac | |
13598 | case "$d_getservent_r_proto" in | |
13599 | define) | |
10bc17b6 JH |
13600 | case "$getservent_r_proto" in |
13601 | ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);' | |
13602 | ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;; | |
13603 | esac | |
13604 | case "$getservent_r_proto" in | |
13605 | ''|0) try='int getservent_r(struct servent*, char*, int);' | |
13606 | ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;; | |
13607 | esac | |
13608 | case "$getservent_r_proto" in | |
13609 | ''|0) try='struct servent* getservent_r(struct servent*, char*, int);' | |
13610 | ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;; | |
13611 | esac | |
13612 | case "$getservent_r_proto" in | |
13613 | ''|0) try='int getservent_r(struct servent*, struct servent_data*);' | |
13614 | ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;; | |
13615 | esac | |
13616 | case "$getservent_r_proto" in | |
90e831dc | 13617 | ''|0) d_getservent_r=undef |
10bc17b6 | 13618 | getservent_r_proto=0 |
a48ec845 | 13619 | echo "Disabling getservent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13620 | * ) case "$getservent_r_proto" in |
13621 | REENTRANT_PROTO*) ;; | |
13622 | *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;; | |
13623 | esac | |
13624 | echo "Prototype: $try" ;; | |
13625 | esac | |
13626 | ;; | |
c18e646a JH |
13627 | *) case "$usethreads" in |
13628 | define) echo "getservent_r has no prototype, not using it." >&4 ;; | |
13629 | esac | |
90e831dc SB |
13630 | d_getservent_r=undef |
13631 | getservent_r_proto=0 | |
c18e646a | 13632 | ;; |
a48ec845 JH |
13633 | esac |
13634 | ;; | |
10bc17b6 JH |
13635 | *) getservent_r_proto=0 |
13636 | ;; | |
13637 | esac | |
13638 | ||
b4eb6b3d JH |
13639 | : see if prototypes for various getservxxx netdb.h functions are available |
13640 | echo " " | |
13641 | set d_getservprotos getservent $i_netdb netdb.h | |
13642 | eval $hasproto | |
13643 | ||
13644 | : see if getspnam exists | |
13645 | set getspnam d_getspnam | |
13646 | eval $inlibc | |
13647 | ||
10bc17b6 JH |
13648 | : see if this is a shadow.h system |
13649 | set shadow.h i_shadow | |
13650 | eval $inhdr | |
13651 | ||
13652 | : see if getspnam_r exists | |
13653 | set getspnam_r d_getspnam_r | |
13654 | eval $inlibc | |
13655 | case "$d_getspnam_r" in | |
13656 | "$define") | |
13657 | hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h" | |
c18e646a JH |
13658 | case "$d_getspnam_r_proto:$usethreads" in |
13659 | ":define") d_getspnam_r_proto=define | |
a48ec845 JH |
13660 | set d_getspnam_r_proto getspnam_r $hdrs |
13661 | eval $hasproto ;; | |
13662 | *) ;; | |
13663 | esac | |
13664 | case "$d_getspnam_r_proto" in | |
13665 | define) | |
10bc17b6 JH |
13666 | case "$getspnam_r_proto" in |
13667 | ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);' | |
13668 | ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;; | |
13669 | esac | |
13670 | case "$getspnam_r_proto" in | |
13671 | ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);' | |
13672 | ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;; | |
13673 | esac | |
13674 | case "$getspnam_r_proto" in | |
90e831dc | 13675 | ''|0) d_getspnam_r=undef |
10bc17b6 | 13676 | getspnam_r_proto=0 |
a48ec845 | 13677 | echo "Disabling getspnam_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13678 | * ) case "$getspnam_r_proto" in |
13679 | REENTRANT_PROTO*) ;; | |
13680 | *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;; | |
13681 | esac | |
13682 | echo "Prototype: $try" ;; | |
13683 | esac | |
13684 | ;; | |
c18e646a JH |
13685 | *) case "$usethreads" in |
13686 | define) echo "getspnam_r has no prototype, not using it." >&4 ;; | |
13687 | esac | |
90e831dc SB |
13688 | d_getspnam_r=undef |
13689 | getspnam_r_proto=0 | |
c18e646a | 13690 | ;; |
a48ec845 JH |
13691 | esac |
13692 | ;; | |
10bc17b6 JH |
13693 | *) getspnam_r_proto=0 |
13694 | ;; | |
13695 | esac | |
13696 | ||
b4eb6b3d JH |
13697 | : see if gettimeofday or ftime exists |
13698 | set gettimeofday d_gettimeod | |
13699 | eval $inlibc | |
13700 | case "$d_gettimeod" in | |
13701 | "$undef") | |
13702 | set ftime d_ftime | |
13703 | eval $inlibc | |
13704 | ;; | |
13705 | *) | |
13706 | val="$undef"; set d_ftime; eval $setvar | |
13707 | ;; | |
13708 | esac | |
13709 | case "$d_gettimeod$d_ftime" in | |
13710 | "$undef$undef") | |
13711 | echo " " | |
13712 | echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 | |
13713 | ;; | |
13714 | esac | |
13715 | ||
10bc17b6 JH |
13716 | : see if gmtime_r exists |
13717 | set gmtime_r d_gmtime_r | |
13718 | eval $inlibc | |
13719 | case "$d_gmtime_r" in | |
13720 | "$define") | |
d63eadf0 | 13721 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
c18e646a JH |
13722 | case "$d_gmtime_r_proto:$usethreads" in |
13723 | ":define") d_gmtime_r_proto=define | |
a48ec845 JH |
13724 | set d_gmtime_r_proto gmtime_r $hdrs |
13725 | eval $hasproto ;; | |
13726 | *) ;; | |
13727 | esac | |
13728 | case "$d_gmtime_r_proto" in | |
13729 | define) | |
10bc17b6 JH |
13730 | case "$gmtime_r_proto" in |
13731 | ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);' | |
13732 | ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;; | |
13733 | esac | |
13734 | case "$gmtime_r_proto" in | |
13735 | ''|0) try='int gmtime_r(const time_t*, struct tm*);' | |
13736 | ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;; | |
13737 | esac | |
13738 | case "$gmtime_r_proto" in | |
90e831dc | 13739 | ''|0) d_gmtime_r=undef |
10bc17b6 | 13740 | gmtime_r_proto=0 |
a48ec845 | 13741 | echo "Disabling gmtime_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
13742 | * ) case "$gmtime_r_proto" in |
13743 | REENTRANT_PROTO*) ;; | |
13744 | *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;; | |
13745 | esac | |
13746 | echo "Prototype: $try" ;; | |
13747 | esac | |
b4eb6b3d | 13748 | ;; |
c18e646a JH |
13749 | *) case "$usethreads" in |
13750 | define) echo "gmtime_r has no prototype, not using it." >&4 ;; | |
13751 | esac | |
90e831dc SB |
13752 | d_gmtime_r=undef |
13753 | gmtime_r_proto=0 | |
c18e646a | 13754 | ;; |
a48ec845 JH |
13755 | esac |
13756 | ;; | |
10bc17b6 | 13757 | *) gmtime_r_proto=0 |
b4eb6b3d JH |
13758 | ;; |
13759 | esac | |
13760 | ||
13761 | : see if hasmntopt exists | |
13762 | set hasmntopt d_hasmntopt | |
13763 | eval $inlibc | |
13764 | ||
13765 | : see if this is a netinet/in.h or sys/in.h system | |
13766 | set netinet/in.h i_niin sys/in.h i_sysin | |
13767 | eval $inhdr | |
13768 | ||
13769 | : see if arpa/inet.h has to be included | |
13770 | set arpa/inet.h i_arpainet | |
13771 | eval $inhdr | |
13772 | ||
13773 | : see if htonl --and friends-- exists | |
13774 | val='' | |
13775 | set htonl val | |
13776 | eval $inlibc | |
13777 | ||
13778 | : Maybe they are macros. | |
13779 | case "$val" in | |
13780 | $undef) | |
13781 | $cat >htonl.c <<EOM | |
13782 | #include <stdio.h> | |
13783 | #include <sys/types.h> | |
13784 | #$i_niin I_NETINET_IN | |
13785 | #$i_sysin I_SYS_IN | |
13786 | #$i_arpainet I_ARPA_INET | |
13787 | #ifdef I_NETINET_IN | |
13788 | #include <netinet/in.h> | |
13789 | #endif | |
13790 | #ifdef I_SYS_IN | |
13791 | #include <sys/in.h> | |
13792 | #endif | |
13793 | #ifdef I_ARPA_INET | |
13794 | #include <arpa/inet.h> | |
13795 | #endif | |
13796 | #ifdef htonl | |
13797 | printf("Defined as a macro."); | |
13798 | #endif | |
13799 | EOM | |
13800 | $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null | |
13801 | if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then | |
13802 | val="$define" | |
13803 | echo "But it seems to be defined as a macro." >&4 | |
13804 | fi | |
13805 | $rm -f htonl.? | |
13806 | ;; | |
13807 | esac | |
13808 | set d_htonl | |
13809 | eval $setvar | |
13810 | ||
5a29c6bc JH |
13811 | : see if ilogbl exists |
13812 | set ilogbl d_ilogbl | |
13813 | eval $inlibc | |
13814 | ||
b4eb6b3d JH |
13815 | : index or strchr |
13816 | echo " " | |
13817 | if set index val -f; eval $csym; $val; then | |
13818 | if set strchr val -f d_strchr; eval $csym; $val; then | |
13819 | if $contains strchr "$strings" >/dev/null 2>&1 ; then | |
13820 | val="$define" | |
13821 | vali="$undef" | |
13822 | echo "strchr() found." >&4 | |
13823 | else | |
13824 | val="$undef" | |
13825 | vali="$define" | |
13826 | echo "index() found." >&4 | |
13827 | fi | |
13828 | else | |
13829 | val="$undef" | |
13830 | vali="$define" | |
8dfa8df9 JH |
13831 | echo "index() found." >&4 |
13832 | fi | |
b4eb6b3d | 13833 | else |
8dfa8df9 JH |
13834 | if set strchr val -f d_strchr; eval $csym; $val; then |
13835 | val="$define" | |
13836 | vali="$undef" | |
13837 | echo "strchr() found." >&4 | |
13838 | else | |
13839 | echo "No index() or strchr() found!" >&4 | |
13840 | val="$undef" | |
13841 | vali="$undef" | |
13842 | fi | |
b4eb6b3d | 13843 | fi |
8dfa8df9 JH |
13844 | set d_strchr; eval $setvar |
13845 | val="$vali" | |
13846 | set d_index; eval $setvar | |
13847 | ||
13848 | : check whether inet_aton exists | |
13849 | set inet_aton d_inetaton | |
13850 | eval $inlibc | |
b4eb6b3d JH |
13851 | |
13852 | : Look for isascii | |
13853 | echo " " | |
5a29c6bc | 13854 | $cat >isascii.c <<EOCP |
b4eb6b3d JH |
13855 | #include <stdio.h> |
13856 | #include <ctype.h> | |
5a29c6bc JH |
13857 | #$i_stdlib I_STDLIB |
13858 | #ifdef I_STDLIB | |
13859 | #include <stdlib.h> | |
13860 | #endif | |
b4eb6b3d JH |
13861 | int main() { |
13862 | int c = 'A'; | |
13863 | if (isascii(c)) | |
13864 | exit(0); | |
13865 | else | |
13866 | exit(1); | |
13867 | } | |
13868 | EOCP | |
13869 | set isascii | |
13870 | if eval $compile; then | |
13871 | echo "isascii() found." >&4 | |
13872 | val="$define" | |
13873 | else | |
13874 | echo "isascii() NOT found." >&4 | |
13875 | val="$undef" | |
13876 | fi | |
13877 | set d_isascii | |
13878 | eval $setvar | |
13879 | $rm -f isascii* | |
13880 | ||
758a5d79 JH |
13881 | : see if isfinite exists |
13882 | set isfinite d_isfinite | |
13883 | eval $inlibc | |
13884 | ||
13885 | : see if isinf exists | |
13886 | set isinf d_isinf | |
13887 | eval $inlibc | |
13888 | ||
b4eb6b3d JH |
13889 | : see if isnan exists |
13890 | set isnan d_isnan | |
13891 | eval $inlibc | |
13892 | ||
13893 | : see if isnanl exists | |
13894 | set isnanl d_isnanl | |
13895 | eval $inlibc | |
13896 | ||
13897 | : see if killpg exists | |
13898 | set killpg d_killpg | |
13899 | eval $inlibc | |
13900 | ||
13901 | : see if lchown exists | |
13902 | echo " " | |
13903 | $cat > try.c <<'EOCP' | |
13904 | /* System header to define __stub macros and hopefully few prototypes, | |
13905 | which can conflict with char lchown(); below. */ | |
13906 | #include <assert.h> | |
13907 | /* Override any gcc2 internal prototype to avoid an error. */ | |
13908 | /* We use char because int might match the return type of a gcc2 | |
13909 | builtin and then its argument prototype would still apply. */ | |
13910 | char lchown(); | |
13911 | int main() { | |
13912 | /* The GNU C library defines this for functions which it implements | |
13913 | to always fail with ENOSYS. Some functions are actually named | |
13914 | something starting with __ and the normal name is an alias. */ | |
13915 | #if defined (__stub_lchown) || defined (__stub___lchown) | |
13916 | choke me | |
13917 | #else | |
13918 | lchown(); | |
13919 | #endif | |
13920 | ; return 0; } | |
13921 | EOCP | |
13922 | set try | |
13923 | if eval $compile; then | |
13924 | $echo "lchown() found." >&4 | |
13925 | val="$define" | |
13926 | else | |
13927 | $echo "lchown() NOT found." >&4 | |
13928 | val="$undef" | |
13929 | fi | |
13930 | set d_lchown | |
13931 | eval $setvar | |
13932 | ||
13933 | : See if number of significant digits in a double precision number is known | |
13934 | echo " " | |
13935 | $cat >ldbl_dig.c <<EOM | |
13936 | #$i_limits I_LIMITS | |
13937 | #$i_float I_FLOAT | |
13938 | #ifdef I_LIMITS | |
13939 | #include <limits.h> | |
13940 | #endif | |
13941 | #ifdef I_FLOAT | |
13942 | #include <float.h> | |
13943 | #endif | |
13944 | #ifdef LDBL_DIG | |
13945 | printf("Contains LDBL_DIG"); | |
13946 | #endif | |
13947 | EOM | |
13948 | $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null | |
13949 | if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then | |
13950 | echo "LDBL_DIG found." >&4 | |
13951 | val="$define" | |
13952 | else | |
13953 | echo "LDBL_DIG NOT found." >&4 | |
13954 | val="$undef" | |
13955 | fi | |
13956 | $rm -f ldbl_dig.? | |
13957 | set d_ldbl_dig | |
13958 | eval $setvar | |
13959 | ||
a663fd0a AT |
13960 | : see if this is a math.h system |
13961 | set math.h i_math | |
13962 | eval $inhdr | |
13963 | ||
13964 | d_libm_lib_version="$undef" | |
13965 | case $i_math in | |
13966 | $define) | |
13967 | : check to see if math.h defines _LIB_VERSION | |
13968 | echo " " | |
13969 | echo "Checking to see if your libm supports _LIB_VERSION..." >&4 | |
13970 | $cat >try.c <<EOCP | |
13971 | #include <unistd.h> | |
13972 | #include <math.h> | |
13973 | int main (int argc, char *argv[]) | |
13974 | { | |
13975 | printf ("%d\n", _LIB_VERSION); | |
13976 | return (0); | |
13977 | } /* main */ | |
13978 | EOCP | |
13979 | set try | |
13980 | if eval $compile; then | |
13981 | foo=`$run ./try` | |
13982 | echo "Yes, it does ($foo)" >&4 | |
13983 | d_libm_lib_version="$define" | |
13984 | else | |
13985 | echo "No, it does not (probably harmless)\n" >&4 | |
13986 | fi | |
13987 | $rm -f try.* try core core.try.* | |
13988 | ;; | |
13989 | ||
13990 | esac | |
13991 | ||
b4eb6b3d JH |
13992 | : see if link exists |
13993 | set link d_link | |
13994 | eval $inlibc | |
13995 | ||
10bc17b6 JH |
13996 | : see if localtime_r exists |
13997 | set localtime_r d_localtime_r | |
13998 | eval $inlibc | |
13999 | case "$d_localtime_r" in | |
14000 | "$define") | |
d63eadf0 | 14001 | hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h" |
c18e646a JH |
14002 | case "$d_localtime_r_proto:$usethreads" in |
14003 | ":define") d_localtime_r_proto=define | |
a48ec845 JH |
14004 | set d_localtime_r_proto localtime_r $hdrs |
14005 | eval $hasproto ;; | |
14006 | *) ;; | |
14007 | esac | |
14008 | case "$d_localtime_r_proto" in | |
14009 | define) | |
10bc17b6 JH |
14010 | case "$localtime_r_proto" in |
14011 | ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);' | |
14012 | ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;; | |
14013 | esac | |
14014 | case "$localtime_r_proto" in | |
14015 | ''|0) try='int localtime_r(const time_t*, struct tm*);' | |
14016 | ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;; | |
14017 | esac | |
14018 | case "$localtime_r_proto" in | |
90e831dc | 14019 | ''|0) d_localtime_r=undef |
10bc17b6 | 14020 | localtime_r_proto=0 |
a48ec845 | 14021 | echo "Disabling localtime_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
14022 | * ) case "$localtime_r_proto" in |
14023 | REENTRANT_PROTO*) ;; | |
14024 | *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;; | |
14025 | esac | |
14026 | echo "Prototype: $try" ;; | |
14027 | esac | |
14028 | ;; | |
c18e646a JH |
14029 | *) case "$usethreads" in |
14030 | define) echo "localtime_r has no prototype, not using it." >&4 ;; | |
14031 | esac | |
90e831dc SB |
14032 | d_localtime_r=undef |
14033 | localtime_r_proto=0 | |
c18e646a | 14034 | ;; |
a48ec845 JH |
14035 | esac |
14036 | ;; | |
10bc17b6 JH |
14037 | *) localtime_r_proto=0 |
14038 | ;; | |
14039 | esac | |
14040 | ||
b4eb6b3d JH |
14041 | : see if localeconv exists |
14042 | set localeconv d_locconv | |
14043 | eval $inlibc | |
14044 | ||
14045 | : see if lockf exists | |
14046 | set lockf d_lockf | |
14047 | eval $inlibc | |
14048 | ||
b4eb6b3d JH |
14049 | : see if prototype for lseek is available |
14050 | echo " " | |
4786929f | 14051 | set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h |
b4eb6b3d JH |
14052 | eval $hasproto |
14053 | ||
14054 | : see if lstat exists | |
14055 | set lstat d_lstat | |
14056 | eval $inlibc | |
14057 | ||
14058 | : see if madvise exists | |
14059 | set madvise d_madvise | |
14060 | eval $inlibc | |
14061 | ||
14062 | : see if mblen exists | |
14063 | set mblen d_mblen | |
14064 | eval $inlibc | |
14065 | ||
14066 | : see if mbstowcs exists | |
14067 | set mbstowcs d_mbstowcs | |
14068 | eval $inlibc | |
14069 | ||
14070 | : see if mbtowc exists | |
14071 | set mbtowc d_mbtowc | |
14072 | eval $inlibc | |
14073 | ||
14074 | : see if memchr exists | |
14075 | set memchr d_memchr | |
14076 | eval $inlibc | |
14077 | ||
14078 | : see if memcmp exists | |
14079 | set memcmp d_memcmp | |
14080 | eval $inlibc | |
14081 | ||
14082 | : see if memcpy exists | |
14083 | set memcpy d_memcpy | |
14084 | eval $inlibc | |
14085 | ||
14086 | : see if memmove exists | |
14087 | set memmove d_memmove | |
14088 | eval $inlibc | |
14089 | ||
14090 | : see if memset exists | |
14091 | set memset d_memset | |
14092 | eval $inlibc | |
14093 | ||
14094 | : see if mkdir exists | |
14095 | set mkdir d_mkdir | |
14096 | eval $inlibc | |
14097 | ||
14098 | : see if mkdtemp exists | |
14099 | set mkdtemp d_mkdtemp | |
14100 | eval $inlibc | |
14101 | ||
14102 | : see if mkfifo exists | |
14103 | set mkfifo d_mkfifo | |
14104 | eval $inlibc | |
14105 | ||
14106 | : see if mkstemp exists | |
14107 | set mkstemp d_mkstemp | |
14108 | eval $inlibc | |
14109 | ||
14110 | : see if mkstemps exists | |
14111 | set mkstemps d_mkstemps | |
14112 | eval $inlibc | |
14113 | ||
14114 | : see if mktime exists | |
14115 | set mktime d_mktime | |
14116 | eval $inlibc | |
14117 | ||
14118 | : see if this is a sys/mman.h system | |
14119 | set sys/mman.h i_sysmman | |
14120 | eval $inhdr | |
14121 | ||
14122 | : see if mmap exists | |
14123 | set mmap d_mmap | |
14124 | eval $inlibc | |
14125 | : see what shmat returns | |
14126 | : default to something harmless | |
14127 | mmaptype='void *' | |
14128 | case "$i_sysmman$d_mmap" in | |
14129 | "$define$define") | |
14130 | $cat >mmap.c <<'END' | |
14131 | #include <sys/mman.h> | |
14132 | void *mmap(); | |
14133 | END | |
14134 | if $cc $ccflags -c mmap.c >/dev/null 2>&1; then | |
14135 | mmaptype='void *' | |
14136 | else | |
14137 | mmaptype='caddr_t' | |
14138 | fi | |
14139 | echo "and it returns ($mmaptype)." >&4 | |
14140 | ;; | |
14141 | esac | |
14142 | ||
14143 | ||
14144 | ||
5a29c6bc JH |
14145 | : see if sqrtl exists |
14146 | set sqrtl d_sqrtl | |
14147 | eval $inlibc | |
14148 | ||
f3479639 JH |
14149 | : see if scalbnl exists |
14150 | set scalbnl d_scalbnl | |
14151 | eval $inlibc | |
14152 | ||
5a29c6bc JH |
14153 | : see if modfl exists |
14154 | set modfl d_modfl | |
14155 | eval $inlibc | |
14156 | ||
14157 | : see if prototype for modfl is available | |
14158 | echo " " | |
a663fd0a | 14159 | set d_modflproto modfl $i_math math.h |
5a29c6bc JH |
14160 | eval $hasproto |
14161 | ||
14162 | d_modfl_pow32_bug="$undef" | |
14163 | ||
14164 | case "$d_longdbl$d_modfl" in | |
14165 | $define$define) | |
14166 | $cat <<EOM | |
14167 | Checking to see whether your modfl() is okay for large values... | |
14168 | EOM | |
14169 | $cat >try.c <<EOCP | |
14170 | #include <math.h> | |
14171 | #include <stdio.h> | |
14172 | EOCP | |
14173 | if $test "X$d_modflproto" != "X$define"; then | |
14174 | $cat >>try.c <<EOCP | |
14175 | /* Sigh. many current glibcs provide the function, but do not prototype it. */ | |
14176 | long double modfl (long double, long double *); | |
14177 | EOCP | |
14178 | fi | |
14179 | $cat >>try.c <<EOCP | |
14180 | int main() { | |
14181 | long double nv = 4294967303.15; | |
14182 | long double v, w; | |
14183 | v = modfl(nv, &w); | |
14184 | #ifdef __GLIBC__ | |
14185 | printf("glibc"); | |
14186 | #endif | |
14187 | printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w); | |
14188 | return 0; | |
14189 | } | |
14190 | EOCP | |
14191 | case "$osname:$gccversion" in | |
14192 | aix:) saveccflags="$ccflags" | |
14193 | ccflags="$ccflags -qlongdouble" ;; # to avoid core dump | |
14194 | esac | |
14195 | set try | |
14196 | if eval $compile; then | |
14197 | foo=`$run ./try` | |
14198 | case "$foo" in | |
14199 | *" 4294967303.150000 1.150000 4294967302.000000") | |
14200 | echo >&4 "Your modfl() is broken for large values." | |
14201 | d_modfl_pow32_bug="$define" | |
14202 | case "$foo" in | |
14203 | glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()." | |
14204 | ;; | |
14205 | esac | |
14206 | ;; | |
14207 | *" 4294967303.150000 0.150000 4294967303.000000") | |
14208 | echo >&4 "Your modfl() seems okay for large values." | |
14209 | ;; | |
14210 | *) echo >&4 "I don't understand your modfl() at all." | |
14211 | d_modfl="$undef" | |
14212 | ;; | |
14213 | esac | |
14214 | $rm -f try.* try core core.try.* | |
14215 | else | |
14216 | echo "I cannot figure out whether your modfl() is okay, assuming it isn't." | |
14217 | d_modfl="$undef" | |
14218 | fi | |
14219 | case "$osname:$gccversion" in | |
14220 | aix:) ccflags="$saveccflags" ;; # restore | |
14221 | esac | |
14222 | ;; | |
14223 | esac | |
14224 | ||
14225 | if $test "$uselongdouble" = "$define"; then | |
f3479639 JH |
14226 | message="" |
14227 | if $test "$d_sqrtl" != "$define"; then | |
14228 | message="$message sqrtl" | |
14229 | fi | |
14230 | if $test "$d_modfl" != "$define"; then | |
5a29c6bc JH |
14231 | if $test "$d_aintl:$d_copysignl" = "$define:$define"; then |
14232 | echo "You have both aintl and copysignl, so I can emulate modfl." | |
14233 | else | |
f3479639 | 14234 | message="$message modfl" |
5a29c6bc | 14235 | fi |
f3479639 JH |
14236 | fi |
14237 | if $test "$d_frexpl" != "$define"; then | |
14238 | if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then | |
14239 | echo "You have both ilogbl and scalbnl, so I can emulate frexpl." | |
14240 | else | |
14241 | message="$message frexpl" | |
14242 | fi | |
14243 | fi | |
5a29c6bc | 14244 | |
f3479639 | 14245 | if $test "$message" != ""; then |
5a29c6bc JH |
14246 | $cat <<EOM >&4 |
14247 | ||
14248 | *** You requested the use of long doubles but you do not seem to have | |
f3479639 JH |
14249 | *** the following mathematical functions needed for long double support: |
14250 | *** $message | |
ff0950a8 JH |
14251 | *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits. |
14252 | *** Cannot continue, aborting. | |
5a29c6bc JH |
14253 | |
14254 | EOM | |
14255 | ||
ff0950a8 | 14256 | exit 1 |
5a29c6bc JH |
14257 | fi |
14258 | fi | |
14259 | ||
b4eb6b3d JH |
14260 | : see if mprotect exists |
14261 | set mprotect d_mprotect | |
14262 | eval $inlibc | |
14263 | ||
14264 | : see if msgctl exists | |
14265 | set msgctl d_msgctl | |
14266 | eval $inlibc | |
14267 | ||
14268 | : see if msgget exists | |
14269 | set msgget d_msgget | |
14270 | eval $inlibc | |
14271 | ||
14272 | : see if msgsnd exists | |
14273 | set msgsnd d_msgsnd | |
14274 | eval $inlibc | |
14275 | ||
14276 | : see if msgrcv exists | |
14277 | set msgrcv d_msgrcv | |
14278 | eval $inlibc | |
14279 | ||
14280 | : see how much of the 'msg*(2)' library is present. | |
14281 | h_msg=true | |
14282 | echo " " | |
14283 | case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in | |
14284 | *"$undef"*) h_msg=false;; | |
14285 | esac | |
14286 | case "$osname" in | |
14287 | freebsd) | |
14288 | case "`ipcs 2>&1`" in | |
14289 | "SVID messages"*"not configured"*) | |
14290 | echo "Your $osname does not have the msg*(2) configured." >&4 | |
14291 | h_msg=false | |
14292 | val="$undef" | |
14293 | set msgctl d_msgctl | |
14294 | eval $setvar | |
14295 | set msgget d_msgget | |
14296 | eval $setvar | |
14297 | set msgsnd d_msgsnd | |
14298 | eval $setvar | |
14299 | set msgrcv d_msgrcv | |
14300 | eval $setvar | |
14301 | ;; | |
14302 | esac | |
14303 | ;; | |
14304 | esac | |
14305 | : we could also check for sys/ipc.h ... | |
14306 | if $h_msg && $test `./findhdr sys/msg.h`; then | |
14307 | echo "You have the full msg*(2) library." >&4 | |
14308 | val="$define" | |
14309 | else | |
14310 | echo "You don't have the full msg*(2) library." >&4 | |
14311 | val="$undef" | |
14312 | fi | |
14313 | set d_msg | |
14314 | eval $setvar | |
14315 | ||
4e0554ec JH |
14316 | |
14317 | echo " " | |
14318 | echo "Checking to see if your system supports struct msghdr..." >&4 | |
14319 | set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h | |
14320 | eval $hasstruct | |
14321 | case "$d_msghdr_s" in | |
14322 | "$define") echo "Yes, it does." ;; | |
14323 | *) echo "No, it doesn't." ;; | |
14324 | esac | |
14325 | ||
14326 | ||
b4eb6b3d JH |
14327 | : see if msync exists |
14328 | set msync d_msync | |
14329 | eval $inlibc | |
14330 | ||
14331 | : see if munmap exists | |
14332 | set munmap d_munmap | |
14333 | eval $inlibc | |
14334 | ||
14335 | : see if nice exists | |
14336 | set nice d_nice | |
14337 | eval $inlibc | |
14338 | ||
2765b840 JH |
14339 | : see if this is a langinfo.h system |
14340 | set langinfo.h i_langinfo | |
14341 | eval $inhdr | |
14342 | ||
14343 | : see if nl_langinfo exists | |
14344 | set nl_langinfo d_nl_langinfo | |
14345 | eval $inlibc | |
14346 | ||
b4eb6b3d JH |
14347 | : check for length of character |
14348 | echo " " | |
14349 | case "$charsize" in | |
14350 | '') | |
14351 | echo "Checking to see how big your characters are (hey, you never know)..." >&4 | |
ada8e391 | 14352 | $cat >try.c <<EOCP |
b4eb6b3d | 14353 | #include <stdio.h> |
5ed858ef JH |
14354 | #$i_stdlib I_STDLIB |
14355 | #ifdef I_STDLIB | |
14356 | #include <stdlib.h> | |
14357 | #endif | |
b4eb6b3d JH |
14358 | int main() |
14359 | { | |
14360 | printf("%d\n", (int)sizeof(char)); | |
14361 | exit(0); | |
14362 | } | |
14363 | EOCP | |
14364 | set try | |
14365 | if eval $compile_ok; then | |
5440bc8e | 14366 | dflt=`$run ./try` |
b4eb6b3d JH |
14367 | else |
14368 | dflt='1' | |
14369 | echo "(I can't seem to compile the test program. Guessing...)" | |
14370 | fi | |
14371 | ;; | |
14372 | *) | |
14373 | dflt="$charsize" | |
14374 | ;; | |
14375 | esac | |
14376 | rp="What is the size of a character (in bytes)?" | |
14377 | . ./myread | |
14378 | charsize="$ans" | |
14379 | $rm -f try.c try | |
14380 | ||
1d1be0dc NC |
14381 | : check for volatile keyword |
14382 | echo " " | |
14383 | echo 'Checking to see if your C compiler knows about "volatile"...' >&4 | |
14384 | $cat >try.c <<'EOCP' | |
14385 | int main() | |
14386 | { | |
14387 | typedef struct _goo_struct goo_struct; | |
14388 | goo_struct * volatile goo = ((goo_struct *)0); | |
14389 | struct _goo_struct { | |
14390 | long long_int; | |
14391 | int reg_int; | |
14392 | char char_var; | |
14393 | }; | |
14394 | typedef unsigned short foo_t; | |
14395 | char *volatile foo; | |
14396 | volatile int bar; | |
14397 | volatile foo_t blech; | |
14398 | foo = foo; | |
14399 | } | |
14400 | EOCP | |
14401 | if $cc -c $ccflags try.c >/dev/null 2>&1 ; then | |
14402 | val="$define" | |
14403 | echo "Yup, it does." | |
14404 | else | |
14405 | val="$undef" | |
14406 | echo "Nope, it doesn't." | |
14407 | fi | |
14408 | set d_volatile | |
14409 | eval $setvar | |
14410 | $rm -f try.* | |
14411 | ||
b4eb6b3d JH |
14412 | |
14413 | echo " " | |
14414 | $echo "Choosing the C types to be used for Perl's internal types..." >&4 | |
14415 | ||
14416 | case "$use64bitint:$d_quad:$quadtype" in | |
14417 | define:define:?*) | |
14418 | ivtype="$quadtype" | |
14419 | uvtype="$uquadtype" | |
14420 | ivsize=8 | |
14421 | uvsize=8 | |
14422 | ;; | |
14423 | *) ivtype="long" | |
14424 | uvtype="unsigned long" | |
14425 | ivsize=$longsize | |
14426 | uvsize=$longsize | |
14427 | ;; | |
14428 | esac | |
14429 | ||
14430 | case "$uselongdouble:$d_longdbl" in | |
14431 | define:define) | |
14432 | nvtype="long double" | |
14433 | nvsize=$longdblsize | |
14434 | ;; | |
14435 | *) nvtype=double | |
14436 | nvsize=$doublesize | |
14437 | ;; | |
14438 | esac | |
14439 | ||
14440 | $echo "(IV will be "$ivtype", $ivsize bytes)" | |
14441 | $echo "(UV will be "$uvtype", $uvsize bytes)" | |
14442 | $echo "(NV will be "$nvtype", $nvsize bytes)" | |
14443 | ||
14444 | $cat >try.c <<EOCP | |
14445 | #$i_inttypes I_INTTYPES | |
14446 | #ifdef I_INTTYPES | |
14447 | #include <inttypes.h> | |
14448 | #endif | |
14449 | #include <stdio.h> | |
14450 | int main() { | |
14451 | #ifdef INT8 | |
14452 | int8_t i = INT8_MAX; | |
14453 | uint8_t u = UINT8_MAX; | |
14454 | printf("int8_t\n"); | |
14455 | #endif | |
14456 | #ifdef INT16 | |
14457 | int16_t i = INT16_MAX; | |
14458 | uint16_t i = UINT16_MAX; | |
14459 | printf("int16_t\n"); | |
14460 | #endif | |
14461 | #ifdef INT32 | |
14462 | int32_t i = INT32_MAX; | |
14463 | uint32_t u = UINT32_MAX; | |
14464 | printf("int32_t\n"); | |
14465 | #endif | |
14466 | } | |
14467 | EOCP | |
14468 | ||
14469 | case "$i8type" in | |
14470 | '') case "$charsize" in | |
14471 | 1) i8type=char | |
14472 | u8type="unsigned char" | |
14473 | i8size=$charsize | |
14474 | u8size=$charsize | |
14475 | ;; | |
14476 | esac | |
14477 | ;; | |
14478 | esac | |
14479 | case "$i8type" in | |
14480 | '') set try -DINT8 | |
14481 | if eval $compile; then | |
5440bc8e | 14482 | case "`$run ./try`" in |
b4eb6b3d JH |
14483 | int8_t) i8type=int8_t |
14484 | u8type=uint8_t | |
14485 | i8size=1 | |
14486 | u8size=1 | |
14487 | ;; | |
14488 | esac | |
14489 | fi | |
14490 | ;; | |
14491 | esac | |
14492 | case "$i8type" in | |
14493 | '') if $test $charsize -ge 1; then | |
14494 | i8type=char | |
14495 | u8type="unsigned char" | |
14496 | i8size=$charsize | |
14497 | u8size=$charsize | |
14498 | fi | |
14499 | ;; | |
14500 | esac | |
14501 | ||
14502 | case "$i16type" in | |
14503 | '') case "$shortsize" in | |
14504 | 2) i16type=short | |
14505 | u16type="unsigned short" | |
14506 | i16size=$shortsize | |
14507 | u16size=$shortsize | |
14508 | ;; | |
14509 | esac | |
14510 | ;; | |
14511 | esac | |
14512 | case "$i16type" in | |
14513 | '') set try -DINT16 | |
14514 | if eval $compile; then | |
5440bc8e | 14515 | case "`$run ./try`" in |
b4eb6b3d JH |
14516 | int16_t) |
14517 | i16type=int16_t | |
14518 | u16type=uint16_t | |
14519 | i16size=2 | |
14520 | u16size=2 | |
14521 | ;; | |
14522 | esac | |
14523 | fi | |
14524 | ;; | |
14525 | esac | |
14526 | case "$i16type" in | |
14527 | '') if $test $shortsize -ge 2; then | |
14528 | i16type=short | |
14529 | u16type="unsigned short" | |
14530 | i16size=$shortsize | |
14531 | u16size=$shortsize | |
14532 | fi | |
14533 | ;; | |
14534 | esac | |
14535 | ||
14536 | case "$i32type" in | |
14537 | '') case "$longsize" in | |
14538 | 4) i32type=long | |
14539 | u32type="unsigned long" | |
14540 | i32size=$longsize | |
14541 | u32size=$longsize | |
14542 | ;; | |
14543 | *) case "$intsize" in | |
14544 | 4) i32type=int | |
14545 | u32type="unsigned int" | |
14546 | i32size=$intsize | |
14547 | u32size=$intsize | |
14548 | ;; | |
14549 | esac | |
14550 | ;; | |
14551 | esac | |
14552 | ;; | |
14553 | esac | |
14554 | case "$i32type" in | |
14555 | '') set try -DINT32 | |
14556 | if eval $compile; then | |
5440bc8e | 14557 | case "`$run ./try`" in |
b4eb6b3d JH |
14558 | int32_t) |
14559 | i32type=int32_t | |
14560 | u32type=uint32_t | |
14561 | i32size=4 | |
14562 | u32size=4 | |
14563 | ;; | |
14564 | esac | |
14565 | fi | |
14566 | ;; | |
14567 | esac | |
14568 | case "$i32type" in | |
14569 | '') if $test $intsize -ge 4; then | |
14570 | i32type=int | |
14571 | u32type="unsigned int" | |
14572 | i32size=$intsize | |
14573 | u32size=$intsize | |
14574 | fi | |
14575 | ;; | |
14576 | esac | |
14577 | ||
14578 | case "$i64type" in | |
14579 | '') case "$d_quad:$quadtype" in | |
14580 | define:?*) | |
14581 | i64type="$quadtype" | |
14582 | u64type="$uquadtype" | |
14583 | i64size=8 | |
14584 | u64size=8 | |
14585 | ;; | |
14586 | esac | |
14587 | ;; | |
14588 | esac | |
14589 | ||
1d1be0dc NC |
14590 | $echo "Checking how many bits of your UVs your NVs can preserve..." >&4 |
14591 | : volatile so that the compiler has to store it out to memory. | |
14592 | if test X"$d_volatile" = X"$define"; then | |
14593 | volatile=volatile | |
14594 | fi | |
b4eb6b3d JH |
14595 | $cat <<EOP >try.c |
14596 | #include <stdio.h> | |
5a29c6bc JH |
14597 | #$i_stdlib I_STDLIB |
14598 | #ifdef I_STDLIB | |
14599 | #include <stdlib.h> | |
14600 | #endif | |
1d1be0dc NC |
14601 | #include <sys/types.h> |
14602 | #include <signal.h> | |
14603 | #ifdef SIGFPE | |
14604 | $volatile int bletched = 0; | |
14605 | $signal_t blech(s) int s; { bletched = 1; } | |
14606 | #endif | |
b4eb6b3d JH |
14607 | int main() { |
14608 | $uvtype u = 0; | |
1d1be0dc | 14609 | $nvtype d; |
b4eb6b3d JH |
14610 | int n = 8 * $uvsize; |
14611 | int i; | |
1d1be0dc NC |
14612 | #ifdef SIGFPE |
14613 | signal(SIGFPE, blech); | |
14614 | #endif | |
14615 | ||
b4eb6b3d JH |
14616 | for (i = 0; i < n; i++) { |
14617 | u = u << 1 | ($uvtype)1; | |
1d1be0dc NC |
14618 | d = ($nvtype)u; |
14619 | if (($uvtype)d != u) | |
b4eb6b3d | 14620 | break; |
1d1be0dc NC |
14621 | if (d <= 0) |
14622 | break; | |
14623 | d = ($nvtype)(u - 1); | |
14624 | if (($uvtype)d != (u - 1)) | |
14625 | break; | |
14626 | #ifdef SIGFPE | |
14627 | if (bletched) { | |
14628 | break; | |
14629 | #endif | |
14630 | } | |
b4eb6b3d | 14631 | } |
efd1522b | 14632 | printf("%d\n", ((i == n) ? -n : i)); |
b4eb6b3d JH |
14633 | exit(0); |
14634 | } | |
14635 | EOP | |
1d1be0dc NC |
14636 | set try |
14637 | ||
14638 | d_nv_preserves_uv="$undef" | |
14639 | if eval $compile; then | |
53133ed1 | 14640 | nv_preserves_uv_bits="`$run ./try`" |
1d1be0dc | 14641 | fi |
53133ed1 | 14642 | case "$nv_preserves_uv_bits" in |
1d1be0dc | 14643 | \-[1-9]*) |
53133ed1 NC |
14644 | nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits` |
14645 | $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1 | |
1d1be0dc | 14646 | d_nv_preserves_uv="$define" |
b4eb6b3d | 14647 | ;; |
53133ed1 | 14648 | [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1 |
1d1be0dc NC |
14649 | d_nv_preserves_uv="$undef" ;; |
14650 | *) $echo "Can't figure out how many bits your NVs preserve." 2>&1 | |
53133ed1 | 14651 | nv_preserves_uv_bits="$undef" ;; |
b4eb6b3d JH |
14652 | esac |
14653 | ||
1d1be0dc NC |
14654 | $rm -f try.* try |
14655 | ||
b4eb6b3d JH |
14656 | |
14657 | : check for off64_t | |
14658 | echo " " | |
14659 | echo "Checking to see if you have off64_t..." >&4 | |
14660 | $cat >try.c <<EOCP | |
14661 | #include <sys/types.h> | |
14662 | #include <unistd.h> | |
14663 | int main() { off64_t x = 7; } | |
14664 | EOCP | |
14665 | set try | |
14666 | if eval $compile; then | |
14667 | val="$define" | |
14668 | echo "You have off64_t." | |
14669 | else | |
14670 | val="$undef" | |
14671 | echo "You do not have off64_t." | |
14672 | case "$lseeksize" in | |
14673 | 8) echo "(Your off_t is 64 bits, so you could use that.)" ;; | |
14674 | esac | |
14675 | fi | |
14676 | $rm -f try.* try | |
14677 | set d_off64_t | |
14678 | eval $setvar | |
14679 | ||
b4eb6b3d JH |
14680 | : how to create joinable pthreads |
14681 | if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then | |
14682 | echo " " | |
14683 | echo "Checking what constant to use for creating joinable pthreads..." >&4 | |
14684 | $cat >try.c <<'EOCP' | |
14685 | #include <pthread.h> | |
14686 | int main() { | |
14687 | int detachstate = JOINABLE; | |
14688 | } | |
14689 | EOCP | |
14690 | set try -DJOINABLE=PTHREAD_CREATE_JOINABLE | |
14691 | if eval $compile; then | |
14692 | echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4 | |
14693 | val="$undef" # Yes, undef. | |
14694 | set d_old_pthread_create_joinable | |
14695 | eval $setvar | |
14696 | val="" | |
14697 | set old_pthread_create_joinable | |
14698 | eval $setvar | |
14699 | else | |
14700 | set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED | |
14701 | if eval $compile; then | |
14702 | echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4 | |
14703 | val="$define" | |
14704 | set d_old_pthread_create_joinable | |
14705 | eval $setvar | |
14706 | val=PTHREAD_CREATE_UNDETACHED | |
14707 | set old_pthread_create_joinable | |
14708 | eval $setvar | |
14709 | else | |
14710 | set try -DJOINABLE=__UNDETACHED | |
14711 | if eval $compile; then | |
14712 | echo "You seem to use __UNDETACHED." >&4 | |
14713 | val="$define" | |
14714 | set d_old_pthread_create_joinable | |
14715 | eval $setvar | |
14716 | val=__UNDETACHED | |
14717 | set old_pthread_create_joinable | |
14718 | eval $setvar | |
14719 | else | |
14720 | echo "Egads, nothing obvious found. Guessing that you use 0." >&4 | |
14721 | val="$define" | |
14722 | set d_old_pthread_create_joinable | |
14723 | eval $setvar | |
14724 | val=0 | |
14725 | set old_pthread_create_joinable | |
14726 | eval $setvar | |
14727 | fi | |
14728 | fi | |
14729 | fi | |
14730 | $rm -f try try.* | |
14731 | else | |
14732 | d_old_pthread_create_joinable="$undef" | |
14733 | old_pthread_create_joinable="" | |
14734 | fi | |
14735 | ||
14736 | : see if pause exists | |
14737 | set pause d_pause | |
14738 | eval $inlibc | |
14739 | ||
14740 | : see if pipe exists | |
14741 | set pipe d_pipe | |
14742 | eval $inlibc | |
14743 | ||
14744 | : see if poll exists | |
14745 | set poll d_poll | |
14746 | eval $inlibc | |
14747 | ||
c7aff470 NIS |
14748 | : see if readlink exists |
14749 | set readlink d_readlink | |
14750 | eval $inlibc | |
14751 | ||
14752 | echo " " | |
f24dbf84 | 14753 | procselfexe='' |
c7aff470 | 14754 | val="$undef" |
a33c94aa JH |
14755 | case "$d_readlink" in |
14756 | "$define") | |
c7aff470 NIS |
14757 | if $issymlink /proc/self/exe ; then |
14758 | $ls -l /proc/self/exe > reflect | |
51660ed5 | 14759 | if $contains /`basename $ls` reflect >/dev/null 2>&1; then |
a33c94aa | 14760 | echo "You have Linux-like /proc/self/exe." |
92236451 | 14761 | procselfexe='"/proc/self/exe"' |
f24dbf84 | 14762 | val="$define" |
f24dbf84 JH |
14763 | fi |
14764 | fi | |
14765 | if $issymlink /proc/curproc/file ; then | |
14766 | $ls -l /proc/curproc/file > reflect | |
14767 | if $contains /`basename $ls` reflect >/dev/null 2>&1; then | |
14768 | echo "You have BSD-like /proc/curproc/file." | |
92236451 | 14769 | procselfexe='"/proc/curproc/file"' |
f24dbf84 | 14770 | val="$define" |
c7aff470 | 14771 | fi |
c7aff470 | 14772 | fi |
a33c94aa JH |
14773 | ;; |
14774 | esac | |
428dc699 | 14775 | $rm -f reflect |
c7aff470 NIS |
14776 | set d_procselfexe |
14777 | eval $setvar | |
14778 | ||
263fee3f JH |
14779 | : see whether the pthread_atfork exists |
14780 | $cat >try.c <<EOP | |
14781 | #include <pthread.h> | |
14782 | #include <stdio.h> | |
14783 | int main() { | |
14784 | #ifdef PTHREAD_ATFORK | |
14785 | pthread_atfork(NULL,NULL,NULL); | |
14786 | #endif | |
14787 | } | |
14788 | EOP | |
14789 | ||
d6483fcc | 14790 | : see if pthread_atfork exists |
263fee3f JH |
14791 | set try -DPTHREAD_ATFORK |
14792 | if eval $compile; then | |
14793 | val="$define" | |
14794 | else | |
14795 | val="$undef" | |
14796 | fi | |
14797 | case "$usethreads" in | |
14798 | $define) | |
14799 | case "$val" in | |
14800 | $define) echo 'pthread_atfork found.' >&4 ;; | |
14801 | *) echo 'pthread_atfork NOT found.' >&4 ;; | |
14802 | esac | |
14803 | esac | |
14804 | set d_pthread_atfork | |
14805 | eval $setvar | |
d6483fcc | 14806 | |
16c773f9 JH |
14807 | : see if pthread_attr_setscope exists |
14808 | set pthread_attr_setscope d_pthread_attr_setscope | |
14809 | eval $inlibc | |
14810 | ||
b4eb6b3d JH |
14811 | |
14812 | : see whether the various POSIXish _yields exist | |
14813 | $cat >try.c <<EOP | |
14814 | #include <pthread.h> | |
14815 | #include <stdio.h> | |
14816 | int main() { | |
14817 | #ifdef SCHED_YIELD | |
14818 | sched_yield(); | |
14819 | #else | |
14820 | #ifdef PTHREAD_YIELD | |
14821 | pthread_yield(); | |
14822 | #else | |
14823 | #ifdef PTHREAD_YIELD_NULL | |
14824 | pthread_yield(NULL); | |
14825 | #endif | |
14826 | #endif | |
14827 | #endif | |
14828 | } | |
14829 | EOP | |
14830 | : see if sched_yield exists | |
14831 | set try -DSCHED_YIELD | |
14832 | if eval $compile; then | |
14833 | val="$define" | |
14834 | sched_yield='sched_yield()' | |
14835 | else | |
14836 | val="$undef" | |
14837 | fi | |
14838 | case "$usethreads" in | |
14839 | $define) | |
14840 | case "$val" in | |
14841 | $define) echo 'sched_yield() found.' >&4 ;; | |
14842 | *) echo 'sched_yield() NOT found.' >&4 ;; | |
14843 | esac | |
14844 | esac | |
10bc17b6 JH |
14845 | set d_sched_yield |
14846 | eval $setvar | |
b4eb6b3d | 14847 | |
10bc17b6 JH |
14848 | : see if pthread_yield exists |
14849 | set try -DPTHREAD_YIELD | |
14850 | if eval $compile; then | |
14851 | val="$define" | |
14852 | case "$sched_yield" in | |
14853 | '') sched_yield='pthread_yield()' ;; | |
14854 | esac | |
14855 | else | |
14856 | set try -DPTHREAD_YIELD_NULL | |
14857 | if eval $compile; then | |
14858 | val="$define" | |
14859 | case "$sched_yield" in | |
14860 | '') sched_yield='pthread_yield(NULL)' ;; | |
14861 | esac | |
14862 | else | |
14863 | val="$undef" | |
14864 | fi | |
14865 | fi | |
14866 | case "$usethreads" in | |
14867 | $define) | |
14868 | case "$val" in | |
14869 | $define) echo 'pthread_yield() found.' >&4 ;; | |
14870 | *) echo 'pthread_yield() NOT found.' >&4 ;; | |
14871 | esac | |
14872 | ;; | |
14873 | esac | |
14874 | set d_pthread_yield | |
14875 | eval $setvar | |
b4eb6b3d | 14876 | |
10bc17b6 JH |
14877 | case "$sched_yield" in |
14878 | '') sched_yield=undef ;; | |
14879 | esac | |
b4eb6b3d | 14880 | |
10bc17b6 JH |
14881 | $rm -f try try.* |
14882 | ||
14883 | : see if random_r exists | |
14884 | set random_r d_random_r | |
14885 | eval $inlibc | |
14886 | case "$d_random_r" in | |
14887 | "$define") | |
14888 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" | |
c18e646a JH |
14889 | case "$d_random_r_proto:$usethreads" in |
14890 | ":define") d_random_r_proto=define | |
a48ec845 JH |
14891 | set d_random_r_proto random_r $hdrs |
14892 | eval $hasproto ;; | |
14893 | *) ;; | |
14894 | esac | |
14895 | case "$d_random_r_proto" in | |
14896 | define) | |
10bc17b6 JH |
14897 | case "$random_r_proto" in |
14898 | ''|0) try='int random_r(int*, struct random_data*);' | |
c71a3471 JH |
14899 | ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;; |
14900 | esac | |
14901 | case "$random_r_proto" in | |
14902 | ''|0) try='int random_r(long*, struct random_data*);' | |
14903 | ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;; | |
14904 | esac | |
14905 | case "$random_r_proto" in | |
14906 | ''|0) try='int random_r(struct random_data*, int32_t*);' | |
14907 | ./protochk "extern $try" $hdrs && random_r_proto=I_St ;; | |
10bc17b6 JH |
14908 | esac |
14909 | case "$random_r_proto" in | |
90e831dc | 14910 | ''|0) d_random_r=undef |
10bc17b6 | 14911 | random_r_proto=0 |
a48ec845 | 14912 | echo "Disabling random_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
14913 | * ) case "$random_r_proto" in |
14914 | REENTRANT_PROTO*) ;; | |
14915 | *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;; | |
14916 | esac | |
14917 | echo "Prototype: $try" ;; | |
14918 | esac | |
b4eb6b3d | 14919 | ;; |
c18e646a JH |
14920 | *) case "$usethreads" in |
14921 | define) echo "random_r has no prototype, not using it." >&4 ;; | |
14922 | esac | |
90e831dc SB |
14923 | d_random_r=undef |
14924 | random_r_proto=0 | |
c18e646a | 14925 | ;; |
a48ec845 JH |
14926 | esac |
14927 | ;; | |
10bc17b6 | 14928 | *) random_r_proto=0 |
b4eb6b3d JH |
14929 | ;; |
14930 | esac | |
14931 | ||
14932 | : see if readdir and friends exist | |
14933 | set readdir d_readdir | |
14934 | eval $inlibc | |
14935 | set seekdir d_seekdir | |
14936 | eval $inlibc | |
14937 | set telldir d_telldir | |
14938 | eval $inlibc | |
14939 | set rewinddir d_rewinddir | |
14940 | eval $inlibc | |
14941 | ||
10bc17b6 JH |
14942 | : see if readdir64_r exists |
14943 | set readdir64_r d_readdir64_r | |
14944 | eval $inlibc | |
14945 | case "$d_readdir64_r" in | |
14946 | "$define") | |
14947 | hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h" | |
c18e646a JH |
14948 | case "$d_readdir64_r_proto:$usethreads" in |
14949 | ":define") d_readdir64_r_proto=define | |
a48ec845 JH |
14950 | set d_readdir64_r_proto readdir64_r $hdrs |
14951 | eval $hasproto ;; | |
14952 | *) ;; | |
14953 | esac | |
14954 | case "$d_readdir64_r_proto" in | |
14955 | define) | |
10bc17b6 JH |
14956 | case "$readdir64_r_proto" in |
14957 | ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);' | |
14958 | ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;; | |
14959 | esac | |
14960 | case "$readdir64_r_proto" in | |
14961 | ''|0) try='int readdir64_r(DIR*, struct dirent64*);' | |
14962 | ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;; | |
14963 | esac | |
14964 | case "$readdir64_r_proto" in | |
90e831dc | 14965 | ''|0) d_readdir64_r=undef |
10bc17b6 | 14966 | readdir64_r_proto=0 |
a48ec845 | 14967 | echo "Disabling readdir64_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
14968 | * ) case "$readdir64_r_proto" in |
14969 | REENTRANT_PROTO*) ;; | |
14970 | *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;; | |
14971 | esac | |
14972 | echo "Prototype: $try" ;; | |
14973 | esac | |
14974 | ;; | |
c18e646a JH |
14975 | *) case "$usethreads" in |
14976 | define) echo "readdir64_r has no prototype, not using it." >&4 ;; | |
14977 | esac | |
90e831dc SB |
14978 | d_readdir64_r=undef |
14979 | readdir64_r_proto=0 | |
c18e646a | 14980 | ;; |
a48ec845 JH |
14981 | esac |
14982 | ;; | |
10bc17b6 JH |
14983 | *) readdir64_r_proto=0 |
14984 | ;; | |
14985 | esac | |
14986 | ||
14987 | : see if readdir_r exists | |
14988 | set readdir_r d_readdir_r | |
14989 | eval $inlibc | |
14990 | case "$d_readdir_r" in | |
14991 | "$define") | |
14992 | hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h" | |
c18e646a JH |
14993 | case "$d_readdir_r_proto:$usethreads" in |
14994 | ":define") d_readdir_r_proto=define | |
a48ec845 JH |
14995 | set d_readdir_r_proto readdir_r $hdrs |
14996 | eval $hasproto ;; | |
14997 | *) ;; | |
14998 | esac | |
14999 | case "$d_readdir_r_proto" in | |
15000 | define) | |
10bc17b6 JH |
15001 | case "$readdir_r_proto" in |
15002 | ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);' | |
15003 | ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;; | |
15004 | esac | |
15005 | case "$readdir_r_proto" in | |
15006 | ''|0) try='int readdir_r(DIR*, struct dirent*);' | |
15007 | ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;; | |
15008 | esac | |
15009 | case "$readdir_r_proto" in | |
90e831dc | 15010 | ''|0) d_readdir_r=undef |
10bc17b6 | 15011 | readdir_r_proto=0 |
a48ec845 | 15012 | echo "Disabling readdir_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15013 | * ) case "$readdir_r_proto" in |
15014 | REENTRANT_PROTO*) ;; | |
15015 | *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;; | |
15016 | esac | |
15017 | echo "Prototype: $try" ;; | |
15018 | esac | |
15019 | ;; | |
c18e646a JH |
15020 | *) case "$usethreads" in |
15021 | define) echo "readdir_r has no prototype, not using it." >&4 ;; | |
15022 | esac | |
90e831dc SB |
15023 | d_readdir_r=undef |
15024 | readdir_r_proto=0 | |
c18e646a | 15025 | ;; |
a48ec845 JH |
15026 | esac |
15027 | ;; | |
10bc17b6 JH |
15028 | *) readdir_r_proto=0 |
15029 | ;; | |
15030 | esac | |
15031 | ||
4e0554ec JH |
15032 | : see if readv exists |
15033 | set readv d_readv | |
15034 | eval $inlibc | |
15035 | ||
15036 | : see if recvmsg exists | |
15037 | set recvmsg d_recvmsg | |
15038 | eval $inlibc | |
15039 | ||
b4eb6b3d JH |
15040 | : see if rename exists |
15041 | set rename d_rename | |
15042 | eval $inlibc | |
15043 | ||
15044 | : see if rmdir exists | |
15045 | set rmdir d_rmdir | |
15046 | eval $inlibc | |
15047 | ||
15048 | : see if memory.h is available. | |
15049 | val='' | |
15050 | set memory.h val | |
15051 | eval $inhdr | |
15052 | ||
15053 | : See if it conflicts with string.h | |
15054 | case "$val" in | |
15055 | $define) | |
15056 | case "$strings" in | |
15057 | '') ;; | |
15058 | *) | |
15059 | $cppstdin $cppflags $cppminus < $strings > mem.h | |
15060 | if $contains 'memcpy' mem.h >/dev/null 2>&1; then | |
15061 | echo " " | |
15062 | echo "We won't be including <memory.h>." | |
15063 | val="$undef" | |
15064 | fi | |
15065 | $rm -f mem.h | |
15066 | ;; | |
15067 | esac | |
15068 | esac | |
15069 | set i_memory | |
15070 | eval $setvar | |
15071 | ||
15072 | : can bcopy handle overlapping blocks? | |
b6cc3bc4 | 15073 | echo " " |
b4eb6b3d | 15074 | val="$undef" |
b6cc3bc4 AD |
15075 | case "$d_memmove" in |
15076 | "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;; | |
15077 | *) case "$d_bcopy" in | |
15078 | "$define") | |
15079 | echo "Checking to see if bcopy() can do overlapping copies..." >&4 | |
15080 | $cat >try.c <<EOCP | |
b4eb6b3d JH |
15081 | #$i_memory I_MEMORY |
15082 | #$i_stdlib I_STDLIB | |
15083 | #$i_string I_STRING | |
15084 | #$i_unistd I_UNISTD | |
15085 | EOCP | |
15086 | $cat >>try.c <<'EOCP' | |
15087 | #include <stdio.h> | |
15088 | #ifdef I_MEMORY | |
15089 | # include <memory.h> | |
15090 | #endif | |
15091 | #ifdef I_STDLIB | |
15092 | # include <stdlib.h> | |
15093 | #endif | |
15094 | #ifdef I_STRING | |
15095 | # include <string.h> | |
15096 | #else | |
15097 | # include <strings.h> | |
15098 | #endif | |
15099 | #ifdef I_UNISTD | |
15100 | # include <unistd.h> /* Needed for NetBSD */ | |
15101 | #endif | |
15102 | int main() | |
15103 | { | |
15104 | char buf[128], abc[128]; | |
15105 | char *b; | |
15106 | int len; | |
15107 | int off; | |
15108 | int align; | |
15109 | ||
b6cc3bc4 AD |
15110 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
15111 | try to store the string in read-only memory. */ | |
b4eb6b3d JH |
15112 | bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36); |
15113 | ||
15114 | for (align = 7; align >= 0; align--) { | |
15115 | for (len = 36; len; len--) { | |
15116 | b = buf+align; | |
15117 | bcopy(abc, b, len); | |
15118 | for (off = 1; off <= len; off++) { | |
15119 | bcopy(b, b+off, len); | |
15120 | bcopy(b+off, b, len); | |
15121 | if (bcmp(b, abc, len)) | |
15122 | exit(1); | |
15123 | } | |
15124 | } | |
15125 | } | |
15126 | exit(0); | |
15127 | } | |
15128 | EOCP | |
b6cc3bc4 AD |
15129 | set try |
15130 | if eval $compile_ok; then | |
15131 | if ./try 2>/dev/null; then | |
15132 | echo "Yes, it can." | |
15133 | val="$define" | |
15134 | else | |
15135 | echo "It can't, sorry." | |
15136 | fi | |
b4eb6b3d | 15137 | else |
b6cc3bc4 | 15138 | echo "(I can't compile the test program, so we'll assume not...)" |
b4eb6b3d | 15139 | fi |
b6cc3bc4 AD |
15140 | ;; |
15141 | esac | |
15142 | $rm -f try.* try core | |
b4eb6b3d JH |
15143 | ;; |
15144 | esac | |
b4eb6b3d JH |
15145 | set d_safebcpy |
15146 | eval $setvar | |
15147 | ||
15148 | : can memcpy handle overlapping blocks? | |
b6cc3bc4 | 15149 | echo " " |
b4eb6b3d | 15150 | val="$undef" |
b6cc3bc4 AD |
15151 | case "$d_memmove" in |
15152 | "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;; | |
15153 | *) case "$d_memcpy" in | |
15154 | "$define") | |
15155 | echo "Checking to see if memcpy() can do overlapping copies..." >&4 | |
15156 | $cat >try.c <<EOCP | |
b4eb6b3d JH |
15157 | #$i_memory I_MEMORY |
15158 | #$i_stdlib I_STDLIB | |
15159 | #$i_string I_STRING | |
15160 | #$i_unistd I_UNISTD | |
15161 | EOCP | |
15162 | $cat >>try.c <<'EOCP' | |
15163 | #include <stdio.h> | |
15164 | #ifdef I_MEMORY | |
15165 | # include <memory.h> | |
15166 | #endif | |
15167 | #ifdef I_STDLIB | |
15168 | # include <stdlib.h> | |
15169 | #endif | |
15170 | #ifdef I_STRING | |
15171 | # include <string.h> | |
15172 | #else | |
15173 | # include <strings.h> | |
15174 | #endif | |
15175 | #ifdef I_UNISTD | |
15176 | # include <unistd.h> /* Needed for NetBSD */ | |
15177 | #endif | |
15178 | int main() | |
15179 | { | |
15180 | char buf[128], abc[128]; | |
15181 | char *b; | |
15182 | int len; | |
15183 | int off; | |
15184 | int align; | |
15185 | ||
15186 | /* Copy "abcde..." string to char abc[] so that gcc doesn't | |
15187 | try to store the string in read-only memory. */ | |
15188 | memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36); | |
15189 | ||
15190 | for (align = 7; align >= 0; align--) { | |
15191 | for (len = 36; len; len--) { | |
15192 | b = buf+align; | |
15193 | memcpy(b, abc, len); | |
15194 | for (off = 1; off <= len; off++) { | |
15195 | memcpy(b+off, b, len); | |
15196 | memcpy(b, b+off, len); | |
15197 | if (memcmp(b, abc, len)) | |
15198 | exit(1); | |
15199 | } | |
15200 | } | |
15201 | } | |
15202 | exit(0); | |
15203 | } | |
15204 | EOCP | |
b6cc3bc4 AD |
15205 | set try |
15206 | if eval $compile_ok; then | |
15207 | if ./try 2>/dev/null; then | |
15208 | echo "Yes, it can." | |
15209 | val="$define" | |
15210 | else | |
15211 | echo "It can't, sorry." | |
15212 | fi | |
b4eb6b3d | 15213 | else |
b6cc3bc4 | 15214 | echo "(I can't compile the test program, so we'll assume not...)" |
b4eb6b3d | 15215 | fi |
b6cc3bc4 AD |
15216 | ;; |
15217 | esac | |
15218 | $rm -f try.* try core | |
b4eb6b3d JH |
15219 | ;; |
15220 | esac | |
b4eb6b3d JH |
15221 | set d_safemcpy |
15222 | eval $setvar | |
15223 | ||
15224 | : can memcmp be trusted to compare relative magnitude? | |
15225 | val="$undef" | |
15226 | case "$d_memcmp" in | |
15227 | "$define") | |
15228 | echo " " | |
15229 | echo "Checking if your memcmp() can compare relative magnitude..." >&4 | |
15230 | $cat >try.c <<EOCP | |
15231 | #$i_memory I_MEMORY | |
15232 | #$i_stdlib I_STDLIB | |
15233 | #$i_string I_STRING | |
15234 | #$i_unistd I_UNISTD | |
15235 | EOCP | |
15236 | $cat >>try.c <<'EOCP' | |
15237 | #include <stdio.h> | |
15238 | #ifdef I_MEMORY | |
15239 | # include <memory.h> | |
15240 | #endif | |
15241 | #ifdef I_STDLIB | |
15242 | # include <stdlib.h> | |
15243 | #endif | |
15244 | #ifdef I_STRING | |
15245 | # include <string.h> | |
15246 | #else | |
15247 | # include <strings.h> | |
15248 | #endif | |
15249 | #ifdef I_UNISTD | |
15250 | # include <unistd.h> /* Needed for NetBSD */ | |
15251 | #endif | |
15252 | int main() | |
15253 | { | |
15254 | char a = -1; | |
15255 | char b = 0; | |
15256 | if ((a < b) && memcmp(&a, &b, 1) < 0) | |
15257 | exit(1); | |
15258 | exit(0); | |
15259 | } | |
15260 | EOCP | |
15261 | set try | |
15262 | if eval $compile_ok; then | |
5440bc8e | 15263 | if $run ./try 2>/dev/null; then |
b4eb6b3d JH |
15264 | echo "Yes, it can." |
15265 | val="$define" | |
15266 | else | |
15267 | echo "No, it can't (it uses signed chars)." | |
15268 | fi | |
15269 | else | |
15270 | echo "(I can't compile the test program, so we'll assume not...)" | |
15271 | fi | |
15272 | ;; | |
15273 | esac | |
15274 | $rm -f try.* try core | |
15275 | set d_sanemcmp | |
15276 | eval $setvar | |
15277 | ||
ef9f17be JH |
15278 | : see if prototype for sbrk is available |
15279 | echo " " | |
15280 | set d_sbrkproto sbrk $i_unistd unistd.h | |
15281 | eval $hasproto | |
15282 | ||
b4eb6b3d JH |
15283 | : see if select exists |
15284 | set select d_select | |
15285 | eval $inlibc | |
15286 | ||
15287 | : see if semctl exists | |
15288 | set semctl d_semctl | |
15289 | eval $inlibc | |
15290 | ||
15291 | : see if semget exists | |
15292 | set semget d_semget | |
15293 | eval $inlibc | |
15294 | ||
15295 | : see if semop exists | |
15296 | set semop d_semop | |
15297 | eval $inlibc | |
15298 | ||
15299 | : see how much of the 'sem*(2)' library is present. | |
15300 | h_sem=true | |
15301 | echo " " | |
15302 | case "$d_semctl$d_semget$d_semop" in | |
15303 | *"$undef"*) h_sem=false;; | |
15304 | esac | |
15305 | case "$osname" in | |
15306 | freebsd) | |
15307 | case "`ipcs 2>&1`" in | |
15308 | "SVID messages"*"not configured"*) | |
15309 | echo "Your $osname does not have the sem*(2) configured." >&4 | |
15310 | h_sem=false | |
15311 | val="$undef" | |
15312 | set semctl d_semctl | |
15313 | eval $setvar | |
15314 | set semget d_semget | |
15315 | eval $setvar | |
15316 | set semop d_semop | |
15317 | eval $setvar | |
15318 | ;; | |
15319 | esac | |
15320 | ;; | |
15321 | esac | |
15322 | : we could also check for sys/ipc.h ... | |
15323 | if $h_sem && $test `./findhdr sys/sem.h`; then | |
15324 | echo "You have the full sem*(2) library." >&4 | |
15325 | val="$define" | |
15326 | else | |
15327 | echo "You don't have the full sem*(2) library." >&4 | |
15328 | val="$undef" | |
15329 | fi | |
15330 | set d_sem | |
15331 | eval $setvar | |
15332 | ||
15333 | : see whether sys/sem.h defines union semun | |
15334 | echo " " | |
15335 | $cat > try.c <<'END' | |
15336 | #include <sys/types.h> | |
15337 | #include <sys/ipc.h> | |
15338 | #include <sys/sem.h> | |
15339 | int main () { union semun semun; semun.buf = 0; } | |
15340 | END | |
15341 | set try | |
15342 | if eval $compile; then | |
15343 | echo "You have union semun in <sys/sem.h>." >&4 | |
15344 | val="$define" | |
15345 | else | |
15346 | echo "You do not have union semun in <sys/sem.h>." >&4 | |
15347 | val="$undef" | |
15348 | fi | |
c9569057 | 15349 | $rm -f try try.c |
b4eb6b3d JH |
15350 | set d_union_semun |
15351 | eval $setvar | |
15352 | ||
15353 | : see how to do semctl IPC_STAT | |
15354 | case "$d_sem" in | |
15355 | $define) | |
b4eb6b3d JH |
15356 | echo " " |
15357 | $cat > try.h <<END | |
15358 | #ifndef S_IRUSR | |
15359 | # ifdef S_IREAD | |
15360 | # define S_IRUSR S_IREAD | |
15361 | # define S_IWUSR S_IWRITE | |
15362 | # define S_IXUSR S_IEXEC | |
15363 | # else | |
15364 | # define S_IRUSR 0400 | |
15365 | # define S_IWUSR 0200 | |
15366 | # define S_IXUSR 0100 | |
15367 | # endif | |
15368 | # define S_IRGRP (S_IRUSR>>3) | |
15369 | # define S_IWGRP (S_IWUSR>>3) | |
15370 | # define S_IXGRP (S_IXUSR>>3) | |
15371 | # define S_IROTH (S_IRUSR>>6) | |
15372 | # define S_IWOTH (S_IWUSR>>6) | |
15373 | # define S_IXOTH (S_IXUSR>>6) | |
15374 | #endif | |
15375 | #ifndef S_IRWXU | |
15376 | # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) | |
15377 | # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) | |
15378 | # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) | |
15379 | #endif | |
15380 | END | |
c9569057 PP |
15381 | : see whether semctl IPC_STAT can use union semun |
15382 | val="$undef" | |
15383 | case "$d_semctl_semun" in | |
15384 | '') | |
15385 | $cat > try.c <<END | |
b4eb6b3d JH |
15386 | #include <sys/types.h> |
15387 | #include <sys/ipc.h> | |
15388 | #include <sys/sem.h> | |
15389 | #include <sys/stat.h> | |
15390 | #include <stdio.h> | |
15391 | #include <errno.h> | |
15392 | #include "try.h" | |
15393 | #ifndef errno | |
15394 | extern int errno; | |
15395 | #endif | |
15396 | #$d_union_semun HAS_UNION_SEMUN | |
15397 | int main() { | |
15398 | union semun | |
15399 | #ifndef HAS_UNION_SEMUN | |
15400 | { | |
15401 | int val; | |
15402 | struct semid_ds *buf; | |
15403 | unsigned short *array; | |
15404 | } | |
15405 | #endif | |
15406 | arg; | |
15407 | int sem, st; | |
15408 | ||
15409 | #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) | |
15410 | sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); | |
15411 | if (sem > -1) { | |
15412 | struct semid_ds argbuf; | |
15413 | arg.buf = &argbuf; | |
15414 | # ifdef IPC_STAT | |
15415 | st = semctl(sem, 0, IPC_STAT, arg); | |
15416 | if (st == 0) | |
15417 | printf("semun\n"); | |
15418 | else | |
15419 | # endif /* IPC_STAT */ | |
15420 | printf("semctl IPC_STAT failed: errno = %d\n", errno); | |
15421 | # ifdef IPC_RMID | |
15422 | if (semctl(sem, 0, IPC_RMID, arg) != 0) | |
15423 | # endif /* IPC_RMID */ | |
15424 | printf("semctl IPC_RMID failed: errno = %d\n", errno); | |
15425 | } else | |
15426 | #endif /* IPC_PRIVATE && ... */ | |
15427 | printf("semget failed: errno = %d\n", errno); | |
15428 | return 0; | |
15429 | } | |
15430 | END | |
c9569057 PP |
15431 | set try |
15432 | if eval $compile; then | |
15433 | xxx=`$run ./try` | |
15434 | case "$xxx" in | |
15435 | semun) val="$define" ;; | |
15436 | esac | |
15437 | fi | |
15438 | $rm -f try try.c | |
15439 | ;; | |
15440 | esac | |
b4eb6b3d JH |
15441 | set d_semctl_semun |
15442 | eval $setvar | |
15443 | case "$d_semctl_semun" in | |
15444 | $define) | |
15445 | echo "You can use union semun for semctl IPC_STAT." >&4 | |
15446 | also='also' | |
15447 | ;; | |
15448 | *) echo "You cannot use union semun for semctl IPC_STAT." >&4 | |
15449 | also='' | |
15450 | ;; | |
15451 | esac | |
15452 | ||
15453 | : see whether semctl IPC_STAT can use struct semid_ds pointer | |
c9569057 PP |
15454 | val="$undef" |
15455 | case "$d_semctl_semid_ds" in | |
15456 | '') | |
15457 | $cat > try.c <<'END' | |
b4eb6b3d JH |
15458 | #include <sys/types.h> |
15459 | #include <sys/ipc.h> | |
15460 | #include <sys/sem.h> | |
15461 | #include <sys/stat.h> | |
15462 | #include "try.h" | |
15463 | #include <stdio.h> | |
15464 | #include <errno.h> | |
15465 | #ifndef errno | |
15466 | extern int errno; | |
15467 | #endif | |
15468 | int main() { | |
15469 | struct semid_ds arg; | |
15470 | int sem, st; | |
15471 | ||
15472 | #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) | |
15473 | sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); | |
15474 | if (sem > -1) { | |
15475 | # ifdef IPC_STAT | |
15476 | st = semctl(sem, 0, IPC_STAT, &arg); | |
15477 | if (st == 0) | |
15478 | printf("semid_ds\n"); | |
15479 | else | |
15480 | # endif /* IPC_STAT */ | |
15481 | printf("semctl IPC_STAT failed: errno = %d\n", errno); | |
15482 | # ifdef IPC_RMID | |
15483 | if (semctl(sem, 0, IPC_RMID, &arg) != 0) | |
15484 | # endif /* IPC_RMID */ | |
15485 | printf("semctl IPC_RMID failed: errno = %d\n", errno); | |
15486 | } else | |
15487 | #endif /* IPC_PRIVATE && ... */ | |
15488 | printf("semget failed: errno = %d\n", errno); | |
15489 | ||
15490 | return 0; | |
15491 | } | |
15492 | END | |
c9569057 PP |
15493 | set try |
15494 | if eval $compile; then | |
15495 | xxx=`$run ./try` | |
15496 | case "$xxx" in | |
15497 | semid_ds) val="$define" ;; | |
15498 | esac | |
15499 | fi | |
15500 | $rm -f try try.c | |
15501 | ;; | |
15502 | esac | |
b4eb6b3d JH |
15503 | set d_semctl_semid_ds |
15504 | eval $setvar | |
15505 | case "$d_semctl_semid_ds" in | |
15506 | $define) | |
15507 | echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4 | |
15508 | ;; | |
15509 | *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4 | |
15510 | ;; | |
15511 | esac | |
15512 | $rm -f try.h | |
15513 | ;; | |
15514 | *) val="$undef" | |
15515 | ||
15516 | # We do not have the full sem*(2) library, so assume we can not | |
15517 | # use either. | |
15518 | ||
15519 | set d_semctl_semun | |
15520 | eval $setvar | |
15521 | ||
15522 | set d_semctl_semid_ds | |
15523 | eval $setvar | |
15524 | ;; | |
15525 | esac | |
15526 | ||
4e0554ec JH |
15527 | : see if sendmsg exists |
15528 | set sendmsg d_sendmsg | |
15529 | eval $inlibc | |
15530 | ||
b4eb6b3d JH |
15531 | : see if setegid exists |
15532 | set setegid d_setegid | |
15533 | eval $inlibc | |
15534 | ||
15535 | : see if seteuid exists | |
15536 | set seteuid d_seteuid | |
15537 | eval $inlibc | |
15538 | ||
15539 | : see if setgrent exists | |
15540 | set setgrent d_setgrent | |
15541 | eval $inlibc | |
15542 | ||
10bc17b6 JH |
15543 | : see if setgrent_r exists |
15544 | set setgrent_r d_setgrent_r | |
15545 | eval $inlibc | |
15546 | case "$d_setgrent_r" in | |
15547 | "$define") | |
15548 | hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h" | |
c18e646a JH |
15549 | case "$d_setgrent_r_proto:$usethreads" in |
15550 | ":define") d_setgrent_r_proto=define | |
a48ec845 JH |
15551 | set d_setgrent_r_proto setgrent_r $hdrs |
15552 | eval $hasproto ;; | |
15553 | *) ;; | |
15554 | esac | |
15555 | case "$d_setgrent_r_proto" in | |
15556 | define) | |
10bc17b6 JH |
15557 | case "$setgrent_r_proto" in |
15558 | ''|0) try='int setgrent_r(FILE**);' | |
15559 | ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;; | |
15560 | esac | |
15561 | case "$setgrent_r_proto" in | |
15562 | ''|0) try='void setgrent_r(FILE**);' | |
15563 | ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;; | |
15564 | esac | |
15565 | case "$setgrent_r_proto" in | |
90e831dc | 15566 | ''|0) d_setgrent_r=undef |
10bc17b6 | 15567 | setgrent_r_proto=0 |
a48ec845 | 15568 | echo "Disabling setgrent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15569 | * ) case "$setgrent_r_proto" in |
15570 | REENTRANT_PROTO*) ;; | |
15571 | *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;; | |
15572 | esac | |
15573 | echo "Prototype: $try" ;; | |
15574 | esac | |
15575 | ;; | |
c18e646a JH |
15576 | *) case "$usethreads" in |
15577 | define) echo "setgrent_r has no prototype, not using it." >&4 ;; | |
15578 | esac | |
90e831dc SB |
15579 | d_setgrent_r=undef |
15580 | setgrent_r_proto=0 | |
c18e646a | 15581 | ;; |
a48ec845 JH |
15582 | esac |
15583 | ;; | |
10bc17b6 JH |
15584 | *) setgrent_r_proto=0 |
15585 | ;; | |
15586 | esac | |
15587 | ||
b4eb6b3d JH |
15588 | : see if sethostent exists |
15589 | set sethostent d_sethent | |
15590 | eval $inlibc | |
15591 | ||
10bc17b6 JH |
15592 | : see if sethostent_r exists |
15593 | set sethostent_r d_sethostent_r | |
15594 | eval $inlibc | |
15595 | case "$d_sethostent_r" in | |
15596 | "$define") | |
15597 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
15598 | case "$d_sethostent_r_proto:$usethreads" in |
15599 | ":define") d_sethostent_r_proto=define | |
a48ec845 JH |
15600 | set d_sethostent_r_proto sethostent_r $hdrs |
15601 | eval $hasproto ;; | |
15602 | *) ;; | |
15603 | esac | |
15604 | case "$d_sethostent_r_proto" in | |
15605 | define) | |
10bc17b6 JH |
15606 | case "$sethostent_r_proto" in |
15607 | ''|0) try='int sethostent_r(int, struct hostent_data*);' | |
15608 | ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;; | |
15609 | esac | |
15610 | case "$sethostent_r_proto" in | |
15611 | ''|0) try='void sethostent_r(int, struct hostent_data*);' | |
15612 | ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;; | |
15613 | esac | |
15614 | case "$sethostent_r_proto" in | |
90e831dc | 15615 | ''|0) d_sethostent_r=undef |
10bc17b6 | 15616 | sethostent_r_proto=0 |
a48ec845 | 15617 | echo "Disabling sethostent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15618 | * ) case "$sethostent_r_proto" in |
15619 | REENTRANT_PROTO*) ;; | |
15620 | *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;; | |
15621 | esac | |
15622 | echo "Prototype: $try" ;; | |
15623 | esac | |
15624 | ;; | |
c18e646a JH |
15625 | *) case "$usethreads" in |
15626 | define) echo "sethostent_r has no prototype, not using it." >&4 ;; | |
15627 | esac | |
90e831dc SB |
15628 | d_sethostent_r=undef |
15629 | sethostent_r_proto=0 | |
c18e646a | 15630 | ;; |
a48ec845 JH |
15631 | esac |
15632 | ;; | |
10bc17b6 JH |
15633 | *) sethostent_r_proto=0 |
15634 | ;; | |
15635 | esac | |
15636 | ||
4e0554ec JH |
15637 | : see if setitimer exists |
15638 | set setitimer d_setitimer | |
15639 | eval $inlibc | |
15640 | ||
b4eb6b3d JH |
15641 | : see if setlinebuf exists |
15642 | set setlinebuf d_setlinebuf | |
15643 | eval $inlibc | |
15644 | ||
15645 | : see if setlocale exists | |
15646 | set setlocale d_setlocale | |
15647 | eval $inlibc | |
15648 | ||
10bc17b6 JH |
15649 | : see if locale.h is available |
15650 | set locale.h i_locale | |
15651 | eval $inhdr | |
15652 | ||
15653 | : see if setlocale_r exists | |
15654 | set setlocale_r d_setlocale_r | |
15655 | eval $inlibc | |
15656 | case "$d_setlocale_r" in | |
15657 | "$define") | |
15658 | hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h" | |
c18e646a JH |
15659 | case "$d_setlocale_r_proto:$usethreads" in |
15660 | ":define") d_setlocale_r_proto=define | |
a48ec845 JH |
15661 | set d_setlocale_r_proto setlocale_r $hdrs |
15662 | eval $hasproto ;; | |
15663 | *) ;; | |
15664 | esac | |
15665 | case "$d_setlocale_r_proto" in | |
15666 | define) | |
10bc17b6 JH |
15667 | case "$setlocale_r_proto" in |
15668 | ''|0) try='int setlocale_r(int, const char*, char*, int);' | |
15669 | ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;; | |
15670 | esac | |
15671 | case "$setlocale_r_proto" in | |
90e831dc | 15672 | ''|0) d_setlocale_r=undef |
10bc17b6 | 15673 | setlocale_r_proto=0 |
a48ec845 | 15674 | echo "Disabling setlocale_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15675 | * ) case "$setlocale_r_proto" in |
15676 | REENTRANT_PROTO*) ;; | |
15677 | *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;; | |
15678 | esac | |
15679 | echo "Prototype: $try" ;; | |
15680 | esac | |
15681 | ;; | |
c18e646a JH |
15682 | *) case "$usethreads" in |
15683 | define) echo "setlocale_r has no prototype, not using it." >&4 ;; | |
15684 | esac | |
90e831dc SB |
15685 | d_setlocale_r=undef |
15686 | setlocale_r_proto=0 | |
c18e646a | 15687 | ;; |
a48ec845 JH |
15688 | esac |
15689 | ;; | |
10bc17b6 JH |
15690 | *) setlocale_r_proto=0 |
15691 | ;; | |
15692 | esac | |
15693 | ||
b4eb6b3d JH |
15694 | : see if setnetent exists |
15695 | set setnetent d_setnent | |
15696 | eval $inlibc | |
15697 | ||
10bc17b6 JH |
15698 | : see if setnetent_r exists |
15699 | set setnetent_r d_setnetent_r | |
15700 | eval $inlibc | |
15701 | case "$d_setnetent_r" in | |
15702 | "$define") | |
15703 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
15704 | case "$d_setnetent_r_proto:$usethreads" in |
15705 | ":define") d_setnetent_r_proto=define | |
a48ec845 JH |
15706 | set d_setnetent_r_proto setnetent_r $hdrs |
15707 | eval $hasproto ;; | |
15708 | *) ;; | |
15709 | esac | |
15710 | case "$d_setnetent_r_proto" in | |
15711 | define) | |
10bc17b6 JH |
15712 | case "$setnetent_r_proto" in |
15713 | ''|0) try='int setnetent_r(int, struct netent_data*);' | |
15714 | ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;; | |
15715 | esac | |
15716 | case "$setnetent_r_proto" in | |
15717 | ''|0) try='void setnetent_r(int, struct netent_data*);' | |
15718 | ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;; | |
15719 | esac | |
15720 | case "$setnetent_r_proto" in | |
90e831dc | 15721 | ''|0) d_setnetent_r=undef |
10bc17b6 | 15722 | setnetent_r_proto=0 |
a48ec845 | 15723 | echo "Disabling setnetent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15724 | * ) case "$setnetent_r_proto" in |
15725 | REENTRANT_PROTO*) ;; | |
15726 | *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;; | |
15727 | esac | |
15728 | echo "Prototype: $try" ;; | |
15729 | esac | |
15730 | ;; | |
c18e646a JH |
15731 | *) case "$usethreads" in |
15732 | define) echo "setnetent_r has no prototype, not using it." >&4 ;; | |
15733 | esac | |
90e831dc SB |
15734 | d_setnetent_r=undef |
15735 | setnetent_r_proto=0 | |
c18e646a | 15736 | ;; |
a48ec845 JH |
15737 | esac |
15738 | ;; | |
10bc17b6 JH |
15739 | *) setnetent_r_proto=0 |
15740 | ;; | |
15741 | esac | |
15742 | ||
b4eb6b3d JH |
15743 | : see if setprotoent exists |
15744 | set setprotoent d_setpent | |
15745 | eval $inlibc | |
15746 | ||
15747 | : see if setpgid exists | |
15748 | set setpgid d_setpgid | |
15749 | eval $inlibc | |
15750 | ||
15751 | : see if setpgrp2 exists | |
15752 | set setpgrp2 d_setpgrp2 | |
15753 | eval $inlibc | |
15754 | ||
15755 | : see if setpriority exists | |
15756 | set setpriority d_setprior | |
15757 | eval $inlibc | |
15758 | ||
15759 | : see if setproctitle exists | |
15760 | set setproctitle d_setproctitle | |
15761 | eval $inlibc | |
15762 | ||
10bc17b6 JH |
15763 | : see if setprotoent_r exists |
15764 | set setprotoent_r d_setprotoent_r | |
15765 | eval $inlibc | |
15766 | case "$d_setprotoent_r" in | |
15767 | "$define") | |
15768 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
15769 | case "$d_setprotoent_r_proto:$usethreads" in |
15770 | ":define") d_setprotoent_r_proto=define | |
a48ec845 JH |
15771 | set d_setprotoent_r_proto setprotoent_r $hdrs |
15772 | eval $hasproto ;; | |
15773 | *) ;; | |
15774 | esac | |
15775 | case "$d_setprotoent_r_proto" in | |
15776 | define) | |
10bc17b6 JH |
15777 | case "$setprotoent_r_proto" in |
15778 | ''|0) try='int setprotoent_r(int, struct protoent_data*);' | |
15779 | ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;; | |
15780 | esac | |
15781 | case "$setprotoent_r_proto" in | |
15782 | ''|0) try='void setprotoent_r(int, struct protoent_data*);' | |
15783 | ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;; | |
15784 | esac | |
15785 | case "$setprotoent_r_proto" in | |
90e831dc | 15786 | ''|0) d_setprotoent_r=undef |
10bc17b6 | 15787 | setprotoent_r_proto=0 |
a48ec845 | 15788 | echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15789 | * ) case "$setprotoent_r_proto" in |
15790 | REENTRANT_PROTO*) ;; | |
15791 | *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;; | |
15792 | esac | |
15793 | echo "Prototype: $try" ;; | |
15794 | esac | |
15795 | ;; | |
c18e646a JH |
15796 | *) case "$usethreads" in |
15797 | define) echo "setprotoent_r has no prototype, not using it." >&4 ;; | |
15798 | esac | |
90e831dc SB |
15799 | d_setprotoent_r=undef |
15800 | setprotoent_r_proto=0 | |
c18e646a | 15801 | ;; |
a48ec845 JH |
15802 | esac |
15803 | ;; | |
10bc17b6 JH |
15804 | *) setprotoent_r_proto=0 |
15805 | ;; | |
15806 | esac | |
15807 | ||
b4eb6b3d JH |
15808 | : see if setpwent exists |
15809 | set setpwent d_setpwent | |
15810 | eval $inlibc | |
15811 | ||
10bc17b6 JH |
15812 | : see if setpwent_r exists |
15813 | set setpwent_r d_setpwent_r | |
15814 | eval $inlibc | |
15815 | case "$d_setpwent_r" in | |
15816 | "$define") | |
15817 | hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h" | |
c18e646a JH |
15818 | case "$d_setpwent_r_proto:$usethreads" in |
15819 | ":define") d_setpwent_r_proto=define | |
a48ec845 JH |
15820 | set d_setpwent_r_proto setpwent_r $hdrs |
15821 | eval $hasproto ;; | |
15822 | *) ;; | |
15823 | esac | |
15824 | case "$d_setpwent_r_proto" in | |
15825 | define) | |
10bc17b6 JH |
15826 | case "$setpwent_r_proto" in |
15827 | ''|0) try='int setpwent_r(FILE**);' | |
15828 | ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;; | |
15829 | esac | |
15830 | case "$setpwent_r_proto" in | |
15831 | ''|0) try='void setpwent_r(FILE**);' | |
15832 | ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;; | |
15833 | esac | |
15834 | case "$setpwent_r_proto" in | |
90e831dc | 15835 | ''|0) d_setpwent_r=undef |
10bc17b6 | 15836 | setpwent_r_proto=0 |
a48ec845 | 15837 | echo "Disabling setpwent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15838 | * ) case "$setpwent_r_proto" in |
15839 | REENTRANT_PROTO*) ;; | |
15840 | *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;; | |
15841 | esac | |
15842 | echo "Prototype: $try" ;; | |
15843 | esac | |
15844 | ;; | |
c18e646a JH |
15845 | *) case "$usethreads" in |
15846 | define) echo "setpwent_r has no prototype, not using it." >&4 ;; | |
15847 | esac | |
90e831dc SB |
15848 | d_setpwent_r=undef |
15849 | setpwent_r_proto=0 | |
c18e646a | 15850 | ;; |
a48ec845 JH |
15851 | esac |
15852 | ;; | |
10bc17b6 JH |
15853 | *) setpwent_r_proto=0 |
15854 | ;; | |
15855 | esac | |
15856 | ||
b4eb6b3d JH |
15857 | : see if setregid exists |
15858 | set setregid d_setregid | |
15859 | eval $inlibc | |
15860 | set setresgid d_setresgid | |
15861 | eval $inlibc | |
15862 | ||
15863 | : see if setreuid exists | |
15864 | set setreuid d_setreuid | |
15865 | eval $inlibc | |
15866 | set setresuid d_setresuid | |
15867 | eval $inlibc | |
15868 | ||
15869 | : see if setrgid exists | |
15870 | set setrgid d_setrgid | |
15871 | eval $inlibc | |
15872 | ||
15873 | : see if setruid exists | |
15874 | set setruid d_setruid | |
15875 | eval $inlibc | |
15876 | ||
15877 | : see if setservent exists | |
15878 | set setservent d_setsent | |
15879 | eval $inlibc | |
15880 | ||
10bc17b6 JH |
15881 | : see if setservent_r exists |
15882 | set setservent_r d_setservent_r | |
15883 | eval $inlibc | |
15884 | case "$d_setservent_r" in | |
15885 | "$define") | |
15886 | hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h" | |
c18e646a JH |
15887 | case "$d_setservent_r_proto:$usethreads" in |
15888 | ":define") d_setservent_r_proto=define | |
a48ec845 JH |
15889 | set d_setservent_r_proto setservent_r $hdrs |
15890 | eval $hasproto ;; | |
15891 | *) ;; | |
15892 | esac | |
15893 | case "$d_setservent_r_proto" in | |
15894 | define) | |
10bc17b6 JH |
15895 | case "$setservent_r_proto" in |
15896 | ''|0) try='int setservent_r(int, struct servent_data*);' | |
15897 | ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;; | |
15898 | esac | |
15899 | case "$setservent_r_proto" in | |
15900 | ''|0) try='void setservent_r(int, struct servent_data*);' | |
15901 | ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;; | |
15902 | esac | |
15903 | case "$setservent_r_proto" in | |
90e831dc | 15904 | ''|0) d_setservent_r=undef |
10bc17b6 | 15905 | setservent_r_proto=0 |
a48ec845 | 15906 | echo "Disabling setservent_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
15907 | * ) case "$setservent_r_proto" in |
15908 | REENTRANT_PROTO*) ;; | |
15909 | *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;; | |
15910 | esac | |
15911 | echo "Prototype: $try" ;; | |
15912 | esac | |
15913 | ;; | |
c18e646a JH |
15914 | *) case "$usethreads" in |
15915 | define) echo "setservent_r has no prototype, not using it." >&4 ;; | |
15916 | esac | |
90e831dc SB |
15917 | d_setservent_r=undef |
15918 | setservent_r_proto=0 | |
c18e646a | 15919 | ;; |
a48ec845 JH |
15920 | esac |
15921 | ;; | |
10bc17b6 JH |
15922 | *) setservent_r_proto=0 |
15923 | ;; | |
15924 | esac | |
15925 | ||
b4eb6b3d JH |
15926 | : see if setsid exists |
15927 | set setsid d_setsid | |
15928 | eval $inlibc | |
15929 | ||
15930 | : see if setvbuf exists | |
15931 | set setvbuf d_setvbuf | |
15932 | eval $inlibc | |
15933 | ||
15934 | : see if sfio.h is available | |
15935 | set sfio.h i_sfio | |
15936 | eval $inhdr | |
15937 | ||
15938 | ||
15939 | : see if sfio library is available | |
15940 | case "$i_sfio" in | |
15941 | $define) | |
15942 | val='' | |
15943 | set sfreserve val | |
15944 | eval $inlibc | |
15945 | ;; | |
15946 | *) | |
15947 | val="$undef" | |
15948 | ;; | |
15949 | esac | |
15950 | : Ok, but do we want to use it. | |
15951 | case "$val" in | |
15952 | $define) | |
15953 | case "$usesfio" in | |
15954 | true|$define|[yY]*) dflt='y';; | |
15955 | *) dflt='n';; | |
15956 | esac | |
15957 | echo "$package can use the sfio library, but it is experimental." | |
15958 | case "$useperlio" in | |
15959 | "$undef") | |
15960 | echo "For sfio also the PerlIO abstraction layer is needed." | |
15961 | echo "Earlier you said you wouldn't want that." | |
15962 | ;; | |
15963 | esac | |
15964 | rp="You seem to have sfio available, do you want to try using it?" | |
15965 | . ./myread | |
15966 | case "$ans" in | |
15967 | y|Y) echo "Ok, turning on both sfio and PerlIO, then." | |
15968 | useperlio="$define" | |
15969 | val="$define" | |
15970 | ;; | |
15971 | *) echo "Ok, avoiding sfio this time. I'll use stdio instead." | |
15972 | val="$undef" | |
b4eb6b3d JH |
15973 | ;; |
15974 | esac | |
15975 | ;; | |
15976 | *) case "$usesfio" in | |
15977 | true|$define|[yY]*) | |
15978 | echo "Sorry, cannot find sfio on this machine." >&4 | |
15979 | echo "Ignoring your setting of usesfio=$usesfio." >&4 | |
15980 | val="$undef" | |
15981 | ;; | |
15982 | esac | |
15983 | ;; | |
15984 | esac | |
15985 | set d_sfio | |
15986 | eval $setvar | |
15987 | case "$d_sfio" in | |
15988 | $define) usesfio='true';; | |
15989 | *) usesfio='false';; | |
15990 | esac | |
3659ebf1 JH |
15991 | case "$d_sfio" in |
15992 | $define) ;; | |
15993 | *) : Remove sfio from list of libraries to use | |
7483f793 JH |
15994 | case "$libs" in |
15995 | *-lsfio*) | |
15996 | echo "Removing unneeded -lsfio from library list" >&4 | |
15997 | set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` | |
15998 | shift | |
15999 | libs="$*" | |
16000 | echo "libs = $libs" >&4 | |
16001 | ;; | |
16002 | esac | |
3659ebf1 JH |
16003 | ;; |
16004 | esac | |
16005 | ||
b4eb6b3d JH |
16006 | |
16007 | : see if shmctl exists | |
16008 | set shmctl d_shmctl | |
16009 | eval $inlibc | |
16010 | ||
16011 | : see if shmget exists | |
16012 | set shmget d_shmget | |
16013 | eval $inlibc | |
16014 | ||
16015 | : see if shmat exists | |
16016 | set shmat d_shmat | |
16017 | eval $inlibc | |
16018 | : see what shmat returns | |
16019 | case "$d_shmat" in | |
16020 | "$define") | |
16021 | $cat >shmat.c <<'END' | |
16022 | #include <sys/shm.h> | |
16023 | void *shmat(); | |
16024 | END | |
16025 | if $cc $ccflags -c shmat.c >/dev/null 2>&1; then | |
16026 | shmattype='void *' | |
16027 | else | |
16028 | shmattype='char *' | |
16029 | fi | |
16030 | echo "and it returns ($shmattype)." >&4 | |
16031 | : see if a prototype for shmat is available | |
16032 | xxx=`./findhdr sys/shm.h` | |
16033 | $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null | |
16034 | if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then | |
16035 | val="$define" | |
16036 | else | |
16037 | val="$undef" | |
16038 | fi | |
16039 | $rm -f shmat.[co] | |
16040 | ;; | |
16041 | *) | |
16042 | val="$undef" | |
16043 | ;; | |
16044 | esac | |
16045 | set d_shmatprototype | |
16046 | eval $setvar | |
16047 | ||
16048 | : see if shmdt exists | |
16049 | set shmdt d_shmdt | |
16050 | eval $inlibc | |
16051 | ||
16052 | : see how much of the 'shm*(2)' library is present. | |
16053 | h_shm=true | |
16054 | echo " " | |
16055 | case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in | |
16056 | *"$undef"*) h_shm=false;; | |
16057 | esac | |
16058 | case "$osname" in | |
16059 | freebsd) | |
16060 | case "`ipcs 2>&1`" in | |
16061 | "SVID shared memory"*"not configured"*) | |
16062 | echo "Your $osname does not have the shm*(2) configured." >&4 | |
16063 | h_shm=false | |
16064 | val="$undef" | |
16065 | set shmctl d_shmctl | |
16066 | evat $setvar | |
16067 | set shmget d_shmget | |
16068 | evat $setvar | |
16069 | set shmat d_shmat | |
16070 | evat $setvar | |
16071 | set shmdt d_shmdt | |
16072 | evat $setvar | |
16073 | ;; | |
16074 | esac | |
16075 | ;; | |
16076 | esac | |
16077 | : we could also check for sys/ipc.h ... | |
16078 | if $h_shm && $test `./findhdr sys/shm.h`; then | |
16079 | echo "You have the full shm*(2) library." >&4 | |
16080 | val="$define" | |
16081 | else | |
16082 | echo "You don't have the full shm*(2) library." >&4 | |
16083 | val="$undef" | |
16084 | fi | |
16085 | set d_shm | |
16086 | eval $setvar | |
16087 | ||
16088 | echo " " | |
16089 | : see if we have sigaction | |
16090 | if set sigaction val -f d_sigaction; eval $csym; $val; then | |
16091 | echo 'sigaction() found.' >&4 | |
c04fee9e | 16092 | $cat > try.c <<EOP |
b4eb6b3d JH |
16093 | #include <stdio.h> |
16094 | #include <sys/types.h> | |
16095 | #include <signal.h> | |
c04fee9e JH |
16096 | #$i_stdlib I_STDLIB |
16097 | #ifdef I_STDLIB | |
16098 | #include <stdlib.h> | |
16099 | #endif | |
b4eb6b3d JH |
16100 | int main() |
16101 | { | |
16102 | struct sigaction act, oact; | |
16103 | act.sa_flags = 0; | |
16104 | oact.sa_handler = 0; | |
16105 | /* so that act and oact are used */ | |
16106 | exit(act.sa_flags == 0 && oact.sa_handler == 0); | |
16107 | } | |
16108 | EOP | |
16109 | set try | |
16110 | if eval $compile_ok; then | |
16111 | val="$define" | |
16112 | else | |
16113 | echo "But you don't seem to have a useable struct sigaction." >&4 | |
16114 | val="$undef" | |
16115 | fi | |
16116 | else | |
16117 | echo 'sigaction NOT found.' >&4 | |
16118 | val="$undef" | |
16119 | fi | |
16120 | set d_sigaction; eval $setvar | |
16121 | $rm -f try try$_o try.c | |
16122 | ||
983dbef6 JH |
16123 | : see if sigprocmask exists |
16124 | set sigprocmask d_sigprocmask | |
16125 | eval $inlibc | |
16126 | ||
b4eb6b3d JH |
16127 | : see if sigsetjmp exists |
16128 | echo " " | |
16129 | case "$d_sigsetjmp" in | |
16130 | '') | |
511118e1 | 16131 | $cat >try.c <<EOP |
b4eb6b3d | 16132 | #include <setjmp.h> |
5ed858ef JH |
16133 | #$i_stdlib I_STDLIB |
16134 | #ifdef I_STDLIB | |
16135 | #include <stdlib.h> | |
16136 | #endif | |
b4eb6b3d JH |
16137 | sigjmp_buf env; |
16138 | int set = 1; | |
16139 | int main() | |
16140 | { | |
16141 | if (sigsetjmp(env,1)) | |
16142 | exit(set); | |
16143 | set = 0; | |
16144 | siglongjmp(env, 1); | |
16145 | exit(1); | |
16146 | } | |
16147 | EOP | |
16148 | set try | |
16149 | if eval $compile; then | |
5440bc8e | 16150 | if $run ./try >/dev/null 2>&1; then |
b4eb6b3d JH |
16151 | echo "POSIX sigsetjmp found." >&4 |
16152 | val="$define" | |
16153 | else | |
16154 | $cat >&4 <<EOM | |
16155 | Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!! | |
16156 | I'll ignore them. | |
16157 | EOM | |
16158 | val="$undef" | |
16159 | fi | |
16160 | else | |
16161 | echo "sigsetjmp not found." >&4 | |
16162 | val="$undef" | |
16163 | fi | |
16164 | ;; | |
16165 | *) val="$d_sigsetjmp" | |
16166 | case "$d_sigsetjmp" in | |
16167 | $define) echo "POSIX sigsetjmp found." >&4;; | |
16168 | $undef) echo "sigsetjmp not found." >&4;; | |
16169 | esac | |
16170 | ;; | |
16171 | esac | |
16172 | set d_sigsetjmp | |
16173 | eval $setvar | |
16174 | $rm -f try.c try | |
16175 | ||
49a78c82 JH |
16176 | : see if sockatmark exists |
16177 | set sockatmark d_sockatmark | |
16178 | eval $inlibc | |
16179 | ||
2ef53570 JH |
16180 | : see if prototype for sockatmark is available |
16181 | echo " " | |
16182 | set d_sockatmarkproto sockatmark $d_socket sys/socket.h | |
16183 | eval $hasproto | |
16184 | ||
b4eb6b3d JH |
16185 | : see if socks5_init exists |
16186 | set socks5_init d_socks5_init | |
16187 | eval $inlibc | |
16188 | ||
10bc17b6 JH |
16189 | : see if srand48_r exists |
16190 | set srand48_r d_srand48_r | |
16191 | eval $inlibc | |
16192 | case "$d_srand48_r" in | |
16193 | "$define") | |
16194 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" | |
c18e646a JH |
16195 | case "$d_srand48_r_proto:$usethreads" in |
16196 | ":define") d_srand48_r_proto=define | |
a48ec845 JH |
16197 | set d_srand48_r_proto srand48_r $hdrs |
16198 | eval $hasproto ;; | |
16199 | *) ;; | |
16200 | esac | |
16201 | case "$d_srand48_r_proto" in | |
16202 | define) | |
10bc17b6 JH |
16203 | case "$srand48_r_proto" in |
16204 | ''|0) try='int srand48_r(long, struct drand48_data*);' | |
16205 | ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;; | |
16206 | esac | |
16207 | case "$srand48_r_proto" in | |
90e831dc | 16208 | ''|0) d_srand48_r=undef |
10bc17b6 | 16209 | srand48_r_proto=0 |
a48ec845 | 16210 | echo "Disabling srand48_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
16211 | * ) case "$srand48_r_proto" in |
16212 | REENTRANT_PROTO*) ;; | |
16213 | *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;; | |
16214 | esac | |
16215 | echo "Prototype: $try" ;; | |
16216 | esac | |
16217 | ;; | |
c18e646a JH |
16218 | *) case "$usethreads" in |
16219 | define) echo "srand48_r has no prototype, not using it." >&4 ;; | |
16220 | esac | |
90e831dc SB |
16221 | d_srand48_r=undef |
16222 | srand48_r_proto=0 | |
c18e646a | 16223 | ;; |
a48ec845 JH |
16224 | esac |
16225 | ;; | |
10bc17b6 JH |
16226 | *) srand48_r_proto=0 |
16227 | ;; | |
16228 | esac | |
16229 | ||
16230 | : see if srandom_r exists | |
16231 | set srandom_r d_srandom_r | |
16232 | eval $inlibc | |
16233 | case "$d_srandom_r" in | |
16234 | "$define") | |
16235 | hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h" | |
c18e646a JH |
16236 | case "$d_srandom_r_proto:$usethreads" in |
16237 | ":define") d_srandom_r_proto=define | |
a48ec845 JH |
16238 | set d_srandom_r_proto srandom_r $hdrs |
16239 | eval $hasproto ;; | |
16240 | *) ;; | |
16241 | esac | |
16242 | case "$d_srandom_r_proto" in | |
16243 | define) | |
10bc17b6 JH |
16244 | case "$srandom_r_proto" in |
16245 | ''|0) try='int srandom_r(unsigned int, struct random_data*);' | |
16246 | ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;; | |
16247 | esac | |
16248 | case "$srandom_r_proto" in | |
90e831dc | 16249 | ''|0) d_srandom_r=undef |
10bc17b6 | 16250 | srandom_r_proto=0 |
a48ec845 | 16251 | echo "Disabling srandom_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
16252 | * ) case "$srandom_r_proto" in |
16253 | REENTRANT_PROTO*) ;; | |
16254 | *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;; | |
16255 | esac | |
16256 | echo "Prototype: $try" ;; | |
16257 | esac | |
16258 | ;; | |
c18e646a JH |
16259 | *) case "$usethreads" in |
16260 | define) echo "srandom_r has no prototype, not using it." >&4 ;; | |
16261 | esac | |
90e831dc SB |
16262 | d_srandom_r=undef |
16263 | srandom_r_proto=0 | |
c18e646a | 16264 | ;; |
a48ec845 JH |
16265 | esac |
16266 | ;; | |
10bc17b6 JH |
16267 | *) srandom_r_proto=0 |
16268 | ;; | |
16269 | esac | |
16270 | ||
eef837ea JH |
16271 | : see if prototype for setresgid is available |
16272 | echo " " | |
16273 | set d_sresgproto setresgid $i_unistd unistd.h | |
16274 | eval $hasproto | |
16275 | ||
640374d0 JH |
16276 | : see if prototype for setresuid is available |
16277 | echo " " | |
16278 | set d_sresuproto setresuid $i_unistd unistd.h | |
16279 | eval $hasproto | |
16280 | ||
b4eb6b3d JH |
16281 | : see if sys/stat.h is available |
16282 | set sys/stat.h i_sysstat | |
16283 | eval $inhdr | |
16284 | ||
16285 | ||
16286 | : see if stat knows about block sizes | |
16287 | echo " " | |
16288 | echo "Checking to see if your struct stat has st_blocks field..." >&4 | |
16289 | set d_statblks stat st_blocks $i_sysstat sys/stat.h | |
16290 | eval $hasfield | |
16291 | ||
16292 | ||
16293 | : see if this is a sys/vfs.h system | |
16294 | set sys/vfs.h i_sysvfs | |
16295 | eval $inhdr | |
16296 | ||
16297 | ||
16298 | : see if this is a sys/statfs.h system | |
16299 | set sys/statfs.h i_sysstatfs | |
16300 | eval $inhdr | |
16301 | ||
16302 | ||
16303 | echo " " | |
16304 | echo "Checking to see if your system supports struct statfs..." >&4 | |
16305 | set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h | |
16306 | eval $hasstruct | |
16307 | case "$d_statfs_s" in | |
16308 | "$define") echo "Yes, it does." ;; | |
16309 | *) echo "No, it doesn't." ;; | |
16310 | esac | |
16311 | ||
16312 | ||
16313 | ||
16314 | : see if struct statfs knows about f_flags | |
16315 | case "$d_statfs_s" in | |
16316 | define) | |
16317 | echo " " | |
16318 | echo "Checking to see if your struct statfs has f_flags field..." >&4 | |
16319 | set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h | |
16320 | eval $hasfield | |
16321 | ;; | |
16322 | *) val="$undef" | |
16323 | set d_statfs_f_flags | |
16324 | eval $setvar | |
16325 | ;; | |
16326 | esac | |
16327 | case "$d_statfs_f_flags" in | |
16328 | "$define") echo "Yes, it does." ;; | |
16329 | *) echo "No, it doesn't." ;; | |
16330 | esac | |
16331 | ||
b4eb6b3d JH |
16332 | $cat >&4 <<EOM |
16333 | Checking how to access stdio streams by file descriptor number... | |
16334 | EOM | |
16335 | case "$stdio_stream_array" in | |
16336 | '') $cat >try.c <<EOCP | |
16337 | #include <stdio.h> | |
16338 | int main() { | |
16339 | if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin) | |
16340 | printf("yes\n"); | |
16341 | } | |
16342 | EOCP | |
16343 | for s in _iob __iob __sF | |
16344 | do | |
16345 | set try -DSTDIO_STREAM_ARRAY=$s | |
16346 | if eval $compile; then | |
5440bc8e | 16347 | case "`$run ./try`" in |
b4eb6b3d JH |
16348 | yes) stdio_stream_array=$s; break ;; |
16349 | esac | |
16350 | fi | |
16351 | done | |
16352 | $rm -f try.* try$exe_ext | |
16353 | esac | |
16354 | case "$stdio_stream_array" in | |
16355 | '') $cat >&4 <<EOM | |
16356 | I can't figure out how to access stdio streams by file descriptor number. | |
16357 | EOM | |
16358 | d_stdio_stream_array="$undef" | |
16359 | ;; | |
16360 | *) $cat >&4 <<EOM | |
16361 | You can access stdio streams by file descriptor number by the $stdio_stream_array array. | |
16362 | EOM | |
16363 | d_stdio_stream_array="$define" | |
16364 | ;; | |
16365 | esac | |
16366 | ||
16367 | : see if strcoll exists | |
16368 | set strcoll d_strcoll | |
16369 | eval $inlibc | |
16370 | ||
16371 | : check for structure copying | |
16372 | echo " " | |
16373 | echo "Checking to see if your C compiler can copy structs..." >&4 | |
16374 | $cat >try.c <<'EOCP' | |
16375 | int main() | |
16376 | { | |
16377 | struct blurfl { | |
16378 | int dyick; | |
16379 | } foo, bar; | |
16380 | ||
16381 | foo = bar; | |
16382 | } | |
16383 | EOCP | |
16384 | if $cc -c try.c >/dev/null 2>&1 ; then | |
16385 | val="$define" | |
16386 | echo "Yup, it can." | |
16387 | else | |
16388 | val="$undef" | |
16389 | echo "Nope, it can't." | |
16390 | fi | |
16391 | set d_strctcpy | |
16392 | eval $setvar | |
16393 | $rm -f try.* | |
16394 | ||
16395 | : see if strerror and/or sys_errlist[] exist | |
16396 | echo " " | |
16397 | if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then | |
16398 | if set strerror val -f d_strerror; eval $csym; $val; then | |
16399 | echo 'strerror() found.' >&4 | |
16400 | d_strerror="$define" | |
16401 | d_strerrm='strerror(e)' | |
16402 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
16403 | echo "(You also have sys_errlist[], so we could roll our own strerror.)" | |
16404 | d_syserrlst="$define" | |
16405 | else | |
16406 | echo "(Since you don't have sys_errlist[], sterror() is welcome.)" | |
16407 | d_syserrlst="$undef" | |
16408 | fi | |
16409 | elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \ | |
16410 | $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then | |
16411 | echo 'strerror() found in string header.' >&4 | |
16412 | d_strerror="$define" | |
16413 | d_strerrm='strerror(e)' | |
16414 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
16415 | echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)" | |
16416 | d_syserrlst="$define" | |
16417 | else | |
16418 | echo "(You don't appear to have any sys_errlist[], how can this be?)" | |
16419 | d_syserrlst="$undef" | |
16420 | fi | |
16421 | elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
16422 | echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4 | |
16423 | d_strerror="$undef" | |
16424 | d_syserrlst="$define" | |
16425 | d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])' | |
16426 | else | |
16427 | echo 'strerror() and sys_errlist[] NOT found.' >&4 | |
16428 | d_strerror="$undef" | |
16429 | d_syserrlst="$undef" | |
16430 | d_strerrm='"unknown"' | |
16431 | fi | |
16432 | fi | |
16433 | ||
10bc17b6 JH |
16434 | : see if strerror_r exists |
16435 | set strerror_r d_strerror_r | |
16436 | eval $inlibc | |
16437 | case "$d_strerror_r" in | |
16438 | "$define") | |
16439 | hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h" | |
c18e646a JH |
16440 | case "$d_strerror_r_proto:$usethreads" in |
16441 | ":define") d_strerror_r_proto=define | |
a48ec845 JH |
16442 | set d_strerror_r_proto strerror_r $hdrs |
16443 | eval $hasproto ;; | |
16444 | *) ;; | |
16445 | esac | |
16446 | case "$d_strerror_r_proto" in | |
16447 | define) | |
10bc17b6 JH |
16448 | case "$strerror_r_proto" in |
16449 | ''|0) try='int strerror_r(int, char*, size_t);' | |
16450 | ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;; | |
16451 | esac | |
16452 | case "$strerror_r_proto" in | |
16453 | ''|0) try='int strerror_r(int, char*, int);' | |
16454 | ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;; | |
16455 | esac | |
16456 | case "$strerror_r_proto" in | |
16457 | ''|0) try='char* strerror_r(int, char*, size_t);' | |
16458 | ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;; | |
16459 | esac | |
16460 | case "$strerror_r_proto" in | |
90e831dc | 16461 | ''|0) d_strerror_r=undef |
10bc17b6 | 16462 | strerror_r_proto=0 |
a48ec845 | 16463 | echo "Disabling strerror_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
16464 | * ) case "$strerror_r_proto" in |
16465 | REENTRANT_PROTO*) ;; | |
16466 | *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;; | |
16467 | esac | |
16468 | echo "Prototype: $try" ;; | |
16469 | esac | |
16470 | ;; | |
c18e646a JH |
16471 | *) case "$usethreads" in |
16472 | define) echo "strerror_r has no prototype, not using it." >&4 ;; | |
16473 | esac | |
90e831dc SB |
16474 | d_strerror_r=undef |
16475 | strerror_r_proto=0 | |
c18e646a | 16476 | ;; |
a48ec845 JH |
16477 | esac |
16478 | ;; | |
10bc17b6 JH |
16479 | *) strerror_r_proto=0 |
16480 | ;; | |
16481 | esac | |
16482 | ||
b3c85772 JH |
16483 | : see if strftime exists |
16484 | set strftime d_strftime | |
16485 | eval $inlibc | |
16486 | ||
84baed4c CB |
16487 | : see if strlcat exists |
16488 | set strlcat d_strlcat | |
16489 | eval $inlibc | |
16490 | ||
16491 | : see if strlcpy exists | |
16492 | set strlcpy d_strlcpy | |
16493 | eval $inlibc | |
16494 | ||
b4eb6b3d JH |
16495 | : see if strtod exists |
16496 | set strtod d_strtod | |
16497 | eval $inlibc | |
16498 | ||
16499 | : see if strtol exists | |
16500 | set strtol d_strtol | |
16501 | eval $inlibc | |
16502 | ||
16503 | : see if strtold exists | |
16504 | set strtold d_strtold | |
16505 | eval $inlibc | |
16506 | ||
16507 | : see if strtoll exists | |
16508 | set strtoll d_strtoll | |
16509 | eval $inlibc | |
16510 | ||
16511 | case "$d_longlong-$d_strtoll" in | |
16512 | "$define-$define") | |
16513 | $cat <<EOM | |
16514 | Checking whether your strtoll() works okay... | |
16515 | EOM | |
16516 | $cat >try.c <<'EOCP' | |
16517 | #include <errno.h> | |
16518 | #ifdef __hpux | |
16519 | #define strtoll __strtoll | |
16520 | #endif | |
e75931a7 YST |
16521 | #ifdef __EMX__ |
16522 | #define strtoll _strtoll | |
16523 | #endif | |
b4eb6b3d JH |
16524 | #include <stdio.h> |
16525 | extern long long int strtoll(char *s, char **, int); | |
16526 | static int bad = 0; | |
16527 | int check(char *s, long long ell, int een) { | |
16528 | long long gll; | |
16529 | errno = 0; | |
16530 | gll = strtoll(s, 0, 10); | |
16531 | if (!((gll == ell) && (errno == een))) | |
16532 | bad++; | |
16533 | } | |
16534 | int main() { | |
16535 | check(" 1", 1LL, 0); | |
16536 | check(" 0", 0LL, 0); | |
16537 | check("-1", -1LL, 0); | |
16538 | check("-9223372036854775808", -9223372036854775808LL, 0); | |
16539 | check("-9223372036854775808", -9223372036854775808LL, 0); | |
16540 | check(" 9223372036854775807", 9223372036854775807LL, 0); | |
16541 | check("-9223372036854775808", -9223372036854775808LL, 0); | |
16542 | check(" 9223372036854775808", 9223372036854775807LL, ERANGE); | |
16543 | check("-9223372036854775809", -9223372036854775808LL, ERANGE); | |
16544 | if (!bad) | |
16545 | printf("ok\n"); | |
16546 | } | |
16547 | EOCP | |
16548 | set try | |
16549 | if eval $compile; then | |
5440bc8e | 16550 | yyy=`$run ./try` |
e75931a7 | 16551 | case "$yyy" in |
b4eb6b3d JH |
16552 | ok) echo "Your strtoll() seems to be working okay." ;; |
16553 | *) cat <<EOM >&4 | |
16554 | Your strtoll() doesn't seem to be working okay. | |
16555 | EOM | |
16556 | d_strtoll="$undef" | |
16557 | ;; | |
69eadf66 | 16558 | esac |
e75931a7 YST |
16559 | else |
16560 | echo "(I can't seem to compile the test program--assuming it doesn't)" | |
16561 | d_strtoll="$undef" | |
b4eb6b3d JH |
16562 | fi |
16563 | ;; | |
16564 | esac | |
16565 | ||
28e5dec8 JH |
16566 | : see if strtoq exists |
16567 | set strtoq d_strtoq | |
16568 | eval $inlibc | |
16569 | ||
b4eb6b3d JH |
16570 | : see if strtoul exists |
16571 | set strtoul d_strtoul | |
16572 | eval $inlibc | |
16573 | ||
d0e6d399 NC |
16574 | case "$d_strtoul" in |
16575 | "$define") | |
16576 | $cat <<EOM | |
16577 | Checking whether your strtoul() works okay... | |
16578 | EOM | |
16579 | $cat >try.c <<'EOCP' | |
16580 | #include <errno.h> | |
16581 | #include <stdio.h> | |
16582 | extern unsigned long int strtoul(char *s, char **, int); | |
16583 | static int bad = 0; | |
16584 | void check(char *s, unsigned long eul, int een) { | |
16585 | unsigned long gul; | |
16586 | errno = 0; | |
16587 | gul = strtoul(s, 0, 10); | |
16588 | if (!((gul == eul) && (errno == een))) | |
16589 | bad++; | |
16590 | } | |
16591 | int main() { | |
16592 | check(" 1", 1L, 0); | |
16593 | check(" 0", 0L, 0); | |
16594 | EOCP | |
16595 | case "$longsize" in | |
16596 | 8) | |
16597 | $cat >>try.c <<'EOCP' | |
09c0d2c4 JH |
16598 | check("18446744073709551615", 18446744073709551615UL, 0); |
16599 | check("18446744073709551616", 18446744073709551615UL, ERANGE); | |
c11ecd62 | 16600 | #if 0 /* strtoul() for /^-/ strings is undefined. */ |
09c0d2c4 | 16601 | check("-1", 18446744073709551615UL, 0); |
d0e6d399 NC |
16602 | check("-18446744073709551614", 2, 0); |
16603 | check("-18446744073709551615", 1, 0); | |
09c0d2c4 JH |
16604 | check("-18446744073709551616", 18446744073709551615UL, ERANGE); |
16605 | check("-18446744073709551617", 18446744073709551615UL, ERANGE); | |
c11ecd62 | 16606 | #endif |
d0e6d399 NC |
16607 | EOCP |
16608 | ;; | |
16609 | 4) | |
16610 | $cat >>try.c <<'EOCP' | |
16611 | check("4294967295", 4294967295UL, 0); | |
16612 | check("4294967296", 4294967295UL, ERANGE); | |
c11ecd62 | 16613 | #if 0 /* strtoul() for /^-/ strings is undefined. */ |
d0e6d399 NC |
16614 | check("-1", 4294967295UL, 0); |
16615 | check("-4294967294", 2, 0); | |
16616 | check("-4294967295", 1, 0); | |
16617 | check("-4294967296", 4294967295UL, ERANGE); | |
16618 | check("-4294967297", 4294967295UL, ERANGE); | |
c11ecd62 | 16619 | #endif |
d0e6d399 NC |
16620 | EOCP |
16621 | ;; | |
16622 | *) | |
16623 | : Should we write these tests to be more portable by sprintf-ing | |
16624 | : ~0 and then manipulating that char string as input for strtol? | |
16625 | ;; | |
16626 | esac | |
16627 | $cat >>try.c <<'EOCP' | |
16628 | if (!bad) | |
16629 | printf("ok\n"); | |
16630 | return 0; | |
16631 | } | |
16632 | EOCP | |
16633 | set try | |
16634 | if eval $compile; then | |
5440bc8e | 16635 | case "`$run ./try`" in |
d0e6d399 NC |
16636 | ok) echo "Your strtoul() seems to be working okay." ;; |
16637 | *) cat <<EOM >&4 | |
16638 | Your strtoul() doesn't seem to be working okay. | |
16639 | EOM | |
16640 | d_strtoul="$undef" | |
16641 | ;; | |
16642 | esac | |
16643 | fi | |
16644 | ;; | |
16645 | esac | |
16646 | ||
b4eb6b3d JH |
16647 | : see if strtoull exists |
16648 | set strtoull d_strtoull | |
16649 | eval $inlibc | |
16650 | ||
16651 | case "$d_longlong-$d_strtoull" in | |
16652 | "$define-$define") | |
16653 | $cat <<EOM | |
16654 | Checking whether your strtoull() works okay... | |
16655 | EOM | |
16656 | $cat >try.c <<'EOCP' | |
16657 | #include <errno.h> | |
16658 | #ifdef __hpux | |
16659 | #define strtoull __strtoull | |
16660 | #endif | |
16661 | #include <stdio.h> | |
16662 | extern unsigned long long int strtoull(char *s, char **, int); | |
16663 | static int bad = 0; | |
16664 | int check(char *s, long long eull, int een) { | |
16665 | long long gull; | |
16666 | errno = 0; | |
16667 | gull = strtoull(s, 0, 10); | |
16668 | if (!((gull == eull) && (errno == een))) | |
16669 | bad++; | |
16670 | } | |
16671 | int main() { | |
d0e6d399 NC |
16672 | check(" 1", 1LL, 0); |
16673 | check(" 0", 0LL, 0); | |
16674 | check("18446744073709551615", 18446744073709551615ULL, 0); | |
16675 | check("18446744073709551616", 18446744073709551615ULL, ERANGE); | |
c11ecd62 | 16676 | #if 0 /* strtoull() for /^-/ strings is undefined. */ |
d0e6d399 NC |
16677 | check("-1", 18446744073709551615ULL, 0); |
16678 | check("-18446744073709551614", 2LL, 0); | |
16679 | check("-18446744073709551615", 1LL, 0); | |
16680 | check("-18446744073709551616", 18446744073709551615ULL, ERANGE); | |
16681 | check("-18446744073709551617", 18446744073709551615ULL, ERANGE); | |
c11ecd62 | 16682 | #endif |
b4eb6b3d JH |
16683 | if (!bad) |
16684 | printf("ok\n"); | |
16685 | } | |
16686 | EOCP | |
16687 | set try | |
16688 | if eval $compile; then | |
5440bc8e | 16689 | case "`$run ./try`" in |
b4eb6b3d JH |
16690 | ok) echo "Your strtoull() seems to be working okay." ;; |
16691 | *) cat <<EOM >&4 | |
16692 | Your strtoull() doesn't seem to be working okay. | |
16693 | EOM | |
16694 | d_strtoull="$undef" | |
16695 | ;; | |
16696 | esac | |
16697 | fi | |
16698 | ;; | |
16699 | esac | |
16700 | ||
16701 | : see if strtouq exists | |
16702 | set strtouq d_strtouq | |
16703 | eval $inlibc | |
16704 | ||
d0e6d399 NC |
16705 | case "$d_strtouq" in |
16706 | "$define") | |
16707 | $cat <<EOM | |
16708 | Checking whether your strtouq() works okay... | |
16709 | EOM | |
16710 | $cat >try.c <<'EOCP' | |
16711 | #include <errno.h> | |
16712 | #include <stdio.h> | |
16713 | extern unsigned long long int strtouq(char *s, char **, int); | |
16714 | static int bad = 0; | |
16715 | void check(char *s, unsigned long long eull, int een) { | |
16716 | unsigned long long gull; | |
16717 | errno = 0; | |
16718 | gull = strtouq(s, 0, 10); | |
16719 | if (!((gull == eull) && (errno == een))) | |
16720 | bad++; | |
16721 | } | |
16722 | int main() { | |
16723 | check(" 1", 1LL, 0); | |
16724 | check(" 0", 0LL, 0); | |
16725 | check("18446744073709551615", 18446744073709551615ULL, 0); | |
16726 | check("18446744073709551616", 18446744073709551615ULL, ERANGE); | |
c11ecd62 | 16727 | #if 0 /* strtouq() for /^-/ strings is undefined. */ |
d0e6d399 NC |
16728 | check("-1", 18446744073709551615ULL, 0); |
16729 | check("-18446744073709551614", 2LL, 0); | |
16730 | check("-18446744073709551615", 1LL, 0); | |
16731 | check("-18446744073709551616", 18446744073709551615ULL, ERANGE); | |
16732 | check("-18446744073709551617", 18446744073709551615ULL, ERANGE); | |
c11ecd62 | 16733 | #endif |
d0e6d399 NC |
16734 | if (!bad) |
16735 | printf("ok\n"); | |
16736 | return 0; | |
16737 | } | |
16738 | EOCP | |
16739 | set try | |
16740 | if eval $compile; then | |
5440bc8e | 16741 | case "`$run ./try`" in |
d0e6d399 NC |
16742 | ok) echo "Your strtouq() seems to be working okay." ;; |
16743 | *) cat <<EOM >&4 | |
16744 | Your strtouq() doesn't seem to be working okay. | |
16745 | EOM | |
16746 | d_strtouq="$undef" | |
16747 | ;; | |
16748 | esac | |
16749 | fi | |
16750 | ;; | |
16751 | esac | |
16752 | ||
b4eb6b3d JH |
16753 | : see if strxfrm exists |
16754 | set strxfrm d_strxfrm | |
16755 | eval $inlibc | |
16756 | ||
16757 | : see if symlink exists | |
16758 | set symlink d_symlink | |
16759 | eval $inlibc | |
16760 | ||
16761 | : see if syscall exists | |
16762 | set syscall d_syscall | |
16763 | eval $inlibc | |
16764 | ||
2ef53570 JH |
16765 | : see if prototype for syscall is available |
16766 | echo " " | |
16767 | set d_syscallproto syscall $i_unistd unistd.h | |
16768 | eval $hasproto | |
16769 | ||
b4eb6b3d JH |
16770 | : see if sysconf exists |
16771 | set sysconf d_sysconf | |
16772 | eval $inlibc | |
16773 | ||
16774 | : see if system exists | |
16775 | set system d_system | |
16776 | eval $inlibc | |
16777 | ||
16778 | : see if tcgetpgrp exists | |
16779 | set tcgetpgrp d_tcgetpgrp | |
16780 | eval $inlibc | |
16781 | ||
16782 | : see if tcsetpgrp exists | |
16783 | set tcsetpgrp d_tcsetpgrp | |
16784 | eval $inlibc | |
16785 | ||
16786 | : see if prototype for telldir is available | |
16787 | echo " " | |
16788 | set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h | |
16789 | eval $hasproto | |
16790 | ||
ad493445 MB |
16791 | : see if time exists |
16792 | echo " " | |
16793 | if test "X$d_time" = X -o X"$timetype" = X; then | |
16794 | if set time val -f d_time; eval $csym; $val; then | |
16795 | echo 'time() found.' >&4 | |
16796 | val="$define" | |
16797 | rp="What is the type returned by time() on this system?" | |
16798 | set time_t timetype long stdio.h sys/types.h | |
16799 | eval $typedef_ask | |
16800 | else | |
16801 | echo 'time() not found, hope that will do.' >&4 | |
16802 | val="$undef" | |
16803 | timetype='int'; | |
16804 | fi | |
16805 | set d_time | |
16806 | eval $setvar | |
16807 | fi | |
16808 | ||
b4eb6b3d JH |
16809 | : see if this is a sys/times.h system |
16810 | set sys/times.h i_systimes | |
16811 | eval $inhdr | |
16812 | ||
16813 | : see if times exists | |
16814 | echo " " | |
16815 | if set times val -f d_times; eval $csym; $val; then | |
16816 | echo 'times() found.' >&4 | |
16817 | d_times="$define" | |
16818 | inc='' | |
16819 | case "$i_systimes" in | |
16820 | "$define") inc='sys/times.h';; | |
16821 | esac | |
16822 | rp="What is the type returned by times() on this system?" | |
16823 | set clock_t clocktype long stdio.h sys/types.h $inc | |
16824 | eval $typedef_ask | |
16825 | else | |
16826 | echo 'times() NOT found, hope that will do.' >&4 | |
16827 | d_times="$undef" | |
16828 | clocktype='int' | |
16829 | fi | |
16830 | ||
10bc17b6 JH |
16831 | : see if tmpnam_r exists |
16832 | set tmpnam_r d_tmpnam_r | |
16833 | eval $inlibc | |
16834 | case "$d_tmpnam_r" in | |
16835 | "$define") | |
31ee0cb7 | 16836 | hdrs="$i_systypes sys/types.h define stdio.h " |
c18e646a JH |
16837 | case "$d_tmpnam_r_proto:$usethreads" in |
16838 | ":define") d_tmpnam_r_proto=define | |
a48ec845 JH |
16839 | set d_tmpnam_r_proto tmpnam_r $hdrs |
16840 | eval $hasproto ;; | |
16841 | *) ;; | |
16842 | esac | |
16843 | case "$d_tmpnam_r_proto" in | |
16844 | define) | |
10bc17b6 JH |
16845 | case "$tmpnam_r_proto" in |
16846 | ''|0) try='char* tmpnam_r(char*);' | |
16847 | ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;; | |
16848 | esac | |
16849 | case "$tmpnam_r_proto" in | |
90e831dc | 16850 | ''|0) d_tmpnam_r=undef |
10bc17b6 | 16851 | tmpnam_r_proto=0 |
a48ec845 | 16852 | echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
16853 | * ) case "$tmpnam_r_proto" in |
16854 | REENTRANT_PROTO*) ;; | |
16855 | *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;; | |
16856 | esac | |
16857 | echo "Prototype: $try" ;; | |
16858 | esac | |
16859 | ;; | |
c18e646a JH |
16860 | *) case "$usethreads" in |
16861 | define) echo "tmpnam_r has no prototype, not using it." >&4 ;; | |
16862 | esac | |
90e831dc SB |
16863 | d_tmpnam_r=undef |
16864 | tmpnam_r_proto=0 | |
c18e646a | 16865 | ;; |
a48ec845 JH |
16866 | esac |
16867 | ;; | |
10bc17b6 JH |
16868 | *) tmpnam_r_proto=0 |
16869 | ;; | |
16870 | esac | |
16871 | ||
b4eb6b3d JH |
16872 | : see if truncate exists |
16873 | set truncate d_truncate | |
16874 | eval $inlibc | |
16875 | ||
10bc17b6 JH |
16876 | : see if ttyname_r exists |
16877 | set ttyname_r d_ttyname_r | |
16878 | eval $inlibc | |
16879 | case "$d_ttyname_r" in | |
16880 | "$define") | |
16881 | hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h" | |
c18e646a JH |
16882 | case "$d_ttyname_r_proto:$usethreads" in |
16883 | ":define") d_ttyname_r_proto=define | |
a48ec845 JH |
16884 | set d_ttyname_r_proto ttyname_r $hdrs |
16885 | eval $hasproto ;; | |
16886 | *) ;; | |
16887 | esac | |
16888 | case "$d_ttyname_r_proto" in | |
16889 | define) | |
10bc17b6 JH |
16890 | case "$ttyname_r_proto" in |
16891 | ''|0) try='int ttyname_r(int, char*, size_t);' | |
16892 | ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;; | |
16893 | esac | |
16894 | case "$ttyname_r_proto" in | |
16895 | ''|0) try='int ttyname_r(int, char*, int);' | |
16896 | ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;; | |
16897 | esac | |
16898 | case "$ttyname_r_proto" in | |
16899 | ''|0) try='char* ttyname_r(int, char*, int);' | |
16900 | ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;; | |
16901 | esac | |
16902 | case "$ttyname_r_proto" in | |
90e831dc | 16903 | ''|0) d_ttyname_r=undef |
10bc17b6 | 16904 | ttyname_r_proto=0 |
a48ec845 | 16905 | echo "Disabling ttyname_r, cannot determine prototype." >&4 ;; |
10bc17b6 JH |
16906 | * ) case "$ttyname_r_proto" in |
16907 | REENTRANT_PROTO*) ;; | |
16908 | *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;; | |
16909 | esac | |
16910 | echo "Prototype: $try" ;; | |
16911 | esac | |
16912 | ;; | |
c18e646a JH |
16913 | *) case "$usethreads" in |
16914 | define) echo "ttyname_r has no prototype, not using it." >&4 ;; | |
16915 | esac | |
90e831dc SB |
16916 | d_ttyname_r=undef |
16917 | ttyname_r_proto=0 | |
c18e646a | 16918 | ;; |
a48ec845 JH |
16919 | esac |
16920 | ;; | |
10bc17b6 JH |
16921 | *) ttyname_r_proto=0 |
16922 | ;; | |
16923 | esac | |
16924 | ||
b4eb6b3d JH |
16925 | : see if tzname[] exists |
16926 | echo " " | |
16927 | if set tzname val -a d_tzname; eval $csym; $val; then | |
16928 | val="$define" | |
16929 | echo 'tzname[] found.' >&4 | |
16930 | else | |
16931 | val="$undef" | |
16932 | echo 'tzname[] NOT found.' >&4 | |
16933 | fi | |
16934 | set d_tzname | |
16935 | eval $setvar | |
16936 | ||
4e0554ec JH |
16937 | case "$osname" in |
16938 | next|rhapsody|darwin) multiarch="$define" ;; | |
16939 | esac | |
16940 | case "$multiarch" in | |
16941 | ''|[nN]*) multiarch="$undef" ;; | |
16942 | esac | |
16943 | ||
24412007 | 16944 | : check for ordering of bytes in a UV |
4e0554ec | 16945 | echo " " |
5440bc8e | 16946 | case "$usecrosscompile$multiarch" in |
4e0554ec JH |
16947 | *$define*) |
16948 | $cat <<EOM | |
16949 | You seem to be either cross-compiling or doing a multiarchitecture build, | |
16950 | skipping the byteorder check. | |
16951 | ||
16952 | EOM | |
5440bc8e | 16953 | byteorder='ffff' |
4e0554ec JH |
16954 | ;; |
16955 | *) | |
16956 | case "$byteorder" in | |
16957 | '') | |
16958 | $cat <<'EOM' | |
16959 | In the following, larger digits indicate more significance. A big-endian | |
16960 | machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A | |
16961 | little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other | |
16962 | machines may have weird orders like 3412. A Cray will report 87654321, | |
16963 | an Alpha will report 12345678. If the test program works the default is | |
16964 | probably right. | |
16965 | I'm now running the test program... | |
16966 | EOM | |
24412007 | 16967 | $cat >try.c <<EOCP |
4e0554ec | 16968 | #include <stdio.h> |
5a29c6bc JH |
16969 | #$i_stdlib I_STDLIB |
16970 | #ifdef I_STDLIB | |
16971 | #include <stdlib.h> | |
16972 | #endif | |
24412007 JH |
16973 | #include <sys/types.h> |
16974 | typedef $uvtype UV; | |
4e0554ec JH |
16975 | int main() |
16976 | { | |
16977 | int i; | |
16978 | union { | |
24412007 JH |
16979 | UV l; |
16980 | char c[$uvsize]; | |
4e0554ec JH |
16981 | } u; |
16982 | ||
24412007 | 16983 | if ($uvsize > 4) |
b5ded3e5 | 16984 | u.l = (((UV)0x08070605) << 32) | (UV)0x04030201; |
4e0554ec | 16985 | else |
a4c53327 | 16986 | u.l = (UV)0x04030201; |
24412007 | 16987 | for (i = 0; i < $uvsize; i++) |
4e0554ec JH |
16988 | printf("%c", u.c[i]+'0'); |
16989 | printf("\n"); | |
16990 | exit(0); | |
16991 | } | |
16992 | EOCP | |
16993 | xxx_prompt=y | |
16994 | set try | |
16995 | if eval $compile && ./try > /dev/null; then | |
5440bc8e | 16996 | dflt=`$run ./try` |
4e0554ec JH |
16997 | case "$dflt" in |
16998 | [1-4][1-4][1-4][1-4]|12345678|87654321) | |
16999 | echo "(The test program ran ok.)" | |
17000 | echo "byteorder=$dflt" | |
17001 | xxx_prompt=n | |
17002 | ;; | |
17003 | ????|????????) echo "(The test program ran ok.)" ;; | |
17004 | *) echo "(The test program didn't run right for some reason.)" ;; | |
17005 | esac | |
17006 | else | |
17007 | dflt='4321' | |
17008 | cat <<'EOM' | |
17009 | (I can't seem to compile the test program. Guessing big-endian...) | |
17010 | EOM | |
17011 | fi | |
17012 | case "$xxx_prompt" in | |
17013 | y) | |
24412007 | 17014 | rp="What is the order of bytes in $uvtype?" |
4e0554ec JH |
17015 | . ./myread |
17016 | byteorder="$ans" | |
17017 | ;; | |
17018 | *) byteorder=$dflt | |
17019 | ;; | |
17020 | esac | |
17021 | ;; | |
17022 | esac | |
17023 | $rm -f try.c try | |
17024 | ;; | |
17025 | esac | |
17026 | ||
17027 | ||
17028 | $cat <<EOM | |
17029 | ||
17030 | Checking to see whether you can access character data unalignedly... | |
17031 | EOM | |
dc7b0a4f JH |
17032 | case "$d_u32align" in |
17033 | '') $cat >try.c <<EOCP | |
4e0554ec | 17034 | #include <stdio.h> |
5ed858ef JH |
17035 | #$i_stdlib I_STDLIB |
17036 | #ifdef I_STDLIB | |
17037 | #include <stdlib.h> | |
17038 | #endif | |
4e0554ec | 17039 | #define U32 $u32type |
d308175a JH |
17040 | #define BYTEORDER 0x$byteorder |
17041 | #define U8 $u8type | |
9958dc3c JH |
17042 | #include <signal.h> |
17043 | #ifdef SIGBUS | |
17044 | $signal_t bletch(s) int s; { exit(4); } | |
17045 | #endif | |
4e0554ec JH |
17046 | int main() { |
17047 | #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321 | |
8906a23e | 17048 | U8 buf[8]; |
4e0554ec JH |
17049 | U32 *up; |
17050 | int i; | |
17051 | ||
17052 | if (sizeof(U32) != 4) { | |
17053 | printf("sizeof(U32) is not 4, but %d\n", sizeof(U32)); | |
17054 | exit(1); | |
17055 | } | |
17056 | ||
17057 | fflush(stdout); | |
17058 | ||
9958dc3c JH |
17059 | #ifdef SIGBUS |
17060 | signal(SIGBUS, bletch); | |
17061 | #endif | |
17062 | ||
8906a23e JH |
17063 | buf[0] = 0; |
17064 | buf[1] = 0; | |
17065 | buf[2] = 0; | |
17066 | buf[3] = 1; | |
9beed644 | 17067 | buf[4] = 0; |
8906a23e JH |
17068 | buf[5] = 0; |
17069 | buf[6] = 0; | |
9beed644 | 17070 | buf[7] = 1; |
8906a23e | 17071 | |
4e0554ec JH |
17072 | for (i = 0; i < 4; i++) { |
17073 | up = (U32*)(buf + i); | |
17074 | if (! ((*up == 1 << (8*i)) || /* big-endian */ | |
17075 | (*up == 1 << (8*(3-i))) /* little-endian */ | |
17076 | ) | |
17077 | ) | |
17078 | { | |
17079 | printf("read failed (%x)\n", *up); | |
17080 | exit(2); | |
17081 | } | |
17082 | } | |
17083 | ||
17084 | /* write test */ | |
17085 | for (i = 0; i < 4; i++) { | |
17086 | up = (U32*)(buf + i); | |
17087 | *up = 0xBeef; | |
17088 | if (*up != 0xBeef) { | |
17089 | printf("write failed (%x)\n", *up); | |
17090 | exit(3); | |
17091 | } | |
17092 | } | |
17093 | ||
17094 | exit(0); | |
17095 | #else | |
17096 | printf("1\n"); | |
17097 | exit(1); | |
17098 | #endif | |
17099 | return 0; | |
17100 | } | |
17101 | EOCP | |
17102 | set try | |
17103 | if eval $compile_ok; then | |
d308175a | 17104 | echo "(Testing for character data alignment may crash the test. That's okay.)" >&4 |
5440bc8e | 17105 | $run ./try 2>&1 >/dev/null |
4e0554ec JH |
17106 | case "$?" in |
17107 | 0) cat >&4 <<EOM | |
17108 | You can access character data pretty unalignedly. | |
17109 | EOM | |
17110 | d_u32align="$undef" | |
17111 | ;; | |
17112 | *) cat >&4 <<EOM | |
17113 | It seems that you must access character data in an aligned manner. | |
17114 | EOM | |
17115 | d_u32align="$define" | |
17116 | ;; | |
17117 | esac | |
4e0554ec JH |
17118 | else |
17119 | rp='Can you access character data at unaligned addresses?' | |
17120 | dflt='n' | |
17121 | . ./myread | |
17122 | case "$ans" in | |
17123 | [yY]*) d_u32align="$undef" ;; | |
17124 | *) d_u32align="$define" ;; | |
17125 | esac | |
17126 | fi | |
e36b5403 | 17127 | $rm -f core core.try.* try.core |
dc7b0a4f JH |
17128 | ;; |
17129 | esac | |
4e0554ec JH |
17130 | |
17131 | : see if ualarm exists | |
17132 | set ualarm d_ualarm | |
17133 | eval $inlibc | |
17134 | ||
b4eb6b3d JH |
17135 | : see if umask exists |
17136 | set umask d_umask | |
17137 | eval $inlibc | |
17138 | ||
758a5d79 JH |
17139 | : see if unordered exists |
17140 | set unordered d_unordered | |
17141 | eval $inlibc | |
17142 | ||
4e0554ec JH |
17143 | : see if usleep exists |
17144 | set usleep d_usleep | |
17145 | eval $inlibc | |
17146 | ||
2ef53570 JH |
17147 | : see if prototype for usleep is available |
17148 | echo " " | |
17149 | set d_usleepproto usleep $i_unistd unistd.h | |
17150 | eval $hasproto | |
17151 | ||
b4eb6b3d JH |
17152 | : see if ustat exists |
17153 | set ustat d_ustat | |
17154 | eval $inlibc | |
17155 | ||
17156 | : backward compatibility for d_hvfork | |
17157 | if test X$d_hvfork != X; then | |
17158 | d_vfork="$d_hvfork" | |
17159 | d_hvfork='' | |
17160 | fi | |
17161 | : see if there is a vfork | |
17162 | val='' | |
17163 | set vfork val | |
17164 | eval $inlibc | |
17165 | ||
17166 | : Ok, but do we want to use it. vfork is reportedly unreliable in | |
17167 | : perl on Solaris 2.x, and probably elsewhere. | |
17168 | case "$val" in | |
17169 | $define) | |
17170 | echo " " | |
17171 | case "$usevfork" in | |
17172 | false) dflt='n';; | |
17173 | *) dflt='y';; | |
17174 | esac | |
17175 | cat <<'EOM' | |
17176 | ||
17177 | Perl can only use a vfork() that doesn't suffer from strict | |
17178 | restrictions on calling functions or modifying global data in | |
17179 | the child. For example, glibc-2.1 contains such a vfork() | |
17180 | that is unsuitable. If your system provides a proper fork() | |
17181 | call, chances are that you do NOT want perl to use vfork(). | |
17182 | ||
17183 | EOM | |
17184 | rp="Do you still want to use vfork()?" | |
17185 | . ./myread | |
17186 | case "$ans" in | |
17187 | y|Y) ;; | |
17188 | *) | |
17189 | echo "Ok, we won't use vfork()." | |
17190 | val="$undef" | |
17191 | ;; | |
17192 | esac | |
17193 | ;; | |
17194 | esac | |
17195 | set d_vfork | |
17196 | eval $setvar | |
17197 | case "$d_vfork" in | |
17198 | $define) usevfork='true';; | |
17199 | *) usevfork='false';; | |
17200 | esac | |
17201 | ||
b4eb6b3d JH |
17202 | : see if closedir exists |
17203 | set closedir d_closedir | |
17204 | eval $inlibc | |
17205 | ||
17206 | case "$d_closedir" in | |
17207 | "$define") | |
17208 | echo " " | |
17209 | echo "Checking whether closedir() returns a status..." >&4 | |
5440bc8e | 17210 | cat > try.c <<EOM |
b4eb6b3d JH |
17211 | #$i_dirent I_DIRENT /**/ |
17212 | #$i_sysdir I_SYS_DIR /**/ | |
17213 | #$i_sysndir I_SYS_NDIR /**/ | |
17214 | #$i_systypes I_SYS_TYPES /**/ | |
17215 | ||
17216 | #if defined(I_SYS_TYPES) | |
17217 | #include <sys/types.h> | |
17218 | #endif | |
17219 | #if defined(I_DIRENT) | |
17220 | #include <dirent.h> | |
17221 | #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ | |
17222 | #include <sys/dir.h> | |
17223 | #endif | |
17224 | #else | |
17225 | #ifdef I_SYS_NDIR | |
17226 | #include <sys/ndir.h> | |
17227 | #else | |
17228 | #ifdef I_SYS_DIR | |
17229 | #ifdef hp9000s500 | |
17230 | #include <ndir.h> /* may be wrong in the future */ | |
17231 | #else | |
17232 | #include <sys/dir.h> | |
17233 | #endif | |
17234 | #endif | |
17235 | #endif | |
17236 | #endif | |
17237 | int main() { return closedir(opendir(".")); } | |
17238 | EOM | |
5440bc8e | 17239 | set try |
b4eb6b3d | 17240 | if eval $compile_ok; then |
5440bc8e | 17241 | if $run ./try > /dev/null 2>&1 ; then |
b4eb6b3d JH |
17242 | echo "Yes, it does." |
17243 | val="$undef" | |
17244 | else | |
17245 | echo "No, it doesn't." | |
17246 | val="$define" | |
17247 | fi | |
17248 | else | |
17249 | echo "(I can't seem to compile the test program--assuming it doesn't)" | |
17250 | val="$define" | |
17251 | fi | |
17252 | ;; | |
17253 | *) | |
17254 | val="$undef"; | |
17255 | ;; | |
17256 | esac | |
17257 | set d_void_closedir | |
17258 | eval $setvar | |
5440bc8e | 17259 | $rm -f try try.* |
b4eb6b3d JH |
17260 | : see if there is a wait4 |
17261 | set wait4 d_wait4 | |
17262 | eval $inlibc | |
17263 | ||
17264 | : see if waitpid exists | |
17265 | set waitpid d_waitpid | |
17266 | eval $inlibc | |
17267 | ||
17268 | : see if wcstombs exists | |
17269 | set wcstombs d_wcstombs | |
17270 | eval $inlibc | |
17271 | ||
17272 | : see if wctomb exists | |
17273 | set wctomb d_wctomb | |
17274 | eval $inlibc | |
17275 | ||
4e0554ec JH |
17276 | : see if writev exists |
17277 | set writev d_writev | |
17278 | eval $inlibc | |
17279 | ||
b4eb6b3d JH |
17280 | : preserve RCS keywords in files with variable substitution, grrr |
17281 | Date='$Date' | |
17282 | Id='$Id' | |
17283 | Log='$Log' | |
17284 | RCSfile='$RCSfile' | |
17285 | Revision='$Revision' | |
17286 | ||
b4eb6b3d JH |
17287 | : check for alignment requirements |
17288 | echo " " | |
5440bc8e | 17289 | case "$usecrosscompile$multiarch" in |
b4eb6b3d JH |
17290 | *$define*) |
17291 | $cat <<EOM | |
17292 | You seem to be either cross-compiling or doing a multiarchitecture build, | |
17293 | skipping the memory alignment check. | |
17294 | ||
17295 | EOM | |
17296 | case "$alignbytes" in | |
17297 | '') alignbytes=8 ;; | |
17298 | esac | |
17299 | ;; | |
17300 | *) | |
17301 | case "$alignbytes" in | |
17302 | '') echo "Checking alignment constraints..." >&4 | |
17303 | if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then | |
17304 | $cat >try.c <<'EOCP' | |
17305 | typedef long double NV; | |
17306 | EOCP | |
17307 | else | |
17308 | $cat >try.c <<'EOCP' | |
17309 | typedef double NV; | |
17310 | EOCP | |
17311 | fi | |
17312 | $cat >>try.c <<'EOCP' | |
17313 | #include <stdio.h> | |
17314 | struct foobar { | |
17315 | char foo; | |
17316 | NV bar; | |
17317 | } try_algn; | |
17318 | int main() | |
17319 | { | |
17320 | printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo)); | |
17321 | return(0); | |
17322 | } | |
17323 | EOCP | |
17324 | set try | |
17325 | if eval $compile_ok; then | |
5440bc8e | 17326 | dflt=`$run ./try` |
b4eb6b3d JH |
17327 | else |
17328 | dflt='8' | |
17329 | echo "(I can't seem to compile the test program...)" | |
17330 | fi | |
17331 | ;; | |
17332 | *) dflt="$alignbytes" | |
17333 | ;; | |
17334 | esac | |
17335 | rp="Doubles must be aligned on a how-many-byte boundary?" | |
17336 | . ./myread | |
17337 | alignbytes="$ans" | |
17338 | $rm -f try.c try | |
17339 | ;; | |
17340 | esac | |
17341 | ||
17342 | ||
17343 | : set the base revision | |
17344 | baserev=5.0 | |
17345 | ||
92b39ff2 | 17346 | : how do we concatenate cpp tokens here? |
b4eb6b3d | 17347 | echo " " |
92b39ff2 | 17348 | echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4 |
b4eb6b3d JH |
17349 | $cat >cpp_stuff.c <<'EOCP' |
17350 | #define RCAT(a,b)a/**/b | |
17351 | #define ACAT(a,b)a ## b | |
17352 | RCAT(Rei,ser) | |
17353 | ACAT(Cir,cus) | |
17354 | EOCP | |
17355 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 | |
17356 | if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then | |
17357 | echo "Oh! Smells like ANSI's been here." >&4 | |
17358 | echo "We can catify or stringify, separately or together!" | |
17359 | cpp_stuff=42 | |
17360 | elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then | |
17361 | echo "Ah, yes! The good old days!" >&4 | |
17362 | echo "However, in the good old days we don't know how to stringify and" | |
17363 | echo "catify at the same time." | |
17364 | cpp_stuff=1 | |
17365 | else | |
17366 | $cat >&4 <<EOM | |
92b39ff2 JH |
17367 | Hmm, I don't seem to be able to concatenate tokens with your cpp. |
17368 | You're going to have to edit the values of CAT[2-5] in config.h... | |
b4eb6b3d JH |
17369 | EOM |
17370 | cpp_stuff="/* Help! How do we handle cpp_stuff? */*/" | |
17371 | fi | |
17372 | $rm -f cpp_stuff.* | |
17373 | ||
17374 | : see if this is a db.h system | |
17375 | set db.h i_db | |
17376 | eval $inhdr | |
17377 | ||
17378 | case "$i_db" in | |
17379 | $define) | |
17380 | : Check db version. | |
17381 | echo " " | |
17382 | echo "Checking Berkeley DB version ..." >&4 | |
17383 | $cat >try.c <<EOCP | |
17384 | #$d_const HASCONST | |
17385 | #ifndef HASCONST | |
17386 | #define const | |
17387 | #endif | |
17388 | #include <sys/types.h> | |
17389 | #include <stdio.h> | |
5a29c6bc JH |
17390 | #$i_stdlib I_STDLIB |
17391 | #ifdef I_STDLIB | |
17392 | #include <stdlib.h> | |
17393 | #endif | |
b4eb6b3d | 17394 | #include <db.h> |
640374d0 | 17395 | int main(int argc, char *argv[]) |
b4eb6b3d JH |
17396 | { |
17397 | #ifdef DB_VERSION_MAJOR /* DB version >= 2 */ | |
17398 | int Major, Minor, Patch ; | |
17399 | unsigned long Version ; | |
17400 | (void)db_version(&Major, &Minor, &Patch) ; | |
640374d0 JH |
17401 | if (argc == 2) { |
17402 | printf("%d %d %d %d %d %d\n", | |
17403 | DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, | |
17404 | Major, Minor, Patch); | |
17405 | exit(0); | |
17406 | } | |
17407 | printf("You have Berkeley DB Version 2 or greater.\n"); | |
b4eb6b3d JH |
17408 | |
17409 | printf("db.h is from Berkeley DB Version %d.%d.%d\n", | |
17410 | DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH); | |
17411 | printf("libdb is from Berkeley DB Version %d.%d.%d\n", | |
17412 | Major, Minor, Patch) ; | |
17413 | ||
17414 | /* check that db.h & libdb are compatible */ | |
17415 | if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) { | |
640374d0 | 17416 | printf("db.h and libdb are incompatible.\n") ; |
b4eb6b3d JH |
17417 | exit(3); |
17418 | } | |
17419 | ||
640374d0 | 17420 | printf("db.h and libdb are compatible.\n") ; |
b4eb6b3d JH |
17421 | |
17422 | Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000 | |
17423 | + DB_VERSION_PATCH ; | |
17424 | ||
17425 | /* needs to be >= 2.3.4 */ | |
17426 | if (Version < 2003004) { | |
17427 | /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */ | |
640374d0 | 17428 | printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ; |
b4eb6b3d JH |
17429 | exit(2); |
17430 | } | |
17431 | ||
17432 | exit(0); | |
17433 | #else | |
17434 | #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) | |
640374d0 JH |
17435 | if (argc == 2) { |
17436 | printf("1 0 0\n"); | |
17437 | exit(0); | |
17438 | } | |
17439 | printf("You have Berkeley DB Version 1.\n"); | |
b4eb6b3d JH |
17440 | exit(0); /* DB version < 2: the coast is clear. */ |
17441 | #else | |
17442 | exit(1); /* <db.h> not Berkeley DB? */ | |
17443 | #endif | |
17444 | #endif | |
17445 | } | |
17446 | EOCP | |
17447 | set try | |
5440bc8e | 17448 | if eval $compile_ok && $run ./try; then |
b4eb6b3d | 17449 | echo 'Looks OK.' >&4 |
5440bc8e | 17450 | set `$run ./try 1` |
640374d0 JH |
17451 | db_version_major=$1 |
17452 | db_version_minor=$2 | |
17453 | db_version_patch=$3 | |
b4eb6b3d JH |
17454 | else |
17455 | echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4 | |
17456 | i_db=$undef | |
17457 | case " $libs " in | |
17458 | *"-ldb "*) | |
17459 | : Remove db from list of libraries to use | |
17460 | echo "Removing unusable -ldb from library list" >&4 | |
17461 | set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'` | |
17462 | shift | |
17463 | libs="$*" | |
17464 | echo "libs = $libs" >&4 | |
17465 | ;; | |
17466 | esac | |
17467 | fi | |
17468 | $rm -f try.* | |
17469 | ;; | |
17470 | esac | |
17471 | ||
17472 | case "$i_db" in | |
17473 | define) | |
17474 | : Check the return type needed for hash | |
17475 | echo " " | |
17476 | echo "Checking return type needed for hash for Berkeley DB ..." >&4 | |
17477 | $cat >try.c <<EOCP | |
17478 | #$d_const HASCONST | |
17479 | #ifndef HASCONST | |
17480 | #define const | |
17481 | #endif | |
17482 | #include <sys/types.h> | |
17483 | #include <db.h> | |
17484 | ||
17485 | #ifndef DB_VERSION_MAJOR | |
17486 | u_int32_t hash_cb (ptr, size) | |
17487 | const void *ptr; | |
17488 | size_t size; | |
17489 | { | |
17490 | } | |
17491 | HASHINFO info; | |
17492 | int main() | |
17493 | { | |
17494 | info.hash = hash_cb; | |
17495 | } | |
17496 | #endif | |
17497 | EOCP | |
17498 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
17499 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
17500 | db_hashtype='int' | |
17501 | else | |
17502 | db_hashtype='u_int32_t' | |
17503 | fi | |
17504 | else | |
17505 | : XXX Maybe we should just give up here. | |
17506 | db_hashtype=u_int32_t | |
17507 | $cat try.out >&4 | |
17508 | echo "Help: I can't seem to compile the db test program." >&4 | |
17509 | echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 | |
17510 | fi | |
17511 | $rm -f try.* | |
17512 | echo "Your version of Berkeley DB uses $db_hashtype for hash." | |
17513 | ;; | |
17514 | *) db_hashtype=u_int32_t | |
17515 | ;; | |
17516 | esac | |
17517 | case "$i_db" in | |
17518 | define) | |
17519 | : Check the return type needed for prefix | |
17520 | echo " " | |
17521 | echo "Checking return type needed for prefix for Berkeley DB ..." >&4 | |
17522 | cat >try.c <<EOCP | |
17523 | #$d_const HASCONST | |
17524 | #ifndef HASCONST | |
17525 | #define const | |
17526 | #endif | |
17527 | #include <sys/types.h> | |
17528 | #include <db.h> | |
17529 | ||
17530 | #ifndef DB_VERSION_MAJOR | |
17531 | size_t prefix_cb (key1, key2) | |
17532 | const DBT *key1; | |
17533 | const DBT *key2; | |
17534 | { | |
17535 | } | |
17536 | BTREEINFO info; | |
17537 | int main() | |
17538 | { | |
17539 | info.prefix = prefix_cb; | |
17540 | } | |
17541 | #endif | |
17542 | EOCP | |
17543 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
17544 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
17545 | db_prefixtype='int' | |
17546 | else | |
17547 | db_prefixtype='size_t' | |
17548 | fi | |
17549 | else | |
17550 | db_prefixtype='size_t' | |
17551 | : XXX Maybe we should just give up here. | |
17552 | $cat try.out >&4 | |
17553 | echo "Help: I can't seem to compile the db test program." >&4 | |
17554 | echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 | |
17555 | fi | |
17556 | $rm -f try.* | |
17557 | echo "Your version of Berkeley DB uses $db_prefixtype for prefix." | |
17558 | ;; | |
17559 | *) db_prefixtype='size_t' | |
17560 | ;; | |
17561 | esac | |
17562 | ||
b4eb6b3d JH |
17563 | |
17564 | : How can we generate normalized random numbers ? | |
17565 | echo " " | |
17566 | echo "Looking for a random number function..." >&4 | |
17567 | case "$randfunc" in | |
17568 | '') | |
17569 | if set drand48 val -f; eval $csym; $val; then | |
17570 | dflt="drand48" | |
17571 | echo "Good, found drand48()." >&4 | |
17572 | elif set random val -f; eval $csym; $val; then | |
17573 | dflt="random" | |
17574 | echo "OK, found random()." >&4 | |
17575 | else | |
17576 | dflt="rand" | |
17577 | echo "Yick, looks like I have to use rand()." >&4 | |
17578 | fi | |
17579 | echo " " | |
17580 | ;; | |
17581 | *) | |
17582 | dflt="$randfunc" | |
17583 | ;; | |
17584 | esac | |
17585 | cont=true | |
17586 | ||
17587 | case "$ccflags" in | |
17588 | *-Dmy_rand=*|*-Dmy_srand=*) | |
17589 | echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4 | |
17590 | ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`" | |
17591 | ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`" | |
17592 | ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`" | |
17593 | ;; | |
17594 | esac | |
17595 | ||
17596 | while $test "$cont"; do | |
17597 | rp="Use which function to generate random numbers?" | |
17598 | . ./myread | |
17599 | if $test "$ans" = "$dflt"; then | |
17600 | : null | |
17601 | else | |
17602 | randbits='' | |
17603 | fi | |
17604 | randfunc="$ans" | |
17605 | if set $ans val -f; eval $csym; $val; then | |
17606 | cont='' | |
17607 | else | |
17608 | dflt=y | |
17609 | rp="I cannot find function $ans. Use that name anyway?" | |
17610 | . ./myread | |
17611 | dflt=rand | |
17612 | case "$ans" in | |
17613 | [yY]*) cont='';; | |
17614 | esac | |
17615 | fi | |
17616 | case "$cont" in | |
17617 | '') | |
17618 | case "$randfunc" in | |
17619 | drand48) | |
17620 | drand01="drand48()" | |
17621 | seedfunc="srand48" | |
17622 | randbits=48 | |
17623 | randseedtype=long | |
17624 | ;; | |
17625 | rand|random) | |
17626 | case "$randbits" in | |
17627 | '') | |
17628 | echo "Checking to see how many bits your $randfunc() function produces..." >&4 | |
17629 | $cat >try.c <<EOCP | |
17630 | #$i_unistd I_UNISTD | |
17631 | #$i_stdlib I_STDLIB | |
17632 | #include <stdio.h> | |
17633 | #ifdef I_UNISTD | |
17634 | # include <unistd.h> | |
17635 | #endif | |
17636 | #ifdef I_STDLIB | |
17637 | # include <stdlib.h> | |
17638 | #endif | |
17639 | int main() | |
17640 | { | |
17641 | register int i; | |
17642 | register unsigned long tmp; | |
17643 | register unsigned long max = 0L; | |
17644 | ||
17645 | for (i = 1000; i; i--) { | |
17646 | tmp = (unsigned long) $randfunc(); | |
17647 | if (tmp > max) max = tmp; | |
17648 | } | |
17649 | for (i = 0; max; i++) | |
17650 | max /= 2; | |
17651 | printf("%d\n",i); | |
17652 | } | |
17653 | EOCP | |
17654 | set try | |
17655 | if eval $compile_ok; then | |
17656 | dflt=`try` | |
17657 | else | |
17658 | dflt='?' | |
17659 | echo "(I can't seem to compile the test program...)" | |
17660 | fi | |
17661 | ;; | |
17662 | *) | |
17663 | dflt="$randbits" | |
17664 | ;; | |
17665 | esac | |
17666 | rp="How many bits does your $randfunc() function produce?" | |
17667 | . ./myread | |
17668 | randbits="$ans" | |
17669 | $rm -f try.c try | |
17670 | drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))" | |
17671 | seedfunc="s$randfunc" | |
17672 | randseedtype=unsigned | |
17673 | ;; | |
17674 | *) | |
17675 | dflt="31" | |
17676 | rp="How many bits does your $randfunc() function produce?" | |
17677 | . ./myread | |
17678 | randbits="$ans" | |
17679 | seedfunc="s$randfunc" | |
17680 | drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))" | |
17681 | if set $seedfunc val -f; eval $csym; $val; then | |
17682 | echo "(Using $seedfunc() to seed random generator)" | |
17683 | else | |
17684 | echo "(Warning: no $seedfunc() to seed random generator)" | |
17685 | seedfunc=rand | |
17686 | fi | |
17687 | randseedtype=unsigned | |
17688 | ;; | |
17689 | esac | |
17690 | ;; | |
17691 | esac | |
17692 | done | |
17693 | ||
17694 | echo " " | |
17695 | echo "Determining whether or not we are on an EBCDIC system..." >&4 | |
5440bc8e | 17696 | $cat >try.c <<'EOM' |
b4eb6b3d JH |
17697 | int main() |
17698 | { | |
17699 | if ('M'==0xd4) return 0; | |
17700 | return 1; | |
17701 | } | |
17702 | EOM | |
17703 | ||
17704 | val=$undef | |
5440bc8e | 17705 | set try |
b4eb6b3d | 17706 | if eval $compile_ok; then |
5440bc8e | 17707 | if $run ./try; then |
b4eb6b3d JH |
17708 | echo "You seem to speak EBCDIC." >&4 |
17709 | val="$define" | |
17710 | else | |
5440bc8e | 17711 | echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4 |
b4eb6b3d JH |
17712 | fi |
17713 | else | |
17714 | echo "I'm unable to compile the test program." >&4 | |
17715 | echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4 | |
17716 | fi | |
5440bc8e | 17717 | $rm -f try try.* |
b4eb6b3d JH |
17718 | set ebcdic |
17719 | eval $setvar | |
17720 | ||
17721 | echo " " | |
17722 | $cat >&4 <<EOM | |
17723 | Checking how to flush all pending stdio output... | |
17724 | EOM | |
17725 | # I only know how to find the first 32 possibly open files on SunOS. | |
17726 | # See also hints/sunos_4_1.sh and util.c --AD | |
17727 | case "$osname" in | |
17728 | sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;; | |
17729 | esac | |
17730 | $cat >>try.c <<EOCP | |
17731 | #include <stdio.h> | |
5a29c6bc JH |
17732 | #$i_stdlib I_STDLIB |
17733 | #ifdef I_STDLIB | |
17734 | #include <stdlib.h> | |
17735 | #endif | |
b4eb6b3d JH |
17736 | #$i_unistd I_UNISTD |
17737 | #ifdef I_UNISTD | |
17738 | # include <unistd.h> | |
17739 | #endif | |
17740 | #$d_sysconf HAS_SYSCONF | |
17741 | #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY | |
17742 | #ifdef HAS_STDIO_STREAM_ARRAY | |
17743 | # define STDIO_STREAM_ARRAY $stdio_stream_array | |
17744 | #endif | |
17745 | int main() { | |
5440bc8e JH |
17746 | FILE* p; |
17747 | unlink("try.out"); | |
17748 | p = fopen("try.out", "w"); | |
b4eb6b3d JH |
17749 | #ifdef TRY_FPUTC |
17750 | fputc('x', p); | |
17751 | #else | |
17752 | # ifdef TRY_FPRINTF | |
17753 | fprintf(p, "x"); | |
17754 | # endif | |
17755 | #endif | |
17756 | #ifdef TRY_FFLUSH_NULL | |
17757 | fflush(NULL); | |
17758 | #endif | |
17759 | #ifdef TRY_FFLUSH_ALL | |
17760 | { | |
17761 | long open_max = -1; | |
17762 | # ifdef PERL_FFLUSH_ALL_FOPEN_MAX | |
17763 | open_max = PERL_FFLUSH_ALL_FOPEN_MAX; | |
17764 | # else | |
17765 | # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) | |
17766 | open_max = sysconf(_SC_OPEN_MAX); | |
17767 | # else | |
17768 | # ifdef FOPEN_MAX | |
17769 | open_max = FOPEN_MAX; | |
17770 | # else | |
17771 | # ifdef OPEN_MAX | |
17772 | open_max = OPEN_MAX; | |
17773 | # else | |
17774 | # ifdef _NFILE | |
17775 | open_max = _NFILE; | |
17776 | # endif | |
17777 | # endif | |
17778 | # endif | |
17779 | # endif | |
17780 | # endif | |
17781 | # ifdef HAS_STDIO_STREAM_ARRAY | |
17782 | if (open_max > 0) { | |
17783 | long i; | |
17784 | for (i = 0; i < open_max; i++) | |
17785 | if (STDIO_STREAM_ARRAY[i]._file >= 0 && | |
17786 | STDIO_STREAM_ARRAY[i]._file < open_max && | |
17787 | STDIO_STREAM_ARRAY[i]._flag) | |
17788 | fflush(&STDIO_STREAM_ARRAY[i]); | |
17789 | } | |
17790 | } | |
17791 | # endif | |
17792 | #endif | |
17793 | _exit(42); | |
17794 | } | |
17795 | EOCP | |
17796 | : first we have to find out how _not_ to flush | |
5440bc8e | 17797 | $to try.c |
b4eb6b3d JH |
17798 | if $test "X$fflushNULL" = X -o "X$fflushall" = X; then |
17799 | output='' | |
17800 | set try -DTRY_FPUTC | |
17801 | if eval $compile; then | |
fbe73d74 | 17802 | $run ./try 2>/dev/null |
28f5ac64 | 17803 | code="$?" |
5440bc8e | 17804 | $from try.out |
28f5ac64 | 17805 | if $test ! -s try.out -a "X$code" = X42; then |
b4eb6b3d JH |
17806 | output=-DTRY_FPUTC |
17807 | fi | |
17808 | fi | |
17809 | case "$output" in | |
17810 | '') | |
17811 | set try -DTRY_FPRINTF | |
b4eb6b3d | 17812 | if eval $compile; then |
fbe73d74 | 17813 | $run ./try 2>/dev/null |
28f5ac64 | 17814 | code="$?" |
5440bc8e | 17815 | $from try.out |
28f5ac64 | 17816 | if $test ! -s try.out -a "X$code" = X42; then |
b4eb6b3d JH |
17817 | output=-DTRY_FPRINTF |
17818 | fi | |
17819 | fi | |
17820 | ;; | |
17821 | esac | |
17822 | fi | |
17823 | : check for fflush NULL behaviour | |
17824 | case "$fflushNULL" in | |
17825 | '') set try -DTRY_FFLUSH_NULL $output | |
17826 | if eval $compile; then | |
5440bc8e | 17827 | $run ./try 2>/dev/null |
b4eb6b3d | 17828 | code="$?" |
5440bc8e | 17829 | $from try.out |
b4eb6b3d JH |
17830 | if $test -s try.out -a "X$code" = X42; then |
17831 | fflushNULL="`$cat try.out`" | |
17832 | else | |
17833 | if $test "X$code" != X42; then | |
17834 | $cat >&4 <<EOM | |
17835 | (If this test failed, don't worry, we'll try another method shortly.) | |
17836 | EOM | |
17837 | fi | |
17838 | fi | |
17839 | fi | |
17840 | $rm -f core try.core core.try.* | |
17841 | case "$fflushNULL" in | |
17842 | x) $cat >&4 <<EOM | |
17843 | Your fflush(NULL) works okay for output streams. | |
17844 | Let's see if it clobbers input pipes... | |
17845 | EOM | |
17846 | # As of mid-March 2000 all versions of Solaris appear to have a stdio | |
17847 | # bug that improperly flushes the input end of pipes. So we avoid the | |
17848 | # autoflush on fork/system/exec support for now. :-( | |
17849 | $cat >tryp.c <<EOCP | |
17850 | #include <stdio.h> | |
17851 | int | |
17852 | main(int argc, char **argv) | |
17853 | { | |
17854 | char buf[1024]; | |
17855 | int i; | |
17856 | char *bp = buf; | |
17857 | while (1) { | |
17858 | while ((i = getc(stdin)) != -1 | |
17859 | && (*bp++ = i) != '\n' | |
17860 | && bp < &buf[1024]) | |
17861 | /* DO NOTHING */ ; | |
17862 | *bp = '\0'; | |
17863 | fprintf(stdout, "%s", buf); | |
17864 | fflush(NULL); | |
17865 | if (i == -1) | |
17866 | return 0; | |
17867 | bp = buf; | |
17868 | } | |
17869 | } | |
17870 | EOCP | |
17871 | fflushNULL="$define" | |
17872 | set tryp | |
17873 | if eval $compile; then | |
17874 | $rm -f tryp.out | |
5440bc8e | 17875 | $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out |
b4eb6b3d JH |
17876 | if cmp tryp.c tryp.out >/dev/null 2>&1; then |
17877 | $cat >&4 <<EOM | |
17878 | fflush(NULL) seems to behave okay with input streams. | |
17879 | EOM | |
17880 | fflushNULL="$define" | |
17881 | else | |
17882 | $cat >&4 <<EOM | |
17883 | Ouch, fflush(NULL) clobbers input pipes! We will not use it. | |
17884 | EOM | |
17885 | fflushNULL="$undef" | |
17886 | fi | |
17887 | fi | |
17888 | $rm -f core tryp.c tryp.core core.tryp.* | |
17889 | ;; | |
17890 | '') $cat >&4 <<EOM | |
17891 | Your fflush(NULL) isn't working (contrary to ANSI C). | |
17892 | EOM | |
17893 | fflushNULL="$undef" | |
17894 | ;; | |
17895 | *) $cat >&4 <<EOM | |
17896 | Cannot figure out whether your fflush(NULL) works or not. | |
17897 | I'm assuming it doesn't (contrary to ANSI C). | |
17898 | EOM | |
17899 | fflushNULL="$undef" | |
17900 | ;; | |
17901 | esac | |
17902 | ;; | |
17903 | $define|true|[yY]*) | |
17904 | fflushNULL="$define" | |
17905 | ;; | |
17906 | *) | |
17907 | fflushNULL="$undef" | |
17908 | ;; | |
17909 | esac | |
17910 | : check explicit looping only if NULL did not work, and if the pipe | |
17911 | : bug does not show up on an explicit flush too | |
17912 | case "$fflushNULL" in | |
17913 | "$undef") | |
17914 | $cat >tryp.c <<EOCP | |
17915 | #include <stdio.h> | |
17916 | int | |
17917 | main(int argc, char **argv) | |
17918 | { | |
17919 | char buf[1024]; | |
17920 | int i; | |
17921 | char *bp = buf; | |
17922 | while (1) { | |
17923 | while ((i = getc(stdin)) != -1 | |
17924 | && (*bp++ = i) != '\n' | |
17925 | && bp < &buf[1024]) | |
17926 | /* DO NOTHING */ ; | |
17927 | *bp = '\0'; | |
17928 | fprintf(stdout, "%s", buf); | |
17929 | fflush(stdin); | |
17930 | if (i == -1) | |
17931 | return 0; | |
17932 | bp = buf; | |
17933 | } | |
17934 | } | |
17935 | EOCP | |
17936 | set tryp | |
17937 | if eval $compile; then | |
17938 | $rm -f tryp.out | |
5440bc8e | 17939 | $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out |
b4eb6b3d JH |
17940 | if cmp tryp.c tryp.out >/dev/null 2>&1; then |
17941 | $cat >&4 <<EOM | |
17942 | Good, at least fflush(stdin) seems to behave okay when stdin is a pipe. | |
17943 | EOM | |
17944 | : now check for fflushall behaviour | |
17945 | case "$fflushall" in | |
17946 | '') set try -DTRY_FFLUSH_ALL $output | |
17947 | if eval $compile; then | |
17948 | $cat >&4 <<EOM | |
17949 | (Now testing the other method--but note that this also may fail.) | |
17950 | EOM | |
5440bc8e | 17951 | $run ./try 2>/dev/null |
28f5ac64 | 17952 | code=$? |
fbe73d74 | 17953 | $from try.out |
28f5ac64 | 17954 | if $test -s try.out -a "X$code" = X42; then |
b4eb6b3d JH |
17955 | fflushall="`$cat try.out`" |
17956 | fi | |
17957 | fi | |
17958 | $rm -f core try.core core.try.* | |
17959 | case "$fflushall" in | |
17960 | x) $cat >&4 <<EOM | |
17961 | Whew. Flushing explicitly all the stdio streams works. | |
17962 | EOM | |
17963 | fflushall="$define" | |
17964 | ;; | |
17965 | '') $cat >&4 <<EOM | |
17966 | Sigh. Flushing explicitly all the stdio streams doesn't work. | |
17967 | EOM | |
17968 | fflushall="$undef" | |
17969 | ;; | |
17970 | *) $cat >&4 <<EOM | |
17971 | Cannot figure out whether flushing stdio streams explicitly works or not. | |
17972 | I'm assuming it doesn't. | |
17973 | EOM | |
17974 | fflushall="$undef" | |
17975 | ;; | |
17976 | esac | |
17977 | ;; | |
17978 | "$define"|true|[yY]*) | |
17979 | fflushall="$define" | |
17980 | ;; | |
17981 | *) | |
17982 | fflushall="$undef" | |
17983 | ;; | |
17984 | esac | |
17985 | else | |
17986 | $cat >&4 <<EOM | |
17987 | All is futile. Even fflush(stdin) clobbers input pipes! | |
17988 | EOM | |
17989 | fflushall="$undef" | |
17990 | fi | |
17991 | else | |
17992 | fflushall="$undef" | |
17993 | fi | |
17994 | $rm -f core tryp.c tryp.core core.tryp.* | |
17995 | ;; | |
17996 | *) fflushall="$undef" | |
17997 | ;; | |
17998 | esac | |
17999 | ||
18000 | case "$fflushNULL$fflushall" in | |
18001 | undefundef) | |
18002 | $cat <<EOM | |
18003 | OK, I give up. I cannot figure out how to flush pending stdio output. | |
18004 | We won't be flushing handles at all before fork/exec/popen. | |
18005 | EOM | |
18006 | ;; | |
18007 | esac | |
18008 | $rm -f try.* try$exe_ext | |
18009 | ||
18010 | : Store the full pathname to the ar program for use in the C program | |
18011 | : Respect a hint or command line value for full_ar. | |
18012 | case "$full_ar" in | |
18013 | '') full_ar=$ar ;; | |
18014 | esac | |
18015 | ||
18016 | : Store the full pathname to the sed program for use in the C program | |
18017 | full_sed=$sed | |
18018 | ||
18019 | : see what type gids are declared as in the kernel | |
18020 | echo " " | |
18021 | echo "Looking for the type for group ids returned by getgid()." | |
18022 | set gid_t gidtype xxx stdio.h sys/types.h | |
18023 | eval $typedef | |
18024 | case "$gidtype" in | |
18025 | xxx) | |
18026 | xxx=`./findhdr sys/user.h` | |
18027 | set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short | |
18028 | case $1 in | |
18029 | unsigned) dflt="$1 $2" ;; | |
18030 | *) dflt="$1" ;; | |
18031 | esac | |
18032 | ;; | |
18033 | *) dflt="$gidtype";; | |
18034 | esac | |
18035 | case "$gidtype" in | |
18036 | gid_t) echo "gid_t found." ;; | |
18037 | *) rp="What is the type for group ids returned by getgid()?" | |
18038 | . ./myread | |
18039 | gidtype="$ans" | |
18040 | ;; | |
18041 | esac | |
18042 | ||
18043 | echo " " | |
18044 | case "$gidtype" in | |
18045 | *_t) zzz="$gidtype" ;; | |
18046 | *) zzz="gid" ;; | |
18047 | esac | |
18048 | echo "Checking the size of $zzz..." >&4 | |
18049 | cat > try.c <<EOCP | |
18050 | #include <sys/types.h> | |
18051 | #include <stdio.h> | |
5ed858ef JH |
18052 | #$i_stdlib I_STDLIB |
18053 | #ifdef I_STDLIB | |
18054 | #include <stdlib.h> | |
18055 | #endif | |
b4eb6b3d JH |
18056 | int main() { |
18057 | printf("%d\n", (int)sizeof($gidtype)); | |
18058 | exit(0); | |
18059 | } | |
18060 | EOCP | |
18061 | set try | |
18062 | if eval $compile_ok; then | |
5440bc8e | 18063 | yyy=`$run ./try` |
b4eb6b3d JH |
18064 | case "$yyy" in |
18065 | '') gidsize=4 | |
18066 | echo "(I can't execute the test program--guessing $gidsize.)" >&4 | |
18067 | ;; | |
18068 | *) gidsize=$yyy | |
18069 | echo "Your $zzz is $gidsize bytes long." | |
18070 | ;; | |
18071 | esac | |
18072 | else | |
18073 | gidsize=4 | |
18074 | echo "(I can't compile the test program--guessing $gidsize.)" >&4 | |
18075 | fi | |
18076 | ||
18077 | ||
18078 | echo " " | |
18079 | case "$gidtype" in | |
18080 | *_t) zzz="$gidtype" ;; | |
18081 | *) zzz="gid" ;; | |
18082 | esac | |
18083 | echo "Checking the sign of $zzz..." >&4 | |
18084 | cat > try.c <<EOCP | |
18085 | #include <sys/types.h> | |
18086 | #include <stdio.h> | |
18087 | int main() { | |
18088 | $gidtype foo = -1; | |
18089 | if (foo < 0) | |
18090 | printf("-1\n"); | |
18091 | else | |
18092 | printf("1\n"); | |
18093 | } | |
18094 | EOCP | |
18095 | set try | |
18096 | if eval $compile; then | |
5440bc8e | 18097 | yyy=`$run ./try` |
b4eb6b3d JH |
18098 | case "$yyy" in |
18099 | '') gidsign=1 | |
18100 | echo "(I can't execute the test program--guessing unsigned.)" >&4 | |
18101 | ;; | |
18102 | *) gidsign=$yyy | |
18103 | case "$gidsign" in | |
18104 | 1) echo "Your $zzz is unsigned." ;; | |
18105 | -1) echo "Your $zzz is signed." ;; | |
18106 | esac | |
18107 | ;; | |
18108 | esac | |
18109 | else | |
18110 | gidsign=1 | |
18111 | echo "(I can't compile the test program--guessing unsigned.)" >&4 | |
18112 | fi | |
18113 | ||
18114 | ||
18115 | echo " " | |
18116 | ||
18117 | if $test X"$quadtype" != X; then | |
18118 | ||
18119 | echo "Checking how to print 64-bit integers..." >&4 | |
18120 | ||
18121 | if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then | |
18122 | $cat >try.c <<'EOCP' | |
18123 | #include <sys/types.h> | |
18124 | #include <stdio.h> | |
18125 | int main() { | |
18126 | int q = 12345678901; | |
18127 | printf("%ld\n", q); | |
18128 | } | |
18129 | EOCP | |
18130 | set try | |
18131 | if eval $compile; then | |
5440bc8e | 18132 | yyy=`$run ./try` |
b4eb6b3d JH |
18133 | case "$yyy" in |
18134 | 12345678901) | |
18135 | sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"'; | |
18136 | sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"'; | |
18137 | echo "We will use %d." | |
18138 | ;; | |
18139 | esac | |
18140 | fi | |
18141 | fi | |
18142 | ||
18143 | if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then | |
18144 | $cat >try.c <<'EOCP' | |
18145 | #include <sys/types.h> | |
18146 | #include <stdio.h> | |
18147 | int main() { | |
18148 | long q = 12345678901; | |
18149 | printf("%ld\n", q); | |
18150 | } | |
18151 | EOCP | |
18152 | set try | |
18153 | if eval $compile; then | |
5440bc8e | 18154 | yyy=`$run ./try` |
b4eb6b3d JH |
18155 | case "$yyy" in |
18156 | 12345678901) | |
18157 | sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"'; | |
18158 | sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"'; | |
18159 | echo "We will use %ld." | |
18160 | ;; | |
18161 | esac | |
18162 | fi | |
18163 | fi | |
18164 | ||
18165 | if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then | |
18166 | $cat >try.c <<'EOCP' | |
18167 | #include <sys/types.h> | |
18168 | #include <inttypes.h> | |
18169 | #include <stdio.h> | |
18170 | int main() { | |
18171 | int64_t q = 12345678901; | |
18172 | printf("%" PRId64 "\n", q); | |
18173 | } | |
18174 | EOCP | |
18175 | set try | |
18176 | if eval $compile; then | |
5440bc8e | 18177 | yyy=`$run ./try` |
b4eb6b3d JH |
18178 | case "$yyy" in |
18179 | 12345678901) | |
18180 | sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64; | |
18181 | sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64; | |
18182 | echo "We will use the C9X style." | |
18183 | ;; | |
18184 | esac | |
18185 | fi | |
18186 | fi | |
18187 | ||
2ef53570 JH |
18188 | if $test X"$sPRId64" = X -a X"$quadtype" != X; then |
18189 | $cat >try.c <<EOCP | |
b4eb6b3d JH |
18190 | #include <sys/types.h> |
18191 | #include <stdio.h> | |
18192 | int main() { | |
2ef53570 JH |
18193 | $quadtype q = 12345678901; |
18194 | printf("%Ld\n", q); | |
b4eb6b3d JH |
18195 | } |
18196 | EOCP | |
18197 | set try | |
18198 | if eval $compile; then | |
5440bc8e | 18199 | yyy=`$run ./try` |
b4eb6b3d JH |
18200 | case "$yyy" in |
18201 | 12345678901) | |
2ef53570 JH |
18202 | sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; |
18203 | sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"'; | |
18204 | echo "We will use %Ld." | |
b4eb6b3d JH |
18205 | ;; |
18206 | esac | |
18207 | fi | |
18208 | fi | |
18209 | ||
2ef53570 JH |
18210 | if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then |
18211 | $cat >try.c <<'EOCP' | |
b4eb6b3d JH |
18212 | #include <sys/types.h> |
18213 | #include <stdio.h> | |
18214 | int main() { | |
2ef53570 JH |
18215 | long long q = 12345678901LL; /* AIX cc requires the LL suffix. */ |
18216 | printf("%lld\n", q); | |
b4eb6b3d JH |
18217 | } |
18218 | EOCP | |
18219 | set try | |
18220 | if eval $compile; then | |
5440bc8e | 18221 | yyy=`$run ./try` |
b4eb6b3d JH |
18222 | case "$yyy" in |
18223 | 12345678901) | |
2ef53570 JH |
18224 | sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; |
18225 | sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"'; | |
18226 | echo "We will use the %lld style." | |
b4eb6b3d JH |
18227 | ;; |
18228 | esac | |
18229 | fi | |
18230 | fi | |
18231 | ||
18232 | if $test X"$sPRId64" = X -a X"$quadtype" != X; then | |
18233 | $cat >try.c <<EOCP | |
18234 | #include <sys/types.h> | |
18235 | #include <stdio.h> | |
18236 | int main() { | |
18237 | $quadtype q = 12345678901; | |
18238 | printf("%qd\n", q); | |
18239 | } | |
18240 | EOCP | |
18241 | set try | |
18242 | if eval $compile; then | |
5440bc8e | 18243 | yyy=`$run ./try` |
b4eb6b3d JH |
18244 | case "$yyy" in |
18245 | 12345678901) | |
18246 | sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; | |
18247 | sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"'; | |
18248 | echo "We will use %qd." | |
18249 | ;; | |
18250 | esac | |
18251 | fi | |
18252 | fi | |
18253 | ||
18254 | if $test X"$sPRId64" = X; then | |
18255 | echo "Cannot figure out how to print 64-bit integers." >&4 | |
18256 | fi | |
18257 | ||
18258 | $rm -f try try.* | |
18259 | ||
18260 | fi | |
18261 | ||
18262 | case "$sPRId64" in | |
18263 | '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; | |
18264 | d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef"; | |
18265 | ;; | |
18266 | *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; | |
18267 | d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define"; | |
18268 | ;; | |
18269 | esac | |
18270 | ||
18271 | ||
18272 | echo " " | |
18273 | $echo "Checking the format strings to be used for Perl's internal types..." >&4 | |
18274 | ||
18275 | if $test X"$ivsize" = X8; then | |
18276 | ivdformat="$sPRId64" | |
18277 | uvuformat="$sPRIu64" | |
18278 | uvoformat="$sPRIo64" | |
18279 | uvxformat="$sPRIx64" | |
18280 | uvXUformat="$sPRIXU64" | |
18281 | else | |
18282 | if $test X"$ivsize" = X"$longsize"; then | |
18283 | ivdformat='"ld"' | |
18284 | uvuformat='"lu"' | |
18285 | uvoformat='"lo"' | |
18286 | uvxformat='"lx"' | |
18287 | uvXUformat='"lX"' | |
18288 | else | |
18289 | if $test X"$ivsize" = X"$intsize"; then | |
18290 | ivdformat='"d"' | |
18291 | uvuformat='"u"' | |
18292 | uvoformat='"o"' | |
18293 | uvxformat='"x"' | |
18294 | uvXUformat='"X"' | |
18295 | else | |
18296 | : far out | |
18297 | if $test X"$ivsize" = X"$shortsize"; then | |
18298 | ivdformat='"hd"' | |
18299 | uvuformat='"hu"' | |
18300 | uvoformat='"ho"' | |
18301 | uvxformat='"hx"' | |
18302 | uvXUformat='"hX"' | |
18303 | fi | |
18304 | fi | |
18305 | fi | |
18306 | fi | |
18307 | ||
18308 | if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then | |
18309 | nveformat="$sPRIeldbl" | |
18310 | nvfformat="$sPRIfldbl" | |
18311 | nvgformat="$sPRIgldbl" | |
18312 | nvEUformat="$sPRIEUldbl" | |
18313 | nvFUformat="$sPRIFUldbl" | |
18314 | nvGUformat="$sPRIGUldbl" | |
18315 | else | |
18316 | nveformat='"e"' | |
18317 | nvfformat='"f"' | |
18318 | nvgformat='"g"' | |
18319 | nvEUformat='"E"' | |
18320 | nvFUformat='"F"' | |
18321 | nvGUformat='"G"' | |
18322 | fi | |
18323 | ||
18324 | case "$ivdformat" in | |
3c728e00 | 18325 | '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4 |
b4eb6b3d JH |
18326 | exit 1 |
18327 | ;; | |
18328 | esac | |
18329 | ||
18330 | ||
18331 | echo " " | |
18332 | $echo "Checking the format string to be used for gids..." >&4 | |
18333 | ||
18334 | case "$gidsign" in | |
18335 | -1) if $test X"$gidsize" = X"$ivsize"; then | |
18336 | gidformat="$ivdformat" | |
18337 | else | |
18338 | if $test X"$gidsize" = X"$longsize"; then | |
18339 | gidformat='"ld"' | |
18340 | else | |
18341 | if $test X"$gidsize" = X"$intsize"; then | |
18342 | gidformat='"d"' | |
18343 | else | |
18344 | if $test X"$gidsize" = X"$shortsize"; then | |
18345 | gidformat='"hd"' | |
18346 | fi | |
18347 | fi | |
18348 | fi | |
18349 | fi | |
18350 | ;; | |
18351 | *) if $test X"$gidsize" = X"$uvsize"; then | |
18352 | gidformat="$uvuformat" | |
18353 | else | |
18354 | if $test X"$gidsize" = X"$longsize"; then | |
18355 | gidformat='"lu"' | |
18356 | else | |
18357 | if $test X"$gidsize" = X"$intsize"; then | |
18358 | gidformat='"u"' | |
18359 | else | |
18360 | if $test X"$gidsize" = X"$shortsize"; then | |
18361 | gidformat='"hu"' | |
18362 | fi | |
18363 | fi | |
18364 | fi | |
18365 | fi | |
18366 | ;; | |
18367 | esac | |
18368 | ||
18369 | : see if getgroups exists | |
18370 | set getgroups d_getgrps | |
18371 | eval $inlibc | |
18372 | ||
18373 | : see if setgroups exists | |
18374 | set setgroups d_setgrps | |
18375 | eval $inlibc | |
18376 | ||
18377 | ||
18378 | : Find type of 2nd arg to 'getgroups()' and 'setgroups()' | |
18379 | echo " " | |
18380 | case "$d_getgrps$d_setgrps" in | |
18381 | *define*) | |
18382 | case "$groupstype" in | |
18383 | '') dflt="$gidtype" ;; | |
18384 | *) dflt="$groupstype" ;; | |
18385 | esac | |
18386 | $cat <<EOM | |
18387 | What type of pointer is the second argument to getgroups() and setgroups()? | |
18388 | Usually this is the same as group ids, $gidtype, but not always. | |
18389 | ||
18390 | EOM | |
18391 | rp='What type pointer is the second argument to getgroups() and setgroups()?' | |
18392 | . ./myread | |
18393 | groupstype="$ans" | |
18394 | ;; | |
18395 | *) groupstype="$gidtype";; | |
18396 | esac | |
18397 | ||
18398 | echo " " | |
18399 | echo "Checking if your $make program sets \$(MAKE)..." >&4 | |
18400 | case "$make_set_make" in | |
18401 | '') | |
18402 | $sed 's/^X //' > testmake.mak << 'EOF' | |
18403 | Xall: | |
18404 | X @echo 'maketemp="$(MAKE)"' | |
18405 | EOF | |
18406 | case "`$make -f testmake.mak 2>/dev/null`" in | |
18407 | *maketemp=*) make_set_make='#' ;; | |
18408 | *) make_set_make="MAKE=$make" ;; | |
18409 | esac | |
18410 | $rm -f testmake.mak | |
18411 | ;; | |
18412 | esac | |
18413 | case "$make_set_make" in | |
18414 | '#') echo "Yup, it does.";; | |
18415 | *) echo "Nope, it doesn't.";; | |
18416 | esac | |
18417 | ||
18418 | : see what type is used for mode_t | |
18419 | rp="What is the type used for file modes for system calls (e.g. fchmod())?" | |
18420 | set mode_t modetype int stdio.h sys/types.h | |
18421 | eval $typedef_ask | |
18422 | ||
2cc61e15 DD |
18423 | : see if stdarg is available |
18424 | echo " " | |
18425 | if $test `./findhdr stdarg.h`; then | |
18426 | echo "<stdarg.h> found." >&4 | |
18427 | valstd="$define" | |
18428 | else | |
18429 | echo "<stdarg.h> NOT found." >&4 | |
18430 | valstd="$undef" | |
18431 | fi | |
18432 | ||
18433 | : see if varags is available | |
18434 | echo " " | |
18435 | if $test `./findhdr varargs.h`; then | |
18436 | echo "<varargs.h> found." >&4 | |
18437 | else | |
18438 | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 | |
18439 | fi | |
18440 | ||
18441 | : set up the varargs testing programs | |
18442 | $cat > varargs.c <<EOP | |
18443 | #ifdef I_STDARG | |
18444 | #include <stdarg.h> | |
18445 | #endif | |
18446 | #ifdef I_VARARGS | |
18447 | #include <varargs.h> | |
18448 | #endif | |
18449 | ||
18450 | #ifdef I_STDARG | |
18451 | int f(char *p, ...) | |
18452 | #else | |
18453 | int f(va_alist) | |
18454 | va_dcl | |
18455 | #endif | |
18456 | { | |
18457 | va_list ap; | |
18458 | #ifndef I_STDARG | |
18459 | char *p; | |
18460 | #endif | |
18461 | #ifdef I_STDARG | |
18462 | va_start(ap,p); | |
18463 | #else | |
18464 | va_start(ap); | |
18465 | p = va_arg(ap, char *); | |
18466 | #endif | |
18467 | va_end(ap); | |
18468 | } | |
18469 | EOP | |
18470 | $cat > varargs <<EOP | |
18471 | $startsh | |
18472 | if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then | |
18473 | echo "true" | |
18474 | else | |
18475 | echo "false" | |
18476 | fi | |
18477 | $rm -f varargs$_o | |
18478 | EOP | |
18479 | chmod +x varargs | |
18480 | ||
18481 | : now check which varargs header should be included | |
18482 | echo " " | |
18483 | i_varhdr='' | |
18484 | case "$valstd" in | |
18485 | "$define") | |
18486 | if `./varargs I_STDARG`; then | |
18487 | val='stdarg.h' | |
18488 | elif `./varargs I_VARARGS`; then | |
18489 | val='varargs.h' | |
18490 | fi | |
18491 | ;; | |
18492 | *) | |
18493 | if `./varargs I_VARARGS`; then | |
18494 | val='varargs.h' | |
18495 | fi | |
18496 | ;; | |
18497 | esac | |
18498 | case "$val" in | |
18499 | '') | |
18500 | echo "I could not find the definition for va_dcl... You have problems..." >&4 | |
18501 | val="$undef"; set i_stdarg; eval $setvar | |
18502 | val="$undef"; set i_varargs; eval $setvar | |
18503 | ;; | |
18504 | *) | |
18505 | set i_varhdr | |
18506 | eval $setvar | |
18507 | case "$i_varhdr" in | |
18508 | stdarg.h) | |
18509 | val="$define"; set i_stdarg; eval $setvar | |
18510 | val="$undef"; set i_varargs; eval $setvar | |
18511 | ;; | |
18512 | varargs.h) | |
18513 | val="$undef"; set i_stdarg; eval $setvar | |
18514 | val="$define"; set i_varargs; eval $setvar | |
18515 | ;; | |
18516 | esac | |
18517 | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; | |
18518 | esac | |
18519 | $rm -f varargs* | |
18520 | ||
18521 | : see if we need va_copy | |
18522 | echo " " | |
18523 | case "$i_stdarg" in | |
18524 | "$define") | |
18525 | $cat >try.c <<EOCP | |
18526 | #include <stdarg.h> | |
18527 | #include <stdio.h> | |
85c8a686 DD |
18528 | #$i_stdlib I_STDLIB |
18529 | #ifdef I_STDLIB | |
18530 | #include <stdlib.h> | |
18531 | #endif | |
18532 | #include <signal.h> | |
2cc61e15 DD |
18533 | |
18534 | int | |
18535 | ivfprintf(FILE *f, const char *fmt, va_list *valp) | |
18536 | { | |
18537 | return vfprintf(f, fmt, *valp); | |
18538 | } | |
18539 | ||
18540 | int | |
18541 | myvfprintf(FILE *f, const char *fmt, va_list val) | |
18542 | { | |
18543 | return ivfprintf(f, fmt, &val); | |
18544 | } | |
18545 | ||
18546 | int | |
18547 | myprintf(char *fmt, ...) | |
18548 | { | |
18549 | va_list val; | |
18550 | va_start(val, fmt); | |
18551 | return myvfprintf(stdout, fmt, val); | |
18552 | } | |
18553 | ||
18554 | int | |
18555 | main(int ac, char **av) | |
18556 | { | |
85c8a686 DD |
18557 | signal(SIGSEGV, exit); |
18558 | ||
2cc61e15 DD |
18559 | myprintf("%s%cs all right, then\n", "that", '\''); |
18560 | exit(0); | |
18561 | } | |
18562 | EOCP | |
18563 | set try | |
5440bc8e JH |
18564 | if eval $compile && $run ./try 2>&1 >/dev/null; then |
18565 | case "`$run ./try`" in | |
2cc61e15 DD |
18566 | "that's all right, then") |
18567 | okay=yes | |
18568 | ;; | |
18569 | esac | |
18570 | fi | |
18571 | case "$okay" in | |
18572 | yes) echo "It seems that you don't need va_copy()." >&4 | |
18573 | need_va_copy="$undef" | |
18574 | ;; | |
18575 | *) echo "It seems that va_copy() or similar will be needed." >&4 | |
18576 | need_va_copy="$define" | |
18577 | ;; | |
18578 | esac | |
18579 | $rm -f try.* core core.* *.core *.core.* | |
18580 | ;; | |
18581 | *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4 | |
18582 | ;; | |
18583 | esac | |
18584 | ||
b4eb6b3d JH |
18585 | : see what type is used for size_t |
18586 | rp="What is the type used for the length parameter for string functions?" | |
18587 | set size_t sizetype 'unsigned int' stdio.h sys/types.h | |
18588 | eval $typedef_ask | |
18589 | ||
18590 | : check for type of arguments to gethostbyaddr. | |
18591 | if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then | |
18592 | case "$d_gethbyaddr" in | |
18593 | $define) | |
18594 | $cat <<EOM | |
18595 | ||
18596 | Checking to see what type of arguments are accepted by gethostbyaddr(). | |
18597 | EOM | |
18598 | hdrs="$define sys/types.h | |
18599 | $d_socket sys/socket.h | |
18600 | $i_niin netinet/in.h | |
18601 | $i_netdb netdb.h | |
18602 | $i_unistd unistd.h" | |
18603 | : The first arg can 'char *' or 'void *' | |
18604 | : The second arg is some of integral type | |
18605 | for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do | |
18606 | for yyy in size_t long int; do | |
18607 | case "$netdb_host_type" in | |
18608 | '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);" | |
18609 | if ./protochk "$try" $hdrs; then | |
18610 | echo "Your system accepts $xxx for the first arg." | |
18611 | echo "...and $yyy for the second arg." | |
18612 | netdb_host_type="$xxx" | |
18613 | netdb_hlen_type="$yyy" | |
18614 | fi | |
18615 | ;; | |
18616 | esac | |
18617 | done | |
18618 | done | |
18619 | : In case none of those worked, prompt the user. | |
18620 | case "$netdb_host_type" in | |
18621 | '') rp='What is the type for the 1st argument to gethostbyaddr?' | |
18622 | dflt='char *' | |
18623 | . ./myread | |
18624 | netdb_host_type=$ans | |
18625 | rp='What is the type for the 2nd argument to gethostbyaddr?' | |
18626 | dflt="$sizetype" | |
18627 | . ./myread | |
18628 | netdb_hlen_type=$ans | |
18629 | ;; | |
18630 | esac | |
18631 | ;; | |
18632 | *) : no gethostbyaddr, so pick harmless defaults | |
18633 | netdb_host_type='char *' | |
18634 | netdb_hlen_type="$sizetype" | |
18635 | ;; | |
18636 | esac | |
18637 | # Remove the "const" if needed. -- but then we'll have a | |
18638 | # prototype clash! | |
18639 | # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'` | |
18640 | fi | |
18641 | ||
18642 | : check for type of argument to gethostbyname. | |
18643 | if test "X$netdb_name_type" = X ; then | |
18644 | case "$d_gethbyname" in | |
18645 | $define) | |
18646 | $cat <<EOM | |
18647 | ||
18648 | Checking to see what type of argument is accepted by gethostbyname(). | |
18649 | EOM | |
18650 | hdrs="$define sys/types.h | |
18651 | $d_socket sys/socket.h | |
18652 | $i_niin netinet/in.h | |
18653 | $i_netdb netdb.h | |
18654 | $i_unistd unistd.h" | |
18655 | for xxx in "const char *" "char *"; do | |
18656 | case "$netdb_name_type" in | |
18657 | '') try="extern struct hostent *gethostbyname($xxx);" | |
18658 | if ./protochk "$try" $hdrs; then | |
18659 | echo "Your system accepts $xxx." | |
18660 | netdb_name_type="$xxx" | |
18661 | fi | |
18662 | ;; | |
18663 | esac | |
18664 | done | |
18665 | : In case none of those worked, prompt the user. | |
18666 | case "$netdb_name_type" in | |
18667 | '') rp='What is the type for the 1st argument to gethostbyname?' | |
18668 | dflt='char *' | |
18669 | . ./myread | |
18670 | netdb_name_type=$ans | |
18671 | ;; | |
18672 | esac | |
18673 | ;; | |
18674 | *) : no gethostbyname, so pick harmless default | |
18675 | netdb_name_type='char *' | |
18676 | ;; | |
18677 | esac | |
18678 | fi | |
18679 | ||
18680 | : check for type of 1st argument to getnetbyaddr. | |
18681 | if test "X$netdb_net_type" = X ; then | |
18682 | case "$d_getnbyaddr" in | |
18683 | $define) | |
18684 | $cat <<EOM | |
18685 | ||
18686 | Checking to see what type of 1st argument is accepted by getnetbyaddr(). | |
18687 | EOM | |
18688 | hdrs="$define sys/types.h | |
18689 | $d_socket sys/socket.h | |
18690 | $i_niin netinet/in.h | |
18691 | $i_netdb netdb.h | |
18692 | $i_unistd unistd.h" | |
18693 | for xxx in in_addr_t "unsigned long" long "unsigned int" int; do | |
18694 | case "$netdb_net_type" in | |
18695 | '') try="extern struct netent *getnetbyaddr($xxx, int);" | |
18696 | if ./protochk "$try" $hdrs; then | |
18697 | echo "Your system accepts $xxx." | |
18698 | netdb_net_type="$xxx" | |
18699 | fi | |
18700 | ;; | |
18701 | esac | |
18702 | done | |
18703 | : In case none of those worked, prompt the user. | |
18704 | case "$netdb_net_type" in | |
18705 | '') rp='What is the type for the 1st argument to getnetbyaddr?' | |
18706 | dflt='long' | |
18707 | . ./myread | |
18708 | netdb_net_type=$ans | |
18709 | ;; | |
18710 | esac | |
18711 | ;; | |
18712 | *) : no getnetbyaddr, so pick harmless default | |
18713 | netdb_net_type='long' | |
18714 | ;; | |
18715 | esac | |
18716 | fi | |
18717 | : locate the preferred pager for this system | |
d604bb53 | 18718 | fn=f/ |
b4eb6b3d JH |
18719 | case "$pager" in |
18720 | '') | |
18721 | dflt='' | |
18722 | case "$pg" in | |
18723 | /*) dflt=$pg;; | |
18724 | [a-zA-Z]:/*) dflt=$pg;; | |
18725 | esac | |
18726 | case "$more" in | |
18727 | /*) dflt=$more;; | |
18728 | [a-zA-Z]:/*) dflt=$more;; | |
18729 | esac | |
18730 | case "$less" in | |
18731 | /*) dflt=$less;; | |
18732 | [a-zA-Z]:/*) dflt=$less;; | |
18733 | esac | |
18734 | case "$dflt" in | |
18735 | '') dflt=/usr/ucb/more;; | |
18736 | esac | |
18737 | ;; | |
d604bb53 JH |
18738 | *) dflt="$pager" |
18739 | : Instruct ./getfile to trust the hinted or previous pager value, | |
18740 | : even if it does not begin with a slash. For example, on os2, | |
18741 | : pager might be cmd /c more. See comments in UU/getfile. | |
18742 | fn="f/($pager)" | |
18743 | ;; | |
b4eb6b3d JH |
18744 | esac |
18745 | echo " " | |
b4eb6b3d JH |
18746 | rp='What pager is used on your system?' |
18747 | . ./getfile | |
18748 | pager="$ans" | |
18749 | ||
18750 | : see what type pids are declared as in the kernel | |
18751 | rp="What is the type of process ids on this system?" | |
18752 | set pid_t pidtype int stdio.h sys/types.h | |
18753 | eval $typedef_ask | |
18754 | ||
b4eb6b3d JH |
18755 | : see if ar generates random libraries by itself |
18756 | echo " " | |
18757 | echo "Checking how to generate random libraries on your machine..." >&4 | |
18758 | echo 'int bar1() { return bar2(); }' > bar1.c | |
18759 | echo 'int bar2() { return 2; }' > bar2.c | |
5a29c6bc JH |
18760 | $cat > foo.c <<EOP |
18761 | #$i_stdlib I_STDLIB | |
18762 | #ifdef I_STDLIB | |
18763 | #include <stdlib.h> | |
18764 | #endif | |
b4eb6b3d JH |
18765 | int main() { printf("%d\n", bar1()); exit(0); } |
18766 | EOP | |
18767 | $cc $ccflags -c bar1.c >/dev/null 2>&1 | |
18768 | $cc $ccflags -c bar2.c >/dev/null 2>&1 | |
18769 | $cc $ccflags -c foo.c >/dev/null 2>&1 | |
18770 | $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1 | |
7a282f6d | 18771 | if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && |
5440bc8e | 18772 | $run ./foobar >/dev/null 2>&1; then |
b4eb6b3d JH |
18773 | echo "$ar appears to generate random libraries itself." |
18774 | orderlib=false | |
18775 | ranlib=":" | |
18776 | elif $ar ts bar$_a >/dev/null 2>&1 && | |
7a282f6d | 18777 | $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 && |
5440bc8e | 18778 | $run ./foobar >/dev/null 2>&1; then |
b4eb6b3d JH |
18779 | echo "a table of contents needs to be added with '$ar ts'." |
18780 | orderlib=false | |
18781 | ranlib="$ar ts" | |
18782 | else | |
18783 | case "$ranlib" in | |
18784 | :) ranlib='';; | |
18785 | '') | |
18786 | ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin` | |
18787 | $test -f $ranlib || ranlib='' | |
18788 | ;; | |
18789 | esac | |
18790 | if $test -n "$ranlib"; then | |
18791 | echo "your system has '$ranlib'; we'll use that." | |
18792 | orderlib=false | |
18793 | else | |
18794 | echo "your system doesn't seem to support random libraries" | |
18795 | echo "so we'll use lorder and tsort to order the libraries." | |
18796 | orderlib=true | |
18797 | ranlib=":" | |
18798 | fi | |
18799 | fi | |
18800 | $rm -f foo* bar* | |
18801 | ||
18802 | : check for type of arguments to select. | |
18803 | case "$selecttype" in | |
18804 | '') case "$d_select" in | |
18805 | $define) | |
18806 | echo " " | |
18807 | $cat <<EOM | |
18808 | Checking to see what type of arguments are accepted by select(). | |
18809 | EOM | |
18810 | hdrs="$define sys/types.h | |
18811 | $i_systime sys/time.h | |
18812 | $i_sysselct sys/select.h | |
18813 | $d_socket sys/socket.h" | |
18814 | : The first arg can be int, unsigned, or size_t | |
18815 | : The last arg may or may not be 'const' | |
18816 | val='' | |
18817 | : void pointer has been seen but using that | |
18818 | : breaks the selectminbits test | |
18819 | for xxx in 'fd_set *' 'int *'; do | |
18820 | for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do | |
18821 | for tmo in 'struct timeval *' 'const struct timeval *'; do | |
18822 | case "$val" in | |
18823 | '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));" | |
18824 | if ./protochk "$try" $hdrs; then | |
18825 | echo "Your system accepts $xxx." | |
18826 | val="$xxx" | |
18827 | fi | |
18828 | ;; | |
18829 | esac | |
18830 | done | |
18831 | done | |
18832 | done | |
18833 | case "$val" in | |
18834 | '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?' | |
18835 | case "$d_fd_set" in | |
18836 | $define) dflt="fd_set *" ;; | |
18837 | *) dflt="int *" ;; | |
18838 | esac | |
18839 | . ./myread | |
18840 | val=$ans | |
18841 | ;; | |
18842 | esac | |
18843 | selecttype="$val" | |
18844 | ;; | |
18845 | *) : no select, so pick a harmless default | |
18846 | selecttype='int *' | |
18847 | ;; | |
18848 | esac | |
18849 | ;; | |
18850 | esac | |
18851 | ||
18852 | : check for the select 'width' | |
18853 | case "$selectminbits" in | |
5a29c6bc JH |
18854 | '') safebits=`expr $ptrsize \* 8` |
18855 | case "$d_select" in | |
b4eb6b3d JH |
18856 | $define) |
18857 | $cat <<EOM | |
18858 | ||
18859 | Checking to see on how many bits at a time your select() operates... | |
18860 | EOM | |
18861 | $cat >try.c <<EOCP | |
18862 | #include <sys/types.h> | |
18863 | #$i_time I_TIME | |
18864 | #$i_systime I_SYS_TIME | |
18865 | #$i_systimek I_SYS_TIME_KERNEL | |
18866 | #ifdef I_TIME | |
18867 | # include <time.h> | |
18868 | #endif | |
18869 | #ifdef I_SYS_TIME | |
18870 | # ifdef I_SYS_TIME_KERNEL | |
18871 | # define KERNEL | |
18872 | # endif | |
18873 | # include <sys/time.h> | |
18874 | # ifdef I_SYS_TIME_KERNEL | |
18875 | # undef KERNEL | |
18876 | # endif | |
18877 | #endif | |
18878 | #$i_sysselct I_SYS_SELECT | |
18879 | #ifdef I_SYS_SELECT | |
18880 | #include <sys/select.h> | |
18881 | #endif | |
18882 | #$d_socket HAS_SOCKET | |
18883 | #ifdef HAS_SOCKET | |
18884 | # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
18885 | #endif | |
18886 | #include <stdio.h> | |
5ed858ef JH |
18887 | #$i_stdlib I_STDLIB |
18888 | #ifdef I_STDLIB | |
18889 | #include <stdlib.h> | |
18890 | #endif | |
b4eb6b3d JH |
18891 | $selecttype b; |
18892 | #define S sizeof(*(b)) | |
18893 | #define MINBITS 64 | |
18894 | #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) | |
18895 | #define NBITS (NBYTES * 8) | |
18896 | int main() { | |
5a29c6bc | 18897 | char *s = malloc(NBYTES); |
b4eb6b3d JH |
18898 | struct timeval t; |
18899 | int i; | |
18900 | FILE* fp; | |
18901 | int fd; | |
18902 | ||
5a29c6bc JH |
18903 | if (!s) |
18904 | exit(1); | |
b4eb6b3d JH |
18905 | fclose(stdin); |
18906 | fp = fopen("try.c", "r"); | |
18907 | if (fp == 0) | |
5a29c6bc | 18908 | exit(2); |
b4eb6b3d JH |
18909 | fd = fileno(fp); |
18910 | if (fd < 0) | |
5a29c6bc | 18911 | exit(3); |
b4eb6b3d JH |
18912 | b = ($selecttype)s; |
18913 | for (i = 0; i < NBITS; i++) | |
18914 | FD_SET(i, b); | |
18915 | t.tv_sec = 0; | |
18916 | t.tv_usec = 0; | |
18917 | select(fd + 1, b, 0, 0, &t); | |
18918 | for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--); | |
5a29c6bc | 18919 | free(s); |
b4eb6b3d JH |
18920 | printf("%d\n", i + 1); |
18921 | return 0; | |
18922 | } | |
18923 | EOCP | |
18924 | set try | |
18925 | if eval $compile_ok; then | |
5440bc8e | 18926 | selectminbits=`$run ./try` |
b4eb6b3d JH |
18927 | case "$selectminbits" in |
18928 | '') cat >&4 <<EOM | |
18929 | Cannot figure out on how many bits at a time your select() operates. | |
5a29c6bc | 18930 | I'll play safe and guess it is $safebits bits. |
b4eb6b3d | 18931 | EOM |
5a29c6bc JH |
18932 | selectminbits=$safebits |
18933 | bits="$safebits bits" | |
b4eb6b3d JH |
18934 | ;; |
18935 | 1) bits="1 bit" ;; | |
18936 | *) bits="$selectminbits bits" ;; | |
18937 | esac | |
18938 | echo "Your select() operates on $bits at a time." >&4 | |
18939 | else | |
18940 | rp='What is the minimum number of bits your select() operates on?' | |
18941 | case "$byteorder" in | |
5a29c6bc JH |
18942 | 12345678) dflt=64 ;; |
18943 | 1234) dflt=32 ;; | |
b4eb6b3d JH |
18944 | *) dflt=1 ;; |
18945 | esac | |
18946 | . ./myread | |
18947 | val=$ans | |
18948 | selectminbits="$val" | |
18949 | fi | |
18950 | $rm -f try.* try | |
18951 | ;; | |
18952 | *) : no select, so pick a harmless default | |
5a29c6bc | 18953 | selectminbits=$safebits |
b4eb6b3d JH |
18954 | ;; |
18955 | esac | |
18956 | ;; | |
18957 | esac | |
18958 | ||
18959 | : Trace out the files included by signal.h, then look for SIGxxx names. | |
18960 | : Remove SIGARRAYSIZE used by HPUX. | |
18961 | : Remove SIGSTKSIZE used by Linux. | |
18962 | : Remove SIGSTKSZ used by Posix. | |
18963 | : Remove SIGTYP void lines used by OS2. | |
18964 | : Some cpps, like os390, dont give the file name anywhere | |
18965 | if [ "X$fieldn" = X ]; then | |
18966 | : Just make some guesses. We check them later. | |
18967 | xxx='/usr/include/signal.h /usr/include/sys/signal.h' | |
18968 | else | |
18969 | xxx=`echo '#include <signal.h>' | | |
18970 | $cppstdin $cppminus $cppflags 2>/dev/null | | |
18971 | $grep '^[ ]*#.*include' | | |
a938a3bb | 18972 | $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq` |
b4eb6b3d JH |
18973 | fi |
18974 | : Check this list of files to be sure we have parsed the cpp output ok. | |
18975 | : This will also avoid potentially non-existent files, such | |
18976 | : as ../foo/bar.h | |
18977 | xxxfiles='' | |
18978 | for xx in $xxx /dev/null ; do | |
18979 | $test -f "$xx" && xxxfiles="$xxxfiles $xx" | |
18980 | done | |
18981 | : If we have found no files, at least try signal.h | |
18982 | case "$xxxfiles" in | |
18983 | '') xxxfiles=`./findhdr signal.h` ;; | |
18984 | esac | |
18985 | xxx=`awk ' | |
18986 | $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ { | |
18987 | print substr($2, 4, 20) | |
18988 | } | |
18989 | $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { | |
18990 | print substr($3, 4, 20) | |
18991 | }' $xxxfiles` | |
18992 | : Append some common names just in case the awk scan failed. | |
18993 | xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE" | |
18994 | xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE" | |
18995 | xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP" | |
18996 | xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2" | |
18997 | xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ" | |
18998 | ||
18999 | : generate a few handy files for later | |
5a29c6bc | 19000 | $cat > signal.c <<EOCP |
b4eb6b3d JH |
19001 | #include <sys/types.h> |
19002 | #include <signal.h> | |
5a29c6bc JH |
19003 | #$i_stdlib I_STDLIB |
19004 | #ifdef I_STDLIB | |
19005 | #include <stdlib.h> | |
19006 | #endif | |
b4eb6b3d JH |
19007 | #include <stdio.h> |
19008 | int main() { | |
19009 | ||
19010 | /* Strange style to avoid deeply-nested #if/#else/#endif */ | |
19011 | #ifndef NSIG | |
19012 | # ifdef _NSIG | |
19013 | # define NSIG (_NSIG) | |
19014 | # endif | |
19015 | #endif | |
19016 | ||
19017 | #ifndef NSIG | |
19018 | # ifdef SIGMAX | |
19019 | # define NSIG (SIGMAX+1) | |
19020 | # endif | |
19021 | #endif | |
19022 | ||
19023 | #ifndef NSIG | |
19024 | # ifdef SIG_MAX | |
19025 | # define NSIG (SIG_MAX+1) | |
19026 | # endif | |
19027 | #endif | |
19028 | ||
19029 | #ifndef NSIG | |
19030 | # ifdef MAXSIG | |
19031 | # define NSIG (MAXSIG+1) | |
19032 | # endif | |
19033 | #endif | |
19034 | ||
19035 | #ifndef NSIG | |
19036 | # ifdef MAX_SIG | |
19037 | # define NSIG (MAX_SIG+1) | |
19038 | # endif | |
19039 | #endif | |
19040 | ||
19041 | #ifndef NSIG | |
19042 | # ifdef SIGARRAYSIZE | |
19043 | # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ | |
19044 | # endif | |
19045 | #endif | |
19046 | ||
19047 | #ifndef NSIG | |
19048 | # ifdef _sys_nsig | |
19049 | # define NSIG (_sys_nsig) /* Solaris 2.5 */ | |
19050 | # endif | |
19051 | #endif | |
19052 | ||
19053 | /* Default to some arbitrary number that's big enough to get most | |
19054 | of the common signals. | |
19055 | */ | |
19056 | #ifndef NSIG | |
19057 | # define NSIG 50 | |
19058 | #endif | |
19059 | ||
19060 | printf("NSIG %d\n", NSIG); | |
19061 | ||
19062 | #ifndef JUST_NSIG | |
19063 | ||
19064 | EOCP | |
19065 | ||
19066 | echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk ' | |
19067 | { | |
19068 | printf "#ifdef SIG"; printf $1; printf "\n" | |
65197d93 | 19069 | printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; |
b4eb6b3d JH |
19070 | printf $1; printf ");\n" |
19071 | printf "#endif\n" | |
19072 | } | |
19073 | END { | |
19074 | printf "#endif /* JUST_NSIG */\n"; | |
19075 | printf "exit(0);\n}\n"; | |
19076 | } | |
19077 | ' >>signal.c | |
19078 | $cat >signal.awk <<'EOP' | |
19079 | BEGIN { ndups = 0 } | |
65197d93 | 19080 | $1 ~ /^NSIG$/ { nsig = $2 } |
582e5fa1 | 19081 | ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) { |
65197d93 JH |
19082 | if ($2 > maxsig) { maxsig = $2 } |
19083 | if (sig_name[$2]) { | |
19084 | dup_name[ndups] = $1 | |
19085 | dup_num[ndups] = $2 | |
b4eb6b3d JH |
19086 | ndups++ |
19087 | } | |
19088 | else { | |
65197d93 JH |
19089 | sig_name[$2] = $1 |
19090 | sig_num[$2] = $2 | |
b4eb6b3d JH |
19091 | } |
19092 | } | |
19093 | END { | |
19094 | if (nsig == 0) { | |
19095 | nsig = maxsig + 1 | |
19096 | } | |
19097 | printf("NSIG %d\n", nsig); | |
19098 | for (n = 1; n < nsig; n++) { | |
19099 | if (sig_name[n]) { | |
19100 | printf("%s %d\n", sig_name[n], sig_num[n]) | |
19101 | } | |
19102 | else { | |
19103 | printf("NUM%d %d\n", n, n) | |
19104 | } | |
19105 | } | |
19106 | for (n = 0; n < ndups; n++) { | |
19107 | printf("%s %d\n", dup_name[n], dup_num[n]) | |
19108 | } | |
19109 | } | |
19110 | EOP | |
19111 | $cat >signal_cmd <<EOS | |
19112 | $startsh | |
19113 | if $test -s signal.lst; then | |
19114 | echo "Using your existing signal.lst file" | |
19115 | exit 0 | |
19116 | fi | |
19117 | xxx="$xxx" | |
19118 | EOS | |
19119 | $cat >>signal_cmd <<'EOS' | |
19120 | ||
19121 | set signal | |
19122 | if eval $compile_ok; then | |
1eb9ad5b | 19123 | $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst |
b4eb6b3d JH |
19124 | else |
19125 | echo "(I can't seem be able to compile the whole test program)" >&4 | |
19126 | echo "(I'll try it in little pieces.)" >&4 | |
19127 | set signal -DJUST_NSIG | |
19128 | if eval $compile_ok; then | |
5440bc8e | 19129 | $run ./signal$_exe > signal.nsg |
b4eb6b3d JH |
19130 | $cat signal.nsg |
19131 | else | |
19132 | echo "I can't seem to figure out how many signals you have." >&4 | |
19133 | echo "Guessing 50." >&4 | |
19134 | echo 'NSIG 50' > signal.nsg | |
19135 | fi | |
19136 | : Now look at all the signal names, one at a time. | |
19137 | for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do | |
19138 | $cat > signal.c <<EOCP | |
19139 | #include <sys/types.h> | |
19140 | #include <signal.h> | |
19141 | #include <stdio.h> | |
19142 | int main() { | |
19143 | printf("$xx %d\n", SIG${xx}); | |
19144 | return 0; | |
19145 | } | |
19146 | EOCP | |
19147 | set signal | |
19148 | if eval $compile; then | |
19149 | echo "SIG${xx} found." | |
5440bc8e | 19150 | $run ./signal$_exe >> signal.ls1 |
b4eb6b3d JH |
19151 | else |
19152 | echo "SIG${xx} NOT found." | |
19153 | fi | |
19154 | done | |
19155 | if $test -s signal.ls1; then | |
19156 | $cat signal.nsg signal.ls1 | | |
65197d93 | 19157 | $sort -n | $uniq | $awk -f signal.awk >signal.lst |
b4eb6b3d JH |
19158 | fi |
19159 | ||
19160 | fi | |
19161 | if $test -s signal.lst; then | |
19162 | : | |
19163 | else | |
19164 | echo "(AAK! I can't compile the test programs -- Guessing)" >&4 | |
19165 | echo 'kill -l' >signal | |
19166 | set X `csh -f <signal` | |
19167 | $rm -f signal | |
19168 | shift | |
19169 | case $# in | |
19170 | 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; | |
19171 | esac | |
19172 | echo $@ | $tr ' ' $trnl | \ | |
19173 | $awk '{ printf "%s %d\n", $1, ++s; } | |
19174 | END { printf "NSIG %d\n", ++s }' >signal.lst | |
19175 | fi | |
19176 | $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1 | |
19177 | EOS | |
19178 | chmod a+x signal_cmd | |
19179 | $eunicefix signal_cmd | |
19180 | ||
19181 | : generate list of signal names | |
19182 | echo " " | |
19183 | case "$sig_name_init" in | |
19184 | '') doinit=yes ;; | |
19185 | *) case "$sig_num_init" in | |
19186 | ''|*,*) doinit=yes ;; | |
19187 | esac ;; | |
19188 | esac | |
19189 | case "$doinit" in | |
19190 | yes) | |
19191 | echo "Generating a list of signal names and numbers..." >&4 | |
19192 | . ./signal_cmd | |
19193 | sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst` | |
19194 | sig_name=`$awk 'BEGIN { printf "ZERO " } | |
19195 | !/^NSIG/ { printf "%s ", $1 }' signal.lst` | |
19196 | sig_num=`$awk 'BEGIN { printf "0 " } | |
19197 | !/^NSIG/ { printf "%d ", $2 }' signal.lst` | |
19198 | sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } | |
19199 | !/^NSIG/ { printf "\"%s\", ", $1 } | |
19200 | END { printf "0\n" }' signal.lst` | |
19201 | sig_num_init=`$awk 'BEGIN { printf "0, " } | |
19202 | !/^NSIG/ { printf "%d, ", $2} | |
19203 | END { printf "0\n"}' signal.lst` | |
19204 | ;; | |
19205 | esac | |
19206 | echo "The following $sig_count signals are available:" | |
19207 | echo " " | |
19208 | echo $sig_name | $awk \ | |
19209 | 'BEGIN { linelen = 0 } | |
19210 | { | |
19211 | for (i = 1; i <= NF; i++) { | |
19212 | name = "SIG" $i " " | |
19213 | linelen = linelen + length(name) | |
19214 | if (linelen > 70) { | |
19215 | printf "\n" | |
19216 | linelen = length(name) | |
19217 | } | |
19218 | printf "%s", name | |
19219 | } | |
19220 | printf "\n" | |
19221 | }' | |
76d3c696 | 19222 | sig_size=`echo $sig_name | awk '{print NF}'` |
b4eb6b3d JH |
19223 | $rm -f signal signal.c signal.awk signal.lst signal_cmd |
19224 | ||
19225 | echo " " | |
19226 | case "$sizetype" in | |
19227 | *_t) zzz="$sizetype" ;; | |
19228 | *) zzz="filesize" ;; | |
19229 | esac | |
19230 | echo "Checking the size of $zzz..." >&4 | |
19231 | cat > try.c <<EOCP | |
19232 | #include <sys/types.h> | |
19233 | #include <stdio.h> | |
5ed858ef JH |
19234 | #$i_stdlib I_STDLIB |
19235 | #ifdef I_STDLIB | |
19236 | #include <stdlib.h> | |
19237 | #endif | |
b4eb6b3d JH |
19238 | int main() { |
19239 | printf("%d\n", (int)sizeof($sizetype)); | |
19240 | exit(0); | |
19241 | } | |
19242 | EOCP | |
19243 | set try | |
19244 | if eval $compile_ok; then | |
5440bc8e | 19245 | yyy=`$run ./try` |
b4eb6b3d JH |
19246 | case "$yyy" in |
19247 | '') sizesize=4 | |
19248 | echo "(I can't execute the test program--guessing $sizesize.)" >&4 | |
19249 | ;; | |
19250 | *) sizesize=$yyy | |
19251 | echo "Your $zzz size is $sizesize bytes." | |
19252 | ;; | |
19253 | esac | |
19254 | else | |
19255 | sizesize=4 | |
19256 | echo "(I can't compile the test program--guessing $sizesize.)" >&4 | |
19257 | fi | |
19258 | ||
19259 | ||
19260 | : check for socklen_t | |
19261 | echo " " | |
19262 | echo "Checking to see if you have socklen_t..." >&4 | |
19263 | $cat >try.c <<EOCP | |
19264 | #include <sys/types.h> | |
19265 | #$d_socket HAS_SOCKET | |
19266 | #ifdef HAS_SOCKET | |
19267 | #include <sys/socket.h> | |
19268 | #endif | |
19269 | int main() { socklen_t x = 16; } | |
19270 | EOCP | |
19271 | set try | |
19272 | if eval $compile; then | |
19273 | val="$define" | |
19274 | echo "You have socklen_t." | |
19275 | else | |
19276 | val="$undef" | |
19277 | echo "You do not have socklen_t." | |
19278 | case "$sizetype" in | |
19279 | size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;; | |
19280 | esac | |
19281 | fi | |
19282 | $rm -f try try.* | |
19283 | set d_socklen_t | |
19284 | eval $setvar | |
19285 | ||
a7710f8d JH |
19286 | : see if this is a socks.h system |
19287 | set socks.h i_socks | |
19288 | eval $inhdr | |
19289 | ||
b4eb6b3d JH |
19290 | : check for type of the size argument to socket calls |
19291 | case "$d_socket" in | |
19292 | "$define") | |
19293 | $cat <<EOM | |
19294 | ||
19295 | Checking to see what type is the last argument of accept(). | |
19296 | EOM | |
b4eb6b3d JH |
19297 | yyy='' |
19298 | case "$d_socklen_t" in | |
19299 | "$define") yyy="$yyy socklen_t" | |
19300 | esac | |
19301 | yyy="$yyy $sizetype int long unsigned" | |
19302 | for xxx in $yyy; do | |
19303 | case "$socksizetype" in | |
19304 | '') try="extern int accept(int, struct sockaddr *, $xxx *);" | |
a7710f8d JH |
19305 | case "$usesocks" in |
19306 | "$define") | |
19307 | if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then | |
19308 | echo "Your system accepts '$xxx *' for the last argument of accept()." | |
19309 | socksizetype="$xxx" | |
19310 | fi | |
19311 | ;; | |
19312 | *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then | |
19313 | echo "Your system accepts '$xxx *' for the last argument of accept()." | |
19314 | socksizetype="$xxx" | |
19315 | fi | |
19316 | ;; | |
19317 | esac | |
b4eb6b3d JH |
19318 | ;; |
19319 | esac | |
19320 | done | |
19321 | : In case none of those worked, prompt the user. | |
19322 | case "$socksizetype" in | |
19323 | '') rp='What is the type for socket address structure sizes?' | |
19324 | dflt='int' | |
19325 | . ./myread | |
19326 | socksizetype=$ans | |
19327 | ;; | |
19328 | esac | |
19329 | ;; | |
19330 | *) : no sockets, so pick relatively harmless default | |
19331 | socksizetype='int' | |
19332 | ;; | |
19333 | esac | |
19334 | ||
19335 | : see what type is used for signed size_t | |
19336 | set ssize_t ssizetype int stdio.h sys/types.h | |
19337 | eval $typedef | |
19338 | dflt="$ssizetype" | |
5440bc8e | 19339 | $cat > try.c <<EOM |
b4eb6b3d | 19340 | #include <stdio.h> |
5ed858ef JH |
19341 | #$i_stdlib I_STDLIB |
19342 | #ifdef I_STDLIB | |
19343 | #include <stdlib.h> | |
19344 | #endif | |
b4eb6b3d JH |
19345 | #include <sys/types.h> |
19346 | #define Size_t $sizetype | |
19347 | #define SSize_t $dflt | |
19348 | int main() | |
19349 | { | |
19350 | if (sizeof(Size_t) == sizeof(SSize_t)) | |
19351 | printf("$dflt\n"); | |
19352 | else if (sizeof(Size_t) == sizeof(int)) | |
19353 | printf("int\n"); | |
19354 | else | |
19355 | printf("long\n"); | |
19356 | exit(0); | |
19357 | } | |
19358 | EOM | |
19359 | echo " " | |
5440bc8e JH |
19360 | set try |
19361 | if eval $compile_ok && $run ./try > /dev/null; then | |
19362 | ssizetype=`$run ./try` | |
b4eb6b3d JH |
19363 | echo "I'll be using $ssizetype for functions returning a byte count." >&4 |
19364 | else | |
19365 | $cat >&4 <<EOM | |
19366 | Help! I can't compile and run the ssize_t test program: please enlighten me! | |
19367 | (This is probably a misconfiguration in your system or libraries, and | |
19368 | you really ought to fix it. Still, I'll try anyway.) | |
19369 | ||
19370 | I need a type that is the same size as $sizetype, but is guaranteed to | |
19371 | be signed. Common values are ssize_t, int and long. | |
19372 | ||
19373 | EOM | |
19374 | rp="What signed type is the same size as $sizetype?" | |
19375 | . ./myread | |
19376 | ssizetype="$ans" | |
19377 | fi | |
5440bc8e | 19378 | $rm -f try try.* |
b4eb6b3d JH |
19379 | |
19380 | : see what type of char stdio uses. | |
19381 | echo " " | |
aa517f50 JH |
19382 | echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh |
19383 | if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then | |
b4eb6b3d JH |
19384 | echo "Your stdio uses unsigned chars." >&4 |
19385 | stdchar="unsigned char" | |
19386 | else | |
aa517f50 JH |
19387 | echo "Your stdio uses signed chars." >&4 |
19388 | stdchar="char" | |
b4eb6b3d | 19389 | fi |
aa517f50 JH |
19390 | $rm -f stdioh |
19391 | ||
19392 | ||
b4eb6b3d | 19393 | |
b4eb6b3d JH |
19394 | : see what type uids are declared as in the kernel |
19395 | echo " " | |
19396 | echo "Looking for the type for user ids returned by getuid()." | |
19397 | set uid_t uidtype xxx stdio.h sys/types.h | |
19398 | eval $typedef | |
19399 | case "$uidtype" in | |
19400 | xxx) | |
19401 | xxx=`./findhdr sys/user.h` | |
19402 | set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short | |
19403 | case $1 in | |
19404 | unsigned) dflt="$1 $2" ;; | |
19405 | *) dflt="$1" ;; | |
19406 | esac | |
19407 | ;; | |
19408 | *) dflt="$uidtype";; | |
19409 | esac | |
19410 | case "$uidtype" in | |
19411 | uid_t) echo "uid_t found." ;; | |
19412 | *) rp="What is the type for user ids returned by getuid()?" | |
19413 | . ./myread | |
19414 | uidtype="$ans" | |
19415 | ;; | |
19416 | esac | |
19417 | ||
19418 | echo " " | |
19419 | case "$uidtype" in | |
19420 | *_t) zzz="$uidtype" ;; | |
19421 | *) zzz="uid" ;; | |
19422 | esac | |
19423 | echo "Checking the size of $zzz..." >&4 | |
19424 | cat > try.c <<EOCP | |
19425 | #include <sys/types.h> | |
19426 | #include <stdio.h> | |
5ed858ef JH |
19427 | #$i_stdlib I_STDLIB |
19428 | #ifdef I_STDLIB | |
19429 | #include <stdlib.h> | |
19430 | #endif | |
b4eb6b3d JH |
19431 | int main() { |
19432 | printf("%d\n", (int)sizeof($uidtype)); | |
19433 | exit(0); | |
19434 | } | |
19435 | EOCP | |
19436 | set try | |
19437 | if eval $compile_ok; then | |
5440bc8e | 19438 | yyy=`$run ./try` |
b4eb6b3d JH |
19439 | case "$yyy" in |
19440 | '') uidsize=4 | |
19441 | echo "(I can't execute the test program--guessing $uidsize.)" >&4 | |
19442 | ;; | |
19443 | *) uidsize=$yyy | |
19444 | echo "Your $zzz is $uidsize bytes long." | |
19445 | ;; | |
19446 | esac | |
19447 | else | |
19448 | uidsize=4 | |
19449 | echo "(I can't compile the test program--guessing $uidsize.)" >&4 | |
19450 | fi | |
19451 | ||
19452 | echo " " | |
19453 | case "$uidtype" in | |
19454 | *_t) zzz="$uidtype" ;; | |
19455 | *) zzz="uid" ;; | |
19456 | esac | |
19457 | echo "Checking the sign of $zzz..." >&4 | |
19458 | cat > try.c <<EOCP | |
19459 | #include <sys/types.h> | |
19460 | #include <stdio.h> | |
19461 | int main() { | |
19462 | $uidtype foo = -1; | |
19463 | if (foo < 0) | |
19464 | printf("-1\n"); | |
19465 | else | |
19466 | printf("1\n"); | |
19467 | } | |
19468 | EOCP | |
19469 | set try | |
19470 | if eval $compile; then | |
5440bc8e | 19471 | yyy=`$run ./try` |
b4eb6b3d JH |
19472 | case "$yyy" in |
19473 | '') uidsign=1 | |
19474 | echo "(I can't execute the test program--guessing unsigned.)" >&4 | |
19475 | ;; | |
19476 | *) uidsign=$yyy | |
19477 | case "$uidsign" in | |
19478 | 1) echo "Your $zzz is unsigned." ;; | |
19479 | -1) echo "Your $zzz is signed." ;; | |
19480 | esac | |
19481 | ;; | |
19482 | esac | |
19483 | else | |
19484 | uidsign=1 | |
19485 | echo "(I can't compile the test program--guessing unsigned.)" >&4 | |
19486 | fi | |
19487 | ||
19488 | ||
19489 | ||
19490 | echo " " | |
19491 | $echo "Checking the format string to be used for uids..." >&4 | |
19492 | ||
19493 | case "$uidsign" in | |
19494 | -1) if $test X"$uidsize" = X"$ivsize"; then | |
19495 | uidformat="$ivdformat" | |
19496 | else | |
19497 | if $test X"$uidsize" = X"$longsize"; then | |
19498 | uidformat='"ld"' | |
19499 | else | |
19500 | if $test X"$uidsize" = X"$intsize"; then | |
19501 | uidformat='"d"' | |
19502 | else | |
19503 | if $test X"$uidsize" = X"$shortsize"; then | |
19504 | uidformat='"hd"' | |
19505 | fi | |
19506 | fi | |
19507 | fi | |
19508 | fi | |
19509 | ;; | |
19510 | *) if $test X"$uidsize" = X"$uvsize"; then | |
19511 | uidformat="$uvuformat" | |
19512 | else | |
19513 | if $test X"$uidsize" = X"$longsize"; then | |
19514 | uidformat='"lu"' | |
19515 | else | |
19516 | if $test X"$uidsize" = X"$intsize"; then | |
19517 | uidformat='"u"' | |
19518 | else | |
19519 | if $test X"$uidsize" = X"$shortsize"; then | |
19520 | uidformat='"hu"' | |
19521 | fi | |
19522 | fi | |
19523 | fi | |
19524 | fi | |
19525 | ;; | |
19526 | esac | |
19527 | ||
a663fd0a AT |
19528 | |
19529 | case "$usesitecustomize" in | |
19530 | $define|true|[Yy]*) | |
19531 | usesitecustomize="$define" | |
19532 | ;; | |
19533 | *) | |
19534 | usesitecustomize="$undef" | |
19535 | ;; | |
19536 | esac | |
19537 | ||
3659ebf1 JH |
19538 | : determine compiler compiler |
19539 | case "$yacc" in | |
19540 | '') | |
19541 | dflt=yacc;; | |
19542 | *) | |
19543 | dflt="$yacc";; | |
19544 | esac | |
19545 | echo " " | |
19546 | comp='yacc' | |
3c728e00 | 19547 | if $test -f "$byacc$_exe"; then |
3659ebf1 JH |
19548 | dflt="$byacc" |
19549 | comp="byacc or $comp" | |
19550 | fi | |
3c728e00 | 19551 | if $test -f "$bison$_exe"; then |
3659ebf1 JH |
19552 | comp="$comp or bison -y" |
19553 | fi | |
19554 | rp="Which compiler compiler ($comp) shall I use?" | |
19555 | . ./myread | |
19556 | yacc="$ans" | |
19557 | case "$yacc" in | |
19558 | *bis*) | |
19559 | case "$yacc" in | |
19560 | *-y*) ;; | |
19561 | *) | |
19562 | yacc="$yacc -y" | |
19563 | echo "(Adding -y option to bison to get yacc-compatible behaviour.)" | |
19564 | ;; | |
19565 | esac | |
19566 | ;; | |
19567 | esac | |
19568 | ||
758a5d79 JH |
19569 | : see if this is a fp.h system |
19570 | set fp.h i_fp | |
19571 | eval $inhdr | |
19572 | ||
19573 | : see if this is a fp_class.h system | |
19574 | set fp_class.h i_fp_class | |
19575 | eval $inhdr | |
19576 | ||
b4eb6b3d | 19577 | : see if this is a ieeefp.h system |
b5b9f165 JH |
19578 | case "$i_ieeefp" in |
19579 | '' ) set ieeefp.h i_ieeefp | |
19580 | eval $inhdr | |
19581 | ;; | |
19582 | esac | |
b4eb6b3d JH |
19583 | |
19584 | : see if this is a libutil.h system | |
19585 | set libutil.h i_libutil | |
19586 | eval $inhdr | |
19587 | ||
b4eb6b3d JH |
19588 | : see if mach cthreads are available |
19589 | if test "X$usethreads" = "X$define"; then | |
19590 | set mach/cthreads.h i_machcthr | |
19591 | eval $inhdr | |
19592 | else | |
19593 | i_machcthr="$undef" | |
19594 | fi | |
19595 | ||
19596 | ||
19597 | ||
b4eb6b3d JH |
19598 | : see if this is a mntent.h system |
19599 | set mntent.h i_mntent | |
19600 | eval $inhdr | |
19601 | ||
19602 | : see if ndbm.h is available | |
19603 | set ndbm.h t_ndbm | |
19604 | eval $inhdr | |
1c6861ad JS |
19605 | |
19606 | case "$t_ndbm" in | |
19607 | $undef) | |
19608 | # Some Linux distributions such as RedHat 7.1 put the | |
19609 | # ndbm.h header in /usr/include/gdbm/ndbm.h. | |
19610 | if $test -f /usr/include/gdbm/ndbm.h; then | |
d11b91bf | 19611 | echo '<gdbm/ndbm.h> found.' |
1c6861ad JS |
19612 | ccflags="$ccflags -I/usr/include/gdbm" |
19613 | cppflags="$cppflags -I/usr/include/gdbm" | |
19614 | t_ndbm=$define | |
19615 | fi | |
19616 | ;; | |
19617 | esac | |
19618 | ||
b4eb6b3d JH |
19619 | case "$t_ndbm" in |
19620 | $define) | |
19621 | : see if dbm_open exists | |
19622 | set dbm_open d_dbm_open | |
19623 | eval $inlibc | |
19624 | case "$d_dbm_open" in | |
19625 | $undef) | |
19626 | t_ndbm="$undef" | |
19627 | echo "We won't be including <ndbm.h>" | |
19628 | ;; | |
19629 | esac | |
19630 | ;; | |
19631 | esac | |
19632 | val="$t_ndbm" | |
19633 | set i_ndbm | |
19634 | eval $setvar | |
19635 | ||
19636 | : see if net/errno.h is available | |
19637 | val='' | |
19638 | set net/errno.h val | |
19639 | eval $inhdr | |
19640 | ||
19641 | : Unfortunately, it causes problems on some systems. Arrgh. | |
19642 | case "$val" in | |
19643 | $define) | |
19644 | cat > try.c <<'EOM' | |
19645 | #include <stdio.h> | |
19646 | #include <errno.h> | |
19647 | #include <net/errno.h> | |
19648 | int func() | |
19649 | { | |
19650 | return ENOTSOCK; | |
19651 | } | |
19652 | EOM | |
19653 | if $cc $ccflags -c try.c >/dev/null 2>&1; then | |
19654 | echo "We'll be including <net/errno.h>." >&4 | |
19655 | else | |
19656 | echo "We won't be including <net/errno.h>." >&4 | |
19657 | val="$undef" | |
19658 | fi | |
19659 | $rm -f try.* try | |
19660 | ;; | |
19661 | esac | |
19662 | set i_neterrno | |
19663 | eval $setvar | |
19664 | ||
19665 | : see if netinet/tcp.h is available | |
19666 | set netinet/tcp.h i_netinettcp | |
19667 | eval $inhdr | |
19668 | ||
19669 | : see if this is a poll.h system | |
19670 | set poll.h i_poll | |
19671 | eval $inhdr | |
19672 | ||
19673 | : see if this is a prot.h system | |
19674 | set prot.h i_prot | |
19675 | eval $inhdr | |
19676 | ||
19677 | echo " " | |
19678 | $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 | |
19679 | $cat <<'EOSH' > Cppsym.know | |
19680 | a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370 | |
19681 | AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE | |
d46c9a2d JH |
19682 | alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX |
19683 | ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b | |
19684 | BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4 | |
b4eb6b3d JH |
19685 | BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi |
19686 | bull c cadmus clipper CMU COFF COMPILER_VERSION | |
19687 | concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX | |
19688 | CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO | |
4f17444b JH |
19689 | Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD |
19690 | FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel | |
19691 | GLIBC GLIBC_MINOR | |
19692 | GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN | |
b4eb6b3d JH |
19693 | H3050R H3050RX hbullx20 hcx host_mips |
19694 | hp200 hp300 hp700 HP700 hp800 hp9000 | |
19695 | hp9000s200 hp9000s300 hp9000s400 hp9000s500 | |
19696 | hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE | |
19697 | i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 | |
d46c9a2d | 19698 | IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64 |
b4eb6b3d JH |
19699 | INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1 |
19700 | LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE | |
19701 | LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE | |
19702 | Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG | |
19703 | LONGDOUBLE LONGLONG LP64 luna luna88k Lynx | |
19704 | M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF | |
19705 | M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3 | |
19706 | M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen | |
19707 | MATH_HAS_NO_SIDE_EFFECTS | |
19708 | mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040 | |
19709 | mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin | |
19710 | mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT | |
19711 | MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola | |
19712 | mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr | |
19713 | NetBSD news1500 news1700 news1800 news1900 news3700 | |
48bcfe03 | 19714 | news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000 |
b4eb6b3d JH |
19715 | ns32016 ns32332 ns32k nsc32000 |
19716 | OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE | |
19717 | pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc | |
19718 | pc532 pdp11 PGC PIC plexus PORTAR posix | |
19719 | POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE | |
19720 | POSIX_C_SOURCE POSIX_SOURCE POWER | |
19721 | PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000 | |
d46c9a2d | 19722 | riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix |
b4eb6b3d JH |
19723 | SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE |
19724 | sony sony_news sonyrisc sparc sparclite spectrum | |
19725 | stardent stdc STDC_EXT stratos sun sun3 sun386 | |
19726 | Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5 | |
19727 | SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44 | |
19728 | SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5 | |
19729 | sysV68 sysV88 Tek4132 Tek4300 titan | |
d46c9a2d | 19730 | TM3200 TM5400 TM5600 |
b4eb6b3d JH |
19731 | tower tower32 tower32_200 tower32_600 tower32_700 |
19732 | tower32_800 tower32_850 tss | |
19733 | u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 | |
19734 | ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK | |
4f17444b JH |
19735 | unix UNIX95 UNIX99 unixpc unos |
19736 | USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64 | |
19737 | USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2 | |
19738 | USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED | |
19739 | USGr4 USGr4_2 | |
b4eb6b3d JH |
19740 | Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 |
19741 | XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED | |
19742 | XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED | |
19743 | z8000 | |
19744 | EOSH | |
19745 | # Maybe put other stuff here too. | |
19746 | cat <<EOSH >>Cppsym.know | |
19747 | $osname | |
19748 | EOSH | |
19749 | ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a | |
19750 | ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b | |
19751 | $cat Cppsym.know > Cppsym.c | |
381aa1ff | 19752 | $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know |
b4eb6b3d JH |
19753 | $rm -f Cppsym.a Cppsym.b Cppsym.c |
19754 | cat <<EOSH > Cppsym | |
19755 | $startsh | |
19756 | if $test \$# -gt 0; then | |
19757 | echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got | |
19758 | if $test -s Cppsym.got; then | |
19759 | $rm -f Cppsym.got | |
19760 | exit 0 | |
19761 | fi | |
19762 | $rm -f Cppsym.got | |
19763 | exit 1 | |
19764 | else | |
19765 | $tr " " "$trnl" | ./Cppsym.try | |
19766 | exit 0 | |
19767 | fi | |
19768 | EOSH | |
19769 | chmod +x Cppsym | |
19770 | $eunicefix Cppsym | |
19771 | cat <<EOSH > Cppsym.try | |
19772 | $startsh | |
19773 | cat <<'EOCP' > try.c | |
19774 | #include <stdio.h> | |
19775 | int main() { | |
19776 | EOCP | |
19777 | $awk \\ | |
19778 | EOSH | |
19779 | cat <<'EOSH' >> Cppsym.try | |
19780 | 'length($1) > 0 { | |
2ef53570 JH |
19781 | printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 |
19782 | printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
19783 | printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
19784 | printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
b4eb6b3d | 19785 | }' >> try.c |
2ef53570 | 19786 | echo 'return 0;}' >> try.c |
b4eb6b3d JH |
19787 | EOSH |
19788 | cat <<EOSH >> Cppsym.try | |
19789 | ccflags="$ccflags" | |
19790 | case "$osname-$gccversion" in | |
19791 | irix-) ccflags="\$ccflags -woff 1178" ;; | |
19792 | os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;; | |
19793 | esac | |
5440bc8e | 19794 | $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try |
b4eb6b3d JH |
19795 | EOSH |
19796 | chmod +x Cppsym.try | |
19797 | $eunicefix Cppsym.try | |
19798 | ./Cppsym < Cppsym.know > Cppsym.true | |
19799 | : now check the C compiler for additional symbols | |
19800 | postprocess_cc_v='' | |
19801 | case "$osname" in | |
19802 | aix) postprocess_cc_v="|$tr , ' '" ;; | |
19803 | esac | |
19804 | $cat >ccsym <<EOS | |
19805 | $startsh | |
19806 | $cat >tmp.c <<EOF | |
19807 | extern int foo; | |
19808 | EOF | |
19809 | for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\` | |
19810 | do | |
19811 | case "\$i" in | |
19812 | -D*) echo "\$i" | $sed 's/^-D//';; | |
b2a76591 | 19813 | -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';; |
b4eb6b3d JH |
19814 | esac |
19815 | done | |
19816 | $rm -f try.c | |
19817 | EOS | |
19818 | postprocess_cc_v='' | |
19819 | chmod +x ccsym | |
19820 | $eunicefix ccsym | |
19821 | ./ccsym > ccsym1.raw | |
19822 | if $test -s ccsym1.raw; then | |
19823 | $sort ccsym1.raw | $uniq >ccsym.raw | |
19824 | else | |
19825 | mv ccsym1.raw ccsym.raw | |
19826 | fi | |
19827 | ||
19828 | $awk '/\=/ { print $0; next } | |
19829 | { print $0"=1" }' ccsym.raw >ccsym.list | |
19830 | $awk '/\=/ { print $0; next } | |
19831 | { print $0"=1" }' Cppsym.true >ccsym.true | |
19832 | $comm -13 ccsym.true ccsym.list >ccsym.own | |
19833 | $comm -12 ccsym.true ccsym.list >ccsym.com | |
19834 | $comm -23 ccsym.true ccsym.list >ccsym.cpp | |
19835 | also='' | |
19836 | if $test -z ccsym.raw; then | |
19837 | echo "Your C compiler doesn't seem to define any symbols!" >&4 | |
19838 | echo " " | |
19839 | echo "However, your C preprocessor defines the following symbols:" | |
19840 | $cat Cppsym.true | |
19841 | ccsymbols='' | |
19842 | cppsymbols=`$cat Cppsym.true` | |
19843 | cppsymbols=`echo $cppsymbols` | |
19844 | cppccsymbols="$cppsymbols" | |
19845 | else | |
19846 | if $test -s ccsym.com; then | |
19847 | echo "Your C compiler and pre-processor define these symbols:" | |
19848 | $sed -e 's/\(..*\)=.*/\1/' ccsym.com | |
19849 | also='also ' | |
19850 | symbols='ones' | |
19851 | cppccsymbols=`$cat ccsym.com` | |
19852 | cppccsymbols=`echo $cppccsymbols` | |
19853 | $test "$silent" || sleep 1 | |
19854 | fi | |
19855 | if $test -s ccsym.cpp; then | |
19856 | $test "$also" && echo " " | |
19857 | echo "Your C pre-processor ${also}defines the following symbols:" | |
19858 | $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp | |
19859 | also='further ' | |
19860 | cppsymbols=`$cat ccsym.cpp` | |
19861 | cppsymbols=`echo $cppsymbols` | |
19862 | $test "$silent" || sleep 1 | |
19863 | fi | |
19864 | if $test -s ccsym.own; then | |
19865 | $test "$also" && echo " " | |
19866 | echo "Your C compiler ${also}defines the following cpp symbols:" | |
19867 | $sed -e 's/\(..*\)=1/\1/' ccsym.own | |
19868 | $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true | |
19869 | ccsymbols=`$cat ccsym.own` | |
19870 | ccsymbols=`echo $ccsymbols` | |
19871 | $test "$silent" || sleep 1 | |
19872 | fi | |
19873 | fi | |
b4eb6b3d JH |
19874 | |
19875 | : see if this is a termio system | |
19876 | val="$undef" | |
19877 | val2="$undef" | |
19878 | val3="$undef" | |
19879 | if $test `./findhdr termios.h`; then | |
19880 | set tcsetattr i_termios | |
19881 | eval $inlibc | |
19882 | val3="$i_termios" | |
19883 | fi | |
19884 | echo " " | |
19885 | case "$val3" in | |
19886 | "$define") echo "You have POSIX termios.h... good!" >&4;; | |
19887 | *) if ./Cppsym pyr; then | |
19888 | case "`/bin/universe`" in | |
19889 | ucb) if $test `./findhdr sgtty.h`; then | |
19890 | val2="$define" | |
19891 | echo "<sgtty.h> found." >&4 | |
19892 | else | |
19893 | echo "System is pyramid with BSD universe." | |
19894 | echo "<sgtty.h> not found--you could have problems." >&4 | |
19895 | fi;; | |
19896 | *) if $test `./findhdr termio.h`; then | |
19897 | val="$define" | |
19898 | echo "<termio.h> found." >&4 | |
19899 | else | |
19900 | echo "System is pyramid with USG universe." | |
19901 | echo "<termio.h> not found--you could have problems." >&4 | |
19902 | fi;; | |
19903 | esac | |
19904 | elif ./usg; then | |
19905 | if $test `./findhdr termio.h`; then | |
19906 | echo "<termio.h> found." >&4 | |
19907 | val="$define" | |
19908 | elif $test `./findhdr sgtty.h`; then | |
19909 | echo "<sgtty.h> found." >&4 | |
19910 | val2="$define" | |
19911 | else | |
19912 | echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4 | |
19913 | fi | |
19914 | else | |
19915 | if $test `./findhdr sgtty.h`; then | |
19916 | echo "<sgtty.h> found." >&4 | |
19917 | val2="$define" | |
19918 | elif $test `./findhdr termio.h`; then | |
19919 | echo "<termio.h> found." >&4 | |
19920 | val="$define" | |
19921 | else | |
19922 | echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4 | |
19923 | fi | |
19924 | fi;; | |
19925 | esac | |
19926 | set i_termio; eval $setvar | |
19927 | val=$val2; set i_sgtty; eval $setvar | |
19928 | val=$val3; set i_termios; eval $setvar | |
19929 | ||
b4eb6b3d JH |
19930 | : see if stddef is available |
19931 | set stddef.h i_stddef | |
19932 | eval $inhdr | |
923fc586 | 19933 | |
b4eb6b3d JH |
19934 | : see if this is a sunmath.h system |
19935 | set sunmath.h i_sunmath | |
19936 | eval $inhdr | |
5f80c64f | 19937 | |
b4eb6b3d JH |
19938 | : see if sys/access.h is available |
19939 | set sys/access.h i_sysaccess | |
19940 | eval $inhdr | |
19941 | ||
19942 | : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl | |
19943 | set sys/filio.h i_sysfilio | |
19944 | eval $inhdr | |
19945 | echo " " | |
19946 | if $test `./findhdr sys/ioctl.h`; then | |
19947 | val="$define" | |
19948 | echo '<sys/ioctl.h> found.' >&4 | |
19949 | else | |
19950 | val="$undef" | |
19951 | if $test $i_sysfilio = "$define"; then | |
19952 | echo '<sys/ioctl.h> NOT found.' >&4 | |
5f80c64f | 19953 | else |
b4eb6b3d JH |
19954 | $test $i_sgtty = "$define" && xxx="sgtty.h" |
19955 | $test $i_termio = "$define" && xxx="termio.h" | |
19956 | $test $i_termios = "$define" && xxx="termios.h" | |
19957 | echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4 | |
19958 | fi | |
19959 | fi | |
19960 | set i_sysioctl | |
19961 | eval $setvar | |
19962 | ||
49a78c82 JH |
19963 | : see if socket ioctl defs are in sys/sockio.h |
19964 | echo " " | |
19965 | xxx=`./findhdr sys/sockio.h` | |
19966 | if $test "$xxx"; then | |
19967 | if $contains SIOCATMARK $xxx >/dev/null 2>&1; then | |
19968 | val="$define" | |
19969 | echo "You have socket ioctls defined in <sys/sockio.h>." >&4 | |
19970 | else | |
19971 | val="$undef" | |
19972 | echo "No socket ioctls found in <sys/sockio.h>." >&4 | |
19973 | fi | |
19974 | else | |
19975 | val="$undef" | |
19976 | $cat <<EOM | |
19977 | <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>. | |
19978 | EOM | |
19979 | fi | |
19980 | set i_syssockio | |
19981 | eval $setvar | |
19982 | ||
b4eb6b3d JH |
19983 | |
19984 | : see if this is a syslog.h system | |
19985 | set syslog.h i_syslog | |
19986 | eval $inhdr | |
19987 | ||
19988 | ||
19989 | : see if this is a sys/mode.h system | |
19990 | set sys/mode.h i_sysmode | |
19991 | eval $inhdr | |
19992 | ||
19993 | : see if sys/resource.h has to be included | |
19994 | set sys/resource.h i_sysresrc | |
19995 | eval $inhdr | |
19996 | ||
19997 | : see if sys/security.h is available | |
19998 | set sys/security.h i_syssecrt | |
19999 | eval $inhdr | |
20000 | ||
20001 | : see if this is a sys/statvfs.h system | |
20002 | set sys/statvfs.h i_sysstatvfs | |
20003 | eval $inhdr | |
20004 | ||
b4eb6b3d JH |
20005 | : see if this is a sys/un.h system |
20006 | set sys/un.h i_sysun | |
20007 | eval $inhdr | |
20008 | ||
20009 | ||
20010 | : see if this is a sys/utsname.h system | |
20011 | set sys/utsname.h i_sysutsname | |
20012 | eval $inhdr | |
20013 | ||
20014 | : see if this is a syswait system | |
20015 | set sys/wait.h i_syswait | |
20016 | eval $inhdr | |
20017 | ||
20018 | : see if this is a ustat.h system | |
20019 | set ustat.h i_ustat | |
20020 | eval $inhdr | |
20021 | ||
20022 | : see if this is an utime system | |
20023 | set utime.h i_utime | |
20024 | eval $inhdr | |
20025 | ||
20026 | : see if this is a values.h system | |
20027 | set values.h i_values | |
20028 | eval $inhdr | |
20029 | ||
20030 | : see if this is a vfork system | |
20031 | case "$d_vfork" in | |
20032 | "$define") | |
20033 | set vfork.h i_vfork | |
20034 | eval $inhdr | |
20035 | ;; | |
20036 | *) | |
20037 | i_vfork="$undef" | |
20038 | ;; | |
20039 | esac | |
20040 | ||
20041 | : see if gdbm.h is available | |
20042 | set gdbm.h t_gdbm | |
20043 | eval $inhdr | |
20044 | case "$t_gdbm" in | |
20045 | $define) | |
20046 | : see if gdbm_open exists | |
20047 | set gdbm_open d_gdbm_open | |
20048 | eval $inlibc | |
20049 | case "$d_gdbm_open" in | |
20050 | $undef) | |
20051 | t_gdbm="$undef" | |
20052 | echo "We won't be including <gdbm.h>" | |
5f80c64f | 20053 | ;; |
b4eb6b3d JH |
20054 | esac |
20055 | ;; | |
20056 | esac | |
20057 | val="$t_gdbm" | |
20058 | set i_gdbm | |
20059 | eval $setvar | |
20060 | ||
20061 | echo " " | |
20062 | echo "Looking for extensions..." >&4 | |
20063 | : If we are using the old config.sh, known_extensions may contain | |
20064 | : old or inaccurate or duplicate values. | |
20065 | known_extensions='' | |
20066 | nonxs_extensions='' | |
20067 | : We do not use find because it might not be available. | |
20068 | : We do not just use MANIFEST because the user may have dropped | |
20069 | : some additional extensions into the source tree and expect them | |
20070 | : to be built. | |
20071 | ||
20072 | : Function to recursively find available extensions, ignoring DynaLoader | |
20073 | : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness | |
20074 | find_extensions=' | |
20075 | for xxx in *; do | |
20076 | case "$xxx" in | |
20077 | DynaLoader|dynaload) ;; | |
20078 | *) | |
20079 | if $test -f $xxx/$xxx.xs; then | |
20080 | known_extensions="$known_extensions $1$xxx"; | |
20081 | elif $test -f $xxx/Makefile.PL; then | |
20082 | nonxs_extensions="$nonxs_extensions $1$xxx"; | |
20083 | else | |
20084 | if $test -d $xxx -a $# -lt 10; then | |
20085 | set $1$xxx/ $*; | |
6904989c | 20086 | cd "$xxx"; |
b4eb6b3d JH |
20087 | eval $find_extensions; |
20088 | cd ..; | |
20089 | shift; | |
20090 | fi; | |
20091 | fi | |
20092 | ;; | |
20093 | esac; | |
20094 | done' | |
20095 | tdir=`pwd` | |
6904989c | 20096 | cd "$rsrc/ext" |
b4eb6b3d JH |
20097 | set X |
20098 | shift | |
20099 | eval $find_extensions | |
4e1a6d26 AD |
20100 | # Special case: Add in threads/shared since it is not picked up by the |
20101 | # recursive find above (and adding in general recursive finding breaks | |
20102 | # SDBM_File/sdbm). A.D. 10/25/2001. | |
998b396c | 20103 | known_extensions="$known_extensions threads/shared" |
b4eb6b3d JH |
20104 | set X $nonxs_extensions |
20105 | shift | |
20106 | nonxs_extensions="$*" | |
20107 | set X $known_extensions | |
20108 | shift | |
20109 | known_extensions="$*" | |
6904989c | 20110 | cd "$tdir" |
b4eb6b3d JH |
20111 | |
20112 | : Now see which are supported on this system. | |
20113 | avail_ext='' | |
20114 | for xxx in $known_extensions ; do | |
20115 | case "$xxx" in | |
20116 | DB_File|db_file) | |
20117 | case "$i_db" in | |
20118 | $define) avail_ext="$avail_ext $xxx" ;; | |
20119 | esac | |
20120 | ;; | |
20121 | GDBM_File|gdbm_fil) | |
20122 | case "$i_gdbm" in | |
20123 | $define) avail_ext="$avail_ext $xxx" ;; | |
20124 | esac | |
20125 | ;; | |
1d59c593 | 20126 | I18N/Langinfo|i18n_lan) |
4bbcc6e8 JH |
20127 | case "$i_langinfo$d_nl_langinfo" in |
20128 | $define$define) avail_ext="$avail_ext $xxx" ;; | |
20129 | esac | |
20130 | ;; | |
b4eb6b3d JH |
20131 | NDBM_File|ndbm_fil) |
20132 | case "$i_ndbm" in | |
20133 | $define) | |
20134 | case "$osname-$use64bitint" in | |
0be9fa5d | 20135 | hpux-define) |
b4eb6b3d JH |
20136 | case "$libs" in |
20137 | *-lndbm*) avail_ext="$avail_ext $xxx" ;; | |
20138 | esac | |
20139 | ;; | |
20140 | *) avail_ext="$avail_ext $xxx" ;; | |
20141 | esac | |
20142 | ;; | |
20143 | esac | |
20144 | ;; | |
20145 | ODBM_File|odbm_fil) | |
20146 | case "${i_dbm}${i_rpcsvcdbm}" in | |
20147 | *"${define}"*) | |
20148 | case "$osname-$use64bitint" in | |
0be9fa5d | 20149 | hpux-define) |
b4eb6b3d JH |
20150 | case "$libs" in |
20151 | *-ldbm*) avail_ext="$avail_ext $xxx" ;; | |
20152 | esac | |
20153 | ;; | |
20154 | *) avail_ext="$avail_ext $xxx" ;; | |
20155 | esac | |
20156 | ;; | |
20157 | esac | |
20158 | ;; | |
20159 | POSIX|posix) | |
20160 | case "$useposix" in | |
20161 | true|define|y) avail_ext="$avail_ext $xxx" ;; | |
20162 | esac | |
20163 | ;; | |
20164 | Opcode|opcode) | |
20165 | case "$useopcode" in | |
20166 | true|define|y) avail_ext="$avail_ext $xxx" ;; | |
20167 | esac | |
20168 | ;; | |
20169 | Socket|socket) | |
20170 | case "$d_socket" in | |
4a9f028c JH |
20171 | true|$define|y) |
20172 | case "$osname" in | |
20173 | beos) ;; # not unless BONE | |
20174 | *) avail_ext="$avail_ext $xxx" ;; | |
20175 | esac | |
20176 | ;; | |
b4eb6b3d JH |
20177 | esac |
20178 | ;; | |
20179 | Sys/Syslog|sys/syslog) | |
20180 | : XXX syslog requires socket | |
20181 | case "$d_socket" in | |
20182 | true|$define|y) avail_ext="$avail_ext $xxx" ;; | |
20183 | esac | |
20184 | ;; | |
20185 | Thread|thread) | |
b00ec89b AB |
20186 | case "$usethreads" in |
20187 | true|$define|y) | |
20188 | case "$useithreads" in | |
20189 | $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;; | |
20190 | esac | |
b4eb6b3d JH |
20191 | esac |
20192 | ;; | |
f9b6ed1c AD |
20193 | XS/APItest|xs/apitest) |
20194 | # This is just for testing. Skip it unless we have dynamic loading. | |
20195 | ||
20196 | case "$usedl" in | |
20197 | $define) avail_ext="$avail_ext $xxx" ;; | |
20198 | esac | |
20199 | ;; | |
20200 | XS/Typemap|xs/typemap) | |
20201 | # This is just for testing. Skip it unless we have dynamic loading. | |
20202 | case "$usedl" in | |
20203 | $define) avail_ext="$avail_ext $xxx" ;; | |
20204 | esac | |
20205 | ;; | |
7deadc5f | 20206 | threads|threads/shared) |
73e09c8f JH |
20207 | # threads and threads::shared are special cases. |
20208 | # To stop people from asking "Perl 5.8.0 was supposed | |
20209 | # to have this new fancy threads implementation but my | |
20210 | # perl doesn't have it" and from people trying to | |
20211 | # (re)install the threads module using CPAN.pm and | |
20212 | # CPAN.pm then offering to reinstall Perl 5.8.0, | |
20213 | # the threads.pm and threads/shared.pm will always be | |
20214 | # there, croaking informatively ("you need to rebuild | |
20215 | # all of Perl with threads, sorry") when threads haven't | |
20216 | # been compiled in. | |
20217 | # --jhi | |
20218 | avail_ext="$avail_ext $xxx" | |
1dca008a | 20219 | ;; |
b4eb6b3d JH |
20220 | IPC/SysV|ipc/sysv) |
20221 | : XXX Do we need a useipcsysv variable here | |
20222 | case "${d_msg}${d_sem}${d_shm}" in | |
20223 | *"${define}"*) avail_ext="$avail_ext $xxx" ;; | |
20224 | esac | |
20225 | ;; | |
20226 | *) avail_ext="$avail_ext $xxx" | |
5f80c64f JH |
20227 | ;; |
20228 | esac | |
b4eb6b3d | 20229 | done |
5f80c64f | 20230 | |
b4eb6b3d JH |
20231 | set X $avail_ext |
20232 | shift | |
20233 | avail_ext="$*" | |
5f80c64f | 20234 | |
4bedfb0f JH |
20235 | case "$onlyextensions" in |
20236 | '') ;; | |
20237 | *) keepextensions='' | |
20238 | echo "You have requested that only certains extensions be included..." >&4 | |
20239 | for i in $onlyextensions; do | |
20240 | case " $avail_ext " in | |
20241 | *" $i "*) | |
20242 | echo "Keeping extension $i." | |
20243 | keepextensions="$keepextensions $i" | |
20244 | ;; | |
20245 | *) echo "Ignoring extension $i." ;; | |
20246 | esac | |
20247 | done | |
20248 | avail_ext="$keepextensions" | |
20249 | ;; | |
20250 | esac | |
20251 | ||
20252 | case "$noextensions" in | |
20253 | '') ;; | |
20254 | *) keepextensions='' | |
20255 | echo "You have requested that certain extensions be ignored..." >&4 | |
20256 | for i in $avail_ext; do | |
67bae6b3 JH |
20257 | case " $noextensions " in |
20258 | *" $i "*) echo "Ignoring extension $i." ;; | |
4bedfb0f JH |
20259 | *) echo "Keeping extension $i."; |
20260 | keepextensions="$keepextensions $i" | |
20261 | ;; | |
20262 | esac | |
20263 | done | |
20264 | avail_ext="$keepextensions" | |
20265 | ;; | |
20266 | esac | |
20267 | ||
b4eb6b3d JH |
20268 | : Now see which nonxs extensions are supported on this system. |
20269 | : For now assume all are. | |
20270 | nonxs_ext='' | |
20271 | for xxx in $nonxs_extensions ; do | |
20272 | case "$xxx" in | |
20273 | *) nonxs_ext="$nonxs_ext $xxx" | |
20274 | ;; | |
20275 | esac | |
20276 | done | |
5f80c64f | 20277 | |
b4eb6b3d JH |
20278 | set X $nonxs_ext |
20279 | shift | |
20280 | nonxs_ext="$*" | |
20281 | ||
20282 | case $usedl in | |
20283 | $define) | |
20284 | $cat <<EOM | |
20285 | A number of extensions are supplied with $package. You may choose to | |
20286 | compile these extensions for dynamic loading (the default), compile | |
20287 | them into the $package executable (static loading), or not include | |
20288 | them at all. Answer "none" to include no extensions. | |
20289 | Note that DynaLoader is always built and need not be mentioned here. | |
5f80c64f JH |
20290 | |
20291 | EOM | |
b4eb6b3d | 20292 | case "$dynamic_ext" in |
5b7ea690 JH |
20293 | '') |
20294 | : Exclude those listed in static_ext | |
20295 | dflt='' | |
20296 | for xxx in $avail_ext; do | |
20297 | case " $static_ext " in | |
20298 | *" $xxx "*) ;; | |
20299 | *) dflt="$dflt $xxx" ;; | |
20300 | esac | |
20301 | done | |
20302 | set X $dflt | |
20303 | shift | |
20304 | dflt="$*" | |
20305 | ;; | |
b4eb6b3d JH |
20306 | *) dflt="$dynamic_ext" |
20307 | # Perhaps we are reusing an old out-of-date config.sh. | |
20308 | case "$hint" in | |
20309 | previous) | |
20310 | if test X"$dynamic_ext" != X"$avail_ext"; then | |
20311 | $cat <<EOM | |
20312 | NOTICE: Your previous config.sh list may be incorrect. | |
20313 | The extensions now available to you are | |
20314 | ${avail_ext} | |
20315 | but the default list from your previous config.sh is | |
20316 | ${dynamic_ext} | |
9c839522 | 20317 | |
b4eb6b3d JH |
20318 | EOM |
20319 | fi | |
9c839522 PM |
20320 | ;; |
20321 | esac | |
b4eb6b3d JH |
20322 | ;; |
20323 | esac | |
5f80c64f | 20324 | case "$dflt" in |
b4eb6b3d JH |
20325 | '') dflt=none;; |
20326 | esac | |
20327 | rp="What extensions do you wish to load dynamically?" | |
20328 | . ./myread | |
20329 | case "$ans" in | |
20330 | none) dynamic_ext=' ' ;; | |
20331 | *) dynamic_ext="$ans" ;; | |
5f80c64f | 20332 | esac |
5f80c64f | 20333 | |
b4eb6b3d JH |
20334 | case "$static_ext" in |
20335 | '') | |
20336 | : Exclude those already listed in dynamic linking | |
20337 | dflt='' | |
20338 | for xxx in $avail_ext; do | |
20339 | case " $dynamic_ext " in | |
20340 | *" $xxx "*) ;; | |
20341 | *) dflt="$dflt $xxx" ;; | |
20342 | esac | |
20343 | done | |
20344 | set X $dflt | |
20345 | shift | |
20346 | dflt="$*" | |
20347 | ;; | |
20348 | *) dflt="$static_ext" | |
20349 | ;; | |
20350 | esac | |
9c839522 | 20351 | |
b4eb6b3d JH |
20352 | case "$dflt" in |
20353 | '') dflt=none;; | |
20354 | esac | |
20355 | rp="What extensions do you wish to load statically?" | |
20356 | . ./myread | |
20357 | case "$ans" in | |
20358 | none) static_ext=' ' ;; | |
20359 | *) static_ext="$ans" ;; | |
20360 | esac | |
20361 | ;; | |
20362 | *) | |
20363 | $cat <<EOM | |
20364 | A number of extensions are supplied with $package. Answer "none" | |
20365 | to include no extensions. | |
20366 | Note that DynaLoader is always built and need not be mentioned here. | |
9c839522 | 20367 | |
b4eb6b3d JH |
20368 | EOM |
20369 | case "$static_ext" in | |
20370 | '') dflt="$avail_ext" ;; | |
20371 | *) dflt="$static_ext" | |
20372 | # Perhaps we are reusing an old out-of-date config.sh. | |
20373 | case "$hint" in | |
20374 | previous) | |
20375 | if test X"$static_ext" != X"$avail_ext"; then | |
20376 | $cat <<EOM | |
20377 | NOTICE: Your previous config.sh list may be incorrect. | |
20378 | The extensions now available to you are | |
20379 | ${avail_ext} | |
20380 | but the default list from your previous config.sh is | |
20381 | ${static_ext} | |
5f80c64f JH |
20382 | |
20383 | EOM | |
b4eb6b3d JH |
20384 | fi |
20385 | ;; | |
20386 | esac | |
20387 | ;; | |
20388 | esac | |
20389 | : Exclude those that are not xs extensions | |
20390 | case "$dflt" in | |
20391 | '') dflt=none;; | |
20392 | esac | |
20393 | rp="What extensions do you wish to include?" | |
20394 | . ./myread | |
20395 | case "$ans" in | |
20396 | none) static_ext=' ' ;; | |
20397 | *) static_ext="$ans" ;; | |
20398 | esac | |
20399 | ;; | |
5f80c64f | 20400 | esac |
f1f6834f AD |
20401 | # |
20402 | # Encode is a special case. If we are building Encode as a static | |
20403 | # extension, we need to explicitly list its subextensions as well. | |
20404 | # For other nested extensions, this is handled automatically by | |
20405 | # the appropriate Makefile.PL. | |
20406 | case " $static_ext " in | |
20407 | *" Encode "*) # Add the subextensions of Encode | |
20408 | cd "$rsrc/ext" | |
20409 | for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do | |
20410 | static_ext="$static_ext Encode/$xxx" | |
20411 | done | |
20412 | cd "$tdir" | |
20413 | ;; | |
20414 | esac | |
5f80c64f | 20415 | |
b4eb6b3d JH |
20416 | set X $dynamic_ext $static_ext $nonxs_ext |
20417 | shift | |
20418 | extensions="$*" | |
20419 | ||
3a067427 AD |
20420 | # Sanity check: We require an extension suitable for use with |
20421 | # AnyDBM_File, as well as Fcntl and IO. (Failure to have these | |
20422 | # should show up as failures in the test suite, but it's helpful to | |
20423 | # catch them now.) The 'extensions' list is normally sorted | |
20424 | # alphabetically, so we need to accept either | |
20425 | # DB_File ... Fcntl ... IO .... | |
20426 | # or something like | |
20427 | # Fcntl ... NDBM_File ... IO .... | |
3b46a705 JH |
20428 | case " $extensions" in |
20429 | *"_File "*" Fcntl "*" IO "*) ;; # DB_File | |
20430 | *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File | |
20431 | *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File | |
5a29c6bc JH |
20432 | *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4 |
20433 | echo "WARNING: The Perl you are building will be quite crippled." >& 4 | |
20434 | ;; | |
20435 | esac | |
20436 | ||
9c839522 PM |
20437 | : Remove libraries needed only for extensions |
20438 | : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary. | |
eedaba54 PM |
20439 | : The exception is SunOS 4.x, which needs them. |
20440 | case "${osname}X${osvers}" in | |
20441 | sunos*X4*) | |
20442 | perllibs="$libs" | |
20443 | ;; | |
20444 | *) case "$usedl" in | |
20445 | $define|true|[yY]*) | |
20446 | set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` | |
20447 | shift | |
20448 | perllibs="$*" | |
20449 | ;; | |
20450 | *) perllibs="$libs" | |
20451 | ;; | |
20452 | esac | |
20453 | ;; | |
9c839522 | 20454 | esac |
5f80c64f JH |
20455 | |
20456 | : Remove build directory name from cppstdin so it can be used from | |
20457 | : either the present location or the final installed location. | |
20458 | echo " " | |
20459 | : Get out of the UU directory to get correct path name. | |
20460 | cd .. | |
20461 | case "$cppstdin" in | |
20462 | `pwd`/cppstdin) | |
20463 | echo "Stripping down cppstdin path name" | |
20464 | cppstdin=cppstdin | |
20465 | ;; | |
20466 | esac | |
20467 | cd UU | |
20468 | ||
20469 | : end of configuration questions | |
20470 | echo " " | |
20471 | echo "End of configuration questions." | |
20472 | echo " " | |
20473 | ||
20474 | : back to where it started | |
20475 | if test -d ../UU; then | |
20476 | cd .. | |
20477 | fi | |
20478 | ||
48370efc JH |
20479 | : configuration may be patched via a 'config.arch' file |
20480 | if $test -f config.arch; then | |
20481 | echo "I see a config.arch file, loading it." | |
20482 | . ./config.arch | |
20483 | fi | |
20484 | ||
5f80c64f JH |
20485 | : configuration may be patched via a 'config.over' file |
20486 | if $test -f config.over; then | |
20487 | echo " " | |
20488 | dflt=y | |
20489 | rp='I see a config.over file. Do you wish to load it?' | |
20490 | . UU/myread | |
20491 | case "$ans" in | |
20492 | n*) echo "OK, I'll ignore it.";; | |
20493 | *) . ./config.over | |
20494 | echo "Configuration override changes have been loaded." | |
20495 | ;; | |
20496 | esac | |
20497 | fi | |
20498 | ||
20499 | : in case they want portability, strip down executable paths | |
20500 | case "$d_portable" in | |
20501 | "$define") | |
20502 | echo " " | |
20503 | echo "Stripping down executable paths..." >&4 | |
20504 | for file in $loclist $trylist; do | |
534ac15a JH |
20505 | eval temp=\$$file |
20506 | eval $file=`basename $temp` | |
5f80c64f JH |
20507 | done |
20508 | ;; | |
20509 | esac | |
20510 | ||
20511 | : create config.sh file | |
20512 | echo " " | |
20513 | echo "Creating config.sh..." >&4 | |
20514 | $spitshell <<EOT >config.sh | |
20515 | $startsh | |
20516 | # | |
20517 | # This file was produced by running the Configure script. It holds all the | |
20518 | # definitions figured out by Configure. Should you modify one of these values, | |
20519 | # do not forget to propagate your changes by running "Configure -der". You may | |
20520 | # instead choose to run each of the .SH files by yourself, or "Configure -S". | |
20521 | # | |
20522 | ||
20523 | # Package name : $package | |
20524 | # Source directory : $src | |
20525 | # Configuration time: $cf_time | |
20526 | # Configured by : $cf_by | |
20527 | # Target system : $myuname | |
20528 | ||
20529 | Author='$Author' | |
20530 | Date='$Date' | |
20531 | Header='$Header' | |
20532 | Id='$Id' | |
20533 | Locker='$Locker' | |
20534 | Log='$Log' | |
20535 | Mcc='$Mcc' | |
20536 | RCSfile='$RCSfile' | |
20537 | Revision='$Revision' | |
20538 | Source='$Source' | |
20539 | State='$State' | |
20540 | _a='$_a' | |
20541 | _exe='$_exe' | |
20542 | _o='$_o' | |
b4eb6b3d | 20543 | afs='$afs' |
a6d26a0d | 20544 | afsroot='$afsroot' |
b4eb6b3d JH |
20545 | alignbytes='$alignbytes' |
20546 | ansi2knr='$ansi2knr' | |
20547 | aphostname='$aphostname' | |
20548 | api_revision='$api_revision' | |
20549 | api_subversion='$api_subversion' | |
20550 | api_version='$api_version' | |
20551 | api_versionstring='$api_versionstring' | |
5f80c64f | 20552 | ar='$ar' |
b4eb6b3d JH |
20553 | archlib='$archlib' |
20554 | archlibexp='$archlibexp' | |
20555 | archname64='$archname64' | |
20556 | archname='$archname' | |
5f80c64f | 20557 | archobjs='$archobjs' |
10bc17b6 | 20558 | asctime_r_proto='$asctime_r_proto' |
5f80c64f | 20559 | awk='$awk' |
b4eb6b3d | 20560 | baserev='$baserev' |
5f80c64f | 20561 | bash='$bash' |
b4eb6b3d | 20562 | bin='$bin' |
b4eb6b3d | 20563 | binexp='$binexp' |
5f80c64f JH |
20564 | bison='$bison' |
20565 | byacc='$byacc' | |
b4eb6b3d | 20566 | byteorder='$byteorder' |
5f80c64f | 20567 | c='$c' |
b4eb6b3d | 20568 | castflags='$castflags' |
5f80c64f JH |
20569 | cat='$cat' |
20570 | cc='$cc' | |
20571 | cccdlflags='$cccdlflags' | |
20572 | ccdlflags='$ccdlflags' | |
20573 | ccflags='$ccflags' | |
b4eb6b3d | 20574 | ccflags_uselargefiles='$ccflags_uselargefiles' |
e723fc21 | 20575 | ccname='$ccname' |
b4eb6b3d | 20576 | ccsymbols='$ccsymbols' |
6b356c8e | 20577 | ccversion='$ccversion' |
5f80c64f | 20578 | cf_by='$cf_by' |
b4eb6b3d | 20579 | cf_email='$cf_email' |
5f80c64f | 20580 | cf_time='$cf_time' |
b4eb6b3d | 20581 | charsize='$charsize' |
5f80c64f JH |
20582 | chgrp='$chgrp' |
20583 | chmod='$chmod' | |
20584 | chown='$chown' | |
b4eb6b3d | 20585 | clocktype='$clocktype' |
5f80c64f JH |
20586 | comm='$comm' |
20587 | compress='$compress' | |
20588 | contains='$contains' | |
20589 | cp='$cp' | |
20590 | cpio='$cpio' | |
20591 | cpp='$cpp' | |
b4eb6b3d JH |
20592 | cpp_stuff='$cpp_stuff' |
20593 | cppccsymbols='$cppccsymbols' | |
5f80c64f JH |
20594 | cppflags='$cppflags' |
20595 | cpplast='$cpplast' | |
20596 | cppminus='$cppminus' | |
20597 | cpprun='$cpprun' | |
20598 | cppstdin='$cppstdin' | |
b4eb6b3d | 20599 | cppsymbols='$cppsymbols' |
10bc17b6 | 20600 | crypt_r_proto='$crypt_r_proto' |
b4eb6b3d | 20601 | cryptlib='$cryptlib' |
5f80c64f | 20602 | csh='$csh' |
10bc17b6 JH |
20603 | ctermid_r_proto='$ctermid_r_proto' |
20604 | ctime_r_proto='$ctime_r_proto' | |
b4eb6b3d JH |
20605 | d_Gconvert='$d_Gconvert' |
20606 | d_PRIEUldbl='$d_PRIEUldbl' | |
20607 | d_PRIFUldbl='$d_PRIFUldbl' | |
20608 | d_PRIGUldbl='$d_PRIGUldbl' | |
20609 | d_PRIXU64='$d_PRIXU64' | |
20610 | d_PRId64='$d_PRId64' | |
20611 | d_PRIeldbl='$d_PRIeldbl' | |
20612 | d_PRIfldbl='$d_PRIfldbl' | |
20613 | d_PRIgldbl='$d_PRIgldbl' | |
20614 | d_PRIi64='$d_PRIi64' | |
20615 | d_PRIo64='$d_PRIo64' | |
20616 | d_PRIu64='$d_PRIu64' | |
20617 | d_PRIx64='$d_PRIx64' | |
20618 | d_SCNfldbl='$d_SCNfldbl' | |
74cac757 | 20619 | d__fwalk='$d__fwalk' |
b4eb6b3d JH |
20620 | d_access='$d_access' |
20621 | d_accessx='$d_accessx' | |
5a29c6bc | 20622 | d_aintl='$d_aintl' |
b4eb6b3d JH |
20623 | d_alarm='$d_alarm' |
20624 | d_archlib='$d_archlib' | |
10bc17b6 | 20625 | d_asctime_r='$d_asctime_r' |
b4eb6b3d JH |
20626 | d_atolf='$d_atolf' |
20627 | d_atoll='$d_atoll' | |
20628 | d_attribut='$d_attribut' | |
20629 | d_bcmp='$d_bcmp' | |
20630 | d_bcopy='$d_bcopy' | |
5f80c64f | 20631 | d_bsd='$d_bsd' |
b4eb6b3d JH |
20632 | d_bsdgetpgrp='$d_bsdgetpgrp' |
20633 | d_bsdsetpgrp='$d_bsdsetpgrp' | |
20634 | d_bzero='$d_bzero' | |
20635 | d_casti32='$d_casti32' | |
20636 | d_castneg='$d_castneg' | |
20637 | d_charvspr='$d_charvspr' | |
20638 | d_chown='$d_chown' | |
20639 | d_chroot='$d_chroot' | |
20640 | d_chsize='$d_chsize' | |
758a5d79 | 20641 | d_class='$d_class' |
b4eb6b3d | 20642 | d_closedir='$d_closedir' |
4e0554ec | 20643 | d_cmsghdr_s='$d_cmsghdr_s' |
b4eb6b3d | 20644 | d_const='$d_const' |
5a29c6bc | 20645 | d_copysignl='$d_copysignl' |
b4eb6b3d | 20646 | d_crypt='$d_crypt' |
10bc17b6 | 20647 | d_crypt_r='$d_crypt_r' |
b4eb6b3d | 20648 | d_csh='$d_csh' |
10bc17b6 JH |
20649 | d_ctermid_r='$d_ctermid_r' |
20650 | d_ctime_r='$d_ctime_r' | |
b4eb6b3d JH |
20651 | d_cuserid='$d_cuserid' |
20652 | d_dbl_dig='$d_dbl_dig' | |
2ef53570 | 20653 | d_dbminitproto='$d_dbminitproto' |
b4eb6b3d | 20654 | d_difftime='$d_difftime' |
ae0e3d3b | 20655 | d_dirfd='$d_dirfd' |
b4eb6b3d JH |
20656 | d_dirnamlen='$d_dirnamlen' |
20657 | d_dlerror='$d_dlerror' | |
5f80c64f | 20658 | d_dlopen='$d_dlopen' |
b4eb6b3d JH |
20659 | d_dlsymun='$d_dlsymun' |
20660 | d_dosuid='$d_dosuid' | |
10bc17b6 | 20661 | d_drand48_r='$d_drand48_r' |
b4eb6b3d JH |
20662 | d_drand48proto='$d_drand48proto' |
20663 | d_dup2='$d_dup2' | |
20664 | d_eaccess='$d_eaccess' | |
20665 | d_endgrent='$d_endgrent' | |
10bc17b6 | 20666 | d_endgrent_r='$d_endgrent_r' |
b4eb6b3d | 20667 | d_endhent='$d_endhent' |
10bc17b6 | 20668 | d_endhostent_r='$d_endhostent_r' |
b4eb6b3d | 20669 | d_endnent='$d_endnent' |
10bc17b6 | 20670 | d_endnetent_r='$d_endnetent_r' |
b4eb6b3d | 20671 | d_endpent='$d_endpent' |
10bc17b6 | 20672 | d_endprotoent_r='$d_endprotoent_r' |
b4eb6b3d | 20673 | d_endpwent='$d_endpwent' |
10bc17b6 | 20674 | d_endpwent_r='$d_endpwent_r' |
b4eb6b3d | 20675 | d_endsent='$d_endsent' |
10bc17b6 | 20676 | d_endservent_r='$d_endservent_r' |
b4eb6b3d | 20677 | d_eofnblk='$d_eofnblk' |
5f80c64f | 20678 | d_eunice='$d_eunice' |
ff0950a8 | 20679 | d_faststdio='$d_faststdio' |
b363b713 | 20680 | d_fchdir='$d_fchdir' |
b4eb6b3d JH |
20681 | d_fchmod='$d_fchmod' |
20682 | d_fchown='$d_fchown' | |
20683 | d_fcntl='$d_fcntl' | |
9d9004a9 | 20684 | d_fcntl_can_lock='$d_fcntl_can_lock' |
b4eb6b3d JH |
20685 | d_fd_macros='$d_fd_macros' |
20686 | d_fd_set='$d_fd_set' | |
20687 | d_fds_bits='$d_fds_bits' | |
20688 | d_fgetpos='$d_fgetpos' | |
758a5d79 JH |
20689 | d_finite='$d_finite' |
20690 | d_finitel='$d_finitel' | |
b4eb6b3d JH |
20691 | d_flexfnam='$d_flexfnam' |
20692 | d_flock='$d_flock' | |
2ef53570 | 20693 | d_flockproto='$d_flockproto' |
b4eb6b3d | 20694 | d_fork='$d_fork' |
758a5d79 | 20695 | d_fp_class='$d_fp_class' |
b4eb6b3d | 20696 | d_fpathconf='$d_fpathconf' |
758a5d79 JH |
20697 | d_fpclass='$d_fpclass' |
20698 | d_fpclassify='$d_fpclassify' | |
20699 | d_fpclassl='$d_fpclassl' | |
b4eb6b3d JH |
20700 | d_fpos64_t='$d_fpos64_t' |
20701 | d_frexpl='$d_frexpl' | |
20702 | d_fs_data_s='$d_fs_data_s' | |
20703 | d_fseeko='$d_fseeko' | |
20704 | d_fsetpos='$d_fsetpos' | |
20705 | d_fstatfs='$d_fstatfs' | |
20706 | d_fstatvfs='$d_fstatvfs' | |
411ab01c | 20707 | d_fsync='$d_fsync' |
b4eb6b3d JH |
20708 | d_ftello='$d_ftello' |
20709 | d_ftime='$d_ftime' | |
20710 | d_getcwd='$d_getcwd' | |
20711 | d_getespwnam='$d_getespwnam' | |
20712 | d_getfsstat='$d_getfsstat' | |
20713 | d_getgrent='$d_getgrent' | |
10bc17b6 JH |
20714 | d_getgrent_r='$d_getgrent_r' |
20715 | d_getgrgid_r='$d_getgrgid_r' | |
20716 | d_getgrnam_r='$d_getgrnam_r' | |
b4eb6b3d JH |
20717 | d_getgrps='$d_getgrps' |
20718 | d_gethbyaddr='$d_gethbyaddr' | |
20719 | d_gethbyname='$d_gethbyname' | |
20720 | d_gethent='$d_gethent' | |
20721 | d_gethname='$d_gethname' | |
10bc17b6 JH |
20722 | d_gethostbyaddr_r='$d_gethostbyaddr_r' |
20723 | d_gethostbyname_r='$d_gethostbyname_r' | |
20724 | d_gethostent_r='$d_gethostent_r' | |
b4eb6b3d | 20725 | d_gethostprotos='$d_gethostprotos' |
4e0554ec | 20726 | d_getitimer='$d_getitimer' |
b4eb6b3d | 20727 | d_getlogin='$d_getlogin' |
10bc17b6 | 20728 | d_getlogin_r='$d_getlogin_r' |
b4eb6b3d JH |
20729 | d_getmnt='$d_getmnt' |
20730 | d_getmntent='$d_getmntent' | |
20731 | d_getnbyaddr='$d_getnbyaddr' | |
20732 | d_getnbyname='$d_getnbyname' | |
20733 | d_getnent='$d_getnent' | |
10bc17b6 JH |
20734 | d_getnetbyaddr_r='$d_getnetbyaddr_r' |
20735 | d_getnetbyname_r='$d_getnetbyname_r' | |
20736 | d_getnetent_r='$d_getnetent_r' | |
b4eb6b3d | 20737 | d_getnetprotos='$d_getnetprotos' |
0c0643d0 | 20738 | d_getpagsz='$d_getpagsz' |
b4eb6b3d JH |
20739 | d_getpbyname='$d_getpbyname' |
20740 | d_getpbynumber='$d_getpbynumber' | |
20741 | d_getpent='$d_getpent' | |
20742 | d_getpgid='$d_getpgid' | |
20743 | d_getpgrp2='$d_getpgrp2' | |
20744 | d_getpgrp='$d_getpgrp' | |
20745 | d_getppid='$d_getppid' | |
20746 | d_getprior='$d_getprior' | |
10bc17b6 JH |
20747 | d_getprotobyname_r='$d_getprotobyname_r' |
20748 | d_getprotobynumber_r='$d_getprotobynumber_r' | |
20749 | d_getprotoent_r='$d_getprotoent_r' | |
b4eb6b3d JH |
20750 | d_getprotoprotos='$d_getprotoprotos' |
20751 | d_getprpwnam='$d_getprpwnam' | |
20752 | d_getpwent='$d_getpwent' | |
10bc17b6 JH |
20753 | d_getpwent_r='$d_getpwent_r' |
20754 | d_getpwnam_r='$d_getpwnam_r' | |
20755 | d_getpwuid_r='$d_getpwuid_r' | |
b4eb6b3d JH |
20756 | d_getsbyname='$d_getsbyname' |
20757 | d_getsbyport='$d_getsbyport' | |
20758 | d_getsent='$d_getsent' | |
10bc17b6 JH |
20759 | d_getservbyname_r='$d_getservbyname_r' |
20760 | d_getservbyport_r='$d_getservbyport_r' | |
20761 | d_getservent_r='$d_getservent_r' | |
b4eb6b3d JH |
20762 | d_getservprotos='$d_getservprotos' |
20763 | d_getspnam='$d_getspnam' | |
10bc17b6 | 20764 | d_getspnam_r='$d_getspnam_r' |
b4eb6b3d | 20765 | d_gettimeod='$d_gettimeod' |
10bc17b6 | 20766 | d_gmtime_r='$d_gmtime_r' |
5f80c64f | 20767 | d_gnulibc='$d_gnulibc' |
b4eb6b3d JH |
20768 | d_grpasswd='$d_grpasswd' |
20769 | d_hasmntopt='$d_hasmntopt' | |
20770 | d_htonl='$d_htonl' | |
5a29c6bc | 20771 | d_ilogbl='$d_ilogbl' |
b4eb6b3d JH |
20772 | d_index='$d_index' |
20773 | d_inetaton='$d_inetaton' | |
20774 | d_int64_t='$d_int64_t' | |
20775 | d_isascii='$d_isascii' | |
758a5d79 JH |
20776 | d_isfinite='$d_isfinite' |
20777 | d_isinf='$d_isinf' | |
b4eb6b3d JH |
20778 | d_isnan='$d_isnan' |
20779 | d_isnanl='$d_isnanl' | |
20780 | d_killpg='$d_killpg' | |
20781 | d_lchown='$d_lchown' | |
20782 | d_ldbl_dig='$d_ldbl_dig' | |
a663fd0a | 20783 | d_libm_lib_version='$d_libm_lib_version' |
b4eb6b3d | 20784 | d_link='$d_link' |
10bc17b6 | 20785 | d_localtime_r='$d_localtime_r' |
b4eb6b3d JH |
20786 | d_locconv='$d_locconv' |
20787 | d_lockf='$d_lockf' | |
20788 | d_longdbl='$d_longdbl' | |
20789 | d_longlong='$d_longlong' | |
20790 | d_lseekproto='$d_lseekproto' | |
20791 | d_lstat='$d_lstat' | |
20792 | d_madvise='$d_madvise' | |
20793 | d_mblen='$d_mblen' | |
20794 | d_mbstowcs='$d_mbstowcs' | |
20795 | d_mbtowc='$d_mbtowc' | |
20796 | d_memchr='$d_memchr' | |
20797 | d_memcmp='$d_memcmp' | |
20798 | d_memcpy='$d_memcpy' | |
20799 | d_memmove='$d_memmove' | |
20800 | d_memset='$d_memset' | |
20801 | d_mkdir='$d_mkdir' | |
20802 | d_mkdtemp='$d_mkdtemp' | |
20803 | d_mkfifo='$d_mkfifo' | |
20804 | d_mkstemp='$d_mkstemp' | |
20805 | d_mkstemps='$d_mkstemps' | |
20806 | d_mktime='$d_mktime' | |
20807 | d_mmap='$d_mmap' | |
20808 | d_modfl='$d_modfl' | |
e67aeab1 | 20809 | d_modfl_pow32_bug='$d_modfl_pow32_bug' |
bc9a1b2c | 20810 | d_modflproto='$d_modflproto' |
b4eb6b3d JH |
20811 | d_mprotect='$d_mprotect' |
20812 | d_msg='$d_msg' | |
20813 | d_msg_ctrunc='$d_msg_ctrunc' | |
20814 | d_msg_dontroute='$d_msg_dontroute' | |
20815 | d_msg_oob='$d_msg_oob' | |
20816 | d_msg_peek='$d_msg_peek' | |
20817 | d_msg_proxy='$d_msg_proxy' | |
20818 | d_msgctl='$d_msgctl' | |
20819 | d_msgget='$d_msgget' | |
4e0554ec | 20820 | d_msghdr_s='$d_msghdr_s' |
b4eb6b3d JH |
20821 | d_msgrcv='$d_msgrcv' |
20822 | d_msgsnd='$d_msgsnd' | |
20823 | d_msync='$d_msync' | |
20824 | d_munmap='$d_munmap' | |
20825 | d_mymalloc='$d_mymalloc' | |
20826 | d_nice='$d_nice' | |
2765b840 | 20827 | d_nl_langinfo='$d_nl_langinfo' |
b4eb6b3d | 20828 | d_nv_preserves_uv='$d_nv_preserves_uv' |
b4eb6b3d JH |
20829 | d_off64_t='$d_off64_t' |
20830 | d_old_pthread_create_joinable='$d_old_pthread_create_joinable' | |
20831 | d_oldpthreads='$d_oldpthreads' | |
20832 | d_oldsock='$d_oldsock' | |
20833 | d_open3='$d_open3' | |
20834 | d_pathconf='$d_pathconf' | |
20835 | d_pause='$d_pause' | |
20836 | d_perl_otherlibdirs='$d_perl_otherlibdirs' | |
20837 | d_phostname='$d_phostname' | |
20838 | d_pipe='$d_pipe' | |
20839 | d_poll='$d_poll' | |
5f80c64f | 20840 | d_portable='$d_portable' |
c7aff470 | 20841 | d_procselfexe='$d_procselfexe' |
d6483fcc | 20842 | d_pthread_atfork='$d_pthread_atfork' |
16c773f9 | 20843 | d_pthread_attr_setscope='$d_pthread_attr_setscope' |
b4eb6b3d JH |
20844 | d_pthread_yield='$d_pthread_yield' |
20845 | d_pwage='$d_pwage' | |
20846 | d_pwchange='$d_pwchange' | |
20847 | d_pwclass='$d_pwclass' | |
20848 | d_pwcomment='$d_pwcomment' | |
20849 | d_pwexpire='$d_pwexpire' | |
20850 | d_pwgecos='$d_pwgecos' | |
20851 | d_pwpasswd='$d_pwpasswd' | |
20852 | d_pwquota='$d_pwquota' | |
20853 | d_qgcvt='$d_qgcvt' | |
20854 | d_quad='$d_quad' | |
10bc17b6 JH |
20855 | d_random_r='$d_random_r' |
20856 | d_readdir64_r='$d_readdir64_r' | |
b4eb6b3d | 20857 | d_readdir='$d_readdir' |
10bc17b6 | 20858 | d_readdir_r='$d_readdir_r' |
b4eb6b3d | 20859 | d_readlink='$d_readlink' |
4e0554ec JH |
20860 | d_readv='$d_readv' |
20861 | d_recvmsg='$d_recvmsg' | |
b4eb6b3d JH |
20862 | d_rename='$d_rename' |
20863 | d_rewinddir='$d_rewinddir' | |
20864 | d_rmdir='$d_rmdir' | |
20865 | d_safebcpy='$d_safebcpy' | |
20866 | d_safemcpy='$d_safemcpy' | |
20867 | d_sanemcmp='$d_sanemcmp' | |
ef9f17be | 20868 | d_sbrkproto='$d_sbrkproto' |
5a29c6bc | 20869 | d_scalbnl='$d_scalbnl' |
b4eb6b3d JH |
20870 | d_sched_yield='$d_sched_yield' |
20871 | d_scm_rights='$d_scm_rights' | |
20872 | d_seekdir='$d_seekdir' | |
20873 | d_select='$d_select' | |
20874 | d_sem='$d_sem' | |
20875 | d_semctl='$d_semctl' | |
20876 | d_semctl_semid_ds='$d_semctl_semid_ds' | |
20877 | d_semctl_semun='$d_semctl_semun' | |
20878 | d_semget='$d_semget' | |
20879 | d_semop='$d_semop' | |
4e0554ec | 20880 | d_sendmsg='$d_sendmsg' |
b4eb6b3d JH |
20881 | d_setegid='$d_setegid' |
20882 | d_seteuid='$d_seteuid' | |
20883 | d_setgrent='$d_setgrent' | |
10bc17b6 | 20884 | d_setgrent_r='$d_setgrent_r' |
b4eb6b3d JH |
20885 | d_setgrps='$d_setgrps' |
20886 | d_sethent='$d_sethent' | |
10bc17b6 | 20887 | d_sethostent_r='$d_sethostent_r' |
4e0554ec | 20888 | d_setitimer='$d_setitimer' |
b4eb6b3d JH |
20889 | d_setlinebuf='$d_setlinebuf' |
20890 | d_setlocale='$d_setlocale' | |
10bc17b6 | 20891 | d_setlocale_r='$d_setlocale_r' |
b4eb6b3d | 20892 | d_setnent='$d_setnent' |
10bc17b6 | 20893 | d_setnetent_r='$d_setnetent_r' |
b4eb6b3d JH |
20894 | d_setpent='$d_setpent' |
20895 | d_setpgid='$d_setpgid' | |
20896 | d_setpgrp2='$d_setpgrp2' | |
20897 | d_setpgrp='$d_setpgrp' | |
20898 | d_setprior='$d_setprior' | |
20899 | d_setproctitle='$d_setproctitle' | |
10bc17b6 | 20900 | d_setprotoent_r='$d_setprotoent_r' |
b4eb6b3d | 20901 | d_setpwent='$d_setpwent' |
10bc17b6 | 20902 | d_setpwent_r='$d_setpwent_r' |
b4eb6b3d JH |
20903 | d_setregid='$d_setregid' |
20904 | d_setresgid='$d_setresgid' | |
20905 | d_setresuid='$d_setresuid' | |
20906 | d_setreuid='$d_setreuid' | |
20907 | d_setrgid='$d_setrgid' | |
20908 | d_setruid='$d_setruid' | |
20909 | d_setsent='$d_setsent' | |
10bc17b6 | 20910 | d_setservent_r='$d_setservent_r' |
b4eb6b3d JH |
20911 | d_setsid='$d_setsid' |
20912 | d_setvbuf='$d_setvbuf' | |
20913 | d_sfio='$d_sfio' | |
20914 | d_shm='$d_shm' | |
20915 | d_shmat='$d_shmat' | |
20916 | d_shmatprototype='$d_shmatprototype' | |
20917 | d_shmctl='$d_shmctl' | |
20918 | d_shmdt='$d_shmdt' | |
20919 | d_shmget='$d_shmget' | |
20920 | d_sigaction='$d_sigaction' | |
983dbef6 | 20921 | d_sigprocmask='$d_sigprocmask' |
b4eb6b3d | 20922 | d_sigsetjmp='$d_sigsetjmp' |
49a78c82 | 20923 | d_sockatmark='$d_sockatmark' |
2ef53570 | 20924 | d_sockatmarkproto='$d_sockatmarkproto' |
b4eb6b3d JH |
20925 | d_socket='$d_socket' |
20926 | d_socklen_t='$d_socklen_t' | |
20927 | d_sockpair='$d_sockpair' | |
20928 | d_socks5_init='$d_socks5_init' | |
20929 | d_sqrtl='$d_sqrtl' | |
10bc17b6 JH |
20930 | d_srand48_r='$d_srand48_r' |
20931 | d_srandom_r='$d_srandom_r' | |
eef837ea | 20932 | d_sresgproto='$d_sresgproto' |
640374d0 | 20933 | d_sresuproto='$d_sresuproto' |
b4eb6b3d JH |
20934 | d_statblks='$d_statblks' |
20935 | d_statfs_f_flags='$d_statfs_f_flags' | |
20936 | d_statfs_s='$d_statfs_s' | |
20937 | d_statvfs='$d_statvfs' | |
20938 | d_stdio_cnt_lval='$d_stdio_cnt_lval' | |
20939 | d_stdio_ptr_lval='$d_stdio_ptr_lval' | |
a7ffa9b9 NC |
20940 | d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt' |
20941 | d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt' | |
b4eb6b3d JH |
20942 | d_stdio_stream_array='$d_stdio_stream_array' |
20943 | d_stdiobase='$d_stdiobase' | |
20944 | d_stdstdio='$d_stdstdio' | |
20945 | d_strchr='$d_strchr' | |
20946 | d_strcoll='$d_strcoll' | |
20947 | d_strctcpy='$d_strctcpy' | |
20948 | d_strerrm='$d_strerrm' | |
20949 | d_strerror='$d_strerror' | |
10bc17b6 | 20950 | d_strerror_r='$d_strerror_r' |
b3c85772 | 20951 | d_strftime='$d_strftime' |
84baed4c CB |
20952 | d_strlcat='$d_strlcat' |
20953 | d_strlcpy='$d_strlcpy' | |
b4eb6b3d JH |
20954 | d_strtod='$d_strtod' |
20955 | d_strtol='$d_strtol' | |
20956 | d_strtold='$d_strtold' | |
20957 | d_strtoll='$d_strtoll' | |
28e5dec8 | 20958 | d_strtoq='$d_strtoq' |
b4eb6b3d JH |
20959 | d_strtoul='$d_strtoul' |
20960 | d_strtoull='$d_strtoull' | |
20961 | d_strtouq='$d_strtouq' | |
20962 | d_strxfrm='$d_strxfrm' | |
20963 | d_suidsafe='$d_suidsafe' | |
20964 | d_symlink='$d_symlink' | |
20965 | d_syscall='$d_syscall' | |
2ef53570 | 20966 | d_syscallproto='$d_syscallproto' |
b4eb6b3d JH |
20967 | d_sysconf='$d_sysconf' |
20968 | d_sysernlst='$d_sysernlst' | |
20969 | d_syserrlst='$d_syserrlst' | |
20970 | d_system='$d_system' | |
20971 | d_tcgetpgrp='$d_tcgetpgrp' | |
20972 | d_tcsetpgrp='$d_tcsetpgrp' | |
20973 | d_telldir='$d_telldir' | |
20974 | d_telldirproto='$d_telldirproto' | |
20975 | d_time='$d_time' | |
20976 | d_times='$d_times' | |
14b90194 JH |
20977 | d_tm_tm_gmtoff='$d_tm_tm_gmtoff' |
20978 | d_tm_tm_zone='$d_tm_tm_zone' | |
10bc17b6 | 20979 | d_tmpnam_r='$d_tmpnam_r' |
b4eb6b3d | 20980 | d_truncate='$d_truncate' |
10bc17b6 | 20981 | d_ttyname_r='$d_ttyname_r' |
b4eb6b3d | 20982 | d_tzname='$d_tzname' |
4e0554ec JH |
20983 | d_u32align='$d_u32align' |
20984 | d_ualarm='$d_ualarm' | |
b4eb6b3d JH |
20985 | d_umask='$d_umask' |
20986 | d_uname='$d_uname' | |
20987 | d_union_semun='$d_union_semun' | |
758a5d79 | 20988 | d_unordered='$d_unordered' |
4e0554ec | 20989 | d_usleep='$d_usleep' |
2ef53570 | 20990 | d_usleepproto='$d_usleepproto' |
b4eb6b3d JH |
20991 | d_ustat='$d_ustat' |
20992 | d_vendorarch='$d_vendorarch' | |
20993 | d_vendorbin='$d_vendorbin' | |
20994 | d_vendorlib='$d_vendorlib' | |
6e1038e0 | 20995 | d_vendorscript='$d_vendorscript' |
b4eb6b3d JH |
20996 | d_vfork='$d_vfork' |
20997 | d_void_closedir='$d_void_closedir' | |
20998 | d_voidsig='$d_voidsig' | |
20999 | d_voidtty='$d_voidtty' | |
21000 | d_volatile='$d_volatile' | |
21001 | d_vprintf='$d_vprintf' | |
21002 | d_wait4='$d_wait4' | |
21003 | d_waitpid='$d_waitpid' | |
21004 | d_wcstombs='$d_wcstombs' | |
21005 | d_wctomb='$d_wctomb' | |
4e0554ec | 21006 | d_writev='$d_writev' |
5f80c64f JH |
21007 | d_xenix='$d_xenix' |
21008 | date='$date' | |
b4eb6b3d JH |
21009 | db_hashtype='$db_hashtype' |
21010 | db_prefixtype='$db_prefixtype' | |
640374d0 JH |
21011 | db_version_major='$db_version_major' |
21012 | db_version_minor='$db_version_minor' | |
21013 | db_version_patch='$db_version_patch' | |
b4eb6b3d JH |
21014 | defvoidused='$defvoidused' |
21015 | direntrytype='$direntrytype' | |
21016 | dlext='$dlext' | |
5f80c64f | 21017 | dlsrc='$dlsrc' |
b4eb6b3d JH |
21018 | doublesize='$doublesize' |
21019 | drand01='$drand01' | |
10bc17b6 | 21020 | drand48_r_proto='$drand48_r_proto' |
b4eb6b3d JH |
21021 | dynamic_ext='$dynamic_ext' |
21022 | eagain='$eagain' | |
21023 | ebcdic='$ebcdic' | |
5f80c64f JH |
21024 | echo='$echo' |
21025 | egrep='$egrep' | |
21026 | emacs='$emacs' | |
10bc17b6 JH |
21027 | endgrent_r_proto='$endgrent_r_proto' |
21028 | endhostent_r_proto='$endhostent_r_proto' | |
21029 | endnetent_r_proto='$endnetent_r_proto' | |
21030 | endprotoent_r_proto='$endprotoent_r_proto' | |
21031 | endpwent_r_proto='$endpwent_r_proto' | |
21032 | endservent_r_proto='$endservent_r_proto' | |
5f80c64f JH |
21033 | eunicefix='$eunicefix' |
21034 | exe_ext='$exe_ext' | |
21035 | expr='$expr' | |
b4eb6b3d | 21036 | extensions='$extensions' |
6fcddf3b | 21037 | extras='$extras' |
b4eb6b3d JH |
21038 | fflushNULL='$fflushNULL' |
21039 | fflushall='$fflushall' | |
5f80c64f JH |
21040 | find='$find' |
21041 | firstmakefile='$firstmakefile' | |
21042 | flex='$flex' | |
b4eb6b3d JH |
21043 | fpossize='$fpossize' |
21044 | fpostype='$fpostype' | |
21045 | freetype='$freetype' | |
5440bc8e | 21046 | from='$from' |
b4eb6b3d JH |
21047 | full_ar='$full_ar' |
21048 | full_csh='$full_csh' | |
21049 | full_sed='$full_sed' | |
2d736872 | 21050 | gccansipedantic='$gccansipedantic' |
5b463ca7 | 21051 | gccosandvers='$gccosandvers' |
5f80c64f | 21052 | gccversion='$gccversion' |
10bc17b6 JH |
21053 | getgrent_r_proto='$getgrent_r_proto' |
21054 | getgrgid_r_proto='$getgrgid_r_proto' | |
21055 | getgrnam_r_proto='$getgrnam_r_proto' | |
21056 | gethostbyaddr_r_proto='$gethostbyaddr_r_proto' | |
21057 | gethostbyname_r_proto='$gethostbyname_r_proto' | |
21058 | gethostent_r_proto='$gethostent_r_proto' | |
21059 | getlogin_r_proto='$getlogin_r_proto' | |
21060 | getnetbyaddr_r_proto='$getnetbyaddr_r_proto' | |
21061 | getnetbyname_r_proto='$getnetbyname_r_proto' | |
21062 | getnetent_r_proto='$getnetent_r_proto' | |
21063 | getprotobyname_r_proto='$getprotobyname_r_proto' | |
21064 | getprotobynumber_r_proto='$getprotobynumber_r_proto' | |
21065 | getprotoent_r_proto='$getprotoent_r_proto' | |
21066 | getpwent_r_proto='$getpwent_r_proto' | |
21067 | getpwnam_r_proto='$getpwnam_r_proto' | |
21068 | getpwuid_r_proto='$getpwuid_r_proto' | |
21069 | getservbyname_r_proto='$getservbyname_r_proto' | |
21070 | getservbyport_r_proto='$getservbyport_r_proto' | |
21071 | getservent_r_proto='$getservent_r_proto' | |
21072 | getspnam_r_proto='$getspnam_r_proto' | |
b4eb6b3d JH |
21073 | gidformat='$gidformat' |
21074 | gidsign='$gidsign' | |
21075 | gidsize='$gidsize' | |
21076 | gidtype='$gidtype' | |
5f80c64f | 21077 | glibpth='$glibpth' |
3c728e00 | 21078 | gmake='$gmake' |
10bc17b6 | 21079 | gmtime_r_proto='$gmtime_r_proto' |
5f6e0ee4 | 21080 | gnulibc_version='$gnulibc_version' |
5f80c64f | 21081 | grep='$grep' |
b4eb6b3d JH |
21082 | groupcat='$groupcat' |
21083 | groupstype='$groupstype' | |
5f80c64f | 21084 | gzip='$gzip' |
b4eb6b3d JH |
21085 | h_fcntl='$h_fcntl' |
21086 | h_sysfile='$h_sysfile' | |
5f80c64f | 21087 | hint='$hint' |
b4eb6b3d | 21088 | hostcat='$hostcat' |
6e1038e0 MB |
21089 | html1dir='$html1dir' |
21090 | html1direxp='$html1direxp' | |
21091 | html3dir='$html3dir' | |
21092 | html3direxp='$html3direxp' | |
b4eb6b3d JH |
21093 | i16size='$i16size' |
21094 | i16type='$i16type' | |
21095 | i32size='$i32size' | |
21096 | i32type='$i32type' | |
21097 | i64size='$i64size' | |
21098 | i64type='$i64type' | |
21099 | i8size='$i8size' | |
21100 | i8type='$i8type' | |
21101 | i_arpainet='$i_arpainet' | |
21102 | i_bsdioctl='$i_bsdioctl' | |
10bc17b6 | 21103 | i_crypt='$i_crypt' |
b4eb6b3d JH |
21104 | i_db='$i_db' |
21105 | i_dbm='$i_dbm' | |
21106 | i_dirent='$i_dirent' | |
5f80c64f | 21107 | i_dld='$i_dld' |
b4eb6b3d JH |
21108 | i_dlfcn='$i_dlfcn' |
21109 | i_fcntl='$i_fcntl' | |
21110 | i_float='$i_float' | |
758a5d79 JH |
21111 | i_fp='$i_fp' |
21112 | i_fp_class='$i_fp_class' | |
b4eb6b3d JH |
21113 | i_gdbm='$i_gdbm' |
21114 | i_grp='$i_grp' | |
b4eb6b3d JH |
21115 | i_ieeefp='$i_ieeefp' |
21116 | i_inttypes='$i_inttypes' | |
2765b840 | 21117 | i_langinfo='$i_langinfo' |
b4eb6b3d JH |
21118 | i_libutil='$i_libutil' |
21119 | i_limits='$i_limits' | |
21120 | i_locale='$i_locale' | |
21121 | i_machcthr='$i_machcthr' | |
21122 | i_malloc='$i_malloc' | |
21123 | i_math='$i_math' | |
21124 | i_memory='$i_memory' | |
21125 | i_mntent='$i_mntent' | |
21126 | i_ndbm='$i_ndbm' | |
21127 | i_netdb='$i_netdb' | |
21128 | i_neterrno='$i_neterrno' | |
21129 | i_netinettcp='$i_netinettcp' | |
21130 | i_niin='$i_niin' | |
21131 | i_poll='$i_poll' | |
21132 | i_prot='$i_prot' | |
21133 | i_pthread='$i_pthread' | |
21134 | i_pwd='$i_pwd' | |
21135 | i_rpcsvcdbm='$i_rpcsvcdbm' | |
21136 | i_sfio='$i_sfio' | |
21137 | i_sgtty='$i_sgtty' | |
21138 | i_shadow='$i_shadow' | |
21139 | i_socks='$i_socks' | |
21140 | i_stdarg='$i_stdarg' | |
21141 | i_stddef='$i_stddef' | |
21142 | i_stdlib='$i_stdlib' | |
21143 | i_string='$i_string' | |
21144 | i_sunmath='$i_sunmath' | |
21145 | i_sysaccess='$i_sysaccess' | |
21146 | i_sysdir='$i_sysdir' | |
21147 | i_sysfile='$i_sysfile' | |
21148 | i_sysfilio='$i_sysfilio' | |
21149 | i_sysin='$i_sysin' | |
21150 | i_sysioctl='$i_sysioctl' | |
21151 | i_syslog='$i_syslog' | |
21152 | i_sysmman='$i_sysmman' | |
21153 | i_sysmode='$i_sysmode' | |
21154 | i_sysmount='$i_sysmount' | |
21155 | i_sysndir='$i_sysndir' | |
21156 | i_sysparam='$i_sysparam' | |
21157 | i_sysresrc='$i_sysresrc' | |
21158 | i_syssecrt='$i_syssecrt' | |
21159 | i_sysselct='$i_sysselct' | |
21160 | i_syssockio='$i_syssockio' | |
21161 | i_sysstat='$i_sysstat' | |
21162 | i_sysstatfs='$i_sysstatfs' | |
21163 | i_sysstatvfs='$i_sysstatvfs' | |
21164 | i_systime='$i_systime' | |
21165 | i_systimek='$i_systimek' | |
21166 | i_systimes='$i_systimes' | |
21167 | i_systypes='$i_systypes' | |
21168 | i_sysuio='$i_sysuio' | |
21169 | i_sysun='$i_sysun' | |
21170 | i_sysutsname='$i_sysutsname' | |
21171 | i_sysvfs='$i_sysvfs' | |
21172 | i_syswait='$i_syswait' | |
21173 | i_termio='$i_termio' | |
21174 | i_termios='$i_termios' | |
21175 | i_time='$i_time' | |
21176 | i_unistd='$i_unistd' | |
21177 | i_ustat='$i_ustat' | |
21178 | i_utime='$i_utime' | |
21179 | i_values='$i_values' | |
21180 | i_varargs='$i_varargs' | |
21181 | i_varhdr='$i_varhdr' | |
21182 | i_vfork='$i_vfork' | |
5f80c64f | 21183 | ignore_versioned_solibs='$ignore_versioned_solibs' |
b4eb6b3d JH |
21184 | inc_version_list='$inc_version_list' |
21185 | inc_version_list_init='$inc_version_list_init' | |
5f80c64f JH |
21186 | incpath='$incpath' |
21187 | inews='$inews' | |
b4eb6b3d JH |
21188 | installarchlib='$installarchlib' |
21189 | installbin='$installbin' | |
6e1038e0 MB |
21190 | installhtml1dir='$installhtml1dir' |
21191 | installhtml3dir='$installhtml3dir' | |
b4eb6b3d JH |
21192 | installman1dir='$installman1dir' |
21193 | installman3dir='$installman3dir' | |
21194 | installprefix='$installprefix' | |
21195 | installprefixexp='$installprefixexp' | |
21196 | installprivlib='$installprivlib' | |
21197 | installscript='$installscript' | |
21198 | installsitearch='$installsitearch' | |
21199 | installsitebin='$installsitebin' | |
3bb95762 JH |
21200 | installsitehtml1dir='$installsitehtml1dir' |
21201 | installsitehtml3dir='$installsitehtml3dir' | |
b4eb6b3d | 21202 | installsitelib='$installsitelib' |
3bb95762 JH |
21203 | installsiteman1dir='$installsiteman1dir' |
21204 | installsiteman3dir='$installsiteman3dir' | |
6e1038e0 | 21205 | installsitescript='$installsitescript' |
b4eb6b3d JH |
21206 | installstyle='$installstyle' |
21207 | installusrbinperl='$installusrbinperl' | |
21208 | installvendorarch='$installvendorarch' | |
21209 | installvendorbin='$installvendorbin' | |
3bb95762 JH |
21210 | installvendorhtml1dir='$installvendorhtml1dir' |
21211 | installvendorhtml3dir='$installvendorhtml3dir' | |
b4eb6b3d | 21212 | installvendorlib='$installvendorlib' |
3bb95762 JH |
21213 | installvendorman1dir='$installvendorman1dir' |
21214 | installvendorman3dir='$installvendorman3dir' | |
6e1038e0 | 21215 | installvendorscript='$installvendorscript' |
b4eb6b3d | 21216 | intsize='$intsize' |
4b661809 | 21217 | issymlink='$issymlink' |
b4eb6b3d JH |
21218 | ivdformat='$ivdformat' |
21219 | ivsize='$ivsize' | |
21220 | ivtype='$ivtype' | |
21221 | known_extensions='$known_extensions' | |
5f80c64f | 21222 | ksh='$ksh' |
5f80c64f JH |
21223 | ld='$ld' |
21224 | lddlflags='$lddlflags' | |
21225 | ldflags='$ldflags' | |
b4eb6b3d JH |
21226 | ldflags_uselargefiles='$ldflags_uselargefiles' |
21227 | ldlibpthname='$ldlibpthname' | |
5f80c64f JH |
21228 | less='$less' |
21229 | lib_ext='$lib_ext' | |
21230 | libc='$libc' | |
b4eb6b3d | 21231 | libperl='$libperl' |
5f80c64f JH |
21232 | libpth='$libpth' |
21233 | libs='$libs' | |
43999f95 JH |
21234 | libsdirs='$libsdirs' |
21235 | libsfiles='$libsfiles' | |
21236 | libsfound='$libsfound' | |
13b3f787 | 21237 | libspath='$libspath' |
5f80c64f | 21238 | libswanted='$libswanted' |
b4eb6b3d | 21239 | libswanted_uselargefiles='$libswanted_uselargefiles' |
5f80c64f JH |
21240 | line='$line' |
21241 | lint='$lint' | |
21242 | lkflags='$lkflags' | |
21243 | ln='$ln' | |
21244 | lns='$lns' | |
10bc17b6 | 21245 | localtime_r_proto='$localtime_r_proto' |
5f80c64f JH |
21246 | locincpth='$locincpth' |
21247 | loclibpth='$loclibpth' | |
b4eb6b3d JH |
21248 | longdblsize='$longdblsize' |
21249 | longlongsize='$longlongsize' | |
21250 | longsize='$longsize' | |
5f80c64f JH |
21251 | lp='$lp' |
21252 | lpr='$lpr' | |
21253 | ls='$ls' | |
b4eb6b3d JH |
21254 | lseeksize='$lseeksize' |
21255 | lseektype='$lseektype' | |
5f80c64f JH |
21256 | mail='$mail' |
21257 | mailx='$mailx' | |
21258 | make='$make' | |
21259 | make_set_make='$make_set_make' | |
b4eb6b3d JH |
21260 | mallocobj='$mallocobj' |
21261 | mallocsrc='$mallocsrc' | |
21262 | malloctype='$malloctype' | |
21263 | man1dir='$man1dir' | |
21264 | man1direxp='$man1direxp' | |
21265 | man1ext='$man1ext' | |
21266 | man3dir='$man3dir' | |
21267 | man3direxp='$man3direxp' | |
21268 | man3ext='$man3ext' | |
5f80c64f | 21269 | mips_type='$mips_type' |
bd43df42 | 21270 | mistrustnm='$mistrustnm' |
5f80c64f | 21271 | mkdir='$mkdir' |
b4eb6b3d JH |
21272 | mmaptype='$mmaptype' |
21273 | modetype='$modetype' | |
5f80c64f | 21274 | more='$more' |
b4eb6b3d | 21275 | multiarch='$multiarch' |
5f80c64f | 21276 | mv='$mv' |
b4eb6b3d JH |
21277 | myarchname='$myarchname' |
21278 | mydomain='$mydomain' | |
21279 | myhostname='$myhostname' | |
5f80c64f JH |
21280 | myuname='$myuname' |
21281 | n='$n' | |
2cc61e15 | 21282 | need_va_copy='$need_va_copy' |
b4eb6b3d JH |
21283 | netdb_hlen_type='$netdb_hlen_type' |
21284 | netdb_host_type='$netdb_host_type' | |
21285 | netdb_name_type='$netdb_name_type' | |
21286 | netdb_net_type='$netdb_net_type' | |
5f80c64f JH |
21287 | nm='$nm' |
21288 | nm_opt='$nm_opt' | |
21289 | nm_so_opt='$nm_so_opt' | |
b4eb6b3d | 21290 | nonxs_ext='$nonxs_ext' |
5f80c64f | 21291 | nroff='$nroff' |
b4eb6b3d JH |
21292 | nvEUformat='$nvEUformat' |
21293 | nvFUformat='$nvFUformat' | |
21294 | nvGUformat='$nvGUformat' | |
53133ed1 | 21295 | nv_preserves_uv_bits='$nv_preserves_uv_bits' |
b4eb6b3d JH |
21296 | nveformat='$nveformat' |
21297 | nvfformat='$nvfformat' | |
21298 | nvgformat='$nvgformat' | |
21299 | nvsize='$nvsize' | |
21300 | nvtype='$nvtype' | |
21301 | o_nonblock='$o_nonblock' | |
5f80c64f | 21302 | obj_ext='$obj_ext' |
b4eb6b3d | 21303 | old_pthread_create_joinable='$old_pthread_create_joinable' |
5f80c64f | 21304 | optimize='$optimize' |
b4eb6b3d | 21305 | orderlib='$orderlib' |
5f80c64f JH |
21306 | osname='$osname' |
21307 | osvers='$osvers' | |
b4eb6b3d | 21308 | otherlibdirs='$otherlibdirs' |
5f80c64f | 21309 | package='$package' |
b4eb6b3d JH |
21310 | pager='$pager' |
21311 | passcat='$passcat' | |
21312 | patchlevel='$patchlevel' | |
5f80c64f | 21313 | path_sep='$path_sep' |
b4eb6b3d | 21314 | perl5='$perl5' |
5f80c64f | 21315 | perl='$perl' |
151e6568 | 21316 | perl_patchlevel='$perl_patchlevel' |
b4eb6b3d | 21317 | perladmin='$perladmin' |
9c839522 | 21318 | perllibs='$perllibs' |
b4eb6b3d | 21319 | perlpath='$perlpath' |
5f80c64f | 21320 | pg='$pg' |
b4eb6b3d JH |
21321 | phostname='$phostname' |
21322 | pidtype='$pidtype' | |
5f80c64f JH |
21323 | plibpth='$plibpth' |
21324 | pmake='$pmake' | |
21325 | pr='$pr' | |
b4eb6b3d JH |
21326 | prefix='$prefix' |
21327 | prefixexp='$prefixexp' | |
21328 | privlib='$privlib' | |
21329 | privlibexp='$privlibexp' | |
f24dbf84 | 21330 | procselfexe='$procselfexe' |
b4eb6b3d JH |
21331 | prototype='$prototype' |
21332 | ptrsize='$ptrsize' | |
21333 | quadkind='$quadkind' | |
21334 | quadtype='$quadtype' | |
21335 | randbits='$randbits' | |
21336 | randfunc='$randfunc' | |
10bc17b6 | 21337 | random_r_proto='$random_r_proto' |
b4eb6b3d JH |
21338 | randseedtype='$randseedtype' |
21339 | ranlib='$ranlib' | |
21340 | rd_nodata='$rd_nodata' | |
10bc17b6 JH |
21341 | readdir64_r_proto='$readdir64_r_proto' |
21342 | readdir_r_proto='$readdir_r_proto' | |
b4eb6b3d | 21343 | revision='$revision' |
5f80c64f JH |
21344 | rm='$rm' |
21345 | rmail='$rmail' | |
5440bc8e | 21346 | run='$run' |
5f80c64f | 21347 | runnm='$runnm' |
b4eb6b3d JH |
21348 | sPRIEUldbl='$sPRIEUldbl' |
21349 | sPRIFUldbl='$sPRIFUldbl' | |
21350 | sPRIGUldbl='$sPRIGUldbl' | |
21351 | sPRIXU64='$sPRIXU64' | |
21352 | sPRId64='$sPRId64' | |
21353 | sPRIeldbl='$sPRIeldbl' | |
21354 | sPRIfldbl='$sPRIfldbl' | |
21355 | sPRIgldbl='$sPRIgldbl' | |
21356 | sPRIi64='$sPRIi64' | |
21357 | sPRIo64='$sPRIo64' | |
21358 | sPRIu64='$sPRIu64' | |
21359 | sPRIx64='$sPRIx64' | |
21360 | sSCNfldbl='$sSCNfldbl' | |
21361 | sched_yield='$sched_yield' | |
21362 | scriptdir='$scriptdir' | |
21363 | scriptdirexp='$scriptdirexp' | |
5f80c64f | 21364 | sed='$sed' |
b4eb6b3d JH |
21365 | seedfunc='$seedfunc' |
21366 | selectminbits='$selectminbits' | |
21367 | selecttype='$selecttype' | |
5f80c64f | 21368 | sendmail='$sendmail' |
10bc17b6 JH |
21369 | setgrent_r_proto='$setgrent_r_proto' |
21370 | sethostent_r_proto='$sethostent_r_proto' | |
21371 | setlocale_r_proto='$setlocale_r_proto' | |
21372 | setnetent_r_proto='$setnetent_r_proto' | |
21373 | setprotoent_r_proto='$setprotoent_r_proto' | |
21374 | setpwent_r_proto='$setpwent_r_proto' | |
21375 | setservent_r_proto='$setservent_r_proto' | |
5f80c64f JH |
21376 | sh='$sh' |
21377 | shar='$shar' | |
21378 | sharpbang='$sharpbang' | |
b4eb6b3d JH |
21379 | shmattype='$shmattype' |
21380 | shortsize='$shortsize' | |
21381 | shrpenv='$shrpenv' | |
5f80c64f | 21382 | shsharp='$shsharp' |
b4eb6b3d JH |
21383 | sig_count='$sig_count' |
21384 | sig_name='$sig_name' | |
21385 | sig_name_init='$sig_name_init' | |
21386 | sig_num='$sig_num' | |
21387 | sig_num_init='$sig_num_init' | |
76d3c696 | 21388 | sig_size='$sig_size' |
b4eb6b3d JH |
21389 | signal_t='$signal_t' |
21390 | sitearch='$sitearch' | |
21391 | sitearchexp='$sitearchexp' | |
21392 | sitebin='$sitebin' | |
21393 | sitebinexp='$sitebinexp' | |
3bb95762 JH |
21394 | sitehtml1dir='$sitehtml1dir' |
21395 | sitehtml1direxp='$sitehtml1direxp' | |
21396 | sitehtml3dir='$sitehtml3dir' | |
21397 | sitehtml3direxp='$sitehtml3direxp' | |
b4eb6b3d JH |
21398 | sitelib='$sitelib' |
21399 | sitelib_stem='$sitelib_stem' | |
21400 | sitelibexp='$sitelibexp' | |
3bb95762 JH |
21401 | siteman1dir='$siteman1dir' |
21402 | siteman1direxp='$siteman1direxp' | |
21403 | siteman3dir='$siteman3dir' | |
21404 | siteman3direxp='$siteman3direxp' | |
b4eb6b3d JH |
21405 | siteprefix='$siteprefix' |
21406 | siteprefixexp='$siteprefixexp' | |
6e1038e0 MB |
21407 | sitescript='$sitescript' |
21408 | sitescriptexp='$sitescriptexp' | |
b4eb6b3d JH |
21409 | sizesize='$sizesize' |
21410 | sizetype='$sizetype' | |
5f80c64f JH |
21411 | sleep='$sleep' |
21412 | smail='$smail' | |
5f80c64f | 21413 | so='$so' |
b4eb6b3d JH |
21414 | sockethdr='$sockethdr' |
21415 | socketlib='$socketlib' | |
21416 | socksizetype='$socksizetype' | |
5f80c64f JH |
21417 | sort='$sort' |
21418 | spackage='$spackage' | |
21419 | spitshell='$spitshell' | |
10bc17b6 JH |
21420 | srand48_r_proto='$srand48_r_proto' |
21421 | srandom_r_proto='$srandom_r_proto' | |
5f80c64f | 21422 | src='$src' |
b4eb6b3d JH |
21423 | ssizetype='$ssizetype' |
21424 | startperl='$startperl' | |
5f80c64f | 21425 | startsh='$startsh' |
b4eb6b3d JH |
21426 | static_ext='$static_ext' |
21427 | stdchar='$stdchar' | |
21428 | stdio_base='$stdio_base' | |
21429 | stdio_bufsiz='$stdio_bufsiz' | |
21430 | stdio_cnt='$stdio_cnt' | |
21431 | stdio_filbuf='$stdio_filbuf' | |
21432 | stdio_ptr='$stdio_ptr' | |
21433 | stdio_stream_array='$stdio_stream_array' | |
10bc17b6 | 21434 | strerror_r_proto='$strerror_r_proto' |
b4eb6b3d | 21435 | strings='$strings' |
5f80c64f | 21436 | submit='$submit' |
b4eb6b3d JH |
21437 | subversion='$subversion' |
21438 | sysman='$sysman' | |
5f80c64f JH |
21439 | tail='$tail' |
21440 | tar='$tar' | |
5440bc8e | 21441 | targetarch='$targetarch' |
5f80c64f JH |
21442 | tbl='$tbl' |
21443 | tee='$tee' | |
21444 | test='$test' | |
b4eb6b3d JH |
21445 | timeincl='$timeincl' |
21446 | timetype='$timetype' | |
10bc17b6 | 21447 | tmpnam_r_proto='$tmpnam_r_proto' |
5440bc8e | 21448 | to='$to' |
5f80c64f JH |
21449 | touch='$touch' |
21450 | tr='$tr' | |
21451 | trnl='$trnl' | |
21452 | troff='$troff' | |
10bc17b6 | 21453 | ttyname_r_proto='$ttyname_r_proto' |
b4eb6b3d JH |
21454 | u16size='$u16size' |
21455 | u16type='$u16type' | |
21456 | u32size='$u32size' | |
21457 | u32type='$u32type' | |
21458 | u64size='$u64size' | |
21459 | u64type='$u64type' | |
21460 | u8size='$u8size' | |
21461 | u8type='$u8type' | |
21462 | uidformat='$uidformat' | |
21463 | uidsign='$uidsign' | |
21464 | uidsize='$uidsize' | |
21465 | uidtype='$uidtype' | |
5f80c64f JH |
21466 | uname='$uname' |
21467 | uniq='$uniq' | |
b4eb6b3d JH |
21468 | uquadtype='$uquadtype' |
21469 | use5005threads='$use5005threads' | |
21470 | use64bitall='$use64bitall' | |
21471 | use64bitint='$use64bitint' | |
5440bc8e | 21472 | usecrosscompile='$usecrosscompile' |
5f80c64f | 21473 | usedl='$usedl' |
ff0950a8 | 21474 | usefaststdio='$usefaststdio' |
b4eb6b3d JH |
21475 | useithreads='$useithreads' |
21476 | uselargefiles='$uselargefiles' | |
21477 | uselongdouble='$uselongdouble' | |
c53af328 | 21478 | usemallocwrap='$usemallocwrap' |
b4eb6b3d JH |
21479 | usemorebits='$usemorebits' |
21480 | usemultiplicity='$usemultiplicity' | |
21481 | usemymalloc='$usemymalloc' | |
5f80c64f | 21482 | usenm='$usenm' |
b4eb6b3d JH |
21483 | useopcode='$useopcode' |
21484 | useperlio='$useperlio' | |
21485 | useposix='$useposix' | |
9514c62b | 21486 | usereentrant='$usereentrant' |
b4eb6b3d JH |
21487 | usesfio='$usesfio' |
21488 | useshrplib='$useshrplib' | |
5d39362b | 21489 | usesitecustomize='$usesitecustomize' |
29209bc5 | 21490 | usesocks='$usesocks' |
b4eb6b3d JH |
21491 | usethreads='$usethreads' |
21492 | usevendorprefix='$usevendorprefix' | |
21493 | usevfork='$usevfork' | |
5f80c64f JH |
21494 | usrinc='$usrinc' |
21495 | uuname='$uuname' | |
b4eb6b3d JH |
21496 | uvXUformat='$uvXUformat' |
21497 | uvoformat='$uvoformat' | |
21498 | uvsize='$uvsize' | |
21499 | uvtype='$uvtype' | |
21500 | uvuformat='$uvuformat' | |
21501 | uvxformat='$uvxformat' | |
21502 | vendorarch='$vendorarch' | |
21503 | vendorarchexp='$vendorarchexp' | |
21504 | vendorbin='$vendorbin' | |
21505 | vendorbinexp='$vendorbinexp' | |
3bb95762 JH |
21506 | vendorhtml1dir='$vendorhtml1dir' |
21507 | vendorhtml1direxp='$vendorhtml1direxp' | |
21508 | vendorhtml3dir='$vendorhtml3dir' | |
21509 | vendorhtml3direxp='$vendorhtml3direxp' | |
b4eb6b3d JH |
21510 | vendorlib='$vendorlib' |
21511 | vendorlib_stem='$vendorlib_stem' | |
21512 | vendorlibexp='$vendorlibexp' | |
3bb95762 JH |
21513 | vendorman1dir='$vendorman1dir' |
21514 | vendorman1direxp='$vendorman1direxp' | |
21515 | vendorman3dir='$vendorman3dir' | |
21516 | vendorman3direxp='$vendorman3direxp' | |
b4eb6b3d JH |
21517 | vendorprefix='$vendorprefix' |
21518 | vendorprefixexp='$vendorprefixexp' | |
6e1038e0 MB |
21519 | vendorscript='$vendorscript' |
21520 | vendorscriptexp='$vendorscriptexp' | |
b4eb6b3d | 21521 | version='$version' |
861eb78d | 21522 | version_patchlevel_string='$version_patchlevel_string' |
d56c5707 | 21523 | versiononly='$versiononly' |
5f80c64f | 21524 | vi='$vi' |
b4eb6b3d | 21525 | voidflags='$voidflags' |
5f80c64f | 21526 | xlibpth='$xlibpth' |
3659ebf1 JH |
21527 | yacc='$yacc' |
21528 | yaccflags='$yaccflags' | |
5f80c64f JH |
21529 | zcat='$zcat' |
21530 | zip='$zip' | |
21531 | EOT | |
21532 | ||
21533 | : Add in command line options if available | |
21534 | $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh | |
21535 | ||
21536 | : add special variables | |
21537 | $test -f $src/patchlevel.h && \ | |
d00b958f | 21538 | awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh |
151e6568 | 21539 | echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh |
a02608de | 21540 | echo "PERL_CONFIG_SH=true" >>config.sh |
5f80c64f JH |
21541 | |
21542 | : propagate old symbols | |
21543 | if $test -f UU/config.sh; then | |
381aa1ff | 21544 | <UU/config.sh $sort | $uniq >UU/oldconfig.sh |
5f80c64f | 21545 | sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\ |
aef7654c | 21546 | $sort | $uniq -u >UU/oldsyms |
5f80c64f JH |
21547 | set X `cat UU/oldsyms` |
21548 | shift | |
21549 | case $# in | |
21550 | 0) ;; | |
21551 | *) | |
21552 | cat <<EOM | |
21553 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em... | |
21554 | EOM | |
21555 | echo "# Variables propagated from previous config.sh file." >>config.sh | |
21556 | for sym in `cat UU/oldsyms`; do | |
21557 | echo " Propagating $hint variable "'$'"$sym..." | |
21558 | eval 'tmp="$'"${sym}"'"' | |
21559 | echo "$tmp" | \ | |
21560 | sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh | |
21561 | done | |
21562 | ;; | |
21563 | esac | |
21564 | fi | |
21565 | ||
21566 | : Finish up by extracting the .SH files | |
21567 | case "$alldone" in | |
21568 | exit) | |
21569 | $rm -rf UU | |
24ccb310 | 21570 | echo "Extraction done." |
5f80c64f JH |
21571 | exit 0 |
21572 | ;; | |
21573 | cont) | |
21574 | ;; | |
21575 | '') | |
21576 | dflt='' | |
21577 | nostick=true | |
21578 | $cat <<EOM | |
21579 | ||
21580 | If you'd like to make any changes to the config.sh file before I begin | |
21581 | to configure things, do it as a shell escape now (e.g. !vi config.sh). | |
21582 | ||
21583 | EOM | |
21584 | rp="Press return or use a shell escape to edit config.sh:" | |
21585 | . UU/myread | |
21586 | nostick='' | |
21587 | case "$ans" in | |
21588 | '') ;; | |
21589 | *) : in case they cannot read | |
21590 | sh 1>&4 -c "$ans";; | |
21591 | esac | |
21592 | ;; | |
21593 | esac | |
21594 | ||
21595 | : if this fails, just run all the .SH files by hand | |
21596 | . ./config.sh | |
21597 | ||
21598 | echo " " | |
21599 | exec 1>&4 | |
a43e8593 | 21600 | pwd=`pwd` |
5f80c64f | 21601 | . ./UU/extract |
6904989c | 21602 | cd "$pwd" |
5f80c64f JH |
21603 | |
21604 | if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then | |
21605 | dflt=y | |
21606 | case "$silent" in | |
21607 | true) ;; | |
21608 | *) | |
21609 | $cat <<EOM | |
21610 | ||
21611 | Now you need to generate make dependencies by running "$make depend". | |
21612 | You might prefer to run it in background: "$make depend > makedepend.out &" | |
21613 | It can take a while, so you might not want to run it right now. | |
21614 | ||
21615 | EOM | |
21616 | ;; | |
21617 | esac | |
21618 | rp="Run $make depend now?" | |
21619 | . UU/myread | |
21620 | case "$ans" in | |
21621 | y*) | |
3d5d58b1 | 21622 | $make depend && echo "Now you must run '$make'." |
5f80c64f JH |
21623 | ;; |
21624 | *) | |
21625 | echo "You must run '$make depend' then '$make'." | |
21626 | ;; | |
21627 | esac | |
21628 | elif test -f [Mm]akefile; then | |
21629 | echo " " | |
21630 | echo "Now you must run a $make." | |
21631 | else | |
24ccb310 | 21632 | echo "Configure done." |
5f80c64f JH |
21633 | fi |
21634 | ||
21635 | if $test -f Policy.sh; then | |
21636 | $cat <<EOM | |
21637 | ||
21638 | If you compile $package on a different machine or from a different object | |
21639 | directory, copy the Policy.sh file from this object directory to the | |
21640 | new one before you run Configure -- this will help you with most of | |
21641 | the policy defaults. | |
21642 | ||
21643 | EOM | |
21644 | fi | |
21645 | if $test -f config.msg; then | |
21646 | echo "Hmm. I also noted the following information while running:" | |
21647 | echo " " | |
21648 | $cat config.msg >&4 | |
21649 | $rm -f config.msg | |
21650 | fi | |
21651 | $rm -f kit*isdone ark*isdone | |
21652 | $rm -rf UU | |
21653 | ||
21654 | : End of Configure | |
21655 |