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 | # |
a3540c92 | 23 | # Generated on Mon Apr 24 23:59:43 EET DST 2000 [metaconfig 3.0 PL70] |
46193409 | 24 | # (with additional metaconfig patches by perlbug@perl.com) |
2304df62 AD |
25 | |
26 | cat >/tmp/c1$$ <<EOF | |
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 | |
37 | cat >/tmp/c2$$ <<EOF | |
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 | ||
43 | true || cat /tmp/c1$$ /tmp/c2$$ | |
44 | true || exec sh $0 $argv:q | |
45 | ||
46 | (exit $?0) || cat /tmp/c2$$ | |
47 | (exit $?0) || exec sh $0 $argv:q | |
48 | rm -f /tmp/c1$$ /tmp/c2$$ | |
49 | ||
a0d0e21e LW |
50 | : compute my invocation name |
51 | me=$0 | |
52 | case "$0" in | |
53 | */*) | |
54 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` | |
55 | test "$me" || me=$0 | |
56 | ;; | |
57 | esac | |
58 | ||
dfe9444c | 59 | : Proper separator for the PATH environment variable |
8e07c86e AD |
60 | p_=: |
61 | : On OS/2 this directory should exist if this is not floppy only system :-] | |
dfe9444c AD |
62 | if test -d c:/. ; then |
63 | if test -n "$OS2_SHELL"; then | |
64 | p_=\; | |
65 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` | |
66 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` | |
c4f23d77 | 67 | elif test -n "$DJGPP"; then |
dfe9444c AD |
68 | p_=\; |
69 | fi | |
39e571d4 | 70 | fi |
a0d0e21e LW |
71 | |
72 | : Proper PATH setting | |
73 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' | |
16d20bd9 | 74 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
232e078e | 75 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
16d20bd9 | 76 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
232e078e AD |
77 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
78 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" | |
79 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" | |
80 | paths="$paths /sbin /usr/sbin /usr/libexec" | |
a0d0e21e LW |
81 | |
82 | for p in $paths | |
83 | do | |
8e07c86e AD |
84 | case "$p_$PATH$p_" in |
85 | *$p_$p$p_*) ;; | |
86 | *) test -d $p && PATH=$PATH$p_$p ;; | |
a0d0e21e LW |
87 | esac |
88 | done | |
89 | ||
8e07c86e | 90 | PATH=.$p_$PATH |
2304df62 AD |
91 | export PATH |
92 | ||
dfe9444c AD |
93 | : shall we be using ksh? |
94 | inksh='' | |
95 | needksh='' | |
96 | avoidksh='' | |
97 | newsh=/bin/ksh | |
98 | changesh='' | |
ff0cee69 | 99 | if (PATH=.; alias -x) >/dev/null 2>&1; then |
dfe9444c AD |
100 | inksh=true |
101 | fi | |
102 | if test -f /hp-ux -a -f /bin/ksh; then | |
103 | needksh='to avoid sh bug in "here document" expansion' | |
104 | fi | |
105 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then | |
106 | if test X`/usr/bin/uname -v` = X4; then | |
107 | avoidksh="to avoid AIX 4's /bin/sh" | |
108 | newsh=/usr/bin/bsh | |
2304df62 | 109 | fi |
dfe9444c | 110 | fi |
cf04f91f JH |
111 | if test -f /osf_boot -a -f /usr/sbin/setld; then |
112 | if test X`/usr/bin/uname -s` = XOSF1; then | |
113 | avoidksh="to avoid Digital UNIX' ksh" | |
114 | newsh=/bin/sh | |
115 | unset BIN_SH # if this is 'xpg4' sh will start up ksh | |
116 | fi | |
117 | fi | |
dfe9444c AD |
118 | case "$inksh/$needksh" in |
119 | /[a-z]*) | |
c4f23d77 | 120 | ENV='' |
dfe9444c AD |
121 | changesh=true |
122 | reason="$needksh" | |
123 | ;; | |
124 | esac | |
125 | case "$inksh/$avoidksh" in | |
126 | true/[a-z]*) | |
127 | changesh=true | |
128 | reason="$avoidksh" | |
129 | ;; | |
130 | esac | |
131 | case "$inksh/$needksh-$avoidksh-" in | |
132 | true/--) | |
a0d0e21e LW |
133 | cat <<EOM |
134 | (I see you are using the Korn shell. Some ksh's blow up on $me, | |
dfe9444c | 135 | mainly on older exotic systems. If yours does, try the Bourne shell instead.) |
ff0cee69 | 136 | EOM |
dfe9444c AD |
137 | ;; |
138 | esac | |
139 | case "$changesh" in | |
140 | true) | |
141 | echo "(Feeding myself to $newsh $reason.)" | |
142 | case "$0" in | |
143 | Configure|*/Configure) exec $newsh $0 "$@";; | |
144 | *) exec $newsh Configure "$@";; | |
145 | esac | |
146 | ;; | |
147 | esac | |
2304df62 | 148 | |
bfb7748a AD |
149 | : if needed set CDPATH to a harmless value that is not chatty |
150 | : avoid bash 2.02 problems with empty CDPATH. | |
151 | case "$CDPATH" in | |
152 | '') ;; | |
153 | *) case "$SHELL" in | |
154 | *bash*) CDPATH='.' ;; | |
155 | *) CDPATH='' ;; | |
156 | esac | |
157 | ;; | |
158 | esac | |
2304df62 AD |
159 | : Configure runs within the UU subdirectory |
160 | test -d UU || mkdir UU | |
8e07c86e | 161 | cd UU && rm -f ./* |
2304df62 | 162 | |
ff49bff8 JH |
163 | ccsymbols='' |
164 | cppccsymbols='' | |
165 | cppsymbols='' | |
a0d0e21e | 166 | dynamic_ext='' |
2304df62 | 167 | extensions='' |
a0d0e21e | 168 | known_extensions='' |
4318d5a0 | 169 | nonxs_ext='' |
bfb7748a | 170 | static_ext='' |
8ff267be | 171 | useopcode='' |
a0d0e21e | 172 | useposix='' |
ecfc5424 | 173 | d_bsd='' |
40a7a20a | 174 | d_eunice='' |
2304df62 AD |
175 | d_xenix='' |
176 | eunicefix='' | |
177 | Mcc='' | |
dfe9444c | 178 | ar='' |
2304df62 AD |
179 | awk='' |
180 | bash='' | |
181 | bison='' | |
182 | byacc='' | |
183 | cat='' | |
184 | chgrp='' | |
185 | chmod='' | |
186 | chown='' | |
ecfc5424 | 187 | comm='' |
2304df62 AD |
188 | compress='' |
189 | cp='' | |
190 | cpio='' | |
191 | cpp='' | |
192 | csh='' | |
193 | date='' | |
194 | echo='' | |
195 | egrep='' | |
196 | emacs='' | |
197 | expr='' | |
198 | find='' | |
199 | flex='' | |
2304df62 | 200 | grep='' |
8ff267be | 201 | gzip='' |
2304df62 AD |
202 | inews='' |
203 | ksh='' | |
204 | less='' | |
205 | line='' | |
206 | lint='' | |
207 | ln='' | |
208 | lp='' | |
209 | lpr='' | |
210 | ls='' | |
211 | mail='' | |
212 | mailx='' | |
dfe9444c | 213 | make='' |
2304df62 AD |
214 | mkdir='' |
215 | more='' | |
216 | mv='' | |
693762b4 | 217 | nm='' |
2304df62 AD |
218 | nroff='' |
219 | perl='' | |
220 | pg='' | |
221 | pmake='' | |
222 | pr='' | |
223 | rm='' | |
224 | rmail='' | |
225 | sed='' | |
226 | sendmail='' | |
2304df62 AD |
227 | shar='' |
228 | sleep='' | |
229 | smail='' | |
230 | sort='' | |
231 | submit='' | |
232 | tail='' | |
233 | tar='' | |
234 | tbl='' | |
693762b4 | 235 | tee='' |
2304df62 AD |
236 | test='' |
237 | touch='' | |
238 | tr='' | |
239 | troff='' | |
240 | uname='' | |
241 | uniq='' | |
242 | uuname='' | |
243 | vi='' | |
244 | zcat='' | |
8ff267be | 245 | zip='' |
ccc7f9b3 | 246 | full_ar='' |
1aef975c | 247 | full_sed='' |
a0d0e21e | 248 | libswanted='' |
2304df62 AD |
249 | hint='' |
250 | myuname='' | |
85e6fe83 LW |
251 | osname='' |
252 | osvers='' | |
2304df62 AD |
253 | Author='' |
254 | Date='' | |
255 | Header='' | |
256 | Id='' | |
257 | Locker='' | |
258 | Log='' | |
259 | RCSfile='' | |
260 | Revision='' | |
261 | Source='' | |
262 | State='' | |
dfe9444c AD |
263 | _a='' |
264 | _exe='' | |
265 | _o='' | |
4633a7c4 LW |
266 | archobjs='' |
267 | exe_ext='' | |
268 | firstmakefile='' | |
269 | lib_ext='' | |
270 | obj_ext='' | |
271 | path_sep='' | |
2304df62 | 272 | afs='' |
a0d0e21e | 273 | alignbytes='' |
c4f23d77 | 274 | ansi2knr='' |
a0d0e21e LW |
275 | archlib='' |
276 | archlibexp='' | |
a0d0e21e LW |
277 | d_archlib='' |
278 | installarchlib='' | |
40000a8c AD |
279 | archname='' |
280 | myarchname='' | |
cf2093f6 JH |
281 | d_atolf='' |
282 | d_atoll='' | |
ecfc5424 | 283 | baserev='' |
2304df62 AD |
284 | bin='' |
285 | binexp='' | |
286 | installbin='' | |
d71b2b6b JH |
287 | bincompat5005='' |
288 | d_bincompat5005='' | |
2304df62 AD |
289 | byteorder='' |
290 | cc='' | |
291 | gccversion='' | |
292 | ccflags='' | |
293 | cppflags='' | |
294 | ldflags='' | |
295 | lkflags='' | |
8e07c86e | 296 | locincpth='' |
2304df62 | 297 | optimize='' |
8e07c86e | 298 | cf_email='' |
2304df62 AD |
299 | cf_by='' |
300 | cf_time='' | |
8175356b | 301 | charsize='' |
2304df62 | 302 | contains='' |
a0d0e21e | 303 | cpp_stuff='' |
2304df62 AD |
304 | cpplast='' |
305 | cppminus='' | |
306 | cpprun='' | |
307 | cppstdin='' | |
68c15b6f | 308 | crosscompile='' |
2304df62 | 309 | d_access='' |
5ff3f7a4 | 310 | d_accessx='' |
a0d0e21e | 311 | d_alarm='' |
ecfc5424 | 312 | d_attribut='' |
2304df62 AD |
313 | d_bcmp='' |
314 | d_bcopy='' | |
315 | d_bzero='' | |
316 | d_casti32='' | |
317 | castflags='' | |
318 | d_castneg='' | |
a0d0e21e LW |
319 | d_chown='' |
320 | d_chroot='' | |
2304df62 | 321 | d_chsize='' |
a0d0e21e LW |
322 | d_closedir='' |
323 | d_void_closedir='' | |
2304df62 AD |
324 | d_const='' |
325 | cryptlib='' | |
326 | d_crypt='' | |
327 | d_csh='' | |
1aef975c | 328 | full_csh='' |
a0d0e21e LW |
329 | d_cuserid='' |
330 | d_dbl_dig='' | |
331 | d_difftime='' | |
332 | d_dlerror='' | |
333 | d_dlopen='' | |
334 | d_dlsymun='' | |
2304df62 | 335 | d_dosuid='' |
a0d0e21e | 336 | d_suidsafe='' |
85ab1d1d | 337 | d_drand48proto='' |
2304df62 | 338 | d_dup2='' |
5ff3f7a4 GS |
339 | d_eaccess='' |
340 | d_endgrent='' | |
e5c9fcd0 AD |
341 | d_endhent='' |
342 | d_endnent='' | |
343 | d_endpent='' | |
5ff3f7a4 | 344 | d_endpwent='' |
e5c9fcd0 | 345 | d_endsent='' |
f1066039 | 346 | d_endspent='' |
2304df62 AD |
347 | d_fchmod='' |
348 | d_fchown='' | |
349 | d_fcntl='' | |
a0d0e21e LW |
350 | d_fd_macros='' |
351 | d_fd_set='' | |
352 | d_fds_bits='' | |
353 | d_fgetpos='' | |
2304df62 AD |
354 | d_flexfnam='' |
355 | d_flock='' | |
a0d0e21e | 356 | d_fork='' |
c5f05a91 | 357 | d_fpos64_t='' |
a3540c92 | 358 | d_frexpl='' |
ad27e871 | 359 | d_fs_data_s='' |
5ff3f7a4 | 360 | d_fseeko='' |
a0d0e21e | 361 | d_fsetpos='' |
0545a864 | 362 | d_fstatfs='' |
5ff3f7a4 | 363 | d_ftello='' |
5f05dabc | 364 | d_ftime='' |
365 | d_gettimeod='' | |
a0d0e21e | 366 | d_Gconvert='' |
49dabb45 | 367 | d_getcwd='' |
c890dc6c | 368 | d_getfsstat='' |
5ff3f7a4 | 369 | d_getgrent='' |
2304df62 | 370 | d_getgrps='' |
4599a1de | 371 | d_gethbyaddr='' |
4599a1de | 372 | d_gethbyname='' |
dfe9444c | 373 | d_gethent='' |
2304df62 AD |
374 | aphostname='' |
375 | d_gethname='' | |
376 | d_phostname='' | |
377 | d_uname='' | |
dc45a647 | 378 | d_gethostprotos='' |
a0d0e21e | 379 | d_getlogin='' |
ad27e871 | 380 | d_getmnt='' |
ccc7f9b3 | 381 | d_getmntent='' |
dfe9444c | 382 | d_getnbyaddr='' |
693762b4 | 383 | d_getnbyname='' |
e5c9fcd0 | 384 | d_getnent='' |
dc45a647 | 385 | d_getnetprotos='' |
e5c9fcd0 | 386 | d_getpent='' |
2afac517 | 387 | d_getpgid='' |
2304df62 | 388 | d_getpgrp2='' |
2afac517 | 389 | d_bsdgetpgrp='' |
2304df62 | 390 | d_getpgrp='' |
a0d0e21e | 391 | d_getppid='' |
2304df62 | 392 | d_getprior='' |
693762b4 AD |
393 | d_getpbyname='' |
394 | d_getpbynumber='' | |
dc45a647 | 395 | d_getprotoprotos='' |
5ff3f7a4 | 396 | d_getpwent='' |
e5c9fcd0 | 397 | d_getsent='' |
dc45a647 | 398 | d_getservprotos='' |
f1066039 JH |
399 | d_getspent='' |
400 | d_getspnam='' | |
693762b4 AD |
401 | d_getsbyname='' |
402 | d_getsbyport='' | |
a4f3eea9 | 403 | d_gnulibc='' |
ccc7f9b3 | 404 | d_hasmntopt='' |
2304df62 | 405 | d_htonl='' |
43999f95 | 406 | d_iconv='' |
7e1af8bc | 407 | d_inetaton='' |
13b3f787 | 408 | d_int64_t='' |
2304df62 | 409 | d_isascii='' |
a3540c92 JH |
410 | d_isnan='' |
411 | d_isnanl='' | |
2304df62 | 412 | d_killpg='' |
dd64f1c3 | 413 | d_lchown='' |
2d4389e4 | 414 | d_ldbl_dig='' |
2304df62 | 415 | d_link='' |
a0d0e21e LW |
416 | d_locconv='' |
417 | d_lockf='' | |
e5c9fcd0 AD |
418 | d_longdbl='' |
419 | longdblsize='' | |
dc45a647 MB |
420 | d_longlong='' |
421 | longlongsize='' | |
49c10eea | 422 | d_lseekproto='' |
2304df62 | 423 | d_lstat='' |
1e8c3fde | 424 | d_madvise='' |
a0d0e21e LW |
425 | d_mblen='' |
426 | d_mbstowcs='' | |
427 | d_mbtowc='' | |
0f27ced1 | 428 | d_memchr='' |
2304df62 AD |
429 | d_memcmp='' |
430 | d_memcpy='' | |
431 | d_memmove='' | |
432 | d_memset='' | |
433 | d_mkdir='' | |
fe749a9f | 434 | d_mkdtemp='' |
a0d0e21e | 435 | d_mkfifo='' |
fe749a9f JH |
436 | d_mkstemp='' |
437 | d_mkstemps='' | |
a0d0e21e | 438 | d_mktime='' |
fe749a9f JH |
439 | d_mmap='' |
440 | mmaptype='' | |
a3540c92 | 441 | d_modfl='' |
fe749a9f | 442 | d_mprotect='' |
2304df62 AD |
443 | d_msg='' |
444 | d_msgctl='' | |
445 | d_msgget='' | |
446 | d_msgrcv='' | |
447 | d_msgsnd='' | |
fe749a9f JH |
448 | d_msync='' |
449 | d_munmap='' | |
a0d0e21e | 450 | d_nice='' |
c5f05a91 | 451 | d_off64_t='' |
2304df62 | 452 | d_open3='' |
a0d0e21e LW |
453 | d_fpathconf='' |
454 | d_pathconf='' | |
455 | d_pause='' | |
456 | d_pipe='' | |
8e07c86e | 457 | d_poll='' |
2304df62 | 458 | d_portable='' |
ef4af2be JH |
459 | d_old_pthread_create_joinable='' |
460 | old_pthread_create_joinable='' | |
dfe9444c AD |
461 | d_pthread_yield='' |
462 | d_sched_yield='' | |
1cfa4ec7 | 463 | sched_yield='' |
bbe6c963 | 464 | d_qgcvt='' |
2304df62 | 465 | d_readdir='' |
85e6fe83 LW |
466 | d_rewinddir='' |
467 | d_seekdir='' | |
468 | d_telldir='' | |
a0d0e21e | 469 | d_readlink='' |
2304df62 AD |
470 | d_rename='' |
471 | d_rmdir='' | |
472 | d_safebcpy='' | |
473 | d_safemcpy='' | |
36477c24 | 474 | d_sanemcmp='' |
2304df62 AD |
475 | d_select='' |
476 | d_sem='' | |
477 | d_semctl='' | |
478 | d_semget='' | |
479 | d_semop='' | |
480 | d_setegid='' | |
481 | d_seteuid='' | |
5ff3f7a4 | 482 | d_setgrent='' |
dfe9444c | 483 | d_setgrps='' |
693762b4 | 484 | d_sethent='' |
a0d0e21e | 485 | d_setlinebuf='' |
2304df62 | 486 | d_setlocale='' |
e5c9fcd0 AD |
487 | d_setnent='' |
488 | d_setpent='' | |
2304df62 AD |
489 | d_setpgid='' |
490 | d_setpgrp2='' | |
2afac517 | 491 | d_bsdsetpgrp='' |
2304df62 AD |
492 | d_setpgrp='' |
493 | d_setprior='' | |
5ff3f7a4 | 494 | d_setpwent='' |
2304df62 AD |
495 | d_setregid='' |
496 | d_setresgid='' | |
497 | d_setresuid='' | |
498 | d_setreuid='' | |
499 | d_setrgid='' | |
500 | d_setruid='' | |
e5c9fcd0 | 501 | d_setsent='' |
2304df62 | 502 | d_setsid='' |
f1066039 | 503 | d_setspent='' |
e5c9fcd0 | 504 | d_setvbuf='' |
760ac839 | 505 | d_sfio='' |
8ff267be | 506 | usesfio='' |
2304df62 AD |
507 | d_shm='' |
508 | d_shmat='' | |
a0d0e21e LW |
509 | d_shmatprototype='' |
510 | shmattype='' | |
2304df62 AD |
511 | d_shmctl='' |
512 | d_shmdt='' | |
513 | d_shmget='' | |
2c7991dc | 514 | d_sigaction='' |
8ff267be | 515 | d_sigsetjmp='' |
de4597cb JH |
516 | d_msg_ctrunc='' |
517 | d_msg_dontroute='' | |
518 | d_msg_oob='' | |
519 | d_msg_peek='' | |
520 | d_msg_proxy='' | |
2304df62 | 521 | d_oldsock='' |
de4597cb | 522 | d_scm_rights='' |
2304df62 AD |
523 | d_socket='' |
524 | d_sockpair='' | |
525 | sockethdr='' | |
526 | socketlib='' | |
13b3f787 | 527 | d_socklen_t='' |
68d4903c | 528 | d_sqrtl='' |
2304df62 | 529 | d_statblks='' |
0545a864 JH |
530 | d_statfs_f_flags='' |
531 | d_statfs_s='' | |
104d25b7 JH |
532 | d_fstatvfs='' |
533 | d_statvfs='' | |
c2960299 AD |
534 | d_stdio_cnt_lval='' |
535 | d_stdio_ptr_lval='' | |
16d20bd9 | 536 | d_stdiobase='' |
2304df62 | 537 | d_stdstdio='' |
16d20bd9 AD |
538 | stdio_base='' |
539 | stdio_bufsiz='' | |
540 | stdio_cnt='' | |
dfe9444c | 541 | stdio_filbuf='' |
16d20bd9 | 542 | stdio_ptr='' |
2304df62 AD |
543 | d_index='' |
544 | d_strchr='' | |
a0d0e21e | 545 | d_strcoll='' |
2304df62 AD |
546 | d_strctcpy='' |
547 | d_strerrm='' | |
548 | d_strerror='' | |
549 | d_sysernlst='' | |
550 | d_syserrlst='' | |
a89d8a78 DH |
551 | d_strtod='' |
552 | d_strtol='' | |
ff935051 | 553 | d_strtold='' |
76d49b1c | 554 | d_strtoll='' |
a89d8a78 | 555 | d_strtoul='' |
ff935051 JH |
556 | d_strtoull='' |
557 | d_strtouq='' | |
a0d0e21e | 558 | d_strxfrm='' |
2304df62 AD |
559 | d_symlink='' |
560 | d_syscall='' | |
a0d0e21e | 561 | d_sysconf='' |
2304df62 | 562 | d_system='' |
a0d0e21e LW |
563 | d_tcgetpgrp='' |
564 | d_tcsetpgrp='' | |
cb86ce0e | 565 | d_telldirproto='' |
85e6fe83 LW |
566 | d_time='' |
567 | timetype='' | |
2304df62 AD |
568 | clocktype='' |
569 | d_times='' | |
570 | d_truncate='' | |
a0d0e21e LW |
571 | d_tzname='' |
572 | d_umask='' | |
bd89102f AD |
573 | d_semctl_semid_ds='' |
574 | d_semctl_semun='' | |
575 | d_union_semun='' | |
0545a864 | 576 | d_ustat='' |
2304df62 | 577 | d_vfork='' |
a0d0e21e | 578 | usevfork='' |
2304df62 AD |
579 | d_voidsig='' |
580 | signal_t='' | |
581 | d_volatile='' | |
582 | d_charvspr='' | |
583 | d_vprintf='' | |
584 | d_wait4='' | |
585 | d_waitpid='' | |
a0d0e21e LW |
586 | d_wcstombs='' |
587 | d_wctomb='' | |
588 | dlext='' | |
85e6fe83 LW |
589 | cccdlflags='' |
590 | ccdlflags='' | |
2304df62 | 591 | dlsrc='' |
232e078e | 592 | ld='' |
85e6fe83 | 593 | lddlflags='' |
2304df62 | 594 | usedl='' |
693762b4 | 595 | doublesize='' |
5ff3f7a4 | 596 | ebcdic='' |
66fe083f | 597 | fflushNULL='' |
767df6a1 | 598 | fflushall='' |
8175356b | 599 | fpossize='' |
a0d0e21e | 600 | fpostype='' |
a22e52b9 | 601 | gidformat='' |
785fb66b JH |
602 | gidsign='' |
603 | gidsize='' | |
2304df62 AD |
604 | gidtype='' |
605 | groupstype='' | |
606 | h_fcntl='' | |
607 | h_sysfile='' | |
5ff3f7a4 | 608 | i_arpainet='' |
ecfc5424 AD |
609 | db_hashtype='' |
610 | db_prefixtype='' | |
a0d0e21e | 611 | i_db='' |
2304df62 | 612 | i_dbm='' |
8e07c86e | 613 | i_rpcsvcdbm='' |
2304df62 | 614 | d_dirnamlen='' |
a0d0e21e | 615 | direntrytype='' |
2304df62 | 616 | i_dirent='' |
a0d0e21e | 617 | i_dld='' |
2304df62 AD |
618 | i_dlfcn='' |
619 | i_fcntl='' | |
a0d0e21e | 620 | i_float='' |
2304df62 | 621 | i_gdbm='' |
28e8609d | 622 | d_grpasswd='' |
2304df62 | 623 | i_grp='' |
43999f95 | 624 | i_iconv='' |
792d8dab | 625 | i_ieeefp='' |
5ff3f7a4 | 626 | i_inttypes='' |
a0d0e21e | 627 | i_limits='' |
4633a7c4 | 628 | i_locale='' |
7f3d1cf1 | 629 | i_machcthr='' |
a0d0e21e LW |
630 | i_malloc='' |
631 | i_math='' | |
85e6fe83 | 632 | i_memory='' |
e7fb4fcc | 633 | i_mntent='' |
2304df62 | 634 | i_ndbm='' |
3fd537d4 | 635 | i_netdb='' |
85e6fe83 | 636 | i_neterrno='' |
9cc6feab | 637 | i_netinettcp='' |
2304df62 AD |
638 | i_niin='' |
639 | i_sysin='' | |
5b34fd99 | 640 | i_poll='' |
c4747d3e | 641 | i_pthread='' |
2304df62 AD |
642 | d_pwage='' |
643 | d_pwchange='' | |
644 | d_pwclass='' | |
645 | d_pwcomment='' | |
646 | d_pwexpire='' | |
c4f23d77 | 647 | d_pwgecos='' |
28e8609d | 648 | d_pwpasswd='' |
2304df62 AD |
649 | d_pwquota='' |
650 | i_pwd='' | |
760ac839 | 651 | i_sfio='' |
f1066039 | 652 | i_shadow='' |
86959918 | 653 | i_socks='' |
2304df62 | 654 | i_stddef='' |
a0d0e21e | 655 | i_stdlib='' |
2304df62 AD |
656 | i_string='' |
657 | strings='' | |
923fc586 | 658 | i_sunmath='' |
5ff3f7a4 | 659 | i_sysaccess='' |
2304df62 AD |
660 | i_sysdir='' |
661 | i_sysfile='' | |
662 | d_voidtty='' | |
663 | i_bsdioctl='' | |
a0d0e21e | 664 | i_sysfilio='' |
2304df62 AD |
665 | i_sysioctl='' |
666 | i_syssockio='' | |
ca52efda | 667 | i_syslog='' |
fe749a9f | 668 | i_sysmman='' |
bf0c440f | 669 | i_sysmode='' |
104d25b7 | 670 | i_sysmount='' |
2304df62 | 671 | i_sysndir='' |
a0d0e21e | 672 | i_sysparam='' |
8ff267be | 673 | i_sysresrc='' |
5ff3f7a4 | 674 | i_syssecrt='' |
2304df62 | 675 | i_sysselct='' |
1aef975c | 676 | i_sysstat='' |
0545a864 | 677 | i_sysstatfs='' |
104d25b7 | 678 | i_sysstatvfs='' |
a0d0e21e | 679 | i_systimes='' |
fed7345c | 680 | i_systypes='' |
de4597cb | 681 | i_sysuio='' |
25f94b33 | 682 | i_sysun='' |
d4935d7f | 683 | i_sysutsname='' |
0545a864 | 684 | i_sysvfs='' |
8ff267be | 685 | i_syswait='' |
2304df62 AD |
686 | i_sgtty='' |
687 | i_termio='' | |
688 | i_termios='' | |
689 | i_systime='' | |
690 | i_systimek='' | |
691 | i_time='' | |
692 | timeincl='' | |
85e6fe83 | 693 | i_unistd='' |
0545a864 | 694 | i_ustat='' |
2304df62 | 695 | i_utime='' |
760ac839 | 696 | i_values='' |
a0d0e21e | 697 | i_stdarg='' |
2304df62 AD |
698 | i_varargs='' |
699 | i_varhdr='' | |
700 | i_vfork='' | |
ff935051 | 701 | inc_version_list='' |
3a096bf3 | 702 | inc_version_list_init='' |
dd4e71fd JH |
703 | installprefix='' |
704 | installprefixexp='' | |
705 | installstyle='' | |
104d25b7 | 706 | installusrbinperl='' |
2304df62 | 707 | intsize='' |
24fef2a7 AD |
708 | longsize='' |
709 | shortsize='' | |
2304df62 | 710 | libc='' |
5cf1d1f1 | 711 | ldlibpthname='' |
8ff267be | 712 | libperl='' |
2afac517 | 713 | shrpenv='' |
8ff267be | 714 | useshrplib='' |
a0d0e21e | 715 | glibpth='' |
2304df62 | 716 | libpth='' |
8e07c86e | 717 | loclibpth='' |
2304df62 AD |
718 | plibpth='' |
719 | xlibpth='' | |
1cfa4ec7 | 720 | ignore_versioned_solibs='' |
2304df62 | 721 | libs='' |
43999f95 JH |
722 | libsdirs='' |
723 | libsfiles='' | |
724 | libsfound='' | |
13b3f787 | 725 | libspath='' |
85e6fe83 | 726 | lns='' |
cf2093f6 JH |
727 | d_PRIEldbl='' |
728 | d_PRIFldbl='' | |
729 | d_PRIGldbl='' | |
730 | d_PRIeldbl='' | |
731 | d_PRIfldbl='' | |
732 | d_PRIgldbl='' | |
733 | sPRIEldbl='' | |
734 | sPRIFldbl='' | |
735 | sPRIGldbl='' | |
736 | sPRIeldbl='' | |
737 | sPRIfldbl='' | |
738 | sPRIgldbl='' | |
5ff3f7a4 | 739 | lseeksize='' |
85e6fe83 | 740 | lseektype='' |
8ff267be | 741 | make_set_make='' |
85e6fe83 | 742 | d_mymalloc='' |
94b6baf5 | 743 | freetype='' |
2304df62 AD |
744 | mallocobj='' |
745 | mallocsrc='' | |
746 | malloctype='' | |
747 | usemymalloc='' | |
16d20bd9 AD |
748 | installman1dir='' |
749 | man1dir='' | |
750 | man1direxp='' | |
751 | man1ext='' | |
752 | installman3dir='' | |
753 | man3dir='' | |
754 | man3direxp='' | |
755 | man3ext='' | |
2304df62 AD |
756 | huge='' |
757 | large='' | |
758 | medium='' | |
759 | models='' | |
760 | small='' | |
761 | split='' | |
a0d0e21e | 762 | modetype='' |
68c15b6f | 763 | multiarch='' |
2304df62 AD |
764 | mydomain='' |
765 | myhostname='' | |
766 | phostname='' | |
767 | c='' | |
768 | n='' | |
8e07c86e AD |
769 | d_eofnblk='' |
770 | eagain='' | |
771 | o_nonblock='' | |
772 | rd_nodata='' | |
dfe9444c AD |
773 | netdb_hlen_type='' |
774 | netdb_host_type='' | |
775 | netdb_name_type='' | |
776 | netdb_net_type='' | |
2304df62 AD |
777 | groupcat='' |
778 | hostcat='' | |
779 | passcat='' | |
85e6fe83 LW |
780 | orderlib='' |
781 | ranlib='' | |
3b777bb4 GS |
782 | d_perl_otherlibdirs='' |
783 | otherlibdirs='' | |
2304df62 AD |
784 | package='' |
785 | spackage='' | |
2c7991dc | 786 | pager='' |
ff935051 JH |
787 | api_revision='' |
788 | api_subversion='' | |
789 | api_version='' | |
790 | api_versionstring='' | |
ecfc5424 | 791 | patchlevel='' |
49c10eea | 792 | revision='' |
760ac839 | 793 | subversion='' |
bfb7748a | 794 | version='' |
49c10eea | 795 | perl5='' |
8e07c86e | 796 | perladmin='' |
4633a7c4 | 797 | perlpath='' |
78691af5 | 798 | d_nv_preserves_uv='' |
8175356b JH |
799 | i16size='' |
800 | i16type='' | |
801 | i32size='' | |
802 | i32type='' | |
803 | i64size='' | |
804 | i64type='' | |
805 | i8size='' | |
806 | i8type='' | |
807 | ivsize='' | |
808 | ivtype='' | |
809 | nvsize='' | |
810 | nvtype='' | |
811 | u16size='' | |
812 | u16type='' | |
813 | u32size='' | |
814 | u32type='' | |
815 | u64size='' | |
816 | u64type='' | |
817 | u8size='' | |
818 | u8type='' | |
819 | uvsize='' | |
820 | uvtype='' | |
821 | ivdformat='' | |
822 | uvoformat='' | |
823 | uvuformat='' | |
824 | uvxformat='' | |
dfe9444c | 825 | pidtype='' |
a0d0e21e | 826 | prefix='' |
1aef975c | 827 | prefixexp='' |
2304df62 AD |
828 | installprivlib='' |
829 | privlib='' | |
830 | privlibexp='' | |
831 | prototype='' | |
693762b4 | 832 | ptrsize='' |
cf2093f6 JH |
833 | d_PRIX64='' |
834 | d_PRId64='' | |
835 | d_PRIi64='' | |
836 | d_PRIo64='' | |
837 | d_PRIu64='' | |
838 | d_PRIx64='' | |
839 | sPRIX64='' | |
840 | sPRId64='' | |
841 | sPRIi64='' | |
842 | sPRIo64='' | |
843 | sPRIu64='' | |
844 | sPRIx64='' | |
de1c2614 | 845 | d_quad='' |
6b8eaf93 | 846 | quadkind='' |
d7d93a81 JH |
847 | quadtype='' |
848 | uquadtype='' | |
85ab1d1d | 849 | drand01='' |
2304df62 | 850 | randbits='' |
85ab1d1d JH |
851 | randfunc='' |
852 | randseedtype='' | |
853 | seedfunc='' | |
2304df62 AD |
854 | installscript='' |
855 | scriptdir='' | |
856 | scriptdirexp='' | |
5ff3f7a4 | 857 | selectminbits='' |
a0d0e21e | 858 | selecttype='' |
8ff267be | 859 | sh='' |
af4c28eb | 860 | sig_count='' |
2304df62 | 861 | sig_name='' |
dfe9444c | 862 | sig_name_init='' |
8e07c86e | 863 | sig_num='' |
824a2ba3 | 864 | sig_num_init='' |
4633a7c4 LW |
865 | installsitearch='' |
866 | sitearch='' | |
867 | sitearchexp='' | |
717c4fcc JH |
868 | installsitebin='' |
869 | sitebin='' | |
870 | sitebinexp='' | |
25f94b33 AD |
871 | installsitelib='' |
872 | sitelib='' | |
526fdc24 | 873 | sitelib_stem='' |
25f94b33 | 874 | sitelibexp='' |
dd4e71fd JH |
875 | siteprefix='' |
876 | siteprefixexp='' | |
8c99d73e | 877 | sizesize='' |
a0d0e21e LW |
878 | sizetype='' |
879 | so='' | |
c890dc6c | 880 | socksizetype='' |
2304df62 AD |
881 | sharpbang='' |
882 | shsharp='' | |
883 | spitshell='' | |
dfe9444c | 884 | src='' |
a0d0e21e | 885 | ssizetype='' |
4633a7c4 | 886 | startperl='' |
2304df62 AD |
887 | startsh='' |
888 | stdchar='' | |
ed39a0f2 | 889 | d_stdio_stream_array='' |
767df6a1 | 890 | stdio_stream_array='' |
2304df62 | 891 | sysman='' |
5ff3f7a4 | 892 | trnl='' |
a22e52b9 | 893 | uidformat='' |
57def98f | 894 | uidsign='' |
785fb66b | 895 | uidsize='' |
2304df62 | 896 | uidtype='' |
85ab1d1d | 897 | archname64='' |
10cc9d2a JH |
898 | use64bitall='' |
899 | use64bitint='' | |
249b38c6 | 900 | uselargefiles='' |
b0ce926a | 901 | uselongdouble='' |
09458382 | 902 | usemorebits='' |
85ab1d1d | 903 | usemultiplicity='' |
2304df62 | 904 | nm_opt='' |
40a7a20a | 905 | nm_so_opt='' |
2304df62 AD |
906 | runnm='' |
907 | usenm='' | |
8ff267be | 908 | useperlio='' |
29209bc5 | 909 | usesocks='' |
693762b4 | 910 | d_oldpthreads='' |
aaacdc8b GS |
911 | use5005threads='' |
912 | useithreads='' | |
dfe9444c | 913 | usethreads='' |
2304df62 | 914 | incpath='' |
2304df62 AD |
915 | mips_type='' |
916 | usrinc='' | |
526fdc24 MS |
917 | d_vendorarch='' |
918 | installvendorarch='' | |
919 | vendorarch='' | |
920 | vendorarchexp='' | |
717c4fcc JH |
921 | d_vendorbin='' |
922 | installvendorbin='' | |
923 | vendorbin='' | |
924 | vendorbinexp='' | |
a3635516 JH |
925 | d_vendorlib='' |
926 | installvendorlib='' | |
927 | vendorlib='' | |
526fdc24 | 928 | vendorlib_stem='' |
a3635516 JH |
929 | vendorlibexp='' |
930 | usevendorprefix='' | |
931 | vendorprefix='' | |
932 | vendorprefixexp='' | |
2304df62 AD |
933 | defvoidused='' |
934 | voidflags='' | |
fe749a9f JH |
935 | pm_apiversion='' |
936 | xs_apiversion='' | |
2304df62 AD |
937 | CONFIG='' |
938 | ||
ecfc5424 AD |
939 | define='define' |
940 | undef='undef' | |
941 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' | |
942 | rmlist='' | |
943 | ||
944 | : We must find out about Eunice early | |
945 | eunicefix=':' | |
946 | if test -f /etc/unixtovms; then | |
947 | eunicefix=/etc/unixtovms | |
948 | fi | |
949 | if test -f /etc/unixtovms.exe; then | |
950 | eunicefix=/etc/unixtovms.exe | |
951 | fi | |
952 | ||
5ff3f7a4 | 953 | i_whoami='' |
ff935051 JH |
954 | : set useposix=false in your hint file to disable the POSIX extension. |
955 | useposix=true | |
956 | : set useopcode=false in your hint file to disable the Opcode extension. | |
957 | useopcode=true | |
dfe9444c | 958 | : Trailing extension. Override this in a hint file, if needed. |
4e2a5f63 | 959 | _exe='' |
dfe9444c AD |
960 | : Extra object files, if any, needed on this platform. |
961 | archobjs='' | |
ff935051 JH |
962 | : Possible local include directories to search. |
963 | : Set locincpth to "" in a hint file to defeat local include searches. | |
964 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" | |
965 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" | |
966 | : | |
967 | : no include file wanted by default | |
968 | inclwanted='' | |
969 | ||
dfe9444c | 970 | groupstype='' |
732c9516 JH |
971 | : change the next line if compiling for Xenix/286 on Xenix/386 |
972 | xlibpth='/usr/lib/386 /lib/386' | |
732c9516 JH |
973 | : Possible local library directories to search. |
974 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
975 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
976 | ||
977 | : general looking path for locating libraries | |
bf0c440f | 978 | glibpth="/usr/lib/large /lib /usr/lib $xlibpth" |
732c9516 JH |
979 | glibpth="$glibpth /lib/large /usr/lib/small /lib/small" |
980 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" | |
f7dd4e7f JH |
981 | test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth" |
982 | test -f /shlib/libc.so && glibpth="/shlib $glibpth" | |
732c9516 JH |
983 | |
984 | : Private path used by Configure to find libraries. Its value | |
985 | : is prepended to libpth. This variable takes care of special | |
986 | : machines, like the mips. Usually, it should be empty. | |
987 | plibpth='' | |
988 | ||
1cfa4ec7 GS |
989 | : default library list |
990 | libswanted='' | |
921b2963 | 991 | : some systems want to use only the non-versioned libso:s |
1cfa4ec7 | 992 | ignore_versioned_solibs='' |
85ab1d1d | 993 | : set usemultiplicity on the Configure command line to enable multiplicity. |
29209bc5 | 994 | : set usesocks on the Configure command line to enable socks. |
dfe9444c | 995 | : set usethreads on the Configure command line to enable threads. |
ff935051 JH |
996 | : full support for void wanted by default |
997 | defvoidused=15 | |
998 | ||
ecfc5424 | 999 | : List of libraries we want. |
693762b4 | 1000 | : If anyone needs -lnet, put it in a hint file. |
997d70a2 | 1001 | libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl' |
69e84d1d | 1002 | libswanted="$libswanted dld ld sun m c cposix posix" |
f1066039 | 1003 | libswanted="$libswanted ndir dir crypt sec" |
997d70a2 | 1004 | libswanted="$libswanted ucb bsd BSD PW x iconv" |
1aef975c | 1005 | : We probably want to search /usr/shlib before most other libraries. |
94b6baf5 | 1006 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
ecfc5424 AD |
1007 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
1008 | glibpth="/usr/shlib $glibpth" | |
1009 | : Do not use vfork unless overridden by a hint file. | |
1010 | usevfork=false | |
1011 | ||
8ff267be | 1012 | : Find the basic shell for Bourne shell scripts |
1013 | case "$sh" in | |
1014 | '') | |
8ff267be | 1015 | case "$SYSTYPE" in |
1016 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; | |
1017 | *) xxx='/bin/sh';; | |
1018 | esac | |
1019 | if test -f "$xxx"; then | |
1020 | sh="$xxx" | |
1021 | else | |
1022 | : Build up a list and do a single loop so we can 'break' out. | |
1023 | pth=`echo $PATH | sed -e "s/$p_/ /g"` | |
1024 | for xxx in sh bash ksh pdksh ash; do | |
1025 | for p in $pth; do | |
1026 | try="$try ${p}/${xxx}" | |
1027 | done | |
1028 | done | |
1029 | for xxx in $try; do | |
1030 | if test -f "$xxx"; then | |
1031 | sh="$xxx"; | |
8ff267be | 1032 | break |
1033 | elif test -f "$xxx.exe"; then | |
1034 | sh="$xxx"; | |
8ff267be | 1035 | break |
1036 | fi | |
1037 | done | |
1038 | fi | |
1039 | ;; | |
1040 | esac | |
1041 | ||
1042 | case "$sh" in | |
1043 | '') cat <<EOM >&2 | |
1044 | $me: Fatal Error: I can't find a Bourne Shell anywhere. | |
dfe9444c | 1045 | |
8ff267be | 1046 | Usually it's in /bin/sh. How did you even get this far? |
46193409 | 1047 | Please contact me (Perl Maintainers) at perlbug@perl.com and |
dfe9444c | 1048 | we'll try to straighten this all out. |
8ff267be | 1049 | EOM |
1050 | exit 1 | |
1051 | ;; | |
1052 | esac | |
1053 | ||
760ac839 | 1054 | : see if sh knows # comments |
8ff267be | 1055 | if `$sh -c '#' >/dev/null 2>&1`; then |
760ac839 LW |
1056 | shsharp=true |
1057 | spitshell=cat | |
760ac839 LW |
1058 | xcat=/bin/cat |
1059 | test -f $xcat || xcat=/usr/bin/cat | |
1060 | echo "#!$xcat" >try | |
1061 | $eunicefix try | |
1062 | chmod +x try | |
1063 | ./try > today | |
1064 | if test -s today; then | |
760ac839 LW |
1065 | sharpbang='#!' |
1066 | else | |
1067 | echo "#! $xcat" > try | |
1068 | $eunicefix try | |
1069 | chmod +x try | |
1070 | ./try > today | |
1071 | if test -s today; then | |
760ac839 LW |
1072 | sharpbang='#! ' |
1073 | else | |
760ac839 LW |
1074 | sharpbang=': use ' |
1075 | fi | |
1076 | fi | |
1077 | else | |
dfe9444c | 1078 | echo " " |
8ff267be | 1079 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
760ac839 LW |
1080 | shsharp=false |
1081 | cd .. | |
1082 | echo "exec grep -v '^[ ]*#'" >spitshell | |
1083 | chmod +x spitshell | |
1084 | $eunicefix spitshell | |
1085 | spitshell=`pwd`/spitshell | |
1086 | cd UU | |
1087 | echo "I presume that if # doesn't work, #! won't work either!" | |
1088 | sharpbang=': use ' | |
1089 | fi | |
1090 | rm -f try today | |
1091 | ||
1092 | : figure out how to guarantee sh startup | |
8ff267be | 1093 | case "$startsh" in |
1094 | '') startsh=${sharpbang}${sh} ;; | |
1095 | *) | |
760ac839 | 1096 | esac |
760ac839 LW |
1097 | cat >try <<EOSS |
1098 | $startsh | |
1099 | set abc | |
1100 | test "$?abc" != 1 | |
1101 | EOSS | |
1102 | ||
1103 | chmod +x try | |
1104 | $eunicefix try | |
1105 | if ./try; then | |
8ff267be | 1106 | : echo "Yup, it does." |
760ac839 | 1107 | else |
dfe9444c AD |
1108 | echo "Hmm... '$startsh' does not guarantee sh startup..." |
1109 | echo "You may have to fix up the shell scripts to make sure $sh runs them." | |
760ac839 LW |
1110 | fi |
1111 | rm -f try | |
1112 | ||
aebf16e7 AD |
1113 | |
1114 | : Save command line options in file UU/cmdline.opt for later use in | |
1115 | : generating config.sh. | |
1116 | cat > cmdline.opt <<EOSH | |
1117 | # Configure command line arguments. | |
1118 | config_arg0='$0' | |
1119 | config_args='$*' | |
1120 | config_argc=$# | |
1121 | EOSH | |
1122 | argn=1 | |
1123 | for arg in "$@"; do | |
1124 | cat >>cmdline.opt <<EOSH | |
1125 | config_arg$argn='$arg' | |
1126 | EOSH | |
1127 | argn=`expr $argn + 1` | |
1128 | done | |
1129 | ||
2304df62 AD |
1130 | : produce awk script to parse command line options |
1131 | cat >options.awk <<'EOF' | |
1132 | BEGIN { | |
02e93a22 | 1133 | optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification |
2304df62 AD |
1134 | |
1135 | len = length(optstr); | |
1136 | for (i = 1; i <= len; i++) { | |
1137 | c = substr(optstr, i, 1); | |
1138 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; | |
1139 | if (a == ":") { | |
1140 | arg[c] = 1; | |
1141 | i++; | |
1142 | } | |
1143 | opt[c] = 1; | |
1144 | } | |
1145 | } | |
1146 | { | |
1147 | expect = 0; | |
1148 | str = $0; | |
1149 | if (substr(str, 1, 1) != "-") { | |
1150 | printf("'%s'\n", str); | |
1151 | next; | |
1152 | } | |
1153 | len = length($0); | |
1154 | for (i = 2; i <= len; i++) { | |
1155 | c = substr(str, i, 1); | |
1156 | if (!opt[c]) { | |
1157 | printf("-%s\n", substr(str, i)); | |
1158 | next; | |
1159 | } | |
1160 | printf("-%s\n", c); | |
1161 | if (arg[c]) { | |
1162 | if (i < len) | |
1163 | printf("'%s'\n", substr(str, i + 1)); | |
1164 | else | |
1165 | expect = 1; | |
1166 | next; | |
1167 | } | |
1168 | } | |
1169 | } | |
1170 | END { | |
1171 | if (expect) | |
1172 | print "?"; | |
1173 | } | |
1174 | EOF | |
1175 | ||
1176 | : process the command line options | |
4633a7c4 LW |
1177 | set X `for arg in "$@"; do echo "X$arg"; done | |
1178 | sed -e s/X// | awk -f options.awk` | |
2304df62 AD |
1179 | eval "set $*" |
1180 | shift | |
1181 | rm -f options.awk | |
1182 | ||
1183 | : set up default values | |
1184 | fastread='' | |
1185 | reuseval=false | |
1186 | config_sh='' | |
1187 | alldone='' | |
1188 | error='' | |
1189 | silent='' | |
1190 | extractsh='' | |
ecfc5424 | 1191 | override='' |
16d20bd9 | 1192 | knowitall='' |
02e93a22 | 1193 | rm -f optdef.sh posthint.sh |
28757baa | 1194 | cat >optdef.sh <<EOS |
1195 | $startsh | |
1196 | EOS | |
2304df62 | 1197 | |
dfe9444c | 1198 | |
2304df62 AD |
1199 | : option parsing |
1200 | while test $# -gt 0; do | |
1201 | case "$1" in | |
1202 | -d) shift; fastread=yes;; | |
1203 | -e) shift; alldone=cont;; | |
1204 | -f) | |
1205 | shift | |
1206 | cd .. | |
1207 | if test -r "$1"; then | |
1208 | config_sh="$1" | |
1209 | else | |
a0d0e21e | 1210 | echo "$me: cannot read config file $1." >&2 |
2304df62 AD |
1211 | error=true |
1212 | fi | |
1213 | cd UU | |
1214 | shift;; | |
1215 | -h) shift; error=true;; | |
1216 | -r) shift; reuseval=true;; | |
dfe9444c | 1217 | -s) shift; silent=true; realsilent=true;; |
2304df62 | 1218 | -E) shift; alldone=exit;; |
16d20bd9 | 1219 | -K) shift; knowitall=true;; |
ecfc5424 | 1220 | -O) shift; override=true;; |
dfe9444c | 1221 | -S) shift; silent=true; extractsh=true;; |
a0d0e21e LW |
1222 | -D) |
1223 | shift | |
1224 | case "$1" in | |
1225 | *=) | |
1226 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 | |
1227 | echo "$me: ignoring -D $1" >&2 | |
1228 | ;; | |
ecfc5424 | 1229 | *=*) echo "$1" | \ |
1aef975c AD |
1230 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
1231 | *) echo "$1='define'" >> optdef.sh;; | |
a0d0e21e LW |
1232 | esac |
1233 | shift | |
1234 | ;; | |
1235 | -U) | |
1236 | shift | |
1237 | case "$1" in | |
1aef975c | 1238 | *=) echo "$1" >> optdef.sh;; |
a0d0e21e LW |
1239 | *=*) |
1240 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 | |
1241 | echo "$me: ignoring -U $1" >&2 | |
1242 | ;; | |
1aef975c | 1243 | *) echo "$1='undef'" >> optdef.sh;; |
a0d0e21e LW |
1244 | esac |
1245 | shift | |
1246 | ;; | |
02e93a22 JH |
1247 | -A) |
1248 | shift | |
1249 | xxx='' | |
1250 | yyy="$1" | |
02e93a22 | 1251 | zzz='' |
5f83a3e9 | 1252 | uuu=undef |
02e93a22 | 1253 | case "$yyy" in |
5f83a3e9 JH |
1254 | *=*) zzz=`echo $yyy|sed 's!=.*!!'` |
1255 | case "$zzz" in | |
1256 | *:*) zzz='' ;; | |
1257 | *) xxx=append | |
1258 | zzz=" "`echo $yyy|sed 's!^[^=]*=!!'` | |
1259 | yyy=`echo $yyy|sed 's!=.*!!'` ;; | |
1260 | esac | |
1261 | ;; | |
1262 | esac | |
1263 | case "$xxx" in | |
1264 | '') case "$yyy" in | |
1265 | *:*) xxx=`echo $yyy|sed 's!:.*!!'` | |
1266 | yyy=`echo $yyy|sed 's!^[^:]*:!!'` | |
1267 | zzz=`echo $yyy|sed 's!^[^=]*=!!'` | |
1268 | yyy=`echo $yyy|sed 's!=.*!!'` ;; | |
1269 | *) xxx=`echo $yyy|sed 's!:.*!!'` | |
1270 | yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;; | |
1271 | esac | |
1272 | ;; | |
1273 | esac | |
02e93a22 JH |
1274 | case "$xxx" in |
1275 | append) | |
5f83a3e9 | 1276 | echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;; |
02e93a22 | 1277 | clear) |
5f83a3e9 | 1278 | echo "$yyy=''" >> posthint.sh ;; |
02e93a22 JH |
1279 | define) |
1280 | case "$zzz" in | |
1281 | '') zzz=define ;; | |
1282 | esac | |
5f83a3e9 | 1283 | echo "$yyy='$zzz'" >> posthint.sh ;; |
02e93a22 | 1284 | eval) |
5f83a3e9 | 1285 | echo "eval \"$yyy=$zzz\"" >> posthint.sh ;; |
02e93a22 | 1286 | prepend) |
5f83a3e9 | 1287 | echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;; |
02e93a22 JH |
1288 | undef) |
1289 | case "$zzz" in | |
1290 | '') zzz="$uuu" ;; | |
1291 | esac | |
5f83a3e9 JH |
1292 | echo "$yyy=$zzz" >> posthint.sh ;; |
1293 | *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;; | |
02e93a22 | 1294 | esac |
bde6b06b | 1295 | shift |
02e93a22 | 1296 | ;; |
dfe9444c | 1297 | -V) echo "$me generated by metaconfig 3.0 PL70." >&2 |
5f83a3e9 | 1298 | exit 0;; |
2304df62 | 1299 | --) break;; |
a0d0e21e | 1300 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
2304df62 AD |
1301 | *) break;; |
1302 | esac | |
1303 | done | |
1304 | ||
1305 | case "$error" in | |
1306 | true) | |
1307 | cat >&2 <<EOM | |
2afac517 | 1308 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
02e93a22 | 1309 | [-U symbol] [-U symbol=] [-A command:symbol...] |
2304df62 AD |
1310 | -d : use defaults for all answers. |
1311 | -e : go on without questioning past the production of config.sh. | |
1312 | -f : specify an alternate default configuration file. | |
1313 | -h : print this help message and exit (with an error status). | |
1314 | -r : reuse C symbols value if possible (skips costly nm extraction). | |
1315 | -s : silent mode, only echoes questions and essential information. | |
a0d0e21e LW |
1316 | -D : define symbol to have some value: |
1317 | -D symbol symbol gets the value 'define' | |
1318 | -D symbol=value symbol gets the value 'value' | |
2304df62 | 1319 | -E : stop at the end of questions, after having produced config.sh. |
16d20bd9 | 1320 | -K : do not use unless you know what you are doing. |
ecfc5424 | 1321 | -O : let -D and -U override definitions from loaded configuration file. |
2304df62 | 1322 | -S : perform variable substitutions on all .SH files (can mix with -f) |
a0d0e21e LW |
1323 | -U : undefine symbol: |
1324 | -U symbol symbol gets the value 'undef' | |
1325 | -U symbol= symbol gets completely empty | |
02e93a22 | 1326 | -A : manipulate symbol after the platform specific hints have been applied: |
5f83a3e9 | 1327 | -A symbol=value append " "value to symbol |
02e93a22 JH |
1328 | -A append:symbol=value append value to symbol |
1329 | -A define:symbol=value define symbol to have value | |
02e93a22 JH |
1330 | -A clear:symbol define symbol to be '' |
1331 | -A define:symbol define symbol to be 'define' | |
1332 | -A eval:symbol=value define symbol to be eval of value | |
1333 | -A prepend:symbol=value prepend value to symbol | |
1334 | -A undef:symbol define symbol to be 'undef' | |
1335 | -A undef:symbol= define symbol to be '' | |
2304df62 AD |
1336 | -V : print version number and exit (with a zero status). |
1337 | EOM | |
1338 | exit 1 | |
1339 | ;; | |
1340 | esac | |
1341 | ||
dfe9444c AD |
1342 | : Sanity checks |
1343 | case "$fastread$alldone" in | |
1344 | yescont|yesexit) ;; | |
1345 | *) | |
aaeb8e51 GS |
1346 | case "$extractsh" in |
1347 | true) ;; | |
1348 | *) | |
1349 | if test ! -t 0; then | |
1350 | echo "Say 'sh Configure', not 'sh <Configure'" | |
1351 | exit 1 | |
1352 | fi | |
1353 | ;; | |
1354 | esac | |
dfe9444c AD |
1355 | ;; |
1356 | esac | |
1357 | ||
2304df62 AD |
1358 | exec 4>&1 |
1359 | case "$silent" in | |
1360 | true) exec 1>/dev/null;; | |
1361 | esac | |
1362 | ||
ecfc5424 | 1363 | : run the defines and the undefines, if any, but leave the file out there... |
1aef975c AD |
1364 | touch optdef.sh |
1365 | . ./optdef.sh | |
02e93a22 JH |
1366 | : create the posthint manipulation script and leave the file out there... |
1367 | touch posthint.sh | |
a0d0e21e | 1368 | |
2304df62 | 1369 | : set package name |
85e6fe83 | 1370 | package=perl5 |
1aef975c AD |
1371 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
1372 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` | |
1373 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1374 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; | |
1375 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; | |
1376 | esac | |
2304df62 | 1377 | |
2304df62 AD |
1378 | : Some greps do not return status, grrr. |
1379 | echo "grimblepritz" >grimble | |
1380 | if grep blurfldyick grimble >/dev/null 2>&1 ; then | |
1381 | contains=contains | |
1382 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then | |
1383 | contains=grep | |
1384 | else | |
1385 | contains=contains | |
1386 | fi | |
1387 | rm -f grimble | |
1388 | : the following should work in any shell | |
1389 | case "$contains" in | |
1390 | contains*) | |
1391 | echo " " | |
1392 | echo "AGH! Grep doesn't return a status. Attempting remedial action." | |
1393 | cat >contains <<'EOSS' | |
1394 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp | |
1395 | EOSS | |
1396 | chmod +x contains | |
1397 | esac | |
1398 | ||
dfe9444c AD |
1399 | : Find the path to the source tree |
1400 | case "$src" in | |
1401 | '') case "$0" in | |
b233458b JH |
1402 | */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'` |
1403 | case "$src" in | |
1404 | /*) ;; | |
1405 | *) src=`cd ../$src && pwd` ;; | |
1406 | esac | |
1407 | ;; | |
dfe9444c AD |
1408 | *) src='.';; |
1409 | esac;; | |
1410 | esac | |
1411 | case "$src" in | |
1412 | '') src=/ | |
1413 | rsrc=/ | |
1414 | ;; | |
1415 | /*) rsrc="$src";; | |
1416 | *) rsrc="../$src";; | |
1417 | esac | |
1418 | if test -f $rsrc/Configure && \ | |
1419 | $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1 | |
1420 | then | |
1421 | : found it, so we are ok. | |
1422 | else | |
1423 | rsrc='' | |
1424 | for src in . .. ../.. ../../.. ../../../..; do | |
1425 | if test -f ../$src/Configure && \ | |
1426 | $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1 | |
1427 | then | |
1428 | rsrc=../$src | |
1429 | break | |
1430 | fi | |
1431 | done | |
1432 | fi | |
1433 | case "$rsrc" in | |
1434 | '') | |
1435 | cat <<EOM >&4 | |
1436 | ||
1437 | Sorry, I can't seem to locate the source dir for $package. Please start | |
1438 | Configure with an explicit path -- i.e. /some/path/Configure. | |
1439 | ||
1440 | EOM | |
1441 | exit 1 | |
1442 | ;; | |
1443 | ../.) rsrc='..';; | |
1444 | *) | |
1445 | echo " " | |
1446 | echo "Sources for $package found in \"$src\"." >&4 | |
1447 | ;; | |
1448 | esac | |
1449 | ||
1450 | : script used to extract .SH files with variable substitutions | |
1451 | cat >extract <<'EOS' | |
2000072c | 1452 | CONFIGDOTSH=true |
dfe9444c AD |
1453 | echo "Doing variable substitutions on .SH files..." |
1454 | if test -f $src/MANIFEST; then | |
f7ab18e9 | 1455 | set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'` |
dfe9444c AD |
1456 | else |
1457 | echo "(Looking for .SH files under the source directory.)" | |
1458 | set x `(cd $src; find . -name "*.SH" -print)` | |
1459 | fi | |
1460 | shift | |
1461 | case $# in | |
1462 | 0) set x `(cd $src; echo *.SH)`; shift;; | |
1463 | esac | |
1464 | if test ! -f $src/$1; then | |
1465 | shift | |
1466 | fi | |
1467 | mkdir_p=' | |
1468 | name=$1; | |
1469 | create=""; | |
1470 | while test $name; do | |
1471 | if test ! -d "$name"; then | |
1472 | create="$name $create"; | |
1473 | name=`echo $name | sed -e "s|^[^/]*$||"`; | |
1474 | name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; | |
1475 | else | |
1476 | name=""; | |
1477 | fi; | |
1478 | done; | |
1479 | for file in $create; do | |
1480 | mkdir $file; | |
1481 | done | |
1482 | ' | |
1483 | for file in $*; do | |
1484 | case "$src" in | |
1485 | ".") | |
1486 | case "$file" in | |
1487 | */*) | |
1488 | dir=`expr X$file : 'X\(.*\)/'` | |
1489 | file=`expr X$file : 'X.*/\(.*\)'` | |
1490 | (cd $dir && . ./$file) | |
1491 | ;; | |
1492 | *) | |
1493 | . ./$file | |
1494 | ;; | |
1495 | esac | |
1496 | ;; | |
1497 | *) | |
1498 | case "$file" in | |
1499 | */*) | |
1500 | dir=`expr X$file : 'X\(.*\)/'` | |
1501 | file=`expr X$file : 'X.*/\(.*\)'` | |
1502 | (set x $dir; shift; eval $mkdir_p) | |
1503 | sh <$src/$dir/$file | |
1504 | ;; | |
1505 | *) | |
1506 | sh <$src/$file | |
1507 | ;; | |
1508 | esac | |
1509 | ;; | |
1510 | esac | |
1511 | done | |
1512 | if test -f $src/config_h.SH; then | |
1513 | if test ! -f config.h; then | |
1514 | : oops, they left it out of MANIFEST, probably, so do it anyway. | |
1515 | . $src/config_h.SH | |
1516 | fi | |
1517 | fi | |
1518 | EOS | |
1519 | ||
1520 | : extract files and exit if asked to do so | |
1521 | case "$extractsh" in | |
1522 | true) | |
1523 | case "$realsilent" in | |
1524 | true) ;; | |
1525 | *) exec 1>&4;; | |
1526 | esac | |
1527 | case "$config_sh" in | |
1528 | '') config_sh='config.sh';; | |
1529 | esac | |
1530 | echo " " | |
1531 | echo "Fetching answers from $config_sh..." | |
1532 | cd .. | |
1533 | . $config_sh | |
1534 | test "$override" && . ./optdef.sh | |
1535 | echo " " | |
1536 | . UU/extract | |
1537 | rm -rf UU | |
1538 | echo "Done." | |
1539 | exit 0 | |
1540 | ;; | |
1541 | esac | |
1542 | ||
1543 | : Eunice requires " " instead of "", can you believe it | |
1544 | echo " " | |
1545 | : Here we go... | |
1546 | echo "Beginning of configuration questions for $package." | |
1547 | ||
1548 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 | |
1549 | ||
2304df62 AD |
1550 | : first determine how to suppress newline on echo command |
1551 | echo " " | |
1552 | echo "Checking echo to see how to suppress newlines..." | |
1553 | (echo "hi there\c" ; echo " ") >.echotmp | |
1554 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
1555 | echo "...using -n." | |
1556 | n='-n' | |
1557 | c='' | |
1558 | else | |
1559 | cat <<'EOM' | |
1560 | ...using \c | |
1561 | EOM | |
1562 | n='' | |
1563 | c='\c' | |
1564 | fi | |
1565 | echo $n "The star should be here-->$c" | |
1566 | echo '*' | |
1567 | rm -f .echotmp | |
1568 | ||
1569 | : Now test for existence of everything in MANIFEST | |
1570 | echo " " | |
dfe9444c | 1571 | if test -f $rsrc/MANIFEST; then |
2304df62 | 1572 | echo "First let's make sure your kit is complete. Checking..." >&4 |
dfe9444c | 1573 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50 |
2304df62 | 1574 | rm -f missing |
dfe9444c | 1575 | tmppwd=`pwd` |
2304df62 | 1576 | for filelist in x??; do |
dfe9444c | 1577 | (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing) |
2304df62 AD |
1578 | done |
1579 | if test -s missing; then | |
1580 | cat missing >&4 | |
1581 | cat >&4 <<'EOM' | |
1582 | ||
1583 | THIS PACKAGE SEEMS TO BE INCOMPLETE. | |
1584 | ||
1585 | You have the option of continuing the configuration process, despite the | |
1586 | distinct possibility that your kit is damaged, by typing 'y'es. If you | |
1587 | do, don't blame me if something goes wrong. I advise you to type 'n'o | |
46193409 | 1588 | and contact the author (perlbug@perl.com). |
2304df62 AD |
1589 | |
1590 | EOM | |
1591 | echo $n "Continue? [n] $c" >&4 | |
1592 | read ans | |
1593 | case "$ans" in | |
1594 | y*) | |
1595 | echo "Continuing..." >&4 | |
1596 | rm -f missing | |
1597 | ;; | |
1598 | *) | |
1599 | echo "ABORTING..." >&4 | |
1600 | kill $$ | |
1601 | ;; | |
1602 | esac | |
1603 | else | |
dfe9444c | 1604 | echo "Looks good..." |
2304df62 AD |
1605 | fi |
1606 | else | |
1607 | echo "There is no MANIFEST file. I hope your kit is complete !" | |
1608 | fi | |
1609 | rm -f missing x?? | |
1610 | ||
5ff3f7a4 GS |
1611 | echo " " |
1612 | : Find the appropriate value for a newline for tr | |
1613 | if test -n "$DJGPP"; then | |
1614 | trnl='\012' | |
1615 | fi | |
1616 | if test X"$trnl" = X; then | |
1617 | case "`echo foo|tr '\n' x 2>/dev/null`" in | |
1618 | foox) trnl='\n' ;; | |
1619 | esac | |
1620 | fi | |
1621 | if test X"$trnl" = X; then | |
1622 | case "`echo foo|tr '\012' x 2>/dev/null`" in | |
1623 | foox) trnl='\012' ;; | |
1624 | esac | |
1625 | fi | |
1626 | if test X"$trnl" = X; then | |
1627 | cat <<EOM >&2 | |
1628 | ||
1629 | $me: Fatal Error: cannot figure out how to translate newlines with 'tr'. | |
1630 | ||
1631 | EOM | |
1632 | exit 1 | |
1633 | fi | |
1634 | ||
2304df62 AD |
1635 | : compute the number of columns on the terminal for proper question formatting |
1636 | case "$COLUMNS" in | |
1637 | '') COLUMNS='80';; | |
1638 | esac | |
1639 | ||
1640 | : set up the echo used in my read | |
1641 | myecho="case \"\$xxxm\" in | |
1642 | '') echo $n \"\$rp $c\" >&4;; | |
1643 | *) case \"\$rp\" in | |
1644 | '') echo $n \"[\$xxxm] $c\";; | |
1645 | *) | |
1646 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then | |
1647 | echo \"\$rp\" >&4 | |
1648 | echo $n \"[\$xxxm] $c\" >&4 | |
1649 | else | |
1650 | echo $n \"\$rp [\$xxxm] $c\" >&4 | |
1651 | fi | |
1652 | ;; | |
1653 | esac;; | |
1654 | esac" | |
1655 | ||
1656 | : now set up to do reads with possible shell escape and default assignment | |
1657 | cat <<EOSC >myread | |
28757baa | 1658 | $startsh |
2304df62 AD |
1659 | xxxm=\$dflt |
1660 | $myecho | |
1661 | ans='!' | |
1662 | case "\$fastread" in | |
1663 | yes) case "\$dflt" in | |
1664 | '') ;; | |
1665 | *) ans=''; | |
1666 | case "\$silent-\$rp" in | |
1667 | true-) ;; | |
1668 | *) echo " " >&4;; | |
1669 | esac;; | |
1670 | esac;; | |
1671 | *) case "\$silent" in | |
1672 | true) case "\$rp" in | |
1673 | '') ans='';; | |
1674 | esac;; | |
1675 | esac;; | |
1676 | esac | |
1677 | while expr "X\$ans" : "X!" >/dev/null; do | |
1678 | read answ | |
1679 | set x \$xxxm | |
1680 | shift | |
dfe9444c | 1681 | aok=''; eval "ans=\\"\$answ\\"" && aok=y |
2304df62 | 1682 | case "\$answ" in |
dfe9444c AD |
1683 | "!") |
1684 | sh 1>&4 | |
1685 | echo " " | |
1686 | $myecho | |
1687 | ;; | |
1688 | !*) | |
1689 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` | |
1690 | shift | |
1691 | sh 1>&4 -c "\$*" | |
1692 | echo " " | |
1693 | $myecho | |
1694 | ;; | |
2304df62 AD |
1695 | "\$ans") |
1696 | case "\$ans" in | |
ecfc5424 AD |
1697 | \\&*) |
1698 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` | |
1699 | shift | |
1700 | case "\$1" in | |
1701 | -d) | |
1702 | fastread=yes | |
40a7a20a | 1703 | echo "(OK, I'll run with -d after this question.)" >&4 |
ecfc5424 AD |
1704 | ;; |
1705 | -*) | |
40a7a20a | 1706 | echo "*** Sorry, \$1 not supported yet." >&4 |
ecfc5424 AD |
1707 | ;; |
1708 | esac | |
1709 | $myecho | |
1710 | ans=! | |
1711 | ;; | |
2304df62 AD |
1712 | esac;; |
1713 | *) | |
1714 | case "\$aok" in | |
1715 | y) | |
1716 | echo "*** Substitution done -- please confirm." | |
1717 | xxxm="\$ans" | |
c9795ab7 | 1718 | ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\` |
2304df62 AD |
1719 | xxxm="\$ans" |
1720 | ans=! | |
1721 | ;; | |
1722 | *) | |
1723 | echo "*** Error -- try again." | |
1724 | ans=! | |
1725 | ;; | |
1726 | esac | |
1727 | $myecho | |
1728 | ;; | |
1729 | esac | |
1730 | case "\$ans\$xxxm\$nostick" in | |
1731 | '') | |
1732 | ans=! | |
1733 | $myecho | |
1734 | ;; | |
1735 | esac | |
1736 | done | |
1737 | case "\$ans" in | |
1738 | '') ans="\$xxxm";; | |
1739 | esac | |
1740 | EOSC | |
1741 | ||
1742 | : create .config dir to save info across Configure sessions | |
1743 | test -d ../.config || mkdir ../.config | |
1744 | cat >../.config/README <<EOF | |
1745 | This directory created by Configure to save information that should | |
dfe9444c | 1746 | persist across sessions for $package. |
2304df62 AD |
1747 | |
1748 | You may safely delete it if you wish. | |
1749 | EOF | |
1750 | ||
1751 | : general instructions | |
1752 | needman=true | |
1753 | firsttime=true | |
760ac839 | 1754 | user=`(logname) 2>/dev/null` |
dfe9444c AD |
1755 | case "$user" in |
1756 | '') user=`whoami 2>&1`;; | |
760ac839 | 1757 | esac |
2304df62 AD |
1758 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
1759 | firsttime=false | |
1760 | echo " " | |
1761 | rp='Would you like to see the instructions?' | |
1762 | dflt=n | |
1763 | . ./myread | |
1764 | case "$ans" in | |
1765 | [yY]*) ;; | |
1766 | *) needman=false;; | |
1767 | esac | |
1768 | fi | |
1769 | if $needman; then | |
1770 | cat <<EOH | |
4e2a5f63 | 1771 | |
2304df62 | 1772 | This installation shell script will examine your system and ask you questions |
a0d0e21e | 1773 | to determine how the perl5 package should be installed. If you get |
2304df62 AD |
1774 | stuck on a question, you may use a ! shell escape to start a subshell or |
1775 | execute a command. Many of the questions will have default answers in square | |
1776 | brackets; typing carriage return will give you the default. | |
1777 | ||
1778 | On some of the questions which ask for file or directory names you are allowed | |
1779 | to use the ~name construct to specify the login directory belonging to "name", | |
1780 | even if you don't have a shell which knows about that. Questions where this is | |
1781 | allowed will be marked "(~name ok)". | |
1782 | ||
1783 | EOH | |
1784 | rp='' | |
1785 | dflt='Type carriage return to continue' | |
1786 | . ./myread | |
1787 | cat <<'EOH' | |
1788 | ||
1789 | The prompter used in this script allows you to use shell variables and | |
1790 | backticks in your answers. You may use $1, $2, etc... to refer to the words | |
1791 | in the default answer, as if the default line was a set of arguments given to a | |
1792 | script shell. This means you may also use $* to repeat the whole default line, | |
1793 | so you do not have to re-type everything to add something to the default. | |
1794 | ||
1795 | Everytime there is a substitution, you will have to confirm. If there is an | |
1796 | error (e.g. an unmatched backtick), the default answer will remain unchanged | |
1797 | and you will be prompted again. | |
1798 | ||
1799 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all | |
1800 | the questions and use the computed defaults (or the previous answers if there | |
1801 | was already a config.sh file). Type 'Configure -h' for a list of options. | |
ecfc5424 | 1802 | You may also start interactively and then answer '& -d' at any prompt to turn |
dfe9444c | 1803 | on the non-interactive behaviour for the remainder of the execution. |
2304df62 AD |
1804 | |
1805 | EOH | |
1806 | . ./myread | |
1807 | cat <<EOH | |
1808 | ||
1809 | Much effort has been expended to ensure that this shell script will run on any | |
1810 | Unix system. If despite that it blows up on yours, your best bet is to edit | |
40000a8c AD |
1811 | Configure and run it again. If you can't run Configure for some reason, |
1812 | you'll have to generate a config.sh file by hand. Whatever problems you | |
46193409 | 1813 | have, let me (perlbug@perl.com) know how I blew it. |
2304df62 AD |
1814 | |
1815 | This installation script affects things in two ways: | |
1816 | ||
1817 | 1) it may do direct variable substitutions on some of the files included | |
1818 | in this kit. | |
1819 | 2) it builds a config.h file for inclusion in C programs. You may edit | |
1820 | any of these files as the need arises after running this script. | |
1821 | ||
1822 | If you make a mistake on a question, there is no easy way to back up to it | |
1823 | currently. The easiest thing to do is to edit config.sh and rerun all the SH | |
1824 | files. Configure will offer to let you do this before it runs the SH files. | |
1825 | ||
1826 | EOH | |
1827 | dflt='Type carriage return to continue' | |
1828 | . ./myread | |
1829 | case "$firsttime" in | |
1830 | true) echo $user >>../.config/instruct;; | |
1831 | esac | |
1832 | fi | |
1833 | ||
2304df62 AD |
1834 | : find out where common programs are |
1835 | echo " " | |
1836 | echo "Locating common programs..." >&4 | |
1837 | cat <<EOSC >loc | |
1838 | $startsh | |
1839 | case \$# in | |
1840 | 0) exit 1;; | |
1841 | esac | |
1842 | thing=\$1 | |
1843 | shift | |
1844 | dflt=\$1 | |
1845 | shift | |
1846 | for dir in \$*; do | |
1847 | case "\$thing" in | |
1848 | .) | |
1849 | if test -d \$dir/\$thing; then | |
1850 | echo \$dir | |
1851 | exit 0 | |
1852 | fi | |
1853 | ;; | |
1854 | *) | |
a0d0e21e | 1855 | for thisthing in \$dir/\$thing; do |
ecfc5424 | 1856 | : just loop through to pick last item |
a0d0e21e | 1857 | done |
25f94b33 | 1858 | if test -f \$thisthing; then |
a0d0e21e | 1859 | echo \$thisthing |
2304df62 AD |
1860 | exit 0 |
1861 | elif test -f \$dir/\$thing.exe; then | |
c4f23d77 AD |
1862 | if test -n "$DJGPP"; then |
1863 | echo \$dir/\$thing.exe | |
1864 | else | |
1865 | : on Eunice apparently | |
1866 | echo \$dir/\$thing | |
1867 | fi | |
2304df62 AD |
1868 | exit 0 |
1869 | fi | |
1870 | ;; | |
1871 | esac | |
1872 | done | |
1873 | echo \$dflt | |
1874 | exit 1 | |
1875 | EOSC | |
1876 | chmod +x loc | |
1877 | $eunicefix loc | |
1878 | loclist=" | |
1879 | awk | |
1880 | cat | |
ecfc5424 | 1881 | comm |
2304df62 AD |
1882 | cp |
1883 | echo | |
1884 | expr | |
1885 | grep | |
a0d0e21e | 1886 | ls |
dfe9444c | 1887 | make |
2304df62 | 1888 | mkdir |
2304df62 AD |
1889 | rm |
1890 | sed | |
1891 | sort | |
85e6fe83 | 1892 | touch |
2304df62 AD |
1893 | tr |
1894 | uniq | |
1895 | " | |
1896 | trylist=" | |
1897 | Mcc | |
dfe9444c | 1898 | ar |
2304df62 AD |
1899 | byacc |
1900 | cpp | |
1901 | csh | |
1902 | date | |
1903 | egrep | |
8ff267be | 1904 | gzip |
2c7991dc | 1905 | less |
8ff267be | 1906 | ln |
2c7991dc | 1907 | more |
693762b4 | 1908 | nm |
2304df62 | 1909 | nroff |
2c7991dc | 1910 | pg |
2304df62 AD |
1911 | test |
1912 | uname | |
8ff267be | 1913 | zip |
2304df62 | 1914 | " |
8e07c86e | 1915 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
1916 | pth="$pth /lib /usr/lib" |
1917 | for file in $loclist; do | |
dfe9444c AD |
1918 | eval xxx=\$$file |
1919 | case "$xxx" in | |
1920 | /*|?:[\\/]*) | |
1921 | if test -f "$xxx"; then | |
1922 | : ok | |
1923 | else | |
1924 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 | |
1925 | xxx=`./loc $file $file $pth` | |
1926 | fi | |
1927 | ;; | |
1928 | '') xxx=`./loc $file $file $pth`;; | |
1929 | *) xxx=`./loc $xxx $xxx $pth`;; | |
1930 | esac | |
2304df62 AD |
1931 | eval $file=$xxx |
1932 | eval _$file=$xxx | |
1933 | case "$xxx" in | |
1934 | /*) | |
1935 | echo $file is in $xxx. | |
1936 | ;; | |
8e07c86e AD |
1937 | ?:[\\/]*) |
1938 | echo $file is in $xxx. | |
1939 | ;; | |
2304df62 | 1940 | *) |
25f94b33 AD |
1941 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
1942 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
4633a7c4 | 1943 | exit 1 |
2304df62 AD |
1944 | ;; |
1945 | esac | |
1946 | done | |
1947 | echo " " | |
1948 | echo "Don't worry if any of the following aren't found..." | |
1949 | say=offhand | |
1950 | for file in $trylist; do | |
dfe9444c AD |
1951 | eval xxx=\$$file |
1952 | case "$xxx" in | |
1953 | /*|?:[\\/]*) | |
1954 | if test -f "$xxx"; then | |
1955 | : ok | |
1956 | else | |
1957 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 | |
1958 | xxx=`./loc $file $file $pth` | |
1959 | fi | |
1960 | ;; | |
1961 | '') xxx=`./loc $file $file $pth`;; | |
1962 | *) xxx=`./loc $xxx $xxx $pth`;; | |
1963 | esac | |
2304df62 AD |
1964 | eval $file=$xxx |
1965 | eval _$file=$xxx | |
1966 | case "$xxx" in | |
1967 | /*) | |
1968 | echo $file is in $xxx. | |
1969 | ;; | |
8e07c86e AD |
1970 | ?:[\\/]*) |
1971 | echo $file is in $xxx. | |
1972 | ;; | |
2304df62 AD |
1973 | *) |
1974 | echo "I don't see $file out there, $say." | |
1975 | say=either | |
1976 | ;; | |
1977 | esac | |
1978 | done | |
1979 | case "$egrep" in | |
1980 | egrep) | |
1981 | echo "Substituting grep for egrep." | |
1982 | egrep=$grep | |
1983 | ;; | |
1984 | esac | |
8ff267be | 1985 | case "$ln" in |
1986 | ln) | |
1987 | echo "Substituting cp for ln." | |
1988 | ln=$cp | |
1989 | ;; | |
1990 | esac | |
2304df62 AD |
1991 | case "$test" in |
1992 | test) | |
1993 | echo "Hopefully test is built into your sh." | |
1994 | ;; | |
1995 | *) | |
ecfc5424 | 1996 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
2304df62 AD |
1997 | echo "Using the test built into your sh." |
1998 | test=test | |
1999 | _test=test | |
2000 | fi | |
2001 | ;; | |
2002 | esac | |
2003 | case "$echo" in | |
2004 | echo) | |
2005 | echo "Hopefully echo is built into your sh." | |
2006 | ;; | |
2007 | '') ;; | |
2008 | *) | |
2009 | echo " " | |
2010 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
2011 | $echo $n "hi there$c" >foo1 | |
2012 | echo $n "hi there$c" >foo2 | |
2013 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
2014 | echo "They are compatible. In fact, they may be identical." | |
2015 | else | |
2016 | case "$n" in | |
2017 | '-n') n='' c='\c';; | |
2018 | *) n='-n' c='';; | |
2019 | esac | |
2020 | cat <<FOO | |
2021 | They are not compatible! You are probably running ksh on a non-USG system. | |
2022 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
2023 | have echo built in and we may have to run some Bourne shell scripts. That | |
2024 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
2025 | ||
2026 | FOO | |
2027 | $echo $n "The star should be here-->$c" | |
2028 | $echo "*" | |
2029 | fi | |
2030 | $rm -f foo1 foo2 | |
2031 | ;; | |
2032 | esac | |
2033 | ||
a0d0e21e LW |
2034 | : determine whether symbolic links are supported |
2035 | echo " " | |
2036 | $touch blurfl | |
2037 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
2038 | echo "Symbolic links are supported." >&4 | |
2039 | lns="$ln -s" | |
2040 | else | |
2041 | echo "Symbolic links are NOT supported." >&4 | |
2042 | lns="$ln" | |
2043 | fi | |
2044 | $rm -f blurfl sym | |
2045 | ||
ecfc5424 AD |
2046 | : see whether [:lower:] and [:upper:] are supported character classes |
2047 | echo " " | |
ecfc5424 AD |
2048 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in |
2049 | ABYZ) | |
2050 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
2051 | up='[:upper:]' | |
2052 | low='[:lower:]' | |
2053 | ;; | |
28e8609d JH |
2054 | *) # There is a discontinuity in EBCDIC between 'I' and 'J' |
2055 | # (0xc9 and 0xd1), therefore that is a nice testing point. | |
2056 | if test "X$up" = X -o "X$low" = X; then | |
3eaeeeae | 2057 | case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in |
28e8609d JH |
2058 | ij) up='[A-Z]' |
2059 | low='[a-z]' | |
2060 | ;; | |
2061 | esac | |
2062 | fi | |
2063 | if test "X$up" = X -o "X$low" = X; then | |
3eaeeeae | 2064 | case "`echo IJ | $tr I-J i-j 2>/dev/null`" in |
28e8609d JH |
2065 | ij) up='A-Z' |
2066 | low='a-z' | |
2067 | ;; | |
2068 | esac | |
2069 | fi | |
2070 | if test "X$up" = X -o "X$low" = X; then | |
2071 | case "`echo IJ | od -x 2>/dev/null`" in | |
2072 | *C9D1*|*c9d1*) | |
2073 | echo "Hey, this might be EBCDIC." >&4 | |
2074 | if test "X$up" = X -o "X$low" = X; then | |
5ff3f7a4 | 2075 | case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
28e8609d JH |
2076 | ij) up='[A-IJ-RS-Z]' |
2077 | low='[a-ij-rs-z]' | |
2078 | ;; | |
2079 | esac | |
2080 | fi | |
2081 | if test "X$up" = X -o "X$low" = X; then | |
5ff3f7a4 | 2082 | case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
28e8609d JH |
2083 | ij) up='A-IJ-RS-Z' |
2084 | low='a-ij-rs-z' | |
2085 | ;; | |
2086 | esac | |
2087 | fi | |
2088 | ;; | |
2089 | esac | |
2090 | fi | |
2091 | esac | |
3eaeeeae | 2092 | case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in |
28e8609d JH |
2093 | ij) |
2094 | echo "Using $up and $low to convert case." >&4 | |
2095 | ;; | |
ecfc5424 | 2096 | *) |
28e8609d JH |
2097 | echo "I don't know how to translate letters from upper to lower case." >&4 |
2098 | echo "Your tr is not acting any way I know of." >&4 | |
2099 | exit 1 | |
2100 | ;; | |
ecfc5424 AD |
2101 | esac |
2102 | : set up the translation script tr, must be called with ./tr of course | |
2103 | cat >tr <<EOSC | |
2104 | $startsh | |
2105 | case "\$1\$2" in | |
2106 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
2107 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
2108 | esac | |
2109 | exec $tr "\$@" | |
2110 | EOSC | |
2111 | chmod +x tr | |
2112 | $eunicefix tr | |
2113 | ||
2304df62 AD |
2114 | : Try to determine whether config.sh was made on this system |
2115 | case "$config_sh" in | |
2116 | '') | |
43999f95 JH |
2117 | myuname=`$uname -a 2>/dev/null` |
2118 | $test -z "$myuname" && myuname=`hostname 2>/dev/null` | |
28e8609d JH |
2119 | # tr '[A-Z]' '[a-z]' would not work in EBCDIC |
2120 | # because the A-Z/a-z are not consecutive. | |
a0d0e21e | 2121 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
3eaeeeae | 2122 | ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` |
1aef975c | 2123 | newmyuname="$myuname" |
2304df62 | 2124 | dflt=n |
16d20bd9 AD |
2125 | case "$knowitall" in |
2126 | '') | |
2127 | if test -f ../config.sh; then | |
2128 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
2129 | eval "`grep myuname= ../config.sh`" | |
2130 | fi | |
2131 | if test "X$myuname" = "X$newmyuname"; then | |
2132 | dflt=y | |
2133 | fi | |
2304df62 | 2134 | fi |
16d20bd9 AD |
2135 | ;; |
2136 | *) dflt=y;; | |
2137 | esac | |
2304df62 AD |
2138 | |
2139 | : Get old answers from old config file if Configure was run on the | |
2140 | : same system, otherwise use the hints. | |
2141 | hint=default | |
2142 | cd .. | |
2143 | if test -f config.sh; then | |
16d20bd9 AD |
2144 | echo " " |
2145 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
2146 | . UU/myread |
2147 | case "$ans" in | |
2148 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; | |
2149 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
ecfc5424 AD |
2150 | tmp_n="$n" |
2151 | tmp_c="$c" | |
85cad39c | 2152 | tmp_sh="$sh" |
2304df62 AD |
2153 | . ./config.sh |
2154 | cp config.sh UU | |
ecfc5424 AD |
2155 | n="$tmp_n" |
2156 | c="$tmp_c" | |
85cad39c | 2157 | : Older versions did not always set $sh. Catch re-use of such |
2158 | : an old config.sh. | |
2159 | case "$sh" in | |
2160 | '') sh="$tmp_sh" ;; | |
2161 | esac | |
2304df62 AD |
2162 | hint=previous |
2163 | ;; | |
2164 | esac | |
2165 | fi | |
2166 | if test ! -f config.sh; then | |
2167 | $cat <<EOM | |
2168 | ||
4e2a5f63 AD |
2169 | First time through, eh? I have some defaults handy for some systems |
2170 | that need some extra help getting the Configure answers right: | |
2304df62 AD |
2171 | |
2172 | EOM | |
dfe9444c | 2173 | (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
2304df62 AD |
2174 | dflt='' |
2175 | : Half the following guesses are probably wrong... If you have better | |
46193409 | 2176 | : tests or hints, please send them to perlbug@perl.com |
2304df62 | 2177 | : The metaconfig authors would also appreciate a copy... |
a0d0e21e | 2178 | $test -f /irix && osname=irix |
85e6fe83 LW |
2179 | $test -f /xenix && osname=sco_xenix |
2180 | $test -f /dynix && osname=dynix | |
2181 | $test -f /dnix && osname=dnix | |
5f05dabc | 2182 | $test -f /lynx.os && osname=lynxos |
2183 | $test -f /unicos && osname=unicos && osvers=`$uname -r` | |
c71a9cee | 2184 | $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` |
7a4c00b4 | 2185 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
85e6fe83 | 2186 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
2187 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
2188 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
2189 | $test -d /usr/apollo/bin && osname=apollo |
2190 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 2191 | $test -d /usr/include/minix && osname=minix |
e060872b | 2192 | if $test -d /MachTen -o -d /MachTen_Folder; then |
dfe9444c | 2193 | osname=machten |
4633a7c4 | 2194 | if $test -x /sbin/version; then |
dfe9444c | 2195 | osvers=`/sbin/version | $awk '{print $2}' | |
4633a7c4 LW |
2196 | $sed -e 's/[A-Za-z]$//'` |
2197 | elif $test -x /usr/etc/version; then | |
dfe9444c | 2198 | osvers=`/usr/etc/version | $awk '{print $2}' | |
4633a7c4 LW |
2199 | $sed -e 's/[A-Za-z]$//'` |
2200 | else | |
2201 | osvers="$2.$3" | |
2202 | fi | |
2203 | fi | |
aaacdc8b GS |
2204 | |
2205 | $test -f /sys/posix.dll && | |
2206 | $test -f /usr/bin/what && | |
2207 | set X `/usr/bin/what /sys/posix.dll` && | |
2208 | $test "$3" = UWIN && | |
2209 | osname=uwin && | |
2210 | osvers="$5" | |
2211 | ||
2304df62 AD |
2212 | if $test -f $uname; then |
2213 | set X $myuname | |
2214 | shift | |
2215 | ||
2304df62 | 2216 | case "$5" in |
85e6fe83 | 2217 | fps*) osname=fps ;; |
2304df62 AD |
2218 | mips*) |
2219 | case "$4" in | |
85e6fe83 LW |
2220 | umips) osname=umips ;; |
2221 | *) osname=mips ;; | |
2304df62 | 2222 | esac;; |
85e6fe83 LW |
2223 | [23]100) osname=mips ;; |
2224 | next*) osname=next ;; | |
ecfc5424 | 2225 | i386*) |
c6912327 JH |
2226 | tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` |
2227 | if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then | |
619ffc2b JH |
2228 | osname='sco' |
2229 | osvers=$tmp | |
2230 | elif $test -f /etc/kconfig; then | |
ecfc5424 | 2231 | osname=isc |
bd628c73 | 2232 | if test "$lns" = "$ln -s"; then |
a0d0e21e LW |
2233 | osvers=4 |
2234 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
2235 | osvers=3 | |
2304df62 | 2236 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 2237 | osvers=2 |
ecfc5424 AD |
2238 | fi |
2239 | fi | |
2000072c | 2240 | tmp='' |
ecfc5424 | 2241 | ;; |
c4f23d77 AD |
2242 | pc*) |
2243 | if test -n "$DJGPP"; then | |
2244 | osname=dos | |
2245 | osvers=djgpp | |
2246 | fi | |
2247 | ;; | |
2304df62 AD |
2248 | esac |
2249 | ||
2250 | case "$1" in | |
a0d0e21e LW |
2251 | aix) osname=aix |
2252 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
2253 | case "$tmp" in | |
1aef975c | 2254 | 'not found') osvers="$4"."$3" ;; |
a0d0e21e LW |
2255 | '<3240'|'<>3240') osvers=3.2.0 ;; |
2256 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
2257 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 2258 | *) osvers=$tmp;; |
a0d0e21e LW |
2259 | esac |
2260 | ;; | |
aaacdc8b GS |
2261 | bsd386) osname=bsd386 |
2262 | osvers=`$uname -r` | |
2263 | ;; | |
2264 | cygwin*) osname=cygwin | |
2265 | osvers="$3" | |
2266 | ;; | |
23f87696 SZ |
2267 | *dc.osx) osname=dcosx |
2268 | osvers="$3" | |
2269 | ;; | |
a0d0e21e LW |
2270 | dnix) osname=dnix |
2271 | osvers="$3" | |
2272 | ;; | |
2273 | domainos) osname=apollo | |
2274 | osvers="$3" | |
2275 | ;; | |
2276 | dgux) osname=dgux | |
2277 | osvers="$3" | |
2278 | ;; | |
760ac839 | 2279 | dynixptx*) osname=dynixptx |
e58e581d | 2280 | osvers=`echo "$4"|sed 's/^v//'` |
760ac839 | 2281 | ;; |
a0d0e21e LW |
2282 | freebsd) osname=freebsd |
2283 | osvers="$3" ;; | |
2284 | genix) osname=genix ;; | |
2285 | hp*) osname=hpux | |
bfb7748a | 2286 | osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` |
a0d0e21e | 2287 | ;; |
a78b0d02 | 2288 | irix*) osname=irix |
a0d0e21e LW |
2289 | case "$3" in |
2290 | 4*) osvers=4 ;; | |
2291 | 5*) osvers=5 ;; | |
ecfc5424 | 2292 | *) osvers="$3" ;; |
a0d0e21e LW |
2293 | esac |
2294 | ;; | |
2295 | linux) osname=linux | |
2296 | case "$3" in | |
a0d0e21e LW |
2297 | *) osvers="$3" ;; |
2298 | esac | |
2299 | ;; | |
28e8609d JH |
2300 | MiNT) osname=mint |
2301 | ;; | |
2302 | netbsd*) osname=netbsd | |
ecfc5424 AD |
2303 | osvers="$3" |
2304 | ;; | |
4e81affe MM |
2305 | news-os) osvers="$3" |
2306 | case "$3" in | |
2307 | 4*) osname=newsos4 ;; | |
2308 | *) osname=newsos ;; | |
2309 | esac | |
2310 | ;; | |
aaacdc8b GS |
2311 | next*) osname=next ;; |
2312 | POSIX-BC | posix-bc ) osname=posix-bc | |
2313 | osvers="$3" | |
a0d0e21e | 2314 | ;; |
ae3afa4e TH |
2315 | powerux | power_ux | powermax_os | powermaxos | \ |
2316 | powerunix | power_unix) osname=powerux | |
2317 | osvers="$3" | |
2318 | ;; | |
aaacdc8b GS |
2319 | qnx) osname=qnx |
2320 | osvers="$4" | |
2321 | ;; | |
a0d0e21e LW |
2322 | solaris) osname=solaris |
2323 | case "$3" in | |
2324 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 2325 | *) osvers="$3" ;; |
a0d0e21e LW |
2326 | esac |
2327 | ;; | |
85e6fe83 LW |
2328 | sunos) osname=sunos |
2329 | case "$3" in | |
85e6fe83 LW |
2330 | 5*) osname=solaris |
2331 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 2332 | *) osvers="$3" ;; |
2304df62 AD |
2333 | esac |
2334 | ;; | |
a0d0e21e | 2335 | titanos) osname=titanos |
85e6fe83 | 2336 | case "$3" in |
a0d0e21e LW |
2337 | 1*) osvers=1 ;; |
2338 | 2*) osvers=2 ;; | |
2339 | 3*) osvers=3 ;; | |
2340 | 4*) osvers=4 ;; | |
ecfc5424 | 2341 | *) osvers="$3" ;; |
2304df62 AD |
2342 | esac |
2343 | ;; | |
85e6fe83 | 2344 | ultrix) osname=ultrix |
ecfc5424 | 2345 | osvers="$3" |
2304df62 | 2346 | ;; |
28757baa | 2347 | osf1|mls+) case "$5" in |
fed7345c AD |
2348 | alpha) |
2349 | osname=dec_osf | |
313489a2 | 2350 | osvers=`echo "$3" | sed 's/^[xvt]//'` |
ecfc5424 AD |
2351 | ;; |
2352 | hp*) osname=hp_osf1 ;; | |
2353 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
2354 | esac |
2355 | ;; | |
0337d152 BG |
2356 | unixware) osname=svr5 |
2357 | osvers="$4" | |
2358 | ;; | |
2359 | uts) osname=uts | |
a0d0e21e LW |
2360 | osvers="$3" |
2361 | ;; | |
85e6fe83 | 2362 | $2) case "$osname" in |
2304df62 | 2363 | *isc*) ;; |
a0d0e21e | 2364 | *freebsd*) ;; |
5f05dabc | 2365 | svr*) |
a0d0e21e LW |
2366 | : svr4.x or possibly later |
2367 | case "svr$3" in | |
2368 | ${osname}*) | |
2369 | osname=svr$3 | |
2370 | osvers=$4 | |
2371 | ;; | |
2372 | esac | |
2373 | case "$osname" in | |
2374 | svr4.0) | |
2375 | : Check for ESIX | |
2376 | if test -f /stand/boot ; then | |
2377 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
2378 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
2379 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
2380 | if test -n "$isesix"; then | |
a0d0e21e LW |
2381 | osname=esix4 |
2382 | fi | |
2383 | fi | |
2384 | fi | |
2385 | ;; | |
2386 | esac | |
2387 | ;; | |
2304df62 | 2388 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
2389 | osname=sco |
2390 | set `echo $3 | $sed 's/\./ /g'` $4 | |
c4f23d77 | 2391 | if $test -f $src/hints/sco_$1_$2_$3.sh; then |
85e6fe83 | 2392 | osvers=$1.$2.$3 |
c4f23d77 | 2393 | elif $test -f $src/hints/sco_$1_$2.sh; then |
85e6fe83 | 2394 | osvers=$1.$2 |
c4f23d77 | 2395 | elif $test -f $src/hints/sco_$1.sh; then |
85e6fe83 | 2396 | osvers=$1 |
2304df62 | 2397 | fi |
a0d0e21e LW |
2398 | else |
2399 | case "$osname" in | |
2400 | '') : Still unknown. Probably a generic Sys V. | |
2401 | osname="sysv" | |
2402 | osvers="$3" | |
2403 | ;; | |
2404 | esac | |
2304df62 AD |
2405 | fi |
2406 | ;; | |
2407 | esac | |
2408 | ;; | |
a0d0e21e LW |
2409 | *) case "$osname" in |
2410 | '') : Still unknown. Probably a generic BSD. | |
2411 | osname="$1" | |
2412 | osvers="$3" | |
2413 | ;; | |
2414 | esac | |
2415 | ;; | |
2304df62 AD |
2416 | esac |
2417 | else | |
dfe9444c AD |
2418 | if test -f /vmunix -a -f $src/hints/news_os.sh; then |
2419 | (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 | |
2420 | if $contains news-os UU/kernel.what >/dev/null 2>&1; then | |
2421 | osname=news_os | |
2304df62 | 2422 | fi |
dfe9444c | 2423 | $rm -f UU/kernel.what |
8e07c86e AD |
2424 | elif test -d c:/.; then |
2425 | set X $myuname | |
2426 | osname=os2 | |
2427 | osvers="$5" | |
2304df62 AD |
2428 | fi |
2429 | fi | |
85e6fe83 | 2430 | |
a0d0e21e LW |
2431 | : Now look for a hint file osname_osvers, unless one has been |
2432 | : specified already. | |
2433 | case "$hintfile" in | |
2434 | ''|' ') | |
1e127011 | 2435 | file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'` |
a0d0e21e | 2436 | : Also try without trailing minor version numbers. |
1e127011 DD |
2437 | xfile=`echo $file | $sed -e 's%_[^_]*$%%'` |
2438 | xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'` | |
2439 | xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'` | |
2440 | xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'` | |
a0d0e21e LW |
2441 | case "$file" in |
2442 | '') dflt=none ;; | |
2443 | *) case "$osvers" in | |
2444 | '') dflt=$file | |
2445 | ;; | |
dfe9444c | 2446 | *) if $test -f $src/hints/$file.sh ; then |
a0d0e21e | 2447 | dflt=$file |
dfe9444c | 2448 | elif $test -f $src/hints/$xfile.sh ; then |
a0d0e21e | 2449 | dflt=$xfile |
dfe9444c | 2450 | elif $test -f $src/hints/$xxfile.sh ; then |
a0d0e21e | 2451 | dflt=$xxfile |
dfe9444c | 2452 | elif $test -f $src/hints/$xxxfile.sh ; then |
a0d0e21e | 2453 | dflt=$xxxfile |
dfe9444c | 2454 | elif $test -f $src/hints/$xxxxfile.sh ; then |
a0d0e21e | 2455 | dflt=$xxxxfile |
dfe9444c | 2456 | elif $test -f "$src/hints/${osname}.sh" ; then |
a0d0e21e LW |
2457 | dflt="${osname}" |
2458 | else | |
2459 | dflt=none | |
2460 | fi | |
2461 | ;; | |
2462 | esac | |
85e6fe83 LW |
2463 | ;; |
2464 | esac | |
4e2a5f63 AD |
2465 | if $test -f Policy.sh ; then |
2466 | case "$dflt" in | |
2467 | *Policy*) ;; | |
2468 | none) dflt="Policy" ;; | |
2469 | *) dflt="Policy $dflt" ;; | |
2470 | esac | |
2471 | fi | |
85e6fe83 | 2472 | ;; |
a0d0e21e | 2473 | *) |
ecfc5424 | 2474 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 2475 | ;; |
2304df62 | 2476 | esac |
1aef975c | 2477 | |
4e2a5f63 AD |
2478 | if $test -f Policy.sh ; then |
2479 | $cat <<EOM | |
2480 | ||
2481 | There's also a Policy hint file available, which should make the | |
2482 | site-specific (policy) questions easier to answer. | |
2483 | EOM | |
2484 | ||
2485 | fi | |
2486 | ||
2304df62 AD |
2487 | $cat <<EOM |
2488 | ||
2489 | You may give one or more space-separated answers, or "none" if appropriate. | |
4e2a5f63 | 2490 | A well-behaved OS will have no hints, so answering "none" or just "Policy" |
a3635516 | 2491 | is a good thing. DO NOT give a wrong version or a wrong OS. |
2304df62 AD |
2492 | |
2493 | EOM | |
4e2a5f63 | 2494 | |
2304df62 | 2495 | rp="Which of these apply, if any?" |
dfe9444c | 2496 | . UU/myread |
85e6fe83 LW |
2497 | tans=$ans |
2498 | for file in $tans; do | |
4e2a5f63 AD |
2499 | if $test X$file = XPolicy -a -f Policy.sh; then |
2500 | . Policy.sh | |
2501 | $cat Policy.sh >> UU/config.sh | |
2502 | elif $test -f $src/hints/$file.sh; then | |
dfe9444c AD |
2503 | . $src/hints/$file.sh |
2504 | $cat $src/hints/$file.sh >> UU/config.sh | |
85e6fe83 | 2505 | elif $test X$tans = X -o X$tans = Xnone ; then |
2304df62 AD |
2506 | : nothing |
2507 | else | |
85e6fe83 LW |
2508 | : Give one chance to correct a possible typo. |
2509 | echo "$file.sh does not exist" | |
2510 | dflt=$file | |
2511 | rp="hint to use instead?" | |
dfe9444c | 2512 | . UU/myread |
85e6fe83 | 2513 | for file in $ans; do |
dfe9444c AD |
2514 | if $test -f "$src/hints/$file.sh"; then |
2515 | . $src/hints/$file.sh | |
2516 | $cat $src/hints/$file.sh >> UU/config.sh | |
85e6fe83 LW |
2517 | elif $test X$ans = X -o X$ans = Xnone ; then |
2518 | : nothing | |
2519 | else | |
2520 | echo "$file.sh does not exist -- ignored." | |
2521 | fi | |
2522 | done | |
2304df62 AD |
2523 | fi |
2524 | done | |
85e6fe83 | 2525 | |
2304df62 | 2526 | hint=recommended |
85e6fe83 | 2527 | : Remember our hint file for later. |
dfe9444c | 2528 | if $test -f "$src/hints/$file.sh" ; then |
a0d0e21e | 2529 | hintfile="$file" |
85e6fe83 | 2530 | else |
a0d0e21e | 2531 | hintfile='' |
85e6fe83 | 2532 | fi |
2304df62 AD |
2533 | fi |
2534 | cd UU | |
2535 | ;; | |
2536 | *) | |
2537 | echo " " | |
2538 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
2539 | tmp_n="$n" |
2540 | tmp_c="$c" | |
2304df62 AD |
2541 | cd .. |
2542 | cp $config_sh config.sh 2>/dev/null | |
a78b0d02 | 2543 | chmod +w config.sh |
2304df62 AD |
2544 | . ./config.sh |
2545 | cd UU | |
2546 | cp ../config.sh . | |
ecfc5424 AD |
2547 | n="$tmp_n" |
2548 | c="$tmp_c" | |
2304df62 AD |
2549 | hint=previous |
2550 | ;; | |
2551 | esac | |
1aef975c AD |
2552 | test "$override" && . ./optdef.sh |
2553 | myuname="$newmyuname" | |
2304df62 AD |
2554 | |
2555 | : Restore computed paths | |
2556 | for file in $loclist $trylist; do | |
2557 | eval $file="\$_$file" | |
2558 | done | |
2559 | ||
85e6fe83 | 2560 | cat << EOM |
a0d0e21e | 2561 | |
85e6fe83 | 2562 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
2563 | The default value is probably right if the name rings a bell. Otherwise, |
2564 | since spelling matters for me, either accept the default or answer "none" | |
2565 | to leave it blank. | |
a0d0e21e | 2566 | |
85e6fe83 | 2567 | EOM |
85e6fe83 | 2568 | case "$osname" in |
a0d0e21e | 2569 | ''|' ') |
85e6fe83 | 2570 | case "$hintfile" in |
a0d0e21e | 2571 | ''|' '|none) dflt=none ;; |
ecfc5424 | 2572 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
2573 | esac |
2574 | ;; | |
2575 | *) dflt="$osname" ;; | |
2576 | esac | |
2577 | rp="Operating system name?" | |
2578 | . ./myread | |
2579 | case "$ans" in | |
ecfc5424 AD |
2580 | none) osname='' ;; |
2581 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 2582 | esac |
8ff267be | 2583 | echo " " |
2584 | case "$osvers" in | |
2585 | ''|' ') | |
2586 | case "$hintfile" in | |
2587 | ''|' '|none) dflt=none ;; | |
2588 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` | |
2589 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` | |
2590 | case "$dflt" in | |
2591 | ''|' ') dflt=none ;; | |
2592 | esac | |
2593 | ;; | |
2594 | esac | |
2595 | ;; | |
2596 | *) dflt="$osvers" ;; | |
2597 | esac | |
2598 | rp="Operating system version?" | |
2599 | . ./myread | |
2600 | case "$ans" in | |
2601 | none) osvers='' ;; | |
2602 | *) osvers="$ans" ;; | |
2603 | esac | |
2604 | ||
02e93a22 JH |
2605 | |
2606 | . ./posthint.sh | |
2607 | ||
2304df62 | 2608 | : who configured the system |
59b83a6f | 2609 | cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1` |
8ff267be | 2610 | cf_by=`(logname) 2>/dev/null` |
dfe9444c AD |
2611 | case "$cf_by" in |
2612 | "") | |
8ff267be | 2613 | cf_by=`(whoami) 2>/dev/null` |
dfe9444c AD |
2614 | case "$cf_by" in |
2615 | "") cf_by=unknown ;; | |
8ff267be | 2616 | esac ;; |
2617 | esac | |
2304df62 | 2618 | |
dfe9444c AD |
2619 | : set up the script used to warn in case of inconsistency |
2620 | cat <<EOS >whoa | |
2621 | $startsh | |
2622 | EOS | |
2623 | cat <<'EOSC' >>whoa | |
2624 | dflt=y | |
2625 | echo " " | |
2626 | echo "*** WHOA THERE!!! ***" >&4 | |
2627 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
2628 | rp=" Keep the $hint value?" | |
2629 | . ./myread | |
2630 | case "$ans" in | |
2631 | y) td=$was; tu=$was;; | |
2632 | esac | |
2633 | EOSC | |
2634 | ||
2635 | : function used to set $1 to $val | |
2636 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
2637 | case "$val$was" in | |
2638 | $define$undef) . ./whoa; eval "$var=\$td";; | |
2639 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
2640 | *) eval "$var=$val";; | |
2641 | esac' | |
2642 | ||
0f0995ae JH |
2643 | case "$usethreads" in |
2644 | $define|true|[yY]*) dflt='y';; | |
2645 | *) dflt='n';; | |
2646 | esac | |
64e689dc JH |
2647 | cat <<EOM |
2648 | ||
3645a519 | 2649 | Perl can be built to take advantage of threads on some systems. |
0f0995ae | 2650 | To do so, Configure can be run with -Dusethreads. |
d00b958f JH |
2651 | |
2652 | Note that threading is a highly experimental feature, and | |
2653 | some known race conditions still remain. If you choose to try | |
2654 | it, be very sure to not actually deploy it for production | |
2655 | purposes. README.threads has more details, and is required | |
2656 | reading if you enable threads. | |
0f0995ae JH |
2657 | |
2658 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
64e689dc | 2659 | EOM |
64e689dc JH |
2660 | rp='Build a threading Perl?' |
2661 | . ./myread | |
2662 | case "$ans" in | |
aaacdc8b | 2663 | y|Y) val="$define" ;; |
64e689dc | 2664 | *) val="$undef" ;; |
dfe9444c | 2665 | esac |
64e689dc | 2666 | set usethreads |
aaacdc8b GS |
2667 | eval $setvar |
2668 | ||
2669 | case "$usethreads" in | |
2670 | $define) | |
2671 | $cat <<EOM | |
2672 | ||
ff42dc34 | 2673 | As of 5.5.640, Perl has two different internal threading implementations, |
aaacdc8b GS |
2674 | the 5.005 version (5005threads) and an interpreter-based version |
2675 | (ithreads) that has one interpreter per thread. Both are very | |
2676 | experimental. This arrangement exists to help developers work out | |
2677 | which one is better. | |
3645a519 JH |
2678 | |
2679 | If you're a casual user, you probably don't want interpreter-threads | |
2680 | at this time. There doesn't yet exist a way to create threads from | |
2681 | within Perl in this model, i.e., "use Thread;" will NOT work. | |
aaacdc8b GS |
2682 | EOM |
2683 | : Default to ithreads unless overridden on command line or with | |
2684 | : old config.sh | |
2685 | dflt='y' | |
2686 | case "$use5005threads" in | |
2687 | $define|true|[yY]*) dflt='n';; | |
2688 | esac | |
2689 | case "$useithreads" in | |
2690 | $undef|false|[nN]*) dflt='n';; | |
2691 | esac | |
2692 | rp='Use interpreter-based ithreads?' | |
2693 | . ./myread | |
2694 | case "$ans" in | |
2695 | y|Y) val="$define" ;; | |
2696 | *) val="$undef" ;; | |
2697 | esac | |
2698 | set useithreads | |
2699 | eval $setvar | |
2700 | : Now set use5005threads to the opposite value. | |
2701 | case "$useithreads" in | |
2702 | $define) val="$undef" ;; | |
2703 | *) val="$define" ;; | |
2704 | esac | |
2705 | set use5005threads | |
2706 | eval $setvar | |
2707 | ;; | |
2708 | *) | |
2709 | useithreads="$undef" | |
2710 | use5005threads="$undef" | |
2711 | ;; | |
2712 | esac | |
104d25b7 | 2713 | |
693762b4 AD |
2714 | case "$d_oldpthreads" in |
2715 | '') : Configure tests would be welcome here. For now, assume undef. | |
2716 | val="$undef" ;; | |
2717 | *) val="$d_oldpthreads" ;; | |
2718 | esac | |
2719 | set d_oldpthreads | |
2720 | eval $setvar | |
dfe9444c | 2721 | |
b691c02f JH |
2722 | |
2723 | case "$usethreads" in | |
104d25b7 JH |
2724 | "$define"|true|[yY]*) |
2725 | : Look for a hint-file generated 'call-back-unit'. If the | |
2726 | : user has specified that a threading perl is to be built, | |
2727 | : we may need to set or change some other defaults. | |
2728 | if $test -f usethreads.cbu; then | |
e5e20432 | 2729 | echo "Your platform has some specific hints for threaded builds, using them..." |
104d25b7 | 2730 | . ./usethreads.cbu |
e5e20432 JH |
2731 | else |
2732 | $cat <<EOM | |
2733 | (Your platform doesn't have any specific hints for threaded builds. | |
2734 | Assuming POSIX threads, then.) | |
b691c02f | 2735 | EOM |
e5e20432 | 2736 | fi |
aaacdc8b | 2737 | ;; |
e5e20432 | 2738 | esac |
104d25b7 | 2739 | |
ff935051 | 2740 | cat <<EOM |
64e689dc | 2741 | |
ff935051 JH |
2742 | Perl can be built so that multiple Perl interpreters can coexist |
2743 | within the same Perl executable. | |
2744 | EOM | |
64e689dc | 2745 | |
ff935051 JH |
2746 | case "$useithreads" in |
2747 | $define) | |
2748 | cat <<EOM | |
2749 | This multiple interpreter support is required for interpreter-based threads. | |
64e689dc | 2750 | EOM |
ff935051 JH |
2751 | val="$define" |
2752 | ;; | |
0f0995ae | 2753 | *) case "$usemultiplicity" in |
ff42dc34 GS |
2754 | $define|true|[yY]*) dflt='y';; |
2755 | *) dflt='n';; | |
2756 | esac | |
49c10eea | 2757 | echo " " |
0f0995ae | 2758 | echo "If this doesn't make any sense to you, just accept the default '$dflt'." |
ff42dc34 GS |
2759 | rp='Build Perl for multiplicity?' |
2760 | . ./myread | |
2761 | case "$ans" in | |
ff935051 | 2762 | y|Y) val="$define" ;; |
ff42dc34 GS |
2763 | *) val="$undef" ;; |
2764 | esac | |
2765 | ;; | |
64e689dc JH |
2766 | esac |
2767 | set usemultiplicity | |
ff935051 | 2768 | eval $setvar |
64e689dc | 2769 | |
e5e20432 JH |
2770 | : determine where manual pages are on this system |
2771 | echo " " | |
2772 | case "$sysman" in | |
2773 | '') | |
2774 | syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' | |
2775 | syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" | |
2776 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" | |
2777 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
2778 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" | |
2779 | sysman=`./loc . /usr/man/man1 $syspath` | |
2780 | ;; | |
2781 | esac | |
2782 | if $test -d "$sysman"; then | |
2783 | echo "System manual is in $sysman." >&4 | |
2784 | else | |
2785 | echo "Could not find manual pages in source form." >&4 | |
2786 | fi | |
2787 | ||
2788 | : see what memory models we can support | |
2789 | case "$models" in | |
2790 | '') | |
2791 | $cat >pdp11.c <<'EOP' | |
2792 | int main() { | |
2793 | #ifdef pdp11 | |
2794 | exit(0); | |
2795 | #else | |
2796 | exit(1); | |
2797 | #endif | |
2798 | } | |
2799 | EOP | |
2800 | ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1 | |
2801 | if $test -f pdp11 && ./pdp11 2>/dev/null; then | |
2802 | dflt='unsplit split' | |
2803 | else | |
2804 | tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` | |
2805 | case "$tans" in | |
2806 | X) dflt='none';; | |
2807 | *) if $test -d /lib/small || $test -d /usr/lib/small; then | |
2808 | dflt='small' | |
2809 | else | |
2810 | dflt='' | |
2811 | fi | |
2812 | if $test -d /lib/medium || $test -d /usr/lib/medium; then | |
2813 | dflt="$dflt medium" | |
2814 | fi | |
2815 | if $test -d /lib/large || $test -d /usr/lib/large; then | |
2816 | dflt="$dflt large" | |
2817 | fi | |
2818 | if $test -d /lib/huge || $test -d /usr/lib/huge; then | |
2819 | dflt="$dflt huge" | |
2820 | fi | |
2821 | esac | |
2822 | fi;; | |
2823 | *) dflt="$models";; | |
2824 | esac | |
2825 | $cat <<EOM | |
2826 | ||
2827 | Some systems have different model sizes. On most systems they are called | |
2828 | small, medium, large, and huge. On the PDP11 they are called unsplit and | |
2829 | split. If your system doesn't support different memory models, say "none". | |
2830 | If you wish to force everything to one memory model, say "none" here and | |
2831 | put the appropriate flags later when it asks you for other cc and ld flags. | |
2832 | Venix systems may wish to put "none" and let the compiler figure things out. | |
2833 | (In the following question multiple model names should be space separated.) | |
2834 | ||
2835 | The default for most systems is "none". | |
2836 | ||
2837 | EOM | |
2838 | rp="Which memory models are supported?" | |
2839 | . ./myread | |
2840 | models="$ans" | |
2841 | ||
2842 | case "$models" in | |
2843 | none) | |
2844 | small='' | |
2845 | medium='' | |
2846 | large='' | |
2847 | huge='' | |
2848 | unsplit='' | |
2849 | split='' | |
2850 | ;; | |
2851 | *split) | |
2852 | case "$split" in | |
2853 | '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \ | |
2854 | $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then | |
2855 | dflt='-i' | |
2856 | else | |
2857 | dflt='none' | |
2858 | fi;; | |
2859 | *) dflt="$split";; | |
2860 | esac | |
2861 | rp="What flag indicates separate I and D space?" | |
2862 | . ./myread | |
2863 | tans="$ans" | |
2864 | case "$tans" in | |
2865 | none) tans='';; | |
2866 | esac | |
2867 | split="$tans" | |
2868 | unsplit='';; | |
2869 | *large*|*small*|*medium*|*huge*) | |
2870 | case "$models" in | |
2871 | *large*) | |
2872 | case "$large" in | |
2873 | '') dflt='-Ml';; | |
2874 | *) dflt="$large";; | |
2875 | esac | |
2876 | rp="What flag indicates large model?" | |
2877 | . ./myread | |
2878 | tans="$ans" | |
2879 | case "$tans" in | |
2880 | none) tans=''; | |
2881 | esac | |
2882 | large="$tans";; | |
2883 | *) large='';; | |
2884 | esac | |
2885 | case "$models" in | |
2886 | *huge*) case "$huge" in | |
2887 | '') dflt='-Mh';; | |
2888 | *) dflt="$huge";; | |
2889 | esac | |
2890 | rp="What flag indicates huge model?" | |
2891 | . ./myread | |
2892 | tans="$ans" | |
2893 | case "$tans" in | |
2894 | none) tans=''; | |
2895 | esac | |
2896 | huge="$tans";; | |
2897 | *) huge="$large";; | |
2898 | esac | |
2899 | case "$models" in | |
2900 | *medium*) case "$medium" in | |
2901 | '') dflt='-Mm';; | |
2902 | *) dflt="$medium";; | |
2903 | esac | |
2904 | rp="What flag indicates medium model?" | |
2905 | . ./myread | |
2906 | tans="$ans" | |
2907 | case "$tans" in | |
2908 | none) tans=''; | |
2909 | esac | |
2910 | medium="$tans";; | |
2911 | *) medium="$large";; | |
2912 | esac | |
2913 | case "$models" in | |
2914 | *small*) case "$small" in | |
2915 | '') dflt='none';; | |
2916 | *) dflt="$small";; | |
2917 | esac | |
2918 | rp="What flag indicates small model?" | |
2919 | . ./myread | |
2920 | tans="$ans" | |
2921 | case "$tans" in | |
2922 | none) tans=''; | |
2923 | esac | |
2924 | small="$tans";; | |
2925 | *) small='';; | |
2926 | esac | |
2927 | ;; | |
2928 | *) | |
2929 | echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 | |
2930 | ;; | |
2931 | esac | |
2932 | $rm -f pdp11.* pdp11 | |
2933 | ||
2934 | : make some quick guesses about what we are up against | |
2935 | echo " " | |
2936 | $echo $n "Hmm... $c" | |
2937 | echo exit 1 >bsd | |
2938 | echo exit 1 >usg | |
2939 | echo exit 1 >v7 | |
2940 | echo exit 1 >osf1 | |
2941 | echo exit 1 >eunice | |
2942 | echo exit 1 >xenix | |
2943 | echo exit 1 >venix | |
2944 | echo exit 1 >os2 | |
2945 | d_bsd="$undef" | |
2946 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null | |
2947 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
2948 | then | |
2949 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
2950 | echo exit 0 >osf1 | |
2951 | elif test `echo abc | tr a-z A-Z` = Abc ; then | |
2952 | xxx=`./loc addbib blurfl $pth` | |
2953 | if $test -f $xxx; then | |
2954 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
2955 | echo exit 0 >bsd | |
2956 | echo exit 0 >usg | |
2957 | else | |
2958 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2959 | echo "Looks kind of like an extended USG system, but we'll see..." | |
2960 | else | |
2961 | echo "Looks kind of like a USG system, but we'll see..." | |
2962 | fi | |
2963 | echo exit 0 >usg | |
2964 | fi | |
2965 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2966 | echo "Looks kind of like a BSD system, but we'll see..." | |
2967 | d_bsd="$define" | |
2968 | echo exit 0 >bsd | |
2969 | else | |
2970 | echo "Looks kind of like a Version 7 system, but we'll see..." | |
2971 | echo exit 0 >v7 | |
2972 | fi | |
2973 | case "$eunicefix" in | |
2974 | *unixtovms*) | |
2975 | $cat <<'EOI' | |
2976 | There is, however, a strange, musty smell in the air that reminds me of | |
2977 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
2978 | EOI | |
2979 | echo exit 0 >eunice | |
2980 | d_eunice="$define" | |
2981 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
2982 | ;; | |
2983 | *) | |
2984 | echo " " | |
2985 | echo "Congratulations. You aren't running Eunice." | |
2986 | d_eunice="$undef" | |
2987 | ;; | |
2988 | esac | |
2989 | : Detect OS2. The p_ variable is set above in the Head.U unit. | |
2990 | case "$p_" in | |
2991 | :) ;; | |
2992 | *) | |
2993 | $cat <<'EOI' | |
2994 | I have the feeling something is not exactly right, however...don't tell me... | |
2995 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! | |
2996 | EOI | |
2997 | echo exit 0 >os2 | |
2998 | ;; | |
2999 | esac | |
3000 | if test -f /xenix; then | |
3001 | echo "Actually, this looks more like a XENIX system..." | |
3002 | echo exit 0 >xenix | |
3003 | d_xenix="$define" | |
3004 | else | |
3005 | echo " " | |
3006 | echo "It's not Xenix..." | |
3007 | d_xenix="$undef" | |
3008 | fi | |
3009 | chmod +x xenix | |
3010 | $eunicefix xenix | |
3011 | if test -f /venix; then | |
3012 | echo "Actually, this looks more like a VENIX system..." | |
3013 | echo exit 0 >venix | |
3014 | else | |
3015 | echo " " | |
3016 | if ./xenix; then | |
3017 | : null | |
3018 | else | |
3019 | echo "Nor is it Venix..." | |
3020 | fi | |
3021 | fi | |
3022 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 | |
3023 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 | |
3024 | $rm -f foo | |
3025 | ||
3026 | : see if we need a special compiler | |
3027 | echo " " | |
3028 | if ./usg; then | |
3029 | case "$cc" in | |
3030 | '') case "$Mcc" in | |
3031 | /*) dflt='Mcc';; | |
3032 | *) case "$large" in | |
3033 | -M*) dflt='cc';; | |
3034 | *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then | |
3035 | if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then | |
3036 | dflt='cc' | |
3037 | else | |
3038 | dflt='cc -M' | |
3039 | fi | |
3040 | else | |
3041 | dflt='cc' | |
3042 | fi;; | |
3043 | esac;; | |
3044 | esac;; | |
3045 | *) dflt="$cc";; | |
3046 | esac | |
3047 | case "$dflt" in | |
3048 | *M*) $cat <<'EOM' | |
3049 | On some older systems the default C compiler will not resolve multiple global | |
3050 | references that happen to have the same name. On some such systems the "Mcc" | |
3051 | command may be used to force these to be resolved. On other systems a "cc -M" | |
3052 | command is required. (Note that the -M flag on other systems indicates a | |
3053 | memory model to use!) If you have the Gnu C compiler, you might wish to use | |
3054 | that instead. | |
3055 | ||
3056 | EOM | |
3057 | ;; | |
3058 | esac | |
3059 | rp="Use which C compiler?" | |
3060 | . ./myread | |
3061 | cc="$ans" | |
3062 | else | |
3063 | case "$cc" in | |
3064 | '') dflt=cc;; | |
3065 | *) dflt="$cc";; | |
3066 | esac | |
3067 | rp="Use which C compiler?" | |
3068 | . ./myread | |
3069 | cc="$ans" | |
3070 | fi | |
3071 | : Look for a hint-file generated 'call-back-unit'. Now that the | |
3072 | : user has specified the compiler, we may need to set or change some | |
3073 | : other defaults. | |
3074 | if $test -f cc.cbu; then | |
3075 | . ./cc.cbu | |
3076 | fi | |
3077 | echo " " | |
3078 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
3079 | $cat >gccvers.c <<EOM | |
3080 | #include <stdio.h> | |
3081 | int main() { | |
3082 | #ifdef __GNUC__ | |
3083 | #ifdef __VERSION__ | |
3084 | printf("%s\n", __VERSION__); | |
3085 | #else | |
3086 | printf("%s\n", "1"); | |
3087 | #endif | |
3088 | #endif | |
3089 | exit(0); | |
3090 | } | |
3091 | EOM | |
bf0c440f | 3092 | if $cc $ldflags -o gccvers gccvers.c; then |
e5e20432 JH |
3093 | gccversion=`./gccvers` |
3094 | case "$gccversion" in | |
3095 | '') echo "You are not using GNU cc." ;; | |
fc68435e | 3096 | *) echo "You are using GNU cc $gccversion." |
fc68435e | 3097 | ;; |
e5e20432 JH |
3098 | esac |
3099 | else | |
3100 | echo " " | |
3101 | echo "*** WHOA THERE!!! ***" >&4 | |
3102 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
3103 | case "$knowitall" in | |
3104 | '') | |
3105 | echo " You'd better start hunting for one and let me know about it." >&4 | |
3106 | exit 1 | |
3107 | ;; | |
3108 | esac | |
3109 | fi | |
3110 | $rm -f gccvers* | |
3111 | case "$gccversion" in | |
3112 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
3113 | esac | |
3114 | ||
bd9b35c9 JH |
3115 | : decide how portable to be. Allow command line overrides. |
3116 | case "$d_portable" in | |
3117 | "$undef") ;; | |
3118 | *) d_portable="$define" ;; | |
104d25b7 | 3119 | esac |
85ab1d1d | 3120 | |
bd9b35c9 JH |
3121 | : set up shell script to do ~ expansion |
3122 | cat >filexp <<EOSS | |
3123 | $startsh | |
3124 | : expand filename | |
3125 | case "\$1" in | |
3126 | ~/*|~) | |
3127 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
3128 | ;; | |
3129 | ~*) | |
3130 | if $test -f /bin/csh; then | |
3131 | /bin/csh -f -c "glob \$1" | |
3132 | failed=\$? | |
3133 | echo "" | |
3134 | exit \$failed | |
e5e20432 | 3135 | else |
bd9b35c9 JH |
3136 | name=\`$expr x\$1 : '..\([^/]*\)'\` |
3137 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
3138 | if $test ! -d "\$dir"; then | |
3139 | me=\`basename \$0\` | |
3140 | echo "\$me: can't locate home directory for: \$name" >&2 | |
3141 | exit 1 | |
3142 | fi | |
3143 | case "\$1" in | |
3144 | */*) | |
3145 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
3146 | ;; | |
3147 | *) | |
3148 | echo \$dir | |
e5e20432 JH |
3149 | ;; |
3150 | esac | |
3151 | fi | |
b691c02f | 3152 | ;; |
4633a7c4 | 3153 | *) |
bd9b35c9 | 3154 | echo \$1 |
2304df62 AD |
3155 | ;; |
3156 | esac | |
4633a7c4 LW |
3157 | EOSS |
3158 | chmod +x filexp | |
3159 | $eunicefix filexp | |
2304df62 AD |
3160 | |
3161 | : now set up to get a file name | |
28757baa | 3162 | cat <<EOS >getfile |
3163 | $startsh | |
3164 | EOS | |
3165 | cat <<'EOSC' >>getfile | |
2304df62 AD |
3166 | tilde='' |
3167 | fullpath='' | |
3168 | already='' | |
3169 | skip='' | |
3170 | none_ok='' | |
3171 | exp_file='' | |
a0d0e21e | 3172 | nopath_ok='' |
2304df62 AD |
3173 | orig_rp="$rp" |
3174 | orig_dflt="$dflt" | |
b233458b JH |
3175 | case "$gfpth" in |
3176 | '') gfpth='.' ;; | |
3177 | esac | |
2304df62 AD |
3178 | |
3179 | case "$fn" in | |
ecfc5424 | 3180 | *\(*) |
28e8609d | 3181 | expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok |
ecfc5424 AD |
3182 | fn=`echo $fn | sed 's/(.*)//'` |
3183 | ;; | |
3184 | esac | |
3185 | ||
3186 | case "$fn" in | |
a0d0e21e LW |
3187 | *:*) |
3188 | loc_file=`expr $fn : '.*:\(.*\)'` | |
3189 | fn=`expr $fn : '\(.*\):.*'` | |
3190 | ;; | |
3191 | esac | |
3192 | ||
3193 | case "$fn" in | |
2304df62 AD |
3194 | *~*) tilde=true;; |
3195 | esac | |
3196 | case "$fn" in | |
3197 | */*) fullpath=true;; | |
3198 | esac | |
3199 | case "$fn" in | |
3200 | *+*) skip=true;; | |
3201 | esac | |
3202 | case "$fn" in | |
3203 | *n*) none_ok=true;; | |
3204 | esac | |
3205 | case "$fn" in | |
3206 | *e*) exp_file=true;; | |
3207 | esac | |
a0d0e21e LW |
3208 | case "$fn" in |
3209 | *p*) nopath_ok=true;; | |
3210 | esac | |
2304df62 AD |
3211 | |
3212 | case "$fn" in | |
3213 | *f*) type='File';; | |
3214 | *d*) type='Directory';; | |
a0d0e21e | 3215 | *l*) type='Locate';; |
2304df62 AD |
3216 | esac |
3217 | ||
3218 | what="$type" | |
3219 | case "$what" in | |
3220 | Locate) what='File';; | |
3221 | esac | |
3222 | ||
3223 | case "$exp_file" in | |
3224 | '') | |
3225 | case "$d_portable" in | |
3226 | "$define") ;; | |
3227 | *) exp_file=true;; | |
3228 | esac | |
3229 | ;; | |
3230 | esac | |
3231 | ||
3232 | cd .. | |
3233 | while test "$type"; do | |
3234 | redo='' | |
3235 | rp="$orig_rp" | |
3236 | dflt="$orig_dflt" | |
3237 | case "$tilde" in | |
3238 | true) rp="$rp (~name ok)";; | |
3239 | esac | |
3240 | . UU/myread | |
ecfc5424 AD |
3241 | if test -f UU/getfile.ok && \ |
3242 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
3243 | then | |
3244 | value="$ans" | |
3245 | ansexp="$ans" | |
3246 | break | |
3247 | fi | |
2304df62 AD |
3248 | case "$ans" in |
3249 | none) | |
3250 | value='' | |
3251 | ansexp='' | |
3252 | case "$none_ok" in | |
3253 | true) type='';; | |
3254 | esac | |
3255 | ;; | |
3256 | *) | |
3257 | case "$tilde" in | |
3258 | '') value="$ans" | |
3259 | ansexp="$ans";; | |
3260 | *) | |
3261 | value=`UU/filexp $ans` | |
3262 | case $? in | |
3263 | 0) | |
3264 | if test "$ans" != "$value"; then | |
ecfc5424 | 3265 | echo "(That expands to $value on this system.)" |
2304df62 AD |
3266 | fi |
3267 | ;; | |
3268 | *) value="$ans";; | |
3269 | esac | |
3270 | ansexp="$value" | |
3271 | case "$exp_file" in | |
3272 | '') value="$ans";; | |
3273 | esac | |
3274 | ;; | |
3275 | esac | |
3276 | case "$fullpath" in | |
3277 | true) | |
3278 | case "$ansexp" in | |
3279 | /*) value="$ansexp" ;; | |
3280 | *) | |
3281 | redo=true | |
3282 | case "$already" in | |
3283 | true) | |
3284 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
3285 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
3286 | ;; | |
3287 | *) | |
3288 | echo "Please give a full path name, starting with slash." >&4 | |
3289 | case "$tilde" in | |
3290 | true) | |
3291 | echo "Note that using ~name is ok provided it expands well." >&4 | |
3292 | already=true | |
3293 | ;; | |
3294 | esac | |
3295 | esac | |
3296 | ;; | |
3297 | esac | |
3298 | ;; | |
3299 | esac | |
3300 | case "$redo" in | |
3301 | '') | |
3302 | case "$type" in | |
3303 | File) | |
b233458b JH |
3304 | for fp in $gfpth; do |
3305 | if test "X$fp" = X.; then | |
3306 | pf="$ansexp" | |
3307 | else | |
3308 | pf="$fp/$ansexp" | |
3309 | fi | |
3310 | if test -f "$pf"; then | |
3311 | type='' | |
3312 | elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 | |
3313 | then | |
3314 | echo "($value is not a plain file, but that's ok.)" | |
3315 | type='' | |
3316 | fi | |
3317 | if test X"$type" = X; then | |
3318 | value="$pf" | |
3319 | break | |
3320 | fi | |
3321 | done | |
2304df62 AD |
3322 | ;; |
3323 | Directory) | |
b233458b JH |
3324 | for fp in $gfpth; do |
3325 | if test "X$fp" = X.; then | |
f78bfc9c JH |
3326 | dir="$ans" |
3327 | direxp="$ansexp" | |
b233458b | 3328 | else |
dd858076 | 3329 | dir="$fp/$ansexp" |
f78bfc9c | 3330 | direxp="$fp/$ansexp" |
b233458b | 3331 | fi |
f78bfc9c | 3332 | if test -d "$direxp"; then |
b233458b | 3333 | type='' |
f78bfc9c | 3334 | value="$dir" |
b233458b JH |
3335 | break |
3336 | fi | |
3337 | done | |
2304df62 AD |
3338 | ;; |
3339 | Locate) | |
40000a8c | 3340 | if test -d "$ansexp"; then |
a0d0e21e LW |
3341 | echo "(Looking for $loc_file in directory $value.)" |
3342 | value="$value/$loc_file" | |
40000a8c | 3343 | ansexp="$ansexp/$loc_file" |
2304df62 | 3344 | fi |
40000a8c | 3345 | if test -f "$ansexp"; then |
2304df62 AD |
3346 | type='' |
3347 | fi | |
a0d0e21e LW |
3348 | case "$nopath_ok" in |
3349 | true) case "$value" in | |
3350 | */*) ;; | |
3351 | *) echo "Assuming $value will be in people's path." | |
3352 | type='' | |
3353 | ;; | |
3354 | esac | |
3355 | ;; | |
3356 | esac | |
2304df62 AD |
3357 | ;; |
3358 | esac | |
3359 | ||
3360 | case "$skip" in | |
3361 | true) type=''; | |
3362 | esac | |
3363 | ||
3364 | case "$type" in | |
3365 | '') ;; | |
3366 | *) | |
3367 | if test "$fastread" = yes; then | |
3368 | dflt=y | |
3369 | else | |
3370 | dflt=n | |
3371 | fi | |
3372 | rp="$what $value doesn't exist. Use that name anyway?" | |
3373 | . UU/myread | |
3374 | dflt='' | |
3375 | case "$ans" in | |
3376 | y*) type='';; | |
3377 | *) echo " ";; | |
3378 | esac | |
3379 | ;; | |
3380 | esac | |
3381 | ;; | |
3382 | esac | |
3383 | ;; | |
3384 | esac | |
3385 | done | |
3386 | cd UU | |
3387 | ans="$value" | |
3388 | rp="$orig_rp" | |
3389 | dflt="$orig_dflt" | |
ecfc5424 | 3390 | rm -f getfile.ok |
b233458b | 3391 | test "X$gfpthkeep" != Xy && gfpth="" |
2304df62 AD |
3392 | EOSC |
3393 | ||
bd9b35c9 JH |
3394 | : What should the include directory be ? |
3395 | echo " " | |
3396 | $echo $n "Hmm... $c" | |
3397 | dflt='/usr/include' | |
3398 | incpath='' | |
3399 | mips_type='' | |
3400 | if $test -f /bin/mips && /bin/mips; then | |
3401 | echo "Looks like a MIPS system..." | |
3402 | $cat >usr.c <<'EOCP' | |
3403 | #ifdef SYSTYPE_BSD43 | |
3404 | /bsd43 | |
3405 | #endif | |
3406 | EOCP | |
3407 | if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then | |
3408 | dflt='/bsd43/usr/include' | |
3409 | incpath='/bsd43' | |
3410 | mips_type='BSD 4.3' | |
3411 | else | |
3412 | mips_type='System V' | |
3413 | fi | |
3414 | $rm -f usr.c usr.out | |
3415 | echo "and you're compiling with the $mips_type compiler and libraries." | |
3416 | xxx_prompt=y | |
3417 | echo "exit 0" >mips | |
3418 | else | |
3419 | echo "Doesn't look like a MIPS system." | |
3420 | xxx_prompt=n | |
3421 | echo "exit 1" >mips | |
3422 | fi | |
3423 | chmod +x mips | |
3424 | $eunicefix mips | |
3425 | case "$usrinc" in | |
3426 | '') ;; | |
3427 | *) dflt="$usrinc";; | |
3428 | esac | |
3429 | case "$xxx_prompt" in | |
3430 | y) fn=d/ | |
3431 | echo " " | |
3432 | rp='Where are the include files you want to use?' | |
3433 | . ./getfile | |
3434 | usrinc="$ans" | |
8e07c86e | 3435 | ;; |
bd9b35c9 | 3436 | *) usrinc="$dflt" |
8e07c86e AD |
3437 | ;; |
3438 | esac | |
2304df62 | 3439 | |
fc68435e JH |
3440 | : see how we invoke the C preprocessor |
3441 | echo " " | |
3442 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 | |
3443 | cat <<'EOT' >testcpp.c | |
3444 | #define ABC abc | |
3445 | #define XYZ xyz | |
3446 | ABC.XYZ | |
3447 | EOT | |
3448 | cd .. | |
3449 | if test ! -f cppstdin; then | |
3450 | if test "X$osname" = "Xaix" -a "X$gccversion" = X; then | |
3451 | # AIX cc -E doesn't show the absolute headerfile | |
3452 | # locations but we'll cheat by using the -M flag. | |
3453 | 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 | |
3454 | else | |
3455 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
3456 | fi | |
3457 | else | |
3458 | echo "Keeping your $hint cppstdin wrapper." | |
3459 | fi | |
3460 | chmod 755 cppstdin | |
3461 | wrapper=`pwd`/cppstdin | |
3462 | ok='false' | |
3463 | cd UU | |
3464 | ||
3465 | if $test "X$cppstdin" != "X" && \ | |
3466 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
3467 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3468 | then | |
3469 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
3470 | case "$cpprun" in | |
3471 | '') echo "But let's see if we can live without a wrapper..." ;; | |
3472 | *) | |
3473 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
3474 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3475 | then | |
3476 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" | |
3477 | ok='true' | |
3478 | else | |
3479 | echo "(However, $cpprun $cpplast does not work, let's see...)" | |
3480 | fi | |
3481 | ;; | |
3482 | esac | |
3483 | else | |
3484 | case "$cppstdin" in | |
3485 | '') ;; | |
3486 | *) | |
3487 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
3488 | ;; | |
3489 | esac | |
3490 | fi | |
3491 | ||
3492 | if $ok; then | |
3493 | : nothing | |
3494 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
3495 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
3496 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3497 | echo "Yup, it does." | |
3498 | x_cpp="$cc -E" | |
3499 | x_minus=''; | |
3500 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
3501 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
3502 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3503 | echo "Yup, it does." | |
3504 | x_cpp="$cc -E" | |
3505 | x_minus='-'; | |
3506 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
3507 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
3508 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3509 | echo "Yipee, that works!" | |
3510 | x_cpp="$cc -P" | |
3511 | x_minus=''; | |
3512 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
3513 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
3514 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3515 | echo "At long last!" | |
3516 | x_cpp="$cc -P" | |
3517 | x_minus='-'; | |
3518 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
3519 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
3520 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3521 | echo "It works!" | |
3522 | x_cpp="$cpp" | |
3523 | x_minus=''; | |
3524 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
3525 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
3526 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3527 | echo "Hooray, it works! I was beginning to wonder." | |
3528 | x_cpp="$cpp" | |
3529 | x_minus='-'; | |
3530 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
3531 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3532 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3533 | x_cpp="$wrapper" | |
3534 | x_minus='' | |
3535 | echo "Eureka!" | |
3536 | else | |
3537 | dflt='' | |
3538 | rp="No dice. I can't find a C preprocessor. Name one:" | |
3539 | . ./myread | |
3540 | x_cpp="$ans" | |
3541 | x_minus='' | |
3542 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
3543 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3544 | echo "OK, that will do." >&4 | |
3545 | else | |
3546 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
3547 | exit 1 | |
3548 | fi | |
3549 | fi | |
3550 | ||
3551 | case "$ok" in | |
3552 | false) | |
3553 | cppstdin="$x_cpp" | |
3554 | cppminus="$x_minus" | |
3555 | cpprun="$x_cpp" | |
3556 | cpplast="$x_minus" | |
3557 | set X $x_cpp | |
3558 | shift | |
3559 | case "$1" in | |
3560 | "$cpp") | |
3561 | echo "Perhaps can we force $cc -E using a wrapper..." | |
3562 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3563 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3564 | then | |
3565 | echo "Yup, we can." | |
3566 | cppstdin="$wrapper" | |
3567 | cppminus=''; | |
3568 | else | |
3569 | echo "Nope, we'll have to live without it..." | |
3570 | fi | |
3571 | ;; | |
3572 | esac | |
3573 | case "$cpprun" in | |
3574 | "$wrapper") | |
3575 | cpprun='' | |
3576 | cpplast='' | |
3577 | ;; | |
3578 | esac | |
3579 | ;; | |
3580 | esac | |
3581 | ||
3582 | case "$cppstdin" in | |
3583 | "$wrapper"|'cppstdin') ;; | |
3584 | *) $rm -f $wrapper;; | |
3585 | esac | |
3586 | $rm -f testcpp.c testcpp.out | |
3587 | ||
bd9b35c9 JH |
3588 | : Set private lib path |
3589 | case "$plibpth" in | |
3590 | '') if ./mips; then | |
3591 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
3592 | fi;; | |
3593 | esac | |
3594 | case "$libpth" in | |
3595 | ' ') dlist='';; | |
3596 | '') dlist="$loclibpth $plibpth $glibpth";; | |
3597 | *) dlist="$libpth";; | |
3598 | esac | |
3599 | ||
3600 | : Now check and see which directories actually exist, avoiding duplicates | |
3601 | libpth='' | |
3602 | for xxx in $dlist | |
3603 | do | |
3604 | if $test -d $xxx; then | |
3605 | case " $libpth " in | |
3606 | *" $xxx "*) ;; | |
3607 | *) libpth="$libpth $xxx";; | |
3608 | esac | |
3609 | fi | |
3610 | done | |
3611 | $cat <<'EOM' | |
3612 | ||
3613 | Some systems have incompatible or broken versions of libraries. Among | |
3614 | the directories listed in the question below, please remove any you | |
3615 | know not to be holding relevant libraries, and add any that are needed. | |
3616 | Say "none" for none. | |
8e07c86e AD |
3617 | |
3618 | EOM | |
bd9b35c9 JH |
3619 | case "$libpth" in |
3620 | '') dflt='none';; | |
8e07c86e | 3621 | *) |
bd9b35c9 JH |
3622 | set X $libpth |
3623 | shift | |
3624 | dflt=${1+"$@"} | |
8e07c86e | 3625 | ;; |
a0d0e21e | 3626 | esac |
bd9b35c9 JH |
3627 | rp="Directories to use for library searches?" |
3628 | . ./myread | |
3629 | case "$ans" in | |
3630 | none) libpth=' ';; | |
3631 | *) libpth="$ans";; | |
3632 | esac | |
a0d0e21e | 3633 | |
bd9b35c9 JH |
3634 | : compute shared library extension |
3635 | case "$so" in | |
3636 | '') | |
3637 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
3638 | dflt='sl' | |
dd4e71fd | 3639 | else |
bd9b35c9 | 3640 | dflt='so' |
dd4e71fd JH |
3641 | fi |
3642 | ;; | |
bd9b35c9 | 3643 | *) dflt="$so";; |
dd4e71fd | 3644 | esac |
dd4e71fd JH |
3645 | $cat <<EOM |
3646 | ||
bd9b35c9 | 3647 | On some systems, shared libraries may be available. Answer 'none' if |
7f95ee77 | 3648 | you want to suppress searching of shared libraries for the remainder |
bd9b35c9 | 3649 | of this configuration. |
dd4e71fd JH |
3650 | |
3651 | EOM | |
bd9b35c9 JH |
3652 | rp='What is the file extension used for shared libraries?' |
3653 | . ./myread | |
3654 | so="$ans" | |
dd4e71fd | 3655 | |
bd9b35c9 JH |
3656 | : Define several unixisms. |
3657 | : Hints files or command line option can be used to override them. | |
3658 | : The convoluted testing is in case hints files set either the old | |
3659 | : or the new name. | |
3660 | case "$_exe" in | |
3661 | '') case "$exe_ext" in | |
3662 | '') ;; | |
3663 | *) _exe="$exe_ext" ;; | |
dd4e71fd | 3664 | esac |
bd9b35c9 | 3665 | ;; |
bfb7748a | 3666 | esac |
bd9b35c9 JH |
3667 | case "$_a" in |
3668 | '') case "$lib_ext" in | |
3669 | '') _a='.a';; | |
3670 | *) _a="$lib_ext" ;; | |
dd4e71fd JH |
3671 | esac |
3672 | ;; | |
dd4e71fd | 3673 | esac |
bd9b35c9 JH |
3674 | case "$_o" in |
3675 | '') case "$obj_ext" in | |
3676 | '') _o='.o';; | |
3677 | *) _o="$obj_ext";; | |
3678 | esac | |
3679 | ;; | |
3680 | esac | |
3681 | case "$p_" in | |
3682 | '') case "$path_sep" in | |
3683 | '') p_=':';; | |
3684 | *) p_="$path_sep";; | |
3685 | esac | |
3686 | ;; | |
3687 | esac | |
3688 | exe_ext=$_exe | |
3689 | lib_ext=$_a | |
3690 | obj_ext=$_o | |
3691 | path_sep=$p_ | |
dd4e71fd | 3692 | |
bd9b35c9 JH |
3693 | : Which makefile gets called first. This is used by make depend. |
3694 | case "$firstmakefile" in | |
3695 | '') firstmakefile='makefile';; | |
4633a7c4 | 3696 | esac |
4633a7c4 | 3697 | |
0f0995ae JH |
3698 | case "$usesocks" in |
3699 | $define|true|[yY]*) dflt='y';; | |
3700 | *) dflt='n';; | |
3701 | esac | |
bd9b35c9 | 3702 | cat <<EOM |
4633a7c4 | 3703 | |
bd9b35c9 JH |
3704 | Perl can be built to use the SOCKS proxy protocol library. To do so, |
3705 | Configure must be run with -Dusesocks. | |
4633a7c4 | 3706 | |
0f0995ae | 3707 | If this doesn't make any sense to you, just accept the default '$dflt'. |
bd9b35c9 | 3708 | EOM |
bd9b35c9 JH |
3709 | rp='Build Perl for SOCKS?' |
3710 | . ./myread | |
3711 | case "$ans" in | |
3712 | y|Y) val="$define" ;; | |
3713 | *) val="$undef" ;; | |
3714 | esac | |
3715 | set usesocks | |
3716 | eval $setvar | |
3717 | ||
3718 | : Looking for optional libraries | |
3719 | echo " " | |
3720 | echo "Checking for optional libraries..." >&4 | |
3721 | case "$libs" in | |
3722 | ' '|'') dflt='';; | |
3723 | *) dflt="$libs";; | |
3724 | esac | |
3725 | case "$libswanted" in | |
3726 | '') libswanted='c_s';; | |
3727 | esac | |
3728 | case "$usesocks" in | |
923fc586 | 3729 | "$define") libswanted="$libswanted socks5 socks5_sh" ;; |
8e07c86e | 3730 | esac |
68435ea7 JH |
3731 | libsfound='' |
3732 | libsfiles='' | |
3733 | libsdirs='' | |
13b3f787 JH |
3734 | libspath='' |
3735 | for thisdir in $libpth $xlibpth; do | |
3736 | test -d $thisdir && libspath="$libspath $thisdir" | |
3737 | done | |
bd9b35c9 | 3738 | for thislib in $libswanted; do |
13b3f787 | 3739 | for thisdir in $libspath; do |
f7dd4e7f JH |
3740 | xxx='' |
3741 | if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then | |
3742 | xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1` | |
3743 | $test -f "$xxx" && eval $libscheck | |
3744 | $test -f "$xxx" && libstyle=shared | |
3745 | fi | |
3746 | if test ! -f "$xxx"; then | |
3747 | xxx=$thisdir/lib$thislib.$so | |
3748 | $test -f "$xxx" && eval $libscheck | |
3749 | $test -f "$xxx" && libstyle=shared | |
3750 | fi | |
3751 | if test ! -f "$xxx"; then | |
3752 | xxx=$thisdir/lib$thislib$_a | |
3753 | $test -f "$xxx" && eval $libscheck | |
3754 | $test -f "$xxx" && libstyle=static | |
3755 | fi | |
3756 | if test ! -f "$xxx"; then | |
3757 | xxx=$thisdir/$thislib$_a | |
3758 | $test -f "$xxx" && eval $libscheck | |
3759 | $test -f "$xxx" && libstyle=static | |
3760 | fi | |
3761 | if test ! -f "$xxx"; then | |
3762 | xxx=$thisdir/lib${thislib}_s$_a | |
3763 | $test -f "$xxx" && eval $libscheck | |
3764 | $test -f "$xxx" && libstyle=static | |
09ea5ba9 | 3765 | $test -f "$xxx" && thislib=${thislib}_s |
f7dd4e7f JH |
3766 | fi |
3767 | if test ! -f "$xxx"; then | |
3768 | xxx=$thisdir/Slib$thislib$_a | |
3769 | $test -f "$xxx" && eval $libscheck | |
3770 | $test -f "$xxx" && libstyle=static | |
3771 | fi | |
3772 | if $test -f "$xxx"; then | |
43999f95 | 3773 | case "$libstyle" in |
f7dd4e7f JH |
3774 | shared) echo "Found -l$thislib (shared)." ;; |
3775 | static) echo "Found -l$thislib." ;; | |
3776 | *) echo "Found -l$thislib ($libstyle)." ;; | |
43999f95 | 3777 | esac |
bd9b35c9 JH |
3778 | case " $dflt " in |
3779 | *"-l$thislib "*);; | |
f7dd4e7f | 3780 | *) dflt="$dflt -l$thislib" |
43999f95 JH |
3781 | libsfound="$libsfound $xxx" |
3782 | yyy=`basename $xxx` | |
3783 | libsfiles="$libsfiles $yyy" | |
1e127011 | 3784 | yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"` |
43999f95 JH |
3785 | case " $libsdirs " in |
3786 | *" $yyy "*) ;; | |
3787 | *) libsdirs="$libsdirs $yyy" ;; | |
3788 | esac | |
3789 | ;; | |
bd9b35c9 | 3790 | esac |
f7dd4e7f JH |
3791 | break |
3792 | fi | |
3793 | done | |
3794 | if $test ! -f "$xxx"; then | |
3795 | echo "No -l$thislib." | |
bd9b35c9 JH |
3796 | fi |
3797 | done | |
3798 | set X $dflt | |
3799 | shift | |
3800 | dflt="$*" | |
3801 | case "$libs" in | |
3802 | '') dflt="$dflt";; | |
3803 | *) dflt="$libs";; | |
3804 | esac | |
3805 | case "$dflt" in | |
3806 | ' '|'') dflt='none';; | |
3807 | esac | |
4633a7c4 | 3808 | |
bd9b35c9 | 3809 | $cat <<EOM |
4633a7c4 | 3810 | |
bd9b35c9 JH |
3811 | In order to compile $package on your machine, a number of libraries |
3812 | are usually needed. Include any other special libraries here as well. | |
3813 | Say "none" for none. The default list is almost always right. | |
8e07c86e | 3814 | EOM |
8e07c86e | 3815 | |
bd9b35c9 JH |
3816 | echo " " |
3817 | rp="What libraries to use?" | |
3818 | . ./myread | |
3819 | case "$ans" in | |
3820 | none) libs=' ';; | |
3821 | *) libs="$ans";; | |
3822 | esac | |
d71b2b6b | 3823 | |
bd9b35c9 JH |
3824 | : determine optimization, if desired, or use for debug flag also |
3825 | case "$optimize" in | |
3826 | ' '|$undef) dflt='none';; | |
3827 | '') dflt='-O';; | |
3828 | *) dflt="$optimize";; | |
3829 | esac | |
3830 | $cat <<EOH | |
d71b2b6b | 3831 | |
bd9b35c9 JH |
3832 | By default, $package compiles with the -O flag to use the optimizer. |
3833 | Alternately, you might want to use the symbolic debugger, which uses | |
3834 | the -g flag (on traditional Unix systems). Either flag can be | |
3835 | specified here. To use neither flag, specify the word "none". | |
d71b2b6b | 3836 | |
bd9b35c9 JH |
3837 | EOH |
3838 | rp="What optimizer/debugger flag should be used?" | |
3839 | . ./myread | |
3840 | optimize="$ans" | |
3841 | case "$optimize" in | |
3842 | 'none') optimize=" ";; | |
3843 | esac | |
3844 | ||
3845 | dflt='' | |
3846 | : We will not override a previous value, but we might want to | |
3847 | : augment a hint file | |
3848 | case "$hint" in | |
3849 | default|recommended) | |
3850 | case "$gccversion" in | |
3851 | 1*) dflt='-fpcc-struct-return' ;; | |
d71b2b6b | 3852 | esac |
bd9b35c9 JH |
3853 | case "$optimize" in |
3854 | *-g*) dflt="$dflt -DDEBUGGING";; | |
d71b2b6b | 3855 | esac |
bd9b35c9 JH |
3856 | case "$gccversion" in |
3857 | 2*) if test -d /etc/conf/kconfig.d && | |
3858 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
3859 | then | |
3860 | dflt="$dflt -posix" | |
3861 | fi | |
f0d04425 | 3862 | ;; |
bd9b35c9 JH |
3863 | esac |
3864 | case "$gccversion" in | |
3865 | 1*) ;; | |
3866 | 2.[0-8]*) ;; | |
3867 | ?*) echo " " | |
3868 | echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1 | |
3869 | echo 'int main(void) { return 0; }' > gcctest.c | |
3870 | if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then | |
3871 | echo "Yes, it does." 2>&1 | |
3872 | case "$ccflags" in | |
3873 | *strict-aliasing*) | |
3874 | echo "Leaving current flags $ccflags alone." 2>&1 | |
3875 | ;; | |
3876 | *) dflt="$dflt -fno-strict-aliasing" ;; | |
3877 | esac | |
3878 | else | |
3879 | echo "Nope, it doesn't, but that's ok." 2>&1 | |
3880 | fi | |
f0d04425 | 3881 | ;; |
e5e20432 JH |
3882 | esac |
3883 | ;; | |
3884 | esac | |
3885 | ||
bd9b35c9 JH |
3886 | case "$mips_type" in |
3887 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
3888 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
3889 | esac | |
3890 | for thisincl in $inclwanted; do | |
3891 | if $test -d $thisincl; then | |
3892 | if $test x$thisincl != x$usrinc; then | |
3893 | case "$dflt" in | |
3894 | *$thisincl*);; | |
3895 | *) dflt="$dflt -I$thisincl";; | |
3896 | esac | |
3897 | fi | |
3898 | fi | |
3899 | done | |
40a7a20a | 3900 | |
bd9b35c9 JH |
3901 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then |
3902 | xxx=true; | |
3903 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
3904 | xxx=true; | |
3905 | else | |
3906 | xxx=false; | |
3907 | fi; | |
3908 | if $xxx; then | |
3909 | case "$dflt" in | |
3910 | *$2*);; | |
3911 | *) dflt="$dflt -D$2";; | |
3912 | esac; | |
3913 | fi' | |
40a7a20a | 3914 | |
bd9b35c9 | 3915 | set signal.h LANGUAGE_C; eval $inctest |
40a7a20a | 3916 | |
bd9b35c9 JH |
3917 | case "$usesocks" in |
3918 | $define) | |
3919 | ccflags="$ccflags -DSOCKS" | |
3920 | ;; | |
3921 | esac | |
40a7a20a | 3922 | |
bd9b35c9 JH |
3923 | case "$hint" in |
3924 | default|recommended) dflt="$ccflags $dflt" ;; | |
3925 | *) dflt="$ccflags";; | |
3926 | esac | |
40a7a20a | 3927 | |
bd9b35c9 JH |
3928 | case "$dflt" in |
3929 | ''|' ') dflt=none;; | |
3930 | esac | |
3931 | $cat <<EOH | |
40a7a20a | 3932 | |
bd9b35c9 JH |
3933 | Your C compiler may want other flags. For this question you should include |
3934 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
3935 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
3936 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
3937 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE. | |
40a7a20a | 3938 | |
bd9b35c9 | 3939 | To use no flags, specify the word "none". |
40a7a20a | 3940 | |
bd9b35c9 JH |
3941 | EOH |
3942 | set X $dflt | |
3943 | shift | |
3944 | dflt=${1+"$@"} | |
3945 | rp="Any additional cc flags?" | |
3946 | . ./myread | |
3947 | case "$ans" in | |
3948 | none) ccflags='';; | |
3949 | *) ccflags="$ans";; | |
3950 | esac | |
8e07c86e | 3951 | |
bd9b35c9 JH |
3952 | : the following weeds options from ccflags that are of no interest to cpp |
3953 | cppflags="$ccflags" | |
3954 | case "$gccversion" in | |
3955 | 1*) cppflags="$cppflags -D__GNUC__" | |
4633a7c4 | 3956 | esac |
bd9b35c9 JH |
3957 | case "$mips_type" in |
3958 | '');; | |
3959 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
3960 | esac | |
3961 | case "$cppflags" in | |
3962 | '');; | |
3963 | *) | |
3964 | echo " " | |
3965 | echo "Let me guess what the preprocessor flags are..." >&4 | |
3966 | set X $cppflags | |
3967 | shift | |
3968 | cppflags='' | |
3969 | $cat >cpp.c <<'EOM' | |
3970 | #define BLURFL foo | |
8e07c86e | 3971 | |
bd9b35c9 JH |
3972 | BLURFL xx LFRULB |
3973 | EOM | |
3974 | previous='' | |
3975 | for flag in $* | |
3976 | do | |
3977 | case "$flag" in | |
3978 | -*) ftry="$flag";; | |
3979 | *) ftry="$previous $flag";; | |
3980 | esac | |
3981 | if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \ | |
3982 | >cpp1.out 2>/dev/null && \ | |
3983 | $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \ | |
3984 | >cpp2.out 2>/dev/null && \ | |
3985 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
3986 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
3987 | then | |
3988 | cppflags="$cppflags $ftry" | |
3989 | previous='' | |
3990 | else | |
3991 | previous="$flag" | |
3992 | fi | |
3993 | done | |
3994 | set X $cppflags | |
3995 | shift | |
3996 | cppflags=${1+"$@"} | |
3997 | case "$cppflags" in | |
3998 | *-*) echo "They appear to be: $cppflags";; | |
3999 | esac | |
4000 | $rm -f cpp.c cpp?.out | |
2afac517 | 4001 | ;; |
4002 | esac | |
8e07c86e | 4003 | |
bd9b35c9 JH |
4004 | : flags used in final linking phase |
4005 | case "$ldflags" in | |
4006 | '') if ./venix; then | |
4007 | dflt='-i -z' | |
10a23457 | 4008 | else |
bd9b35c9 | 4009 | dflt='' |
10a23457 | 4010 | fi |
bd9b35c9 JH |
4011 | case "$ccflags" in |
4012 | *-posix*) dflt="$dflt -posix" ;; | |
c4f23d77 | 4013 | esac |
bd9b35c9 JH |
4014 | ;; |
4015 | *) dflt="$ldflags";; | |
4016 | esac | |
4017 | ||
4018 | : Try to guess additional flags to pick up local libraries. | |
4019 | for thislibdir in $libpth; do | |
4020 | case " $loclibpth " in | |
4021 | *" $thislibdir "*) | |
4022 | case "$dflt " in | |
4023 | *"-L$thislibdir "*) ;; | |
4024 | *) dflt="$dflt -L$thislibdir" ;; | |
4025 | esac | |
c4f23d77 AD |
4026 | ;; |
4027 | esac | |
bd9b35c9 | 4028 | done |
c4f23d77 | 4029 | |
bd9b35c9 JH |
4030 | case "$dflt" in |
4031 | '') dflt='none' ;; | |
4032 | esac | |
c4f23d77 | 4033 | |
bd9b35c9 JH |
4034 | $cat <<EOH |
4035 | ||
4036 | Your C linker may need flags. For this question you should | |
4037 | include -L/whatever and any other flags used by the C linker, but you | |
4038 | should NOT include libraries like -lwhatever. | |
4039 | ||
4040 | Make sure you include the appropriate -L/path flags if your C linker | |
4041 | does not normally search all of the directories you specified above, | |
4042 | namely | |
4043 | $libpth | |
4044 | To use no flags, specify the word "none". | |
4045 | ||
4046 | EOH | |
4047 | ||
4048 | rp="Any additional ld flags (NOT including libraries)?" | |
4049 | . ./myread | |
4050 | case "$ans" in | |
4051 | none) ldflags='';; | |
4052 | *) ldflags="$ans";; | |
4053 | esac | |
4054 | rmlist="$rmlist pdp11" | |
4055 | ||
4056 | : coherency check | |
4057 | echo " " | |
4058 | echo "Checking your choice of C compiler and flags for coherency..." >&4 | |
4059 | $cat > try.c <<'EOF' | |
4060 | #include <stdio.h> | |
4061 | int main() { printf("Ok\n"); exit(0); } | |
4062 | EOF | |
4063 | set X $cc $optimize $ccflags -o try $ldflags try.c $libs | |
4064 | shift | |
4065 | $cat >try.msg <<'EOM' | |
4066 | I've tried to compile and run the following simple program: | |
4067 | ||
4068 | EOM | |
4069 | $cat try.c >> try.msg | |
4070 | ||
4071 | $cat >> try.msg <<EOM | |
4072 | ||
4073 | I used the command: | |
4074 | ||
4075 | $* | |
4076 | ./try | |
4077 | ||
4078 | and I got the following output: | |
4079 | ||
4080 | EOM | |
4081 | dflt=y | |
4082 | if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then | |
4083 | if sh -c './try' >>try.msg 2>&1; then | |
4084 | xxx=`./try` | |
4085 | case "$xxx" in | |
4086 | "Ok") dflt=n ;; | |
4087 | *) echo 'The program compiled OK, but produced no output.' >> try.msg | |
4088 | case " $libs " in | |
4089 | *" -lsfio "*) | |
4090 | cat >> try.msg <<'EOQS' | |
4091 | If $libs contains -lsfio, and sfio is mis-configured, then it | |
4092 | sometimes (apparently) runs and exits with a 0 status, but with no | |
4093 | output! It may have to do with sfio's use of _exit vs. exit. | |
4094 | ||
4095 | EOQS | |
4096 | rp="You have a big problem. Shall I abort Configure" | |
4097 | dflt=y | |
4098 | ;; | |
4099 | esac | |
4100 | ;; | |
4101 | esac | |
4102 | else | |
4103 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
4104 | rp="You have a problem. Shall I abort Configure" | |
4105 | dflt=y | |
4106 | fi | |
4107 | else | |
4108 | echo "I can't compile the test program." >>try.msg | |
4109 | rp="You have a BIG problem. Shall I abort Configure" | |
4110 | dflt=y | |
4111 | fi | |
4112 | case "$dflt" in | |
4113 | y) | |
4114 | $cat try.msg >&4 | |
4115 | case "$knowitall" in | |
4116 | '') | |
4117 | echo "(The supplied flags or libraries might be incorrect.)" | |
c4f23d77 | 4118 | ;; |
bd9b35c9 | 4119 | *) dflt=n;; |
c4f23d77 | 4120 | esac |
bd9b35c9 JH |
4121 | echo " " |
4122 | . ./myread | |
4123 | case "$ans" in | |
4124 | n*|N*) ;; | |
4125 | *) echo "Ok. Stopping Configure." >&4 | |
4126 | exit 1 | |
c4f23d77 AD |
4127 | ;; |
4128 | esac | |
4129 | ;; | |
bd9b35c9 | 4130 | n) echo "OK, that should do.";; |
c4f23d77 | 4131 | esac |
bd9b35c9 | 4132 | $rm -f try try.* core |
c4f23d77 | 4133 | |
bd9b35c9 JH |
4134 | : define an is-a-typedef? function |
4135 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
4136 | case "$inclist" in | |
4137 | "") inclist="sys/types.h";; | |
4138 | esac; | |
4139 | eval "varval=\$$var"; | |
4140 | case "$varval" in | |
4141 | "") | |
4142 | $rm -f temp.c; | |
4143 | for inc in $inclist; do | |
4144 | echo "#include <$inc>" >>temp.c; | |
4145 | done; | |
4146 | echo "#ifdef $type" >> temp.c; | |
4147 | echo "printf(\"We have $type\");" >> temp.c; | |
4148 | echo "#endif" >> temp.c; | |
4149 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
4150 | if $contains $type temp.E >/dev/null 2>&1; then | |
4151 | eval "$var=\$type"; | |
4152 | else | |
4153 | eval "$var=\$def"; | |
4154 | fi; | |
4155 | $rm -f temp.?;; | |
4156 | *) eval "$var=\$varval";; | |
4157 | esac' | |
8e07c86e | 4158 | |
bd9b35c9 JH |
4159 | : define an is-a-typedef? function that prompts if the type is not available. |
4160 | typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
4161 | case "$inclist" in | |
4162 | "") inclist="sys/types.h";; | |
4163 | esac; | |
4164 | eval "varval=\$$var"; | |
4165 | case "$varval" in | |
4166 | "") | |
4167 | $rm -f temp.c; | |
4168 | for inc in $inclist; do | |
4169 | echo "#include <$inc>" >>temp.c; | |
4170 | done; | |
4171 | echo "#ifdef $type" >> temp.c; | |
4172 | echo "printf(\"We have $type\");" >> temp.c; | |
4173 | echo "#endif" >> temp.c; | |
4174 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
4175 | echo " " ; | |
4176 | echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./"; | |
4177 | if $contains $type temp.E >/dev/null 2>&1; then | |
4178 | echo "$type found." >&4; | |
4179 | eval "$var=\$type"; | |
4180 | else | |
4181 | echo "$type NOT found." >&4; | |
4182 | dflt="$def"; | |
4183 | . ./myread ; | |
4184 | eval "$var=\$ans"; | |
4185 | fi; | |
4186 | $rm -f temp.?;; | |
4187 | *) eval "$var=\$varval";; | |
4188 | esac' | |
8e07c86e | 4189 | |
bd9b35c9 JH |
4190 | : define a shorthand compile call |
4191 | compile=' | |
4192 | mc_file=$1; | |
4193 | shift; | |
4194 | $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;' | |
4195 | : define a shorthand compile call for compilations that should be ok. | |
4196 | compile_ok=' | |
4197 | mc_file=$1; | |
4198 | shift; | |
4199 | $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;' | |
8e07c86e | 4200 | |
bd9b35c9 JH |
4201 | : check for lengths of integral types |
4202 | echo " " | |
4203 | case "$intsize" in | |
2afac517 | 4204 | '') |
bd9b35c9 JH |
4205 | echo "Checking to see how big your integers are..." >&4 |
4206 | $cat >intsize.c <<'EOCP' | |
4207 | #include <stdio.h> | |
4208 | int main() | |
4209 | { | |
4210 | printf("intsize=%d;\n", (int)sizeof(int)); | |
4211 | printf("longsize=%d;\n", (int)sizeof(long)); | |
4212 | printf("shortsize=%d;\n", (int)sizeof(short)); | |
4213 | exit(0); | |
4214 | } | |
4215 | EOCP | |
4216 | set intsize | |
4217 | if eval $compile_ok && ./intsize > /dev/null; then | |
4218 | eval `./intsize` | |
4219 | echo "Your integers are $intsize bytes long." | |
4220 | echo "Your long integers are $longsize bytes long." | |
4221 | echo "Your short integers are $shortsize bytes long." | |
2afac517 | 4222 | else |
bd9b35c9 JH |
4223 | $cat >&4 <<EOM |
4224 | ! | |
4225 | Help! I can't compile and run the intsize test program: please enlighten me! | |
4226 | (This is probably a misconfiguration in your system or libraries, and | |
4227 | you really ought to fix it. Still, I'll try anyway.) | |
4228 | ! | |
4229 | EOM | |
4230 | dflt=4 | |
4231 | rp="What is the size of an integer (in bytes)?" | |
4232 | . ./myread | |
4233 | intsize="$ans" | |
4234 | dflt=$intsize | |
4235 | rp="What is the size of a long integer (in bytes)?" | |
4236 | . ./myread | |
4237 | longsize="$ans" | |
4238 | dflt=2 | |
4239 | rp="What is the size of a short integer (in bytes)?" | |
4240 | . ./myread | |
4241 | shortsize="$ans" | |
2afac517 | 4242 | fi |
4243 | ;; | |
8e07c86e | 4244 | esac |
bd9b35c9 JH |
4245 | $rm -f intsize intsize.* |
4246 | ||
4247 | : see what type lseek is declared as in the kernel | |
4248 | rp="What is the type used for lseek's offset on this system?" | |
4249 | set off_t lseektype long stdio.h sys/types.h | |
4250 | eval $typedef_ask | |
4251 | ||
4252 | echo " " | |
49c10eea | 4253 | echo "Checking to see how big your file offsets are..." >&4 |
bd9b35c9 JH |
4254 | $cat >try.c <<EOCP |
4255 | #include <sys/types.h> | |
4256 | #include <stdio.h> | |
4257 | int main() | |
4258 | { | |
4259 | printf("%d\n", (int)sizeof($lseektype)); | |
4260 | return(0); | |
4261 | } | |
4262 | EOCP | |
4263 | set try | |
4264 | if eval $compile_ok; then | |
4265 | lseeksize=`./try` | |
49c10eea | 4266 | echo "Your file offsets are $lseeksize bytes long." |
bd9b35c9 JH |
4267 | else |
4268 | dflt=$longsize | |
4269 | echo " " | |
4270 | echo "(I can't seem to compile the test program. Guessing...)" | |
4271 | rp="What is the size of your file offsets (in bytes)?" | |
4272 | . ./myread | |
4273 | lseeksize="$ans" | |
4274 | fi | |
4275 | $rm -f try.c try | |
4276 | ||
4277 | : see what type file positions are declared as in the library | |
4278 | rp="What is the type for file position used by fsetpos()?" | |
4279 | set fpos_t fpostype long stdio.h sys/types.h | |
4280 | eval $typedef_ask | |
4281 | ||
4282 | echo " " | |
4283 | case "$fpostype" in | |
4284 | *_t) zzz="$fpostype" ;; | |
4285 | *) zzz="fpos_t" ;; | |
4286 | esac | |
49c10eea | 4287 | echo "Checking the size of $zzz..." >&4 |
bd9b35c9 JH |
4288 | cat > try.c <<EOCP |
4289 | #include <sys/types.h> | |
4290 | #include <stdio.h> | |
4291 | int main() { | |
4292 | printf("%d\n", (int)sizeof($fpostype)); | |
4293 | exit(0); | |
4294 | } | |
4295 | EOCP | |
4296 | set try | |
4297 | if eval $compile_ok; then | |
4298 | yyy=`./try` | |
4299 | case "$yyy" in | |
4300 | '') fpossize=4 | |
bd9b35c9 JH |
4301 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 |
4302 | ;; | |
4303 | *) fpossize=$yyy | |
c890dc6c | 4304 | echo "Your $zzz is $fpossize bytes long." |
bd9b35c9 JH |
4305 | ;; |
4306 | esac | |
4307 | else | |
4308 | dflt="$longsize" | |
68435ea7 | 4309 | echo " " >&4 |
bd9b35c9 JH |
4310 | echo "(I can't compile the test program. Guessing...)" >&4 |
4311 | rp="What is the size of your file positions (in bytes)?" | |
4312 | . ./myread | |
4313 | fpossize="$ans" | |
4314 | fi | |
4315 | ||
4316 | ||
8e07c86e | 4317 | |
10cc9d2a JH |
4318 | # Backward compatibility (uselfs is deprecated). |
4319 | case "$uselfs" in | |
4320 | "$define"|true|[yY]*) | |
4321 | cat <<EOM >&4 | |
4322 | ||
4323 | *** Configure -Duselfs is deprecated, using -Duselargefiles instead. | |
10cc9d2a JH |
4324 | EOM |
4325 | uselargefiles="$define" | |
4326 | ;; | |
4327 | esac | |
4328 | ||
bd9b35c9 JH |
4329 | case "$lseeksize:$fpossize" in |
4330 | 8:8) cat <<EOM | |
8e07c86e | 4331 | |
bd9b35c9 | 4332 | You can have files larger than 2 gigabytes. |
8e07c86e | 4333 | EOM |
bd9b35c9 | 4334 | val="$define" ;; |
0f0995ae JH |
4335 | *) case "$uselargefiles" in |
4336 | "$undef"|false|[nN]*) dflt='n' ;; | |
4337 | *) dflt='y' ;; | |
4338 | esac | |
4339 | cat <<EOM | |
8e07c86e | 4340 | |
bd9b35c9 | 4341 | Perl can be built to understand large files (files larger than 2 gigabytes) |
0f0995ae | 4342 | on some systems. To do so, Configure can be run with -Duselargefiles. |
bd9b35c9 | 4343 | |
0f0995ae | 4344 | If this doesn't make any sense to you, just accept the default '$dflt'. |
bd9b35c9 | 4345 | EOM |
bd9b35c9 JH |
4346 | rp='Try to understand large files, if available?' |
4347 | . ./myread | |
4348 | case "$ans" in | |
4349 | y|Y) val="$define" ;; | |
4350 | *) val="$undef" ;; | |
4351 | esac | |
4352 | ;; | |
dfe9444c | 4353 | esac |
bd9b35c9 JH |
4354 | set uselargefiles |
4355 | eval $setvar | |
4356 | case "$uselargefiles" in | |
4357 | "$define") | |
4358 | : Look for a hint-file generated 'call-back-unit'. If the | |
4359 | : user has specified that a large files perl is to be built, | |
4360 | : we may need to set or change some other defaults. | |
8a647129 | 4361 | if $test -f uselargefiles.cbu; then |
bd9b35c9 | 4362 | echo "Your platform has some specific hints for large file builds, using them..." |
8a647129 | 4363 | . ./uselargefiles.cbu |
bd9b35c9 | 4364 | echo " " |
49c10eea | 4365 | echo "Rechecking to see how big your file offsets are..." >&4 |
bd9b35c9 JH |
4366 | $cat >try.c <<EOCP |
4367 | #include <sys/types.h> | |
4368 | #include <stdio.h> | |
4369 | int main() | |
4370 | { | |
4371 | printf("%d\n", (int)sizeof($lseektype)); | |
4372 | return(0); | |
4373 | } | |
4374 | EOCP | |
4375 | set try | |
4376 | if eval $compile_ok; then | |
4377 | lseeksize=`./try` | |
49c10eea | 4378 | $echo "Your file offsets are now $lseeksize bytes long." |
bd9b35c9 JH |
4379 | else |
4380 | dflt="$lseeksize" | |
4381 | echo " " | |
4382 | echo "(I can't seem to compile the test program. Guessing...)" | |
4383 | rp="What is the size of your file offsets (in bytes)?" | |
4384 | . ./myread | |
4385 | lseeksize="$ans" | |
4386 | fi | |
4387 | case "$fpostype" in | |
4388 | *_t) zzz="$fpostype" ;; | |
4389 | *) zzz="fpos_t" ;; | |
4390 | esac | |
4391 | $echo $n "Rechecking the size of $zzz...$c" >&4 | |
4392 | $cat > try.c <<EOCP | |
4393 | #include <sys/types.h> | |
4394 | #include <stdio.h> | |
4395 | int main() { | |
4396 | printf("%d\n", (int)sizeof($fpostype)); | |
4397 | exit(0); | |
4398 | } | |
4399 | EOCP | |
4400 | set try | |
4401 | if eval $compile_ok; then | |
4402 | yyy=`./try` | |
4403 | dflt="$lseeksize" | |
4404 | case "$yyy" in | |
4405 | '') echo " " | |
4406 | echo "(I can't execute the test program--guessing $fpossize.)" >&4 | |
4407 | ;; | |
4408 | *) fpossize=$yyy | |
49c10eea | 4409 | echo " $fpossize bytes." >&4 |
bd9b35c9 JH |
4410 | ;; |
4411 | esac | |
4412 | else | |
4413 | dflt="$fpossize" | |
4414 | echo " " | |
4415 | echo "(I can't compile the test program. Guessing...)" >&4 | |
4416 | rp="What is the size of your file positions (in bytes)?" | |
4417 | . ./myread | |
4418 | fpossize="$ans" | |
4419 | fi | |
4420 | $rm -f try.c try | |
4421 | fi | |
dfe9444c AD |
4422 | ;; |
4423 | esac | |
bd9b35c9 JH |
4424 | |
4425 | ||
4426 | case "$usemorebits" in | |
4427 | "$define"|true|[yY]*) | |
10cc9d2a | 4428 | use64bitint="$define" |
bd9b35c9 JH |
4429 | uselongdouble="$define" |
4430 | usemorebits="$define" | |
dfe9444c | 4431 | ;; |
bd9b35c9 | 4432 | *) usemorebits="$undef" |
dfe9444c AD |
4433 | ;; |
4434 | esac | |
dfe9444c | 4435 | |
dfe9444c | 4436 | |
49c10eea JH |
4437 | case "$uselonglong" in |
4438 | "$define"|true|[yY]*) | |
4439 | cat <<EOM >&4 | |
4440 | ||
10cc9d2a | 4441 | *** Configure -Duselonglong is deprecated, using -Duse64bitint instead. |
10cc9d2a JH |
4442 | EOM |
4443 | use64bitint="$define" | |
4444 | ;; | |
4445 | esac | |
10cc9d2a JH |
4446 | case "$use64bits" in |
4447 | "$define"|true|[yY]*) | |
4448 | cat <<EOM >&4 | |
4449 | ||
4450 | *** Configure -Duse64bits is deprecated, using -Duse64bitint instead. | |
49c10eea | 4451 | EOM |
10cc9d2a | 4452 | use64bitint="$define" |
49c10eea JH |
4453 | ;; |
4454 | esac | |
10cc9d2a JH |
4455 | case "$use64bitints" in |
4456 | "$define"|true|[yY]*) | |
4457 | cat <<EOM >&4 | |
4458 | ||
4459 | *** There is no Configure -Duse64bitints, using -Duse64bitint instead. | |
10cc9d2a JH |
4460 | EOM |
4461 | use64bitint="$define" | |
4462 | ;; | |
4463 | esac | |
3141530c JH |
4464 | case "$use64bitsint" in |
4465 | "$define"|true|[yY]*) | |
4466 | cat <<EOM >&4 | |
4467 | ||
4468 | *** There is no Configure -Duse64bitsint, using -Duse64bitint instead. | |
4469 | EOM | |
4470 | use64bitint="$define" | |
4471 | ;; | |
4472 | esac | |
4473 | case "$uselonglongs" in | |
4474 | "$define"|true|[yY]*) | |
4475 | cat <<EOM >&4 | |
4476 | ||
4477 | *** There is no Configure -Duselonglongs, using -Duse64bitint instead. | |
4478 | EOM | |
4479 | use64bitint="$define" | |
4480 | ;; | |
4481 | esac | |
a1b03cdf JH |
4482 | case "$use64bitsall" in |
4483 | "$define"|true|[yY]*) | |
4484 | cat <<EOM >&4 | |
4485 | ||
4486 | *** There is no Configure -Duse64bitsall, using -Duse64bitall instead. | |
4487 | EOM | |
4488 | use64bitall="$define" | |
4489 | ;; | |
4490 | esac | |
10cc9d2a | 4491 | |
49c10eea | 4492 | case "$ccflags" in |
10cc9d2a | 4493 | *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";; |
49c10eea | 4494 | esac |
10cc9d2a JH |
4495 | case "$use64bitall" in |
4496 | "$define"|true|[yY]*) use64bitint="$define" ;; | |
49c10eea JH |
4497 | esac |
4498 | ||
4499 | case "$longsize" in | |
4500 | 8) cat <<EOM | |
4501 | ||
4502 | You have natively 64-bit long integers. | |
bd9b35c9 | 4503 | EOM |
ad551343 JH |
4504 | val="$define" |
4505 | ;; | |
10cc9d2a | 4506 | *) case "$use64bitint" in |
49c10eea | 4507 | "$define"|true|[yY]*) dflt='y';; |
ad551343 JH |
4508 | *) dflt='n';; |
4509 | esac | |
49c10eea | 4510 | cat <<EOM |
29209bc5 | 4511 | |
bd9b35c9 | 4512 | Perl can be built to take advantage of 64-bit integer types |
10cc9d2a | 4513 | on some systems. To do so, Configure can be run with -Duse64bitint. |
49c10eea | 4514 | Choosing this option will most probably introduce binary incompatibilities. |
29209bc5 | 4515 | |
ad551343 | 4516 | If this doesn't make any sense to you, just accept the default '$dflt'. |
29209bc5 | 4517 | EOM |
ad551343 JH |
4518 | rp='Try to use 64-bit integers, if available?' |
4519 | . ./myread | |
4520 | case "$ans" in | |
4521 | [yY]*) val="$define" ;; | |
4522 | *) val="$undef" ;; | |
4523 | esac | |
4524 | ;; | |
29209bc5 | 4525 | esac |
10cc9d2a | 4526 | set use64bitint |
29209bc5 JH |
4527 | eval $setvar |
4528 | ||
1acc7ade JH |
4529 | case "$use64bitall" in |
4530 | "$define"|true|[yY]*) dflt='y' ;; | |
4531 | *) case "$longsize" in | |
4532 | 8) dflt='y' ;; | |
4533 | *) dflt='n' ;; | |
4534 | esac | |
4535 | ;; | |
4536 | esac | |
843b3b0e JH |
4537 | cat <<EOM |
4538 | ||
4539 | You may also choose to try maximal 64-bitness. It means using as much | |
4540 | 64-bitness as possible on the platform. This in turn means even more | |
4541 | binary incompatibilities. On the other hand, your platform may not | |
4542 | have any more 64-bitness available than what you already have chosen. | |
4543 | ||
4544 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
4545 | EOM | |
4546 | rp='Try to use maximal 64-bit support, if available?' | |
4547 | . ./myread | |
4548 | case "$ans" in | |
4549 | [yY]*) val="$define" ;; | |
4550 | *) val="$undef" ;; | |
4551 | esac | |
10cc9d2a | 4552 | set use64bitall |
49c10eea | 4553 | eval $setvar |
843b3b0e JH |
4554 | case "$use64bitall" in |
4555 | "$define") | |
4556 | case "$use64bitint" in | |
4557 | "$undef") | |
4558 | cat <<EOM | |
4559 | ||
4560 | Since you have chosen a maximally 64-bit build, I'm also turning on | |
4561 | the use of 64-bit integers. | |
4562 | EOM | |
4563 | use64bitint="$define" ;; | |
4564 | esac | |
4565 | ;; | |
4566 | esac | |
bd9b35c9 | 4567 | |
10cc9d2a | 4568 | case "$use64bitint" in |
bd9b35c9 JH |
4569 | "$define"|true|[yY]*) |
4570 | : Look for a hint-file generated 'call-back-unit'. If the | |
4571 | : user has specified that a 64-bit perl is to be built, | |
4572 | : we may need to set or change some other defaults. | |
10cc9d2a | 4573 | if $test -f use64bitint.cbu; then |
e5788f28 | 4574 | echo "Your platform has some specific hints for 64-bit integers, using them..." |
10cc9d2a | 4575 | . ./use64bitint.cbu |
bd9b35c9 | 4576 | fi |
49c10eea | 4577 | case "$longsize" in |
701a9a05 | 4578 | 4) case "$archname64" in |
10cc9d2a | 4579 | '') archname64=64int ;; |
49c10eea JH |
4580 | esac |
4581 | ;; | |
4582 | esac | |
4583 | ;; | |
4584 | esac | |
4585 | ||
10cc9d2a | 4586 | case "$use64bitall" in |
49c10eea JH |
4587 | "$define"|true|[yY]*) |
4588 | : Look for a hint-file generated 'call-back-unit'. If the | |
843b3b0e | 4589 | : user has specified that a maximally 64-bit perl is to be built, |
49c10eea | 4590 | : we may need to set or change some other defaults. |
10cc9d2a | 4591 | if $test -f use64bitall.cbu; then |
843b3b0e | 4592 | echo "Your platform has some specific hints for 64-bit builds, using them..." |
10cc9d2a | 4593 | . ./use64bitall.cbu |
49c10eea JH |
4594 | fi |
4595 | case "$longsize" in | |
c6861c9d | 4596 | 4) case "$archname64" in |
bab3591f | 4597 | ''|64int) archname64=64all ;; |
49c10eea JH |
4598 | esac |
4599 | ;; | |
4600 | esac | |
bd9b35c9 JH |
4601 | ;; |
4602 | esac | |
4603 | ||
4604 | : determine the architecture name | |
2afac517 | 4605 | echo " " |
bd9b35c9 JH |
4606 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
4607 | tarch=`arch`"-$osname" | |
4608 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
4609 | if uname -m > tmparch 2>&1 ; then | |
4610 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ | |
4611 | -e 's/$/'"-$osname/" tmparch` | |
4612 | else | |
4613 | tarch="$osname" | |
4614 | fi | |
4615 | $rm -f tmparch | |
4616 | else | |
4617 | tarch="$osname" | |
4618 | fi | |
4619 | case "$myarchname" in | |
4620 | ''|"$tarch") ;; | |
4621 | *) | |
4622 | echo "(Your architecture name used to be $myarchname.)" | |
4623 | archname='' | |
4624 | ;; | |
8e07c86e | 4625 | esac |
bd9b35c9 JH |
4626 | myarchname="$tarch" |
4627 | case "$archname" in | |
4628 | '') dflt="$tarch";; | |
4629 | *) dflt="$archname";; | |
2afac517 | 4630 | esac |
bd9b35c9 JH |
4631 | rp='What is your architecture name' |
4632 | . ./myread | |
4633 | archname="$ans" | |
4634 | case "$usethreads" in | |
29209bc5 | 4635 | $define) |
bd9b35c9 JH |
4636 | echo "Threads selected." >&4 |
4637 | case "$archname" in | |
4638 | *-thread*) echo "...and architecture name already has -thread." >&4 | |
4639 | ;; | |
4640 | *) archname="$archname-thread" | |
4641 | echo "...setting architecture name to $archname." >&4 | |
4642 | ;; | |
4643 | esac | |
29209bc5 JH |
4644 | ;; |
4645 | esac | |
bd9b35c9 JH |
4646 | case "$usemultiplicity" in |
4647 | $define) | |
4648 | echo "Multiplicity selected." >&4 | |
4649 | case "$archname" in | |
4650 | *-multi*) echo "...and architecture name already has -multi." >&4 | |
4651 | ;; | |
4652 | *) archname="$archname-multi" | |
4653 | echo "...setting architecture name to $archname." >&4 | |
4654 | ;; | |
4655 | esac | |
4656 | ;; | |
4657 | esac | |
10cc9d2a | 4658 | case "$use64bitint" in |
bd9b35c9 JH |
4659 | $define) |
4660 | case "$archname64" in | |
4661 | '') | |
4662 | ;; | |
4663 | *) | |
4664 | case "$archname" in | |
4665 | *-$archname64*) echo "...and architecture name already has $archname64." >&4 | |
4666 | ;; | |
4667 | *) archname="$archname-$archname64" | |
4668 | echo "...setting architecture name to $archname." >&4 | |
4669 | ;; | |
4670 | esac | |
4671 | ;; | |
4672 | esac | |
4673 | esac | |
4674 | ||
4675 | : determine root of directory hierarchy where package will be installed. | |
4676 | case "$prefix" in | |
4677 | '') | |
4678 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
4679 | ;; | |
4680 | *) | |
4681 | dflt="$prefix" | |
4682 | ;; | |
4683 | esac | |
4684 | $cat <<EOM | |
4685 | ||
4686 | By default, $package will be installed in $dflt/bin, manual pages | |
4687 | under $dflt/man, etc..., i.e. with $dflt as prefix for all | |
4688 | installation directories. Typically this is something like /usr/local. | |
4689 | If you wish to have binaries under /usr/bin but other parts of the | |
4690 | installation under /usr/local, that's ok: you will be prompted | |
4691 | separately for each of the installation directories, the prefix being | |
4692 | only used to set the defaults. | |
4693 | ||
4694 | EOM | |
4695 | fn=d~ | |
4696 | rp='Installation prefix to use?' | |
4697 | . ./getfile | |
4698 | oldprefix='' | |
4699 | case "$prefix" in | |
4700 | '') ;; | |
4701 | *) | |
4702 | case "$ans" in | |
4703 | "$prefix") ;; | |
4704 | *) oldprefix="$prefix";; | |
4705 | esac | |
4706 | ;; | |
4707 | esac | |
4708 | prefix="$ans" | |
4709 | prefixexp="$ansexp" | |
4710 | ||
4711 | : is AFS running? | |
4712 | echo " " | |
4713 | case "$afs" in | |
4714 | $define|true) afs=true ;; | |
4715 | $undef|false) afs=false ;; | |
4716 | *) if test -d /afs; then | |
4717 | afs=true | |
2afac517 | 4718 | else |
bd9b35c9 | 4719 | afs=false |
2afac517 | 4720 | fi |
bd9b35c9 | 4721 | ;; |
8e07c86e | 4722 | esac |
bd9b35c9 JH |
4723 | if $afs; then |
4724 | echo "AFS may be running... I'll be extra cautious then..." >&4 | |
4725 | else | |
4726 | echo "AFS does not seem to be running..." >&4 | |
4727 | fi | |
2afac517 | 4728 | |
bd9b35c9 JH |
4729 | : determine installation prefix for where package is to be installed. |
4730 | if $afs; then | |
4633a7c4 | 4731 | $cat <<EOM |
29209bc5 | 4732 | |
bd9b35c9 JH |
4733 | Since you are running AFS, I need to distinguish the directory in which |
4734 | files will reside from the directory in which they are installed (and from | |
4735 | which they are presumably copied to the former directory by occult means). | |
4736 | ||
4633a7c4 | 4737 | EOM |
bd9b35c9 JH |
4738 | case "$installprefix" in |
4739 | '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;; | |
4740 | *) dflt="$installprefix";; | |
4741 | esac | |
4742 | else | |
4743 | $cat <<EOM | |
2afac517 | 4744 | |
bd9b35c9 JH |
4745 | In some special cases, particularly when building $package for distribution, |
4746 | it is convenient to distinguish between the directory in which files should | |
4747 | be installed from the directory ($prefix) in which they | |
4748 | will eventually reside. For most users, these two directories are the same. | |
8e07c86e | 4749 | |
bd9b35c9 JH |
4750 | EOM |
4751 | case "$installprefix" in | |
4752 | '') dflt=$prefix ;; | |
4753 | *) dflt=$installprefix;; | |
4754 | esac | |
4755 | fi | |
4756 | fn=d~ | |
4757 | rp='What installation prefix should I use for installing files?' | |
4758 | . ./getfile | |
4759 | installprefix="$ans" | |
4760 | installprefixexp="$ansexp" | |
4633a7c4 | 4761 | |
bd9b35c9 JH |
4762 | : set the prefixit variable, to compute a suitable default value |
4763 | prefixit='case "$3" in | |
4764 | ""|none) | |
4765 | case "$oldprefix" in | |
4766 | "") eval "$1=\"\$$2\"";; | |
4767 | *) | |
4768 | case "$3" in | |
4769 | "") eval "$1=";; | |
4770 | none) | |
4771 | eval "tp=\"\$$2\""; | |
4772 | case "$tp" in | |
4773 | ""|" ") eval "$1=\"\$$2\"";; | |
4774 | *) eval "$1=";; | |
4775 | esac;; | |
4776 | esac;; | |
4777 | esac;; | |
4778 | *) | |
4779 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; | |
4780 | case "$tp" in | |
4781 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; | |
4782 | /*-$oldprefix/*|\~*-$oldprefix/*) | |
4783 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; | |
4784 | *) eval "$1=\"\$$2\"";; | |
4785 | esac;; | |
4786 | esac' | |
4633a7c4 | 4787 | |
ff935051 JH |
4788 | |
4789 | : get the patchlevel | |
bd9b35c9 JH |
4790 | echo " " |
4791 | echo "Getting the current patchlevel..." >&4 | |
4792 | if $test -r $rsrc/patchlevel.h;then | |
49c10eea | 4793 | revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` |
bd9b35c9 JH |
4794 | patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
4795 | subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` | |
ff935051 JH |
4796 | api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` |
4797 | api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` | |
4798 | api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` | |
bd9b35c9 | 4799 | else |
49c10eea | 4800 | revision=0 |
bd9b35c9 JH |
4801 | patchlevel=0 |
4802 | subversion=0 | |
ff935051 JH |
4803 | api_revision=0 |
4804 | api_version=0 | |
4805 | api_subversion=0 | |
bd9b35c9 | 4806 | fi |
49c10eea | 4807 | $echo $n "(You have $package revision $revision" $c |
bd9b35c9 JH |
4808 | $echo $n " patchlevel $patchlevel" $c |
4809 | test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c | |
4810 | echo ".)" | |
ff935051 | 4811 | case "$osname" in |
3645a519 | 4812 | dos|vms) |
ff935051 | 4813 | : XXX Should be a Configure test for double-dots in filenames. |
49c10eea | 4814 | version=`echo $revision $patchlevel $subversion | \ |
273cf8d1 | 4815 | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` |
ff935051 JH |
4816 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
4817 | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` | |
4818 | ;; | |
4819 | *) | |
49c10eea | 4820 | version=`echo $revision $patchlevel $subversion | \ |
ff935051 JH |
4821 | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` |
4822 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ | |
273cf8d1 | 4823 | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` |
ff935051 JH |
4824 | ;; |
4825 | esac | |
4826 | : Special case the 5.005_xx maintenance series, which used 5.005 | |
4827 | : without any subversion label as a subdirectory in $sitelib | |
4828 | if test "${api_revision}${api_version}${api_subversion}" = "550"; then | |
4829 | api_versionstring='5.005' | |
273cf8d1 | 4830 | fi |
bd9b35c9 JH |
4831 | |
4832 | : determine installation style | |
4833 | : For now, try to deduce it from prefix unless it is already set. | |
4834 | : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. | |
4835 | case "$installstyle" in | |
4836 | '') case "$prefix" in | |
4837 | *perl*) dflt='lib';; | |
4838 | *) dflt='lib/perl5' ;; | |
34d1710f | 4839 | esac |
4633a7c4 | 4840 | ;; |
d6c8a45d | 4841 | *) dflt="$installstyle" ;; |
4633a7c4 | 4842 | esac |
bd9b35c9 JH |
4843 | : Probably not worth prompting for this since we prompt for all |
4844 | : the directories individually, and the prompt would be too long and | |
4845 | : confusing anyway. | |
4846 | installstyle=$dflt | |
4633a7c4 | 4847 | |
bd9b35c9 JH |
4848 | : determine where private library files go |
4849 | : Usual default is /usr/local/lib/perl5/$version. | |
4850 | : Also allow things like /opt/perl/lib/$version, since | |
4851 | : /opt/perl/lib/perl5... would be redundant. | |
4852 | : The default "style" setting is made in installstyle.U | |
4853 | case "$installstyle" in | |
4854 | *lib/perl5*) set dflt privlib lib/$package/$version ;; | |
4855 | *) set dflt privlib lib/$version ;; | |
a4f3eea9 | 4856 | esac |
bd9b35c9 JH |
4857 | eval $prefixit |
4858 | $cat <<EOM | |
a4f3eea9 | 4859 | |
bd9b35c9 JH |
4860 | There are some auxiliary files for $package that need to be put into a |
4861 | private library directory that is accessible by everyone. | |
4862 | ||
4863 | EOM | |
4864 | fn=d~+ | |
4865 | rp='Pathname where the private library files will reside?' | |
4866 | . ./getfile | |
4867 | privlib="$ans" | |
4868 | privlibexp="$ansexp" | |
4869 | : Change installation prefix, if necessary. | |
4870 | if $test X"$prefix" != X"$installprefix"; then | |
4871 | installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"` | |
a4f3eea9 | 4872 | else |
bd9b35c9 JH |
4873 | installprivlib="$privlibexp" |
4874 | fi | |
a4f3eea9 | 4875 | |
bd9b35c9 JH |
4876 | : set the prefixup variable, to restore leading tilda escape |
4877 | prefixup='case "$prefixexp" in | |
4878 | "$prefix") ;; | |
4879 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; | |
4880 | esac' | |
a4f3eea9 | 4881 | |
bd9b35c9 JH |
4882 | : determine where public architecture dependent libraries go |
4883 | set archlib archlib | |
4884 | eval $prefixit | |
4885 | : privlib default is /usr/local/lib/$package/$version | |
4886 | : archlib default is /usr/local/lib/$package/$version/$archname | |
4887 | : privlib may have an optional trailing /share. | |
4888 | tdflt=`echo $privlib | $sed 's,/share$,,'` | |
4889 | tdflt=$tdflt/$archname | |
4890 | case "$archlib" in | |
4891 | '') dflt=$tdflt | |
29209bc5 | 4892 | ;; |
bd9b35c9 JH |
4893 | *) dflt="$archlib" |
4894 | ;; | |
29209bc5 | 4895 | esac |
bd9b35c9 | 4896 | $cat <<EOM |
29209bc5 | 4897 | |
bd9b35c9 JH |
4898 | $spackage contains architecture-dependent library files. If you are |
4899 | sharing libraries in a heterogeneous environment, you might store | |
4900 | these files in a separate location. Otherwise, you can just include | |
4901 | them with the rest of the public library files. | |
a4f3eea9 | 4902 | |
bd9b35c9 JH |
4903 | EOM |
4904 | fn=d+~ | |
4905 | rp='Where do you want to put the public architecture-dependent libraries?' | |
4906 | . ./getfile | |
4907 | archlib="$ans" | |
4908 | archlibexp="$ansexp" | |
4909 | if $test X"$archlib" = X"$privlib"; then | |
4910 | d_archlib="$undef" | |
4911 | else | |
4912 | d_archlib="$define" | |
4913 | fi | |
4914 | : Change installation prefix, if necessary. | |
4915 | if $test X"$prefix" != X"$installprefix"; then | |
4916 | installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"` | |
4917 | else | |
4918 | installarchlib="$archlibexp" | |
4919 | fi | |
a4f3eea9 | 4920 | |
a4f3eea9 | 4921 | |
bd9b35c9 JH |
4922 | : Binary compatibility with 5.005 is not possible for builds |
4923 | : with advanced features | |
4924 | case "$usethreads$usemultiplicity" in | |
4925 | *define*) | |
4926 | bincompat5005="$undef" | |
4927 | d_bincompat5005="$undef" | |
4928 | ;; | |
4929 | *) $cat <<EOM | |
a4f3eea9 | 4930 | |
ee3551f5 GS |
4931 | This version of Perl can be compiled for binary compatibility with 5.005. |
4932 | If you decide to do so, you will be able to continue using most of the | |
4933 | extensions that were compiled for Perl 5.005. | |
a4f3eea9 | 4934 | |
a4f3eea9 | 4935 | EOM |
bd9b35c9 JH |
4936 | case "$bincompat5005$d_bincompat5005" in |
4937 | *"$undef"*) dflt=n ;; | |
4938 | *) dflt=y ;; | |
a4f3eea9 | 4939 | esac |
bd9b35c9 JH |
4940 | rp='Binary compatibility with Perl 5.005?' |
4941 | . ./myread | |
4942 | case "$ans" in | |
4943 | y*) val="$define" ;; | |
4944 | *) val="$undef" ;; | |
a4f3eea9 | 4945 | esac |
bd9b35c9 JH |
4946 | set d_bincompat5005 |
4947 | eval $setvar | |
4948 | case "$d_bincompat5005" in | |
4949 | "$define") | |
4950 | bincompat5005="$define" | |
4951 | ;; | |
4952 | *) bincompat5005="$undef" | |
4953 | d_bincompat5005="$undef" | |
a4f3eea9 | 4954 | ;; |
4955 | esac | |
bd9b35c9 | 4956 | ;; |
a4f3eea9 | 4957 | esac |
4958 | ||
a4f3eea9 | 4959 | |
bd9b35c9 JH |
4960 | : see if setuid scripts can be secure |
4961 | $cat <<EOM | |
a4f3eea9 | 4962 | |
bd9b35c9 JH |
4963 | Some kernels have a bug that prevents setuid #! scripts from being |
4964 | secure. Some sites have disabled setuid #! scripts because of this. | |
a4f3eea9 | 4965 | |
bd9b35c9 JH |
4966 | First let's decide if your kernel supports secure setuid #! scripts. |
4967 | (If setuid #! scripts would be secure but have been disabled anyway, | |
4968 | don't say that they are secure if asked.) | |
5ff3f7a4 GS |
4969 | |
4970 | EOM | |
a4f3eea9 | 4971 | |
bd9b35c9 JH |
4972 | val="$undef" |
4973 | if $test -d /dev/fd; then | |
4974 | echo "#!$ls" >reflect | |
4975 | chmod +x,u+s reflect | |
4976 | ./reflect >flect 2>&1 | |
4977 | if $contains "/dev/fd" flect >/dev/null; then | |
4978 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 | |
4979 | val="$define" | |
4980 | else | |
4981 | $cat <<EOM | |
4982 | If you are not sure if they are secure, I can check but I'll need a | |
4983 | username and password different from the one you are using right now. | |
4984 | If you don't have such a username or don't want me to test, simply | |
4985 | enter 'none'. | |
a4f3eea9 | 4986 | |
4987 | EOM | |
bd9b35c9 JH |
4988 | rp='Other username to test security of setuid scripts with?' |
4989 | dflt='none' | |
4990 | . ./myread | |
4991 | case "$ans" in | |
4992 | n|none) | |
4993 | case "$d_suidsafe" in | |
4994 | '') echo "I'll assume setuid scripts are *not* secure." >&4 | |
4995 | dflt=n;; | |
4996 | "$undef") | |
4997 | echo "Well, the $hint value is *not* secure." >&4 | |
4998 | dflt=n;; | |
4999 | *) echo "Well, the $hint value *is* secure." >&4 | |
5000 | dflt=y;; | |
dfe9444c AD |
5001 | esac |
5002 | ;; | |
bd9b35c9 JH |
5003 | *) |
5004 | $rm -f reflect flect | |
5005 | echo "#!$ls" >reflect | |
5006 | chmod +x,u+s reflect | |
5007 | echo >flect | |
5008 | chmod a+w flect | |
5009 | echo '"su" will (probably) prompt you for '"$ans's password." | |
5010 | su $ans -c './reflect >flect' | |
5011 | if $contains "/dev/fd" flect >/dev/null; then | |
5012 | echo "Okay, it looks like setuid scripts are secure." >&4 | |
5013 | dflt=y | |
5014 | else | |
5015 | echo "I don't think setuid scripts are secure." >&4 | |
5016 | dflt=n | |
5017 | fi | |
5018 | ;; | |
5019 | esac | |
5020 | rp='Does your kernel have *secure* setuid scripts?' | |
5021 | . ./myread | |
5022 | case "$ans" in | |
5023 | [yY]*) val="$define";; | |
5024 | *) val="$undef";; | |
dfe9444c | 5025 | esac |
a4f3eea9 | 5026 | fi |
5027 | else | |
bd9b35c9 JH |
5028 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 |
5029 | echo "(That's for file descriptors, not floppy disks.)" | |
5030 | val="$undef" | |
a4f3eea9 | 5031 | fi |
bd9b35c9 JH |
5032 | set d_suidsafe |
5033 | eval $setvar | |
5034 | ||
5035 | $rm -f reflect flect | |
5036 | ||
5037 | : now see if they want to do setuid emulation | |
5038 | echo " " | |
5039 | val="$undef" | |
5040 | case "$d_suidsafe" in | |
5041 | "$define") | |
5042 | val="$undef" | |
5043 | echo "No need to emulate SUID scripts since they are secure here." >& 4 | |
5044 | ;; | |
5045 | *) | |
5046 | $cat <<EOM | |
5047 | Some systems have disabled setuid scripts, especially systems where | |
5048 | setuid scripts cannot be secure. On systems where setuid scripts have | |
5049 | been disabled, the setuid/setgid bits on scripts are currently | |
5050 | useless. It is possible for $package to detect those bits and emulate | |
5051 | setuid/setgid in a secure fashion. This emulation will only work if | |
5052 | setuid scripts have been disabled in your kernel. | |
5053 | ||
5054 | EOM | |
5055 | case "$d_dosuid" in | |
5056 | "$define") dflt=y ;; | |
5057 | *) dflt=n ;; | |
a4f3eea9 | 5058 | esac |
bd9b35c9 | 5059 | rp="Do you want to do setuid/setgid emulation?" |
a4f3eea9 | 5060 | . ./myread |
5061 | case "$ans" in | |
bd9b35c9 JH |
5062 | [yY]*) val="$define";; |
5063 | *) val="$undef";; | |
a4f3eea9 | 5064 | esac |
5065 | ;; | |
a4f3eea9 | 5066 | esac |
bd9b35c9 JH |
5067 | set d_dosuid |
5068 | eval $setvar | |
a4f3eea9 | 5069 | |
bfb7748a AD |
5070 | : determine filename position in cpp output |
5071 | echo " " | |
5072 | echo "Computing filename position in cpp output for #include directives..." >&4 | |
5073 | echo '#include <stdio.h>' > foo.c | |
5074 | $cat >fieldn <<EOF | |
5075 | $startsh | |
5076 | $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \ | |
5077 | $grep '^[ ]*#.*stdio\.h' | \ | |
5078 | while read cline; do | |
5079 | pos=1 | |
5080 | set \$cline | |
5081 | while $test \$# -gt 0; do | |
5082 | if $test -r \`echo \$1 | $tr -d '"'\`; then | |
5083 | echo "\$pos" | |
5084 | exit 0 | |
5085 | fi | |
5086 | shift | |
5087 | pos=\`expr \$pos + 1\` | |
5088 | done | |
5089 | done | |
5090 | EOF | |
5091 | chmod +x fieldn | |
5092 | fieldn=`./fieldn` | |
5093 | $rm -f foo.c fieldn | |
5094 | case $fieldn in | |
5095 | '') pos='???';; | |
5096 | 1) pos=first;; | |
5097 | 2) pos=second;; | |
5098 | 3) pos=third;; | |
5099 | *) pos="${fieldn}th";; | |
5100 | esac | |
5101 | echo "Your cpp writes the filename in the $pos field of the line." | |
5102 | ||
5103 | : locate header file | |
5104 | $cat >findhdr <<EOF | |
5105 | $startsh | |
5106 | wanted=\$1 | |
9cc6feab | 5107 | name='' |
3656fc86 JH |
5108 | for usrincdir in $usrinc |
5109 | do | |
5110 | if test -f \$usrincdir/\$wanted; then | |
5111 | echo "\$usrincdir/\$wanted" | |
5112 | exit 0 | |
5113 | fi | |
5114 | done | |
bfb7748a AD |
5115 | awkprg='{ print \$$fieldn }' |
5116 | echo "#include <\$wanted>" > foo\$\$.c | |
5117 | $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ | |
5118 | $grep "^[ ]*#.*\$wanted" | \ | |
5119 | while read cline; do | |
5120 | name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` | |
5121 | case "\$name" in | |
4e400192 JH |
5122 | *[/\\\\]\$wanted) echo "\$name"; exit 1;; |
5123 | *[\\\\/]\$wanted) echo "\$name"; exit 1;; | |
5124 | *) exit 2;; | |
bfb7748a AD |
5125 | esac; |
5126 | done; | |
4e400192 JH |
5127 | # |
5128 | # status = 0: grep returned 0 lines, case statement not executed | |
5129 | # status = 1: headerfile found | |
5130 | # status = 2: while loop executed, no headerfile found | |
5131 | # | |
5132 | status=\$? | |
bfb7748a | 5133 | $rm -f foo\$\$.c; |
4e400192 JH |
5134 | if test \$status -eq 1; then |
5135 | exit 0; | |
5136 | fi | |
5137 | exit 1 | |
bfb7748a AD |
5138 | EOF |
5139 | chmod +x findhdr | |
5140 | ||
5141 | : define an alternate in-header-list? function | |
5142 | inhdr='echo " "; td=$define; tu=$undef; yyy=$@; | |
5143 | cont=true; xxf="echo \"<\$1> found.\" >&4"; | |
5144 | case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; | |
5145 | *) xxnf="echo \"<\$1> NOT found, ...\" >&4";; | |
5146 | esac; | |
5147 | case $# in 4) instead=instead;; *) instead="at last";; esac; | |
5148 | while $test "$cont"; do | |
5149 | xxx=`./findhdr $1` | |
5150 | var=$2; eval "was=\$$2"; | |
5151 | if $test "$xxx" && $test -r "$xxx"; | |
5152 | then eval $xxf; | |
5153 | eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; | |
5154 | cont=""; | |
5155 | else eval $xxnf; | |
5156 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; | |
5157 | set $yyy; shift; shift; yyy=$@; | |
5158 | case $# in 0) cont="";; | |
5159 | 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; | |
5160 | xxnf="echo \"and I did not find <\$1> either.\" >&4";; | |
5161 | *) xxf="echo \"but I found <\$1\> instead.\" >&4"; | |
5162 | xxnf="echo \"there is no <\$1>, ...\" >&4";; | |
5163 | esac; | |
5164 | done; | |
5165 | while $test "$yyy"; | |
5166 | do set $yyy; var=$2; eval "was=\$$2"; | |
5167 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; | |
5168 | set $yyy; shift; shift; yyy=$@; | |
5169 | done' | |
5170 | ||
5171 | : see if this is a malloc.h system | |
5172 | set malloc.h i_malloc | |
5173 | eval $inhdr | |
5174 | ||
5175 | : see if stdlib is available | |
5176 | set stdlib.h i_stdlib | |
5177 | eval $inhdr | |
5178 | ||
5179 | : determine which malloc to compile in | |
5180 | echo " " | |
5181 | case "$usemymalloc" in | |
5ff3f7a4 GS |
5182 | ''|[yY]*|true|$define) dflt='y' ;; |
5183 | *) dflt='n' ;; | |
bfb7748a AD |
5184 | esac |
5185 | rp="Do you wish to attempt to use the malloc that comes with $package?" | |
5186 | . ./myread | |
5187 | usemymalloc="$ans" | |
5188 | case "$ans" in | |
5189 | y*|true) | |
5190 | usemymalloc='y' | |
5191 | mallocsrc='malloc.c' | |
5192 | mallocobj="malloc$_o" | |
5193 | d_mymalloc="$define" | |
5194 | case "$libs" in | |
5195 | *-lmalloc*) | |
5196 | : Remove malloc from list of libraries to use | |
5197 | echo "Removing unneeded -lmalloc from library list" >&4 | |
5198 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` | |
5199 | shift | |
5200 | libs="$*" | |
5201 | echo "libs = $libs" >&4 | |
5202 | ;; | |
5203 | esac | |
5204 | ;; | |
5205 | *) | |
5206 | usemymalloc='n' | |
5207 | mallocsrc='' | |
5208 | mallocobj='' | |
5209 | d_mymalloc="$undef" | |
5210 | ;; | |
5211 | esac | |
5212 | ||
5213 | : compute the return types of malloc and free | |
5214 | echo " " | |
5215 | $cat >malloc.c <<END | |
5216 | #$i_malloc I_MALLOC | |
5217 | #$i_stdlib I_STDLIB | |
5218 | #include <stdio.h> | |
5219 | #include <sys/types.h> | |
5220 | #ifdef I_MALLOC | |
5221 | #include <malloc.h> | |
5222 | #endif | |
5223 | #ifdef I_STDLIB | |
5224 | #include <stdlib.h> | |
5225 | #endif | |
5226 | #ifdef TRY_MALLOC | |
5227 | void *malloc(); | |
5228 | #endif | |
5229 | #ifdef TRY_FREE | |
5230 | void free(); | |
5231 | #endif | |
5232 | END | |
5233 | case "$malloctype" in | |
5234 | '') | |
5235 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then | |
5236 | malloctype='void *' | |
5237 | else | |
5238 | malloctype='char *' | |
5239 | fi | |
5240 | ;; | |
5241 | esac | |
5242 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 | |
5243 | ||
5244 | case "$freetype" in | |
5245 | '') | |
5246 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then | |
5247 | freetype='void' | |
5248 | else | |
5249 | freetype='int' | |
5250 | fi | |
5251 | ;; | |
5252 | esac | |
5253 | echo "Your system uses $freetype free(), it would seem." >&4 | |
5254 | $rm -f malloc.[co] | |
a3635516 JH |
5255 | $cat <<EOM |
5256 | ||
5257 | The installation process will also create a directory for | |
5258 | vendor-supplied add-ons. Vendors who supply perl with their system | |
5259 | may find it convenient to place all vendor-supplied files in this | |
5260 | directory rather than in the main distribution directory. This will | |
5261 | ease upgrades between binary-compatible maintenance versions of perl. | |
5262 | ||
5263 | Of course you may also use these directories in whatever way you see | |
5264 | fit. For example, you might use them to access modules shared over a | |
5265 | company-wide network. | |
5266 | ||
5267 | The default answer should be fine for most people. | |
5268 | This causes further questions about vendor add-ons to be skipped | |
5269 | and no vendor-specific directories will be configured for perl. | |
5270 | ||
5271 | EOM | |
5272 | rp='Do you want to configure vendor-specific add-on directories?' | |
5273 | case "$usevendorprefix" in | |
5274 | define|true|[yY]*) dflt=y ;; | |
49c10eea JH |
5275 | *) : User may have set vendorprefix directly on Configure command line. |
5276 | case "$vendorprefix" in | |
5277 | ''|' ') dflt=n ;; | |
5278 | *) dflt=y ;; | |
5279 | esac | |
5280 | ;; | |
a3635516 JH |
5281 | esac |
5282 | . ./myread | |
5283 | case "$ans" in | |
5284 | [yY]*) fn=d~+ | |
5285 | rp='Installation prefix to use for vendor-supplied add-ons?' | |
5286 | case "$vendorprefix" in | |
5287 | '') dflt='' ;; | |
5288 | *) dflt=$vendorprefix ;; | |
5289 | esac | |
5290 | . ./getfile | |
49c10eea | 5291 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix |
a3635516 JH |
5292 | oldvendorprefix='' |
5293 | case "$vendorprefix" in | |
5294 | '') ;; | |
5295 | *) case "$ans" in | |
5296 | "$prefix") ;; | |
5297 | *) oldvendorprefix="$prefix";; | |
5298 | esac | |
5299 | ;; | |
5300 | esac | |
5301 | usevendorprefix="$define" | |
5302 | vendorprefix="$ans" | |
5303 | vendorprefixexp="$ansexp" | |
5304 | ;; | |
5305 | *) usevendorprefix="$undef" | |
5306 | vendorprefix='' | |
5307 | vendorprefixexp='' | |
5308 | ;; | |
5309 | esac | |
5310 | ||
5311 | case "$vendorprefix" in | |
5312 | '') d_vendorlib="$undef" | |
5313 | vendorlib='' | |
5314 | vendorlibexp='' | |
5315 | ;; | |
5316 | *) d_vendorlib="$define" | |
5317 | : determine where vendor-supplied modules go. | |
629ae163 | 5318 | : Usual default is /usr/local/lib/perl5/vendor_perl/$version |
49c10eea JH |
5319 | case "$vendorlib" in |
5320 | '') | |
5321 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` | |
5322 | case "$installstyle" in | |
5323 | *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; | |
5324 | *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; | |
5325 | esac | |
5326 | ;; | |
5327 | *) dflt="$vendorlib" | |
5328 | ;; | |
a3635516 JH |
5329 | esac |
5330 | fn=d~+ | |
5331 | rp='Pathname for the vendor-supplied library files?' | |
5332 | . ./getfile | |
5333 | vendorlib="$ans" | |
5334 | vendorlibexp="$ansexp" | |
a3635516 JH |
5335 | ;; |
5336 | esac | |
526fdc24 | 5337 | vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` |
49c10eea JH |
5338 | : Change installation prefix, if necessary. |
5339 | if $test X"$prefix" != X"$installprefix"; then | |
5340 | installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"` | |
5341 | else | |
5342 | installvendorlib="$vendorlibexp" | |
5343 | fi | |
a3635516 | 5344 | |
526fdc24 MS |
5345 | case "$vendorprefix" in |
5346 | '') d_vendorarch="$undef" | |
5347 | vendorarch='' | |
5348 | vendorarchexp='' | |
5349 | ;; | |
5350 | *) d_vendorarch="$define" | |
5351 | : determine where vendor-supplied architecture-dependent libraries go. | |
5352 | : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version | |
5353 | : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname | |
5354 | : vendorlib may have an optional trailing /share. | |
5355 | case "$vendorarch" in | |
5356 | '') dflt=`echo $vendorlib | $sed 's,/share$,,'` | |
5357 | dflt="$dflt/$archname" | |
5358 | ;; | |
5359 | *) dflt="$vendorarch" ;; | |
5360 | esac | |
5361 | fn=d~+ | |
5362 | rp='Pathname for vendor-supplied architecture-dependent files?' | |
5363 | . ./getfile | |
5364 | vendorarch="$ans" | |
5365 | vendorarchexp="$ansexp" | |
5366 | ;; | |
5367 | esac | |
5368 | : Change installation prefix, if necessary. | |
5369 | if $test X"$prefix" != X"$installprefix"; then | |
5370 | installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"` | |
5371 | else | |
5372 | installvendorarch="$vendorarchexp" | |
5373 | fi | |
5374 | ||
3b777bb4 GS |
5375 | : Final catch-all directories to search |
5376 | $cat <<EOM | |
5377 | ||
5378 | Lastly, you can have perl look in other directories for extensions and | |
5379 | modules in addition to those already specified. | |
5380 | These directories will be searched after | |
5381 | $sitearch | |
5382 | $sitelib | |
5383 | EOM | |
5384 | test X"$vendorlib" != "X" && echo ' ' $vendorlib | |
5385 | test X"$vendorarch" != "X" && echo ' ' $vendorarch | |
5386 | echo ' ' | |
5387 | case "$otherlibdirs" in | |
5388 | ''|' ') dflt='none' ;; | |
5389 | *) dflt="$otherlibdirs" ;; | |
5390 | esac | |
5391 | $cat <<EOM | |
5392 | Enter a colon-separated set of extra paths to include in perl's @INC | |
5393 | search path, or enter 'none' for no extra paths. | |
5394 | ||
5395 | EOM | |
5396 | ||
5397 | rp='Colon-separated list of additional directories for perl to search?' | |
5398 | . ./myread | |
5399 | case "$ans" in | |
5400 | ' '|''|none) otherlibdirs=' ' ;; | |
5401 | *) otherlibdirs="$ans" ;; | |
5402 | esac | |
5403 | case "$otherlibdirs" in | |
5404 | ' ') val=$undef ;; | |
5405 | *) val=$define ;; | |
5406 | esac | |
5407 | set d_perl_otherlibdirs | |
5408 | eval $setvar | |
5409 | ||
c4f23d77 AD |
5410 | : Cruising for prototypes |
5411 | echo " " | |
5412 | echo "Checking out function prototypes..." >&4 | |
5413 | $cat >prototype.c <<'EOCP' | |
5a411a32 | 5414 | int main(int argc, char *argv[]) { |
c4f23d77 AD |
5415 | exit(0);} |
5416 | EOCP | |
5417 | if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then | |
5418 | echo "Your C compiler appears to support function prototypes." | |
5419 | val="$define" | |
5420 | else | |
5421 | echo "Your C compiler doesn't seem to understand function prototypes." | |
5422 | val="$undef" | |
5423 | fi | |
5424 | set prototype | |
5425 | eval $setvar | |
5426 | $rm -f prototype* | |
5427 | ||
5428 | case "$prototype" in | |
5429 | "$define") ;; | |
5430 | *) ansi2knr='ansi2knr' | |
5431 | echo " " | |
5432 | cat <<EOM >&4 | |
5433 | ||
5434 | $me: FATAL ERROR: | |
5435 | This version of $package can only be compiled by a compiler that | |
5436 | understands function prototypes. Unfortunately, your C compiler | |
5437 | $cc $ccflags | |
5438 | doesn't seem to understand them. Sorry about that. | |
5439 | ||
5ff3f7a4 | 5440 | If GNU cc is available for your system, perhaps you could try that instead. |
c4f23d77 AD |
5441 | |
5442 | Eventually, we hope to support building Perl with pre-ANSI compilers. | |
5443 | If you would like to help in that effort, please contact <perlbug@perl.org>. | |
5444 | ||
5445 | Aborting Configure now. | |
5446 | EOM | |
5447 | exit 2 | |
5448 | ;; | |
5449 | esac | |
5450 | ||
5451 | : determine where public executables go | |
5452 | echo " " | |
5453 | set dflt bin bin | |
5454 | eval $prefixit | |
5455 | fn=d~ | |
5456 | rp='Pathname where the public executables will reside?' | |
5457 | . ./getfile | |
5458 | if $test "X$ansexp" != "X$binexp"; then | |
5459 | installbin='' | |
5460 | fi | |
5461 | bin="$ans" | |
5462 | binexp="$ansexp" | |
dd4e71fd JH |
5463 | : Change installation prefix, if necessary. |
5464 | : XXX Bug? -- ignores Configure -Dinstallprefix setting. | |
5465 | if $test X"$prefix" != X"$installprefix"; then | |
ec897fb9 | 5466 | installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"` |
71c4afb4 JH |
5467 | else |
5468 | installbin="$binexp" | |
c4f23d77 AD |
5469 | fi |
5470 | ||
49c10eea JH |
5471 | : Find perl5.005 or later. |
5472 | echo "Looking for a previously installed perl5.005 or later... " | |
5473 | case "$perl5" in | |
5474 | '') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do | |
5475 | : Check if this perl is recent and can load a simple module | |
5476 | if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then | |
5477 | perl5=$tdir/perl | |
5478 | break; | |
5479 | elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then | |
5480 | perl5=$tdir/perl | |
5481 | break; | |
5482 | fi | |
5483 | done | |
5484 | ;; | |
5485 | *) perl5="$perl5" | |
5486 | ;; | |
5487 | esac | |
5488 | case "$perl5" in | |
5489 | '') echo "None found. That's ok.";; | |
5490 | *) echo "Using $perl5." ;; | |
5491 | esac | |
5492 | ||
ff935051 JH |
5493 | $cat <<EOM |
5494 | ||
5495 | After $package is installed, you may wish to install various | |
5496 | add-on modules and utilities. Typically, these add-ons will | |
5497 | be installed under $prefix with the rest | |
5498 | of this package. However, you may wish to install such add-ons | |
5499 | elsewhere under a different prefix. | |
5500 | ||
5501 | If you do not wish to put everything under a single prefix, that's | |
5502 | ok. You will be prompted for the individual locations; this siteprefix | |
5503 | is only used to suggest the defaults. | |
5504 | ||
5505 | The default should be fine for most people. | |
5506 | ||
5507 | EOM | |
5508 | fn=d~+ | |
5509 | rp='Installation prefix to use for add-on modules and utilities?' | |
5510 | : XXX Here might be another good place for an installstyle setting. | |
5511 | case "$siteprefix" in | |
5512 | '') dflt=$prefix ;; | |
5513 | *) dflt=$siteprefix ;; | |
5514 | esac | |
5515 | . ./getfile | |
49c10eea | 5516 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix |
ff935051 JH |
5517 | oldsiteprefix='' |
5518 | case "$siteprefix" in | |
5519 | '') ;; | |
49c10eea | 5520 | *) case "$ans" in |
ff935051 JH |
5521 | "$prefix") ;; |
5522 | *) oldsiteprefix="$prefix";; | |
5523 | esac | |
5524 | ;; | |
5525 | esac | |
5526 | siteprefix="$ans" | |
5527 | siteprefixexp="$ansexp" | |
5528 | ||
5529 | : determine where site specific libraries go. | |
5530 | : Usual default is /usr/local/lib/perl5/site_perl/$version | |
5531 | : The default "style" setting is made in installstyle.U | |
5532 | : XXX No longer works with Prefixit stuff. | |
5533 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` | |
49c10eea JH |
5534 | case "$sitelib" in |
5535 | '') case "$installstyle" in | |
5536 | *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; | |
5537 | *) dflt=$siteprefix/lib/site_$prog/$version ;; | |
5538 | esac | |
5539 | ;; | |
5540 | *) dflt="$sitelib" | |
5541 | ;; | |
ff935051 JH |
5542 | esac |
5543 | $cat <<EOM | |
5544 | ||
5545 | The installation process will create a directory for | |
5546 | site-specific extensions and modules. Most users find it convenient | |
5547 | to place all site-specific files in this directory rather than in the | |
5548 | main distribution directory. | |
5549 | ||
5550 | EOM | |
5551 | fn=d~+ | |
5552 | rp='Pathname for the site-specific library files?' | |
5553 | . ./getfile | |
5554 | sitelib="$ans" | |
5555 | sitelibexp="$ansexp" | |
526fdc24 | 5556 | sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` |
ff935051 JH |
5557 | : Change installation prefix, if necessary. |
5558 | if $test X"$prefix" != X"$installprefix"; then | |
49c10eea | 5559 | installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"` |
ff935051 JH |
5560 | else |
5561 | installsitelib="$sitelibexp" | |
5562 | fi | |
5563 | ||
5564 | : Determine list of previous versions to include in @INC | |
5565 | $cat > getverlist <<EOPL | |
49c10eea | 5566 | #!$perl5 -w |
ff935051 JH |
5567 | use File::Basename; |
5568 | \$api_versionstring = "$api_versionstring"; | |
5569 | \$version = "$version"; | |
92d29cee | 5570 | \$stem = "$sitelib_stem"; |
ff935051 JH |
5571 | \$archname = "$archname"; |
5572 | EOPL | |
5573 | $cat >> getverlist <<'EOPL' | |
5574 | # Can't have leading @ because metaconfig interprets it as a command! | |
5575 | ;@inc_version_list=(); | |
49c10eea | 5576 | # XXX Redo to do opendir/readdir? |
ff935051 JH |
5577 | if (-d $stem) { |
5578 | chdir($stem); | |
5579 | ;@candidates = glob("5.*"); | |
5580 | } | |
5581 | else { | |
5582 | ;@candidates = (); | |
5583 | } | |
5584 | ||
937ac629 JH |
5585 | # XXX ToDo: These comparisons must be reworked when two-digit |
5586 | # subversions come along, so that 5.7.10 compares as greater than | |
5587 | # 5.7.3! By that time, hope that 5.6.x is sufficiently | |
5588 | # widespread that we can use the built-in version vectors rather | |
5589 | # than reinventing them here. For 5.6.0, however, we must | |
5590 | # assume this script will likely be run by 5.005_0x. --AD 1/2000. | |
ff935051 JH |
5591 | foreach $d (@candidates) { |
5592 | if ($d lt $version) { | |
5593 | if ($d ge $api_versionstring) { | |
9a170fb4 | 5594 | unshift(@inc_version_list, grep { -d } "$d/$archname", $d); |
ff935051 JH |
5595 | } |
5596 | elsif ($d ge "5.005") { | |
9a170fb4 | 5597 | unshift(@inc_version_list, grep { -d } $d); |
ff935051 JH |
5598 | } |
5599 | } | |
5600 | else { | |
5601 | # Skip newer version. I.e. don't look in | |
5602 | # 5.7.0 if we're installing 5.6.1. | |
5603 | } | |
5604 | } | |
5605 | ||
5606 | if (@inc_version_list) { | |
3a096bf3 | 5607 | print join(' ', @inc_version_list); |
ff935051 JH |
5608 | } |
5609 | else { | |
5610 | # Blank space to preserve value for next Configure run. | |
5611 | print " "; | |
5612 | } | |
5613 | EOPL | |
5614 | chmod +x getverlist | |
5615 | case "$inc_version_list" in | |
49c10eea JH |
5616 | '') if test -x "$perl5"; then |
5617 | dflt=`$perl5 getverlist` | |
ff935051 | 5618 | else |
3a096bf3 | 5619 | dflt='none' |
ff935051 JH |
5620 | fi |
5621 | ;; | |
3a096bf3 | 5622 | $undef) dflt='none' ;; |
ff935051 JH |
5623 | *) dflt="$inc_version_list" ;; |
5624 | esac | |
49c10eea JH |
5625 | case "$dflt" in |
5626 | ''|' ') dflt=none ;; | |
5627 | esac | |
ff935051 JH |
5628 | $cat <<'EOM' |
5629 | ||
5630 | In order to ease the process of upgrading, this version of perl | |
5631 | can be configured to use modules built and installed with earlier | |
5632 | versions of perl that were installed under $prefix. Specify here | |
5633 | the list of earlier versions that this version of perl should check. | |
5634 | If Configure detected no earlier versions of perl installed under | |
3a096bf3 JH |
5635 | $prefix, then the list will be empty. Answer 'none' to tell perl |
5636 | to not search earlier versions. | |
ff935051 JH |
5637 | |
5638 | The default should almost always be sensible, so if you're not sure, | |
5639 | just accept the default. | |
5640 | EOM | |
5641 | ||
3a096bf3 | 5642 | rp='List of earlier versions to include in @INC?' |
ff935051 | 5643 | . ./myread |
3a096bf3 | 5644 | case "$ans" in |
49c10eea | 5645 | [Nn]one|''|' ') inc_version_list=' ' ;; |
3a096bf3 JH |
5646 | *) inc_version_list="$ans" ;; |
5647 | esac | |
5648 | case "$inc_version_list" in | |
5649 | ''|' ') | |
82aaaa3c | 5650 | inc_version_list_init='0';; |
3a096bf3 | 5651 | *) inc_version_list_init=`echo $inc_version_list | |
82aaaa3c | 5652 | $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` |
3a096bf3 JH |
5653 | ;; |
5654 | esac | |
ff935051 JH |
5655 | $rm -f getverlist |
5656 | ||
104d25b7 JH |
5657 | : determine whether to install perl also as /usr/bin/perl |
5658 | ||
5659 | echo " " | |
dd4e71fd | 5660 | if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then |
104d25b7 | 5661 | $cat <<EOM |
526fdc24 | 5662 | Many scripts expect perl to be installed as /usr/bin/perl. |
104d25b7 JH |
5663 | I can install the perl you are about to compile also as /usr/bin/perl |
5664 | (in addition to $installbin/perl). | |
5665 | EOM | |
472a4973 JH |
5666 | case "$installusrbinperl" in |
5667 | "$undef"|[nN]*) dflt='n';; | |
5668 | *) dflt='y';; | |
5669 | esac | |
104d25b7 JH |
5670 | rp="Do you want to install perl as /usr/bin/perl?" |
5671 | . ./myread | |
5672 | case "$ans" in | |
5673 | [yY]*) val="$define";; | |
472a4973 | 5674 | *) val="$undef" ;; |
104d25b7 | 5675 | esac |
472a4973 JH |
5676 | else |
5677 | val="$undef" | |
5678 | fi | |
104d25b7 JH |
5679 | set installusrbinperl |
5680 | eval $setvar | |
5681 | ||
a4f3eea9 | 5682 | echo " " |
5683 | echo "Checking for GNU C Library..." >&4 | |
5684 | cat >gnulibc.c <<EOM | |
aebf16e7 | 5685 | #include <stdio.h> |
5a411a32 | 5686 | int main() |
a4f3eea9 | 5687 | { |
aebf16e7 AD |
5688 | #ifdef __GLIBC__ |
5689 | exit(0); | |
5690 | #else | |
5691 | exit(1); | |
5692 | #endif | |
a4f3eea9 | 5693 | } |
5694 | EOM | |
dfe9444c | 5695 | set gnulibc |
aebf16e7 | 5696 | if eval $compile_ok && ./gnulibc; then |
a4f3eea9 | 5697 | val="$define" |
5698 | echo "You are using the GNU C Library" | |
4633a7c4 | 5699 | else |
a4f3eea9 | 5700 | val="$undef" |
5701 | echo "You are not using the GNU C Library" | |
4633a7c4 | 5702 | fi |
a4f3eea9 | 5703 | $rm -f gnulibc* |
5704 | set d_gnulibc | |
5705 | eval $setvar | |
25f94b33 | 5706 | |
a4f3eea9 | 5707 | : see if nm is to be used to determine whether a symbol is defined or not |
5708 | case "$usenm" in | |
5709 | '') | |
dc45a647 | 5710 | dflt='' |
a4f3eea9 | 5711 | case "$d_gnulibc" in |
dc45a647 MB |
5712 | "$define") |
5713 | echo " " | |
5714 | echo "nm probably won't work on the GNU C Library." >&4 | |
a4f3eea9 | 5715 | dflt=n |
5716 | ;; | |
dc45a647 MB |
5717 | esac |
5718 | case "$dflt" in | |
5719 | '') | |
5720 | if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then | |
5721 | echo " " | |
5722 | echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 | |
5723 | echo "'nm' won't be sufficient on this sytem." >&4 | |
5724 | dflt=n | |
5725 | fi | |
5726 | ;; | |
5727 | esac | |
5728 | case "$dflt" in | |
c4f23d77 | 5729 | '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` |
a4f3eea9 | 5730 | if $test $dflt -gt 20; then |
5731 | dflt=y | |
5732 | else | |
5733 | dflt=n | |
5734 | fi | |
5735 | ;; | |
5736 | esac | |
5737 | ;; | |
5738 | *) | |
5739 | case "$usenm" in | |
dc45a647 | 5740 | true|$define) dflt=y;; |
a4f3eea9 | 5741 | *) dflt=n;; |
5742 | esac | |
5743 | ;; | |
25f94b33 | 5744 | esac |
a4f3eea9 | 5745 | $cat <<EOM |
4633a7c4 | 5746 | |
dc45a647 MB |
5747 | I can use $nm to extract the symbols from your C libraries. This |
5748 | is a time consuming task which may generate huge output on the disk (up | |
5749 | to 3 megabytes) but that should make the symbols extraction faster. The | |
5750 | alternative is to skip the 'nm' extraction part and to compile a small | |
5751 | test program instead to determine whether each symbol is present. If | |
5752 | you have a fast C compiler and/or if your 'nm' output cannot be parsed, | |
5753 | this may be the best solution. | |
5754 | ||
5755 | You probably shouldn't let me use 'nm' if you are using the GNU C Library. | |
4633a7c4 | 5756 | |
a4f3eea9 | 5757 | EOM |
693762b4 | 5758 | rp="Shall I use $nm to extract C symbols from the libraries?" |
4633a7c4 LW |
5759 | . ./myread |
5760 | case "$ans" in | |
dc45a647 | 5761 | [Nn]*) usenm=false;; |
a4f3eea9 | 5762 | *) usenm=true;; |
4633a7c4 LW |
5763 | esac |
5764 | ||
a4f3eea9 | 5765 | runnm=$usenm |
5766 | case "$reuseval" in | |
5767 | true) runnm=false;; | |
4633a7c4 | 5768 | esac |
a4f3eea9 | 5769 | |
5770 | : nm options which may be necessary | |
5771 | case "$nm_opt" in | |
5772 | '') if $test -f /mach_boot; then | |
1e422769 | 5773 | nm_opt='' # Mach |
a4f3eea9 | 5774 | elif $test -d /usr/ccs/lib; then |
1e422769 | 5775 | nm_opt='-p' # Solaris (and SunOS?) |
a4f3eea9 | 5776 | elif $test -f /dgux; then |
1e422769 | 5777 | nm_opt='-p' # DG-UX |
2ae324a7 | 5778 | elif $test -f /lib64/rld; then |
1e422769 | 5779 | nm_opt='-p' # 64-bit Irix |
a4f3eea9 | 5780 | else |
5781 | nm_opt='' | |
5782 | fi;; | |
4633a7c4 | 5783 | esac |
4633a7c4 | 5784 | |
a4f3eea9 | 5785 | : nm options which may be necessary for shared libraries but illegal |
5786 | : for archive libraries. Thank you, Linux. | |
5787 | case "$nm_so_opt" in | |
5788 | '') case "$myuname" in | |
5789 | *linux*) | |
693762b4 | 5790 | if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then |
a4f3eea9 | 5791 | nm_so_opt='--dynamic' |
4633a7c4 | 5792 | fi |
a4f3eea9 | 5793 | ;; |
4633a7c4 | 5794 | esac |
4633a7c4 LW |
5795 | ;; |
5796 | esac | |
5797 | ||
a4f3eea9 | 5798 | case "$runnm" in |
5799 | true) | |
5800 | : get list of predefined functions in a handy place | |
5801 | echo " " | |
5802 | case "$libc" in | |
5803 | '') libc=unknown | |
5804 | case "$libs" in | |
dfe9444c | 5805 | *-lc_s*) libc=`./loc libc_s$_a $libc $libpth` |
a4f3eea9 | 5806 | esac |
5807 | ;; | |
5808 | esac | |
5809 | libnames=''; | |
5810 | case "$libs" in | |
5811 | '') ;; | |
5812 | *) for thislib in $libs; do | |
5813 | case "$thislib" in | |
5814 | -lc|-lc_s) | |
5815 | : Handle C library specially below. | |
5816 | ;; | |
5817 | -l*) | |
5818 | thislib=`echo $thislib | $sed -e 's/^-l//'` | |
5819 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then | |
5820 | : | |
5821 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then | |
5822 | : | |
dfe9444c | 5823 | elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then |
a4f3eea9 | 5824 | : |
dfe9444c | 5825 | elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then |
d97d40b5 | 5826 | : |
a4f3eea9 | 5827 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then |
5828 | : | |
5829 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then | |
5830 | : | |
dfe9444c | 5831 | elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then |
a4f3eea9 | 5832 | : |
5833 | else | |
5834 | try='' | |
5835 | fi | |
5836 | libnames="$libnames $try" | |
5837 | ;; | |
5838 | *) libnames="$libnames $thislib" ;; | |
5839 | esac | |
5840 | done | |
5841 | ;; | |
5842 | esac | |
5843 | xxx=normal | |
5844 | case "$libc" in | |
5845 | unknown) | |
5846 | set /lib/libc.$so | |
5847 | for xxx in $libpth; do | |
5848 | $test -r $1 || set $xxx/libc.$so | |
5849 | : The messy sed command sorts on library version numbers. | |
5850 | $test -r $1 || \ | |
5851 | set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ | |
28e8609d | 5852 | tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e ' |
a4f3eea9 | 5853 | h |
5854 | s/[0-9][0-9]*/0000&/g | |
5855 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g | |
5856 | G | |
5857 | s/\n/ /' | \ | |
dfe9444c | 5858 | sort | $sed -e 's/^.* //'` |
a4f3eea9 | 5859 | eval set \$$# |
5860 | done | |
5861 | $test -r $1 || set /usr/ccs/lib/libc.$so | |
dfe9444c AD |
5862 | $test -r $1 || set /lib/libsys_s$_a |
5863 | ;; | |
a4f3eea9 | 5864 | *) |
5865 | set blurfl | |
5866 | ;; | |
5867 | esac | |
5868 | if $test -r "$1"; then | |
5869 | echo "Your (shared) C library seems to be in $1." | |
5870 | libc="$1" | |
5871 | elif $test -r /lib/libc && $test -r /lib/clib; then | |
5872 | echo "Your C library seems to be in both /lib/clib and /lib/libc." | |
5873 | xxx=apollo | |
5874 | libc='/lib/clib /lib/libc' | |
5875 | if $test -r /lib/syslib; then | |
5876 | echo "(Your math library is in /lib/syslib.)" | |
5877 | libc="$libc /lib/syslib" | |
5878 | fi | |
5879 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
5880 | echo "Your C library seems to be in $libc, as you said before." | |
dfe9444c AD |
5881 | elif $test -r $incpath/usr/lib/libc$_a; then |
5882 | libc=$incpath/usr/lib/libc$_a; | |
a4f3eea9 | 5883 | echo "Your C library seems to be in $libc. That's fine." |
dfe9444c AD |
5884 | elif $test -r /lib/libc$_a; then |
5885 | libc=/lib/libc$_a; | |
a4f3eea9 | 5886 | echo "Your C library seems to be in $libc. You're normal." |
5887 | else | |
dfe9444c | 5888 | if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then |
a4f3eea9 | 5889 | : |
5890 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then | |
5891 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` | |
5892 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then | |
5893 | : | |
dfe9444c | 5894 | elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then |
a4f3eea9 | 5895 | : |
dfe9444c | 5896 | elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then |
a4f3eea9 | 5897 | : |
4633a7c4 | 5898 | else |
dfe9444c | 5899 | tans=`./loc Llibc$_a blurfl/dyick $xlibpth` |
4633a7c4 | 5900 | fi |
a4f3eea9 | 5901 | if $test -r "$tans"; then |
5902 | echo "Your C library seems to be in $tans, of all places." | |
5903 | libc=$tans | |
5904 | else | |
5905 | libc='blurfl' | |
5906 | fi | |
5907 | fi | |
5908 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
5909 | dflt="$libc" | |
5910 | cat <<EOM | |
4633a7c4 | 5911 | |
a4f3eea9 | 5912 | If the guess above is wrong (which it might be if you're using a strange |
5913 | compiler, or your machine supports multiple models), you can override it here. | |
4633a7c4 | 5914 | |
a4f3eea9 | 5915 | EOM |
5916 | else | |
5917 | dflt='' | |
28e8609d | 5918 | echo $libpth | tr ' ' $trnl | sort | uniq > libpath |
a4f3eea9 | 5919 | cat >&4 <<EOM |
5920 | I can't seem to find your C library. I've looked in the following places: | |
4633a7c4 | 5921 | |
a4f3eea9 | 5922 | EOM |
5923 | $sed 's/^/ /' libpath | |
5924 | cat <<EOM | |
4633a7c4 | 5925 | |
a4f3eea9 | 5926 | None of these seems to contain your C library. I need to get its name... |
4633a7c4 | 5927 | |
a4f3eea9 | 5928 | EOM |
5929 | fi | |
5930 | fn=f | |
5931 | rp='Where is your C library?' | |
5932 | . ./getfile | |
5933 | libc="$ans" | |
4633a7c4 | 5934 | |
4633a7c4 | 5935 | echo " " |
28e8609d | 5936 | echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames |
a4f3eea9 | 5937 | set X `cat libnames` |
4633a7c4 | 5938 | shift |
a4f3eea9 | 5939 | xxx=files |
5940 | case $# in 1) xxx=file; esac | |
5941 | echo "Extracting names from the following $xxx for later perusal:" >&4 | |
5942 | echo " " | |
5943 | $sed 's/^/ /' libnames >&4 | |
5944 | echo " " | |
5945 | $echo $n "This may take a while...$c" >&4 | |
4633a7c4 | 5946 | |
dfe9444c AD |
5947 | for file in $*; do |
5948 | case $file in | |
693762b4 AD |
5949 | *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;; |
5950 | *) $nm $nm_opt $file 2>/dev/null;; | |
a4f3eea9 | 5951 | esac |
dfe9444c | 5952 | done >libc.tmp |
4633a7c4 | 5953 | |
a4f3eea9 | 5954 | $echo $n ".$c" |
5955 | $grep fprintf libc.tmp > libc.ptf | |
5956 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' | |
5957 | xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4' | |
5958 | xxx='[ADTSIW]' | |
5959 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\ | |
5960 | eval $xscan;\ | |
5961 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5962 | eval $xrun | |
5963 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ | |
5964 | eval $xscan;\ | |
5965 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5966 | eval $xrun | |
5967 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ | |
5968 | eval $xscan;\ | |
5969 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5970 | eval $xrun | |
5971 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ | |
5972 | eval $xscan;\ | |
5973 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5974 | eval $xrun | |
5975 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ | |
5976 | eval $xscan;\ | |
5977 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5978 | eval $xrun | |
5979 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ | |
5980 | eval $xscan;\ | |
5981 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5982 | eval $xrun | |
5983 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ | |
5984 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ | |
5985 | eval $xscan;\ | |
5986 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5987 | eval $xrun | |
5988 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ | |
5989 | eval $xscan;\ | |
5990 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5991 | eval $xrun | |
5992 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ | |
5993 | eval $xscan;\ | |
5994 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5995 | eval $xrun | |
1e422769 | 5996 | elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ |
5997 | eval $xscan;\ | |
5998 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
5999 | eval $xrun | |
a4f3eea9 | 6000 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
6001 | eval $xscan;\ | |
6002 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
6003 | eval $xrun | |
6004 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ | |
6005 | eval $xscan;\ | |
6006 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
6007 | eval $xrun | |
44a8e56a | 6008 | elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ |
6009 | eval $xscan;\ | |
6010 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
6011 | eval $xrun | |
0f502cca BL |
6012 | elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\ |
6013 | eval $xscan;\ | |
6014 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
6015 | eval $xrun | |
a4f3eea9 | 6016 | else |
693762b4 | 6017 | $nm -p $* 2>/dev/null >libc.tmp |
a4f3eea9 | 6018 | $grep fprintf libc.tmp > libc.ptf |
6019 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ | |
6020 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 | |
6021 | then | |
6022 | nm_opt='-p' | |
6023 | eval $xrun | |
4633a7c4 | 6024 | else |
a4f3eea9 | 6025 | echo " " |
e5c9fcd0 | 6026 | echo "$nm didn't seem to work right. Trying $ar instead..." >&4 |
a4f3eea9 | 6027 | com='' |
dc45a647 MB |
6028 | if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then |
6029 | for thisname in $libnames $libc; do | |
e5c9fcd0 | 6030 | $ar t $thisname >>libc.tmp |
a4f3eea9 | 6031 | done |
dfe9444c | 6032 | $sed -e "s/\\$_o\$//" < libc.tmp > libc.list |
a4f3eea9 | 6033 | echo "Ok." >&4 |
dc45a647 MB |
6034 | elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then |
6035 | # Repeat libc to extract forwarders to DLL entries too | |
6036 | for thisname in $libnames $libc; do | |
6037 | $ar tv $thisname >>libc.tmp | |
6038 | # Revision 50 of EMX has bug in $ar. | |
6039 | # it will not extract forwarders to DLL entries | |
6040 | # Use emximp which will extract exactly them. | |
6041 | emximp -o tmp.imp $thisname \ | |
6042 | 2>/dev/null && \ | |
6043 | $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \ | |
6044 | < tmp.imp >>libc.tmp | |
6045 | $rm tmp.imp | |
6046 | done | |
6047 | $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list | |
6048 | echo "Ok." >&4 | |
a4f3eea9 | 6049 | else |
e5c9fcd0 | 6050 | echo "$ar didn't seem to work right." >&4 |
a4f3eea9 | 6051 | echo "Maybe this is a Cray...trying bld instead..." >&4 |
dfe9444c | 6052 | if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list |
a4f3eea9 | 6053 | then |
6054 | for thisname in $libnames; do | |
6055 | bld t $libnames | \ | |
dfe9444c | 6056 | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list |
e5c9fcd0 | 6057 | $ar t $thisname >>libc.tmp |
a4f3eea9 | 6058 | done |
6059 | echo "Ok." >&4 | |
6060 | else | |
6061 | echo "That didn't work either. Giving up." >&4 | |
6062 | exit 1 | |
6063 | fi | |
6064 | fi | |
4633a7c4 | 6065 | fi |
4633a7c4 | 6066 | fi |
a4f3eea9 | 6067 | nm_extract="$com" |
6068 | if $test -f /lib/syscalls.exp; then | |
4633a7c4 | 6069 | echo " " |
a4f3eea9 | 6070 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 |
c6912327 | 6071 | $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list |
a4f3eea9 | 6072 | fi |
6073 | ;; | |
6074 | esac | |
6075 | $rm -f libnames libpath | |
6076 | ||
2afac517 | 6077 | : see if dld is available |
6078 | set dld.h i_dld | |
6079 | eval $inhdr | |
4633a7c4 | 6080 | |
2afac517 | 6081 | : is a C symbol defined? |
6082 | csym='tlook=$1; | |
6083 | case "$3" in | |
6084 | -v) tf=libc.tmp; tc=""; tdc="";; | |
6085 | -a) tf=libc.tmp; tc="[0]"; tdc="[]";; | |
6086 | *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; | |
6087 | esac; | |
6088 | tx=yes; | |
6089 | case "$reuseval-$4" in | |
6090 | true-) ;; | |
6091 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; | |
6092 | esac; | |
6093 | case "$tx" in | |
6094 | yes) | |
6095 | case "$runnm" in | |
6096 | true) | |
6097 | if $contains $tlook $tf >/dev/null 2>&1; | |
6098 | then tval=true; | |
6099 | else tval=false; | |
6100 | fi;; | |
6101 | *) | |
d674cd6d | 6102 | echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; |
dfe9444c | 6103 | if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; |
2afac517 | 6104 | then tval=true; |
6105 | else tval=false; | |
6106 | fi; | |
6107 | $rm -f t t.c;; | |
6108 | esac;; | |
6109 | *) | |
6110 | case "$tval" in | |
6111 | $define) tval=true;; | |
6112 | *) tval=false;; | |
6113 | esac;; | |
6114 | esac; | |
6115 | eval "$2=$tval"' | |
4633a7c4 | 6116 | |
2afac517 | 6117 | : define an is-in-libc? function |
6118 | inlibc='echo " "; td=$define; tu=$undef; | |
6119 | sym=$1; var=$2; eval "was=\$$2"; | |
6120 | tx=yes; | |
6121 | case "$reuseval$was" in | |
6122 | true) ;; | |
6123 | true*) tx=no;; | |
6124 | esac; | |
6125 | case "$tx" in | |
6126 | yes) | |
6127 | set $sym tres -f; | |
6128 | eval $csym; | |
6129 | case "$tres" in | |
6130 | true) | |
6131 | echo "$sym() found." >&4; | |
6132 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; | |
6133 | *) | |
6134 | echo "$sym() NOT found." >&4; | |
6135 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; | |
6136 | esac;; | |
6137 | *) | |
6138 | case "$was" in | |
6139 | $define) echo "$sym() found." >&4;; | |
6140 | *) echo "$sym() NOT found." >&4;; | |
6141 | esac;; | |
6142 | esac' | |
4633a7c4 | 6143 | |
2afac517 | 6144 | : see if dlopen exists |
6145 | xxx_runnm="$runnm" | |
6146 | runnm=false | |
6147 | set dlopen d_dlopen | |
6148 | eval $inlibc | |
6149 | runnm="$xxx_runnm" | |
40a7a20a | 6150 | |
2afac517 | 6151 | : determine which dynamic loading, if any, to compile in |
4633a7c4 | 6152 | echo " " |
2afac517 | 6153 | dldir="ext/DynaLoader" |
6154 | case "$usedl" in | |
6155 | $define|y|true) | |
6156 | dflt='y' | |
6157 | usedl="$define" | |
6158 | ;; | |
6159 | $undef|n|false) | |
6160 | dflt='n' | |
6161 | usedl="$undef" | |
6162 | ;; | |
6163 | *) | |
6164 | dflt='n' | |
6165 | case "$d_dlopen" in | |
6166 | $define) dflt='y' ;; | |
6167 | esac | |
6168 | case "$i_dld" in | |
6169 | $define) dflt='y' ;; | |
4633a7c4 | 6170 | esac |
2afac517 | 6171 | : Does a dl_xxx.xs file exist for this operating system |
dc45a647 | 6172 | $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y' |
4633a7c4 LW |
6173 | ;; |
6174 | esac | |
2afac517 | 6175 | rp="Do you wish to use dynamic loading?" |
6176 | . ./myread | |
6177 | usedl="$ans" | |
6178 | case "$ans" in | |
6179 | y*) usedl="$define" | |
6180 | case "$dlsrc" in | |
6181 | '') | |
dc45a647 | 6182 | if $test -f $rsrc/$dldir/dl_${osname}.xs ; then |
2afac517 | 6183 | dflt="$dldir/dl_${osname}.xs" |
6184 | elif $test "$d_dlopen" = "$define" ; then | |
6185 | dflt="$dldir/dl_dlopen.xs" | |
6186 | elif $test "$i_dld" = "$define" ; then | |
6187 | dflt="$dldir/dl_dld.xs" | |
4633a7c4 | 6188 | else |
2afac517 | 6189 | dflt='' |
4633a7c4 | 6190 | fi |
4633a7c4 | 6191 | ;; |
2afac517 | 6192 | *) dflt="$dldir/$dlsrc" |
6193 | ;; | |
4633a7c4 | 6194 | esac |
2afac517 | 6195 | echo "The following dynamic loading files are available:" |
6196 | : Can not go over to $dldir because getfile has path hard-coded in. | |
dc45a647 MB |
6197 | tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir |
6198 | rp="Source file to use for dynamic loading" | |
6199 | fn="fne" | |
b233458b | 6200 | gfpth="$src" |
dc45a647 | 6201 | . ./getfile |
2afac517 | 6202 | usedl="$define" |
6203 | : emulate basename | |
1e127011 | 6204 | dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'` |
2304df62 | 6205 | |
dc45a647 | 6206 | $cat << EOM |
2304df62 | 6207 | |
2afac517 | 6208 | Some systems may require passing special flags to $cc -c to |
6209 | compile modules that will be used to create a shared library. | |
6210 | To use no flags, say "none". | |
2304df62 AD |
6211 | |
6212 | EOM | |
2afac517 | 6213 | case "$cccdlflags" in |
6214 | '') case "$gccversion" in | |
6215 | '') case "$osname" in | |
6216 | hpux) dflt='+z' ;; | |
6217 | next) dflt='none' ;; | |
8cc95fdb | 6218 | irix*) dflt='-KPIC' ;; |
3a6175e1 | 6219 | svr4*|esix*|solaris) dflt='-KPIC' ;; |
2afac517 | 6220 | sunos) dflt='-pic' ;; |
6221 | *) dflt='none' ;; | |
dfe9444c AD |
6222 | esac |
6223 | ;; | |
6224 | *) case "$osname" in | |
3a6175e1 | 6225 | svr4*|esix*|solaris) dflt='-fPIC' ;; |
dfe9444c | 6226 | *) dflt='-fpic' ;; |
81d89818 | 6227 | esac ;; |
2afac517 | 6228 | esac ;; |
bfb7748a | 6229 | ' ') dflt='none' ;; |
2afac517 | 6230 | *) dflt="$cccdlflags" ;; |
6231 | esac | |
6232 | rp="Any special flags to pass to $cc -c to compile shared library modules?" | |
6233 | . ./myread | |
6234 | case "$ans" in | |
6235 | none) cccdlflags=' ' ;; | |
6236 | *) cccdlflags="$ans" ;; | |
6237 | esac | |
2304df62 | 6238 | |
2afac517 | 6239 | cat << EOM |
ecfc5424 | 6240 | |
2afac517 | 6241 | Some systems use ld to create libraries that can be dynamically loaded, |
6242 | while other systems (such as those using ELF) use $cc. | |
a0f45b59 | 6243 | |
2afac517 | 6244 | EOM |
6245 | case "$ld" in | |
6246 | '') $cat >try.c <<'EOM' | |
6247 | /* Test for whether ELF binaries are produced */ | |
6248 | #include <fcntl.h> | |
6249 | #include <stdlib.h> | |
5a411a32 | 6250 | int main() { |
2afac517 | 6251 | char b[4]; |
6252 | int i = open("a.out",O_RDONLY); | |
6253 | if(i == -1) | |
6254 | exit(1); /* fail */ | |
6255 | if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') | |
6256 | exit(0); /* succeed (yes, it's ELF) */ | |
2304df62 | 6257 | else |
2afac517 | 6258 | exit(1); /* fail */ |
6259 | } | |
6260 | EOM | |
6261 | if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then | |
6262 | cat <<EOM | |
6263 | You appear to have ELF support. I'll use $cc to build dynamic libraries. | |
6264 | EOM | |
6265 | dflt="$cc" | |
2304df62 | 6266 | else |
2afac517 | 6267 | echo "I'll use ld to build dynamic libraries." |
6268 | dflt='ld' | |
2304df62 | 6269 | fi |
2afac517 | 6270 | rm -f try.c a.out |
6271 | ;; | |
6272 | *) dflt="$ld" | |
6273 | ;; | |
6274 | esac | |
6275 | ||
6276 | rp="What command should be used to create dynamic libraries?" | |
6277 | . ./myread | |
6278 | ld="$ans" | |
6279 | ||
6280 | cat << EOM | |
6281 | ||
6282 | Some systems may require passing special flags to $ld to create a | |
6283 | library that can be dynamically loaded. If your ld flags include | |
6284 | -L/other/path options to locate libraries outside your loader's normal | |
6285 | search path, you may need to specify those -L options here as well. To | |
6286 | use no flags, say "none". | |
6287 | ||
6288 | EOM | |
6289 | case "$lddlflags" in | |
6290 | '') case "$osname" in | |
46193409 | 6291 | beos) dflt='-nostart' ;; |
a5f83cbf JH |
6292 | hpux) dflt='-b'; |
6293 | case "$gccversion" in | |
6294 | '') dflt="$dflt +vnocompatwarnings" ;; | |
b36fec95 JH |
6295 | esac |
6296 | ;; | |
2afac517 | 6297 | linux|irix*) dflt='-shared' ;; |
6298 | next) dflt='none' ;; | |
6299 | solaris) dflt='-G' ;; | |
6300 | sunos) dflt='-assert nodefinitions' ;; | |
6301 | svr4*|esix*) dflt="-G $ldflags" ;; | |
6302 | *) dflt='none' ;; | |
6303 | esac | |
6304 | ;; | |
6305 | *) dflt="$lddlflags" ;; | |
6306 | esac | |
6307 | ||
bfb7748a | 6308 | : Try to guess additional flags to pick up local libraries. |
a0915cb7 AD |
6309 | : Be careful not to append to a plain 'none' |
6310 | case "$dflt" in | |
6311 | none) dflt='' ;; | |
6312 | esac | |
bfb7748a AD |
6313 | for thisflag in $ldflags; do |
6314 | case "$thisflag" in | |
6315 | -L*) | |
6316 | case " $dflt " in | |
6317 | *" $thisflag "*) ;; | |
6318 | *) dflt="$dflt $thisflag" ;; | |
6319 | esac | |
6320 | ;; | |
2afac517 | 6321 | esac |
bfb7748a | 6322 | done |
2afac517 | 6323 | |
bfb7748a AD |
6324 | case "$dflt" in |
6325 | ''|' ') dflt='none' ;; | |
6326 | esac | |
2afac517 | 6327 | |
6328 | rp="Any special flags to pass to $ld to create a dynamically loaded library?" | |
6329 | . ./myread | |
6330 | case "$ans" in | |
6331 | none) lddlflags=' ' ;; | |
6332 | *) lddlflags="$ans" ;; | |
6333 | esac | |
6334 | ||
6335 | cat <<EOM | |
6336 | ||
6337 | Some systems may require passing special flags to $cc to indicate that | |
6338 | the resulting executable will use dynamic linking. To use no flags, | |
6339 | say "none". | |
6340 | ||
6341 | EOM | |
6342 | case "$ccdlflags" in | |
6343 | '') case "$osname" in | |
6344 | hpux) dflt='-Wl,-E' ;; | |
6345 | linux) dflt='-rdynamic' ;; | |
6346 | next) dflt='none' ;; | |
6347 | sunos) dflt='none' ;; | |
6348 | *) dflt='none' ;; | |
6349 | esac ;; | |
bfb7748a | 6350 | ' ') dflt='none' ;; |
2afac517 | 6351 | *) dflt="$ccdlflags" ;; |
6352 | esac | |
7f95ee77 | 6353 | rp="Any special flags to pass to $cc to use dynamic linking?" |
2afac517 | 6354 | . ./myread |
6355 | case "$ans" in | |
6356 | none) ccdlflags=' ' ;; | |
6357 | *) ccdlflags="$ans" ;; | |
6358 | esac | |
6359 | ;; | |
6360 | *) usedl="$undef" | |
6361 | ld='ld' | |
6362 | dlsrc='dl_none.xs' | |
6363 | lddlflags='' | |
6364 | ccdlflags='' | |
6365 | ;; | |
6366 | esac | |
6367 | ||
6368 | also='' | |
6369 | case "$usedl" in | |
6370 | $undef) | |
6371 | # No dynamic loading being used, so don't bother even to prompt. | |
6372 | useshrplib='false' | |
6373 | ;; | |
6374 | *) case "$useshrplib" in | |
6375 | '') case "$osname" in | |
4fabb596 | 6376 | svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*) |
3e3baf6d | 6377 | dflt=y |
2afac517 | 6378 | also='Building a shared libperl is required for dynamic loading to work on your system.' |
6379 | ;; | |
6380 | next*) | |
6381 | case "$osvers" in | |
3e3baf6d | 6382 | 4*) dflt=y |
2afac517 | 6383 | also='Building a shared libperl is needed for MAB support.' |
6384 | ;; | |
3e3baf6d | 6385 | *) dflt=n |
2afac517 | 6386 | ;; |
6387 | esac | |
6388 | ;; | |
3e3baf6d | 6389 | *) dflt=n |
2afac517 | 6390 | ;; |
6391 | esac | |
6392 | ;; | |
6393 | $define|true|[Yy]*) | |
3e3baf6d | 6394 | dflt=y |
2afac517 | 6395 | ;; |
3e3baf6d | 6396 | *) dflt=n |
2afac517 | 6397 | ;; |
6398 | esac | |
6399 | $cat << EOM | |
6400 | ||
6401 | The perl executable is normally obtained by linking perlmain.c with | |
dfe9444c | 6402 | libperl${_a}, any static extensions (usually just DynaLoader), and |
2afac517 | 6403 | any other libraries needed on this system (such as -lm, etc.). Since |
6404 | your system supports dynamic loading, it is probably possible to build | |
6405 | a shared libperl.$so. If you will have more than one executable linked | |
6406 | to libperl.$so, this will significantly reduce the size of each | |
6407 | executable, but it may have a noticeable affect on performance. The | |
6408 | default is probably sensible for your system. | |
6409 | $also | |
6410 | ||
6411 | EOM | |
6412 | rp="Build a shared libperl.$so (y/n)" | |
6413 | . ./myread | |
6414 | case "$ans" in | |
6415 | true|$define|[Yy]*) | |
5cf1d1f1 | 6416 | useshrplib='true' ;; |
2afac517 | 6417 | *) useshrplib='false' ;; |
6418 | esac | |
6419 | ;; | |
6420 | esac | |
6421 | ||
6422 | case "$useshrplib" in | |
6423 | true) | |
6424 | case "$libperl" in | |
6425 | '') | |
6426 | # Figure out a good name for libperl.so. Since it gets stored in | |
6427 | # a version-specific architecture-dependent library, the version | |
6428 | # number isn't really that important, except for making cc/ld happy. | |
6429 | # | |
6430 | # A name such as libperl.so.3.1 | |
6431 | majmin="libperl.$so.$patchlevel.$subversion" | |
6432 | # A name such as libperl.so.301 | |
6433 | majonly=`echo $patchlevel $subversion | | |
6434 | $awk '{printf "%d%02d", $1, $2}'` | |
6435 | majonly=libperl.$so.$majonly | |
6436 | # I'd prefer to keep the os-specific stuff here to a minimum, and | |
6437 | # rely on figuring it out from the naming of libc. | |
6438 | case "${osname}${osvers}" in | |
6439 | next4*) | |
6440 | dflt=libperl.5.$so | |
6441 | # XXX How handle the --version stuff for MAB? | |
6442 | ;; | |
6443 | linux*) # ld won't link with a bare -lperl otherwise. | |
6444 | dflt=libperl.$so | |
6445 | ;; | |
4fabb596 GS |
6446 | cygwin*) # include version |
6447 | dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext | |
6448 | ;; | |
2afac517 | 6449 | *) # Try to guess based on whether libc has major.minor. |
6450 | case "$libc" in | |
6451 | *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; | |
6452 | *libc.$so.[0-9]*) dflt=$majonly ;; | |
6453 | *) dflt=libperl.$so ;; | |
6454 | esac | |
6455 | ;; | |
6456 | esac | |
6457 | ;; | |
6458 | *) dflt=$libperl | |
6459 | ;; | |
6460 | esac | |
6461 | cat << EOM | |
6462 | ||
6463 | I need to select a good name for the shared libperl. If your system uses | |
6464 | library names with major and minor numbers, then you might want something | |
6465 | like $majmin. Alternatively, if your system uses a single version | |
6466 | number for shared libraries, then you might want to use $majonly. | |
6467 | Or, your system might be quite happy with a simple libperl.$so. | |
6468 | ||
6469 | Since the shared libperl will get installed into a version-specific | |
6470 | architecture-dependent directory, the version number of the shared perl | |
6471 | library probably isn't important, so the default should be o.k. | |
6472 | ||
6473 | EOM | |
6474 | rp='What name do you want to give to the shared libperl?' | |
6475 | . ./myread | |
6476 | libperl=$ans | |
6477 | echo "Ok, I'll use $libperl" | |
6478 | ;; | |
6479 | *) | |
dfe9444c | 6480 | libperl="libperl${_a}" |
2afac517 | 6481 | ;; |
6482 | esac | |
6483 | ||
6484 | # Detect old use of shrpdir via undocumented Configure -Dshrpdir | |
6485 | case "$shrpdir" in | |
6486 | '') ;; | |
6487 | *) $cat >&4 <<EOM | |
6488 | WARNING: Use of the shrpdir variable for the installation location of | |
6489 | the shared $libperl is not supported. It was never documented and | |
46193409 | 6490 | will not work in this version. Let me (perlbug@perl.com) |
dfe9444c | 6491 | know of any problems this may cause. |
2afac517 | 6492 | |
6493 | EOM | |
6494 | case "$shrpdir" in | |
6495 | "$archlibexp/CORE") | |
6496 | $cat >&4 <<EOM | |
6497 | But your current setting of $shrpdir is | |
6498 | the default anyway, so it's harmless. | |
6499 | EOM | |
6500 | ;; | |
6501 | *) | |
4e2a5f63 AD |
6502 | $cat >&4 <<EOM |
6503 | Further, your current attempted setting of $shrpdir | |
6504 | conflicts with the value of $archlibexp/CORE | |
6505 | that installperl will use. | |
6506 | EOM | |
dc45a647 MB |
6507 | ;; |
6508 | esac | |
6509 | ;; | |
6510 | esac | |
6511 | ||
6512 | # How will the perl executable find the installed shared $libperl? | |
6513 | # Add $xxx to ccdlflags. | |
6514 | # If we can't figure out a command-line option, use $shrpenv to | |
6515 | # set env LD_RUN_PATH. The main perl makefile uses this. | |
6516 | shrpdir=$archlibexp/CORE | |
6517 | xxx='' | |
6518 | tmp_shrpenv='' | |
6519 | if "$useshrplib"; then | |
6520 | case "$osname" in | |
6521 | aix) | |
6522 | # We'll set it in Makefile.SH... | |
6523 | ;; | |
6524 | solaris|netbsd) | |
6525 | xxx="-R $shrpdir" | |
6526 | ;; | |
6527 | freebsd) | |
6528 | xxx="-Wl,-R$shrpdir" | |
6529 | ;; | |
6530 | linux|irix*|dec_osf) | |
6531 | xxx="-Wl,-rpath,$shrpdir" | |
6532 | ;; | |
6533 | next) | |
6534 | # next doesn't like the default... | |
6535 | ;; | |
46193409 JH |
6536 | beos) |
6537 | # beos doesn't like the default, either. | |
6538 | ;; | |
3656fc86 JH |
6539 | hpux*) |
6540 | # hpux doesn't like the default, either. | |
6541 | tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" | |
6542 | ;; | |
dc45a647 MB |
6543 | *) |
6544 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" | |
6545 | ;; | |
6546 | esac | |
6547 | case "$xxx" in | |
6548 | '') ;; | |
6549 | *) | |
6550 | # Only add $xxx if it isn't already in ccdlflags. | |
6551 | case " $ccdlflags " in | |
6552 | *" $xxx "*) ;; | |
6553 | *) ccdlflags="$ccdlflags $xxx" | |
6554 | cat <<EOM >&4 | |
6555 | ||
6556 | Adding $xxx to the flags | |
6557 | passed to $ld so that the perl executable will find the | |
6558 | installed shared $libperl. | |
6559 | ||
6560 | EOM | |
6561 | ;; | |
6562 | esac | |
6563 | ;; | |
6564 | esac | |
6565 | fi | |
5cf1d1f1 JH |
6566 | # Fix ccdlflags in AIX for building external extensions. |
6567 | # (For building Perl itself bare -bE:perl.exp is needed, | |
6568 | # Makefile.SH takes care of this.) | |
5f9d9a17 | 6569 | case "$osname" in |
5cf1d1f1 | 6570 | aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;; |
5f9d9a17 | 6571 | esac |
dc45a647 MB |
6572 | # Respect a hint or command-line value. |
6573 | case "$shrpenv" in | |
6574 | '') shrpenv="$tmp_shrpenv" ;; | |
6575 | esac | |
5cf1d1f1 JH |
6576 | case "$ldlibpthname" in |
6577 | '') ldlibpthname=LD_LIBRARY_PATH ;; | |
6578 | none) ldlibpthname='' ;; | |
6579 | esac | |
dc45a647 MB |
6580 | |
6581 | : determine where manual pages go | |
6582 | set man1dir man1dir none | |
6583 | eval $prefixit | |
6584 | $cat <<EOM | |
6585 | ||
6586 | $spackage has manual pages available in source form. | |
6587 | EOM | |
6588 | case "$nroff" in | |
6589 | nroff) | |
6590 | echo "However, you don't have nroff, so they're probably useless to you." | |
6591 | case "$man1dir" in | |
6592 | '') man1dir="none";; | |
6593 | esac;; | |
6594 | esac | |
6595 | echo "If you don't want the manual sources installed, answer 'none'." | |
6596 | case "$man1dir" in | |
6597 | ' ') dflt=none | |
6598 | ;; | |
6599 | '') | |
6600 | lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1" | |
6601 | lookpath="$lookpath $prefixexp/man/p_man/man1" | |
6602 | lookpath="$lookpath $prefixexp/man/u_man/man1" | |
6603 | lookpath="$lookpath $prefixexp/man/man.1" | |
6604 | case "$sysman" in | |
6605 | */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;; | |
6606 | *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;; | |
6607 | esac | |
6608 | set dflt | |
6609 | eval $prefixup | |
6610 | ;; | |
6611 | *) dflt="$man1dir" | |
6612 | ;; | |
6613 | esac | |
6614 | echo " " | |
6615 | fn=dn+~ | |
6616 | rp="Where do the main $spackage manual pages (source) go?" | |
6617 | . ./getfile | |
6618 | if $test "X$man1direxp" != "X$ansexp"; then | |
6619 | installman1dir='' | |
6620 | fi | |
6621 | man1dir="$ans" | |
6622 | man1direxp="$ansexp" | |
6623 | case "$man1dir" in | |
dd4e71fd | 6624 | '') man1dir=' ' |
dc45a647 MB |
6625 | installman1dir='';; |
6626 | esac | |
dc45a647 | 6627 | |
dd4e71fd JH |
6628 | : Change installation prefix, if necessary. |
6629 | if $test X"$prefix" != X"$installprefix"; then | |
ec897fb9 | 6630 | installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"` |
71c4afb4 JH |
6631 | else |
6632 | installman1dir="$man1direxp" | |
dc45a647 MB |
6633 | fi |
6634 | ||
6635 | : What suffix to use on installed man pages | |
6636 | ||
6637 | case "$man1dir" in | |
6638 | ' ') | |
6639 | man1ext='0' | |
6640 | ;; | |
6641 | *) | |
6642 | rp="What suffix should be used for the main $spackage man pages?" | |
6643 | case "$man1ext" in | |
6644 | '') case "$man1dir" in | |
6645 | *1) dflt=1 ;; | |
6646 | *1p) dflt=1p ;; | |
6647 | *1pm) dflt=1pm ;; | |
6648 | *l) dflt=l;; | |
6649 | *n) dflt=n;; | |
6650 | *o) dflt=o;; | |
6651 | *p) dflt=p;; | |
6652 | *C) dflt=C;; | |
6653 | *L) dflt=L;; | |
6654 | *L1) dflt=L1;; | |
6655 | *) dflt=1;; | |
6656 | esac | |
6657 | ;; | |
6658 | *) dflt="$man1ext";; | |
6659 | esac | |
6660 | . ./myread | |
6661 | man1ext="$ans" | |
6662 | ;; | |
6663 | esac | |
6664 | ||
6665 | : see if we can have long filenames | |
6666 | echo " " | |
dc45a647 | 6667 | first=123456789abcdef |
8c99d73e | 6668 | $rm -f $first |
dc45a647 MB |
6669 | if (echo hi >$first) 2>/dev/null; then |
6670 | if $test -f 123456789abcde; then | |
6671 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
6672 | val="$undef" | |
6673 | else | |
8c99d73e GS |
6674 | echo 'You can have filenames longer than 14 characters.'>&4 |
6675 | val="$define" | |
dc45a647 MB |
6676 | fi |
6677 | else | |
6678 | $cat <<'EOM' | |
8c99d73e GS |
6679 | You can't have filenames longer than 14 chars. |
6680 | You can't even think about them! | |
dc45a647 MB |
6681 | EOM |
6682 | val="$undef" | |
6683 | fi | |
6684 | set d_flexfnam | |
6685 | eval $setvar | |
8c99d73e | 6686 | $rm -rf 123456789abcde* |
dc45a647 MB |
6687 | |
6688 | : determine where library module manual pages go | |
6689 | set man3dir man3dir none | |
6690 | eval $prefixit | |
6691 | $cat <<EOM | |
6692 | ||
6693 | $spackage has manual pages for many of the library modules. | |
6694 | EOM | |
6695 | ||
6696 | case "$nroff" in | |
6697 | nroff) | |
6698 | $cat <<'EOM' | |
6699 | However, you don't have nroff, so they're probably useless to you. | |
6700 | EOM | |
6701 | case "$man3dir" in | |
6702 | '') man3dir="none";; | |
6703 | esac;; | |
6704 | esac | |
6705 | ||
6706 | case "$d_flexfnam" in | |
6707 | undef) | |
6708 | $cat <<'EOM' | |
6709 | However, your system can't handle the long file names like File::Basename.3. | |
6710 | EOM | |
6711 | case "$man3dir" in | |
6712 | '') man3dir="none";; | |
6713 | esac;; | |
6714 | esac | |
6715 | ||
6716 | echo "If you don't want the manual sources installed, answer 'none'." | |
6717 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` | |
6718 | case "$man3dir" in | |
8c99d73e | 6719 | '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` |
dd4e71fd JH |
6720 | if $test -d "$privlib/man/man3"; then |
6721 | cat <<EOM >&4 | |
6722 | ||
6723 | WARNING: Previous versions of perl installed man3 pages into | |
6724 | $privlib/man/man3. This version will suggest a | |
6725 | new default of $dflt. | |
6726 | EOM | |
6727 | tdflt=$dflt | |
6728 | dflt='n' | |
6729 | rp='Do you wish to preserve the old behavior?(y/n)' | |
6730 | . ./myread | |
6731 | case "$ans" in | |
6732 | y*) dflt="$privlib/man/man3" ;; | |
6733 | *) dflt=$tdflt ;; | |
6734 | esac | |
6735 | fi | |
2afac517 | 6736 | ;; |
dc45a647 | 6737 | *) dflt="$man3dir" ;; |
2afac517 | 6738 | esac |
8c99d73e GS |
6739 | case "$dflt" in |
6740 | ' ') dflt=none ;; | |
6741 | esac | |
dc45a647 | 6742 | echo " " |
dc45a647 MB |
6743 | fn=dn+~ |
6744 | rp="Where do the $package library man pages (source) go?" | |
6745 | . ./getfile | |
dc45a647 MB |
6746 | man3dir="$ans" |
6747 | man3direxp="$ansexp" | |
8c99d73e | 6748 | case "$man3dir" in |
dd4e71fd | 6749 | '') man3dir=' ' |
dc45a647 MB |
6750 | installman3dir='';; |
6751 | esac | |
dc45a647 | 6752 | |
dd4e71fd JH |
6753 | : Change installation prefix, if necessary. |
6754 | if $test X"$prefix" != X"$installprefix"; then | |
ec897fb9 | 6755 | installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"` |
71c4afb4 JH |
6756 | else |
6757 | installman3dir="$man3direxp" | |
dc45a647 MB |
6758 | fi |
6759 | ||
6760 | : What suffix to use on installed man pages | |
dc45a647 MB |
6761 | case "$man3dir" in |
6762 | ' ') | |
6763 | man3ext='0' | |
6764 | ;; | |
6765 | *) | |
6766 | rp="What suffix should be used for the $package library man pages?" | |
6767 | case "$man3ext" in | |
6768 | '') case "$man3dir" in | |
6769 | *3) dflt=3 ;; | |
6770 | *3p) dflt=3p ;; | |
6771 | *3pm) dflt=3pm ;; | |
6772 | *l) dflt=l;; | |
6773 | *n) dflt=n;; | |
6774 | *o) dflt=o;; | |
6775 | *p) dflt=p;; | |
6776 | *C) dflt=C;; | |
6777 | *L) dflt=L;; | |
6778 | *L3) dflt=L3;; | |
6779 | *) dflt=3;; | |
2afac517 | 6780 | esac |
6781 | ;; | |
dc45a647 | 6782 | *) dflt="$man3ext";; |
2afac517 | 6783 | esac |
dc45a647 MB |
6784 | . ./myread |
6785 | man3ext="$ans" | |
6786 | ;; | |
2afac517 | 6787 | esac |
6788 | ||
6789 | : see if we have to deal with yellow pages, now NIS. | |
6790 | if $test -d /usr/etc/yp || $test -d /etc/yp; then | |
6791 | if $test -f /usr/etc/nibindd; then | |
6792 | echo " " | |
6793 | echo "I'm fairly confident you're on a NeXT." | |
6794 | echo " " | |
6795 | rp='Do you get the hosts file via NetInfo?' | |
6796 | dflt=y | |
6797 | case "$hostcat" in | |
6798 | nidump*) ;; | |
6799 | '') ;; | |
6800 | *) dflt=n;; | |
6801 | esac | |
6802 | . ./myread | |
6803 | case "$ans" in | |
6804 | y*) hostcat='nidump hosts .';; | |
6805 | *) case "$hostcat" in | |
6806 | nidump*) hostcat='';; | |
6807 | esac | |
6808 | ;; | |
6809 | esac | |
6810 | fi | |
6811 | case "$hostcat" in | |
6812 | nidump*) ;; | |
6813 | *) | |
6814 | case "$hostcat" in | |
6815 | *ypcat*) dflt=y;; | |
6816 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
6817 | dflt=y | |
6818 | else | |
6819 | dflt=n | |
6820 | fi;; | |
6821 | *) dflt=n;; | |
6822 | esac | |
6823 | echo " " | |
6824 | rp='Are you getting the hosts file via yellow pages?' | |
6825 | . ./myread | |
6826 | case "$ans" in | |
6827 | y*) hostcat='ypcat hosts';; | |
6828 | *) hostcat='cat /etc/hosts';; | |
6829 | esac | |
6830 | ;; | |
6831 | esac | |
6832 | fi | |
dfe9444c | 6833 | case "$hostcat" in |
7599c0b3 | 6834 | '') test -f /etc/hosts && hostcat='cat /etc/hosts';; |
dfe9444c AD |
6835 | esac |
6836 | case "$groupcat" in | |
7599c0b3 | 6837 | '') test -f /etc/group && groupcat='cat /etc/group';; |
dfe9444c AD |
6838 | esac |
6839 | case "$passcat" in | |
7599c0b3 | 6840 | '') test -f /etc/passwd && passcat='cat /etc/passwd';; |
dfe9444c | 6841 | esac |
2afac517 | 6842 | |
6843 | : now get the host name | |
6844 | echo " " | |
6845 | echo "Figuring out host name..." >&4 | |
6846 | case "$myhostname" in | |
6847 | '') cont=true | |
6848 | echo 'Maybe "hostname" will work...' | |
6849 | if tans=`sh -c hostname 2>&1` ; then | |
6850 | myhostname=$tans | |
6851 | phostname=hostname | |
6852 | cont='' | |
6853 | fi | |
6854 | ;; | |
6855 | *) cont='';; | |
6856 | esac | |
6857 | if $test "$cont"; then | |
6858 | if ./xenix; then | |
6859 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' | |
6860 | if tans=`cat /etc/systemid 2>&1` ; then | |
6861 | myhostname=$tans | |
6862 | phostname='cat /etc/systemid' | |
6863 | echo "Whadyaknow. Xenix always was a bit strange..." | |
6864 | cont='' | |
6865 | fi | |
6866 | elif $test -r /etc/systemid; then | |
6867 | echo "(What is a non-Xenix system doing with /etc/systemid?)" | |
6868 | fi | |
6869 | fi | |
6870 | if $test "$cont"; then | |
6871 | echo 'No, maybe "uuname -l" will work...' | |
6872 | if tans=`sh -c 'uuname -l' 2>&1` ; then | |
6873 | myhostname=$tans | |
6874 | phostname='uuname -l' | |
6875 | else | |
6876 | echo 'Strange. Maybe "uname -n" will work...' | |
6877 | if tans=`sh -c 'uname -n' 2>&1` ; then | |
6878 | myhostname=$tans | |
6879 | phostname='uname -n' | |
6880 | else | |
6881 | echo 'Oh well, maybe I can mine it out of whoami.h...' | |
6882 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then | |
6883 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` | |
6884 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" | |
6885 | else | |
6886 | case "$myhostname" in | |
6887 | '') echo "Does this machine have an identity crisis or something?" | |
6888 | phostname='';; | |
6889 | *) | |
6890 | echo "Well, you said $myhostname before..." | |
6891 | phostname='echo $myhostname';; | |
6892 | esac | |
6893 | fi | |
6894 | fi | |
6895 | fi | |
6896 | fi | |
6897 | : you do not want to know about this | |
6898 | set $myhostname | |
6899 | myhostname=$1 | |
6900 | ||
6901 | : verify guess | |
6902 | if $test "$myhostname" ; then | |
6903 | dflt=y | |
6904 | rp='Your host name appears to be "'$myhostname'".'" Right?" | |
6905 | . ./myread | |
6906 | case "$ans" in | |
6907 | y*) ;; | |
6908 | *) myhostname='';; | |
6909 | esac | |
6910 | fi | |
6911 | ||
6912 | : bad guess or no guess | |
6913 | while $test "X$myhostname" = X ; do | |
6914 | dflt='' | |
6915 | rp="Please type the (one word) name of your host:" | |
6916 | . ./myread | |
6917 | myhostname="$ans" | |
6918 | done | |
6919 | ||
6920 | : translate upper to lower if necessary | |
6921 | case "$myhostname" in | |
6922 | *[A-Z]*) | |
6923 | echo "(Normalizing case in your host name)" | |
6924 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` | |
6925 | ;; | |
6926 | esac | |
6927 | ||
6928 | case "$myhostname" in | |
6929 | *.*) | |
6930 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` | |
6931 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` | |
6932 | echo "(Trimming domain name from host name--host name is now $myhostname)" | |
6933 | ;; | |
6934 | *) case "$mydomain" in | |
6935 | '') | |
6936 | { | |
2afac517 | 6937 | test "X$hostcat" = "Xypcat hosts" && |
6938 | ypmatch "$myhostname" hosts 2>/dev/null |\ | |
6939 | $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ | |
6940 | $test -s hosts | |
6941 | } || { | |
7599c0b3 | 6942 | test "X$hostcat" != "X" && |
2afac517 | 6943 | $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / |
6944 | /[ ]$myhostname[ . ]/p" > hosts | |
6945 | } | |
6946 | tmp_re="[ . ]" | |
6947 | $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } | |
6948 | END { print sum }" hosts` = x1 || tmp_re="[ ]" | |
6949 | dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ | |
6950 | hosts | $sort | $uniq | \ | |
6951 | $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` | |
6952 | case `$echo X$dflt` in | |
6953 | X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" | |
6954 | dflt=. | |
6955 | ;; | |
6956 | X.) echo "(You do not have fully-qualified names in /etc/hosts)" | |
6957 | ;; | |
6958 | esac | |
6959 | case "$dflt" in | |
6960 | .) | |
6961 | tans=`./loc resolv.conf X /etc /usr/etc` | |
6962 | if $test -f "$tans"; then | |
6963 | echo "(Attempting domain name extraction from $tans)" | |
a6006777 | 6964 | dflt=.`$sed -n -e 's/ / /g' \ |
28757baa | 6965 | -e 's/^search *\([^ ]*\).*/\1/p' $tans \ |
a6006777 | 6966 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
2afac517 | 6967 | case "$dflt" in |
a6006777 | 6968 | .) dflt=.`$sed -n -e 's/ / /g' \ |
28757baa | 6969 | -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ |
a6006777 | 6970 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
774d564b | 6971 | ;; |
2afac517 | 6972 | esac |
6973 | fi | |
6974 | ;; | |
6975 | esac | |
6976 | case "$dflt" in | |
6977 | .) echo "(No help from resolv.conf either -- attempting clever guess)" | |
6978 | dflt=.`sh -c domainname 2>/dev/null` | |
6979 | case "$dflt" in | |
6980 | '') dflt='.';; | |
6981 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; | |
6982 | esac | |
6983 | ;; | |
6984 | esac | |
6985 | case "$dflt" in | |
6986 | .) echo "(Lost all hope -- silly guess then)" | |
6987 | dflt='.uucp' | |
6988 | ;; | |
6989 | esac | |
6990 | $rm -f hosts | |
6991 | ;; | |
6992 | *) dflt="$mydomain";; | |
6993 | esac;; | |
6994 | esac | |
6995 | echo " " | |
6996 | rp="What is your domain name?" | |
6997 | . ./myread | |
6998 | tans="$ans" | |
6999 | case "$ans" in | |
7000 | '') ;; | |
7001 | .*) ;; | |
7002 | *) tans=".$tans";; | |
7003 | esac | |
7004 | mydomain="$tans" | |
7005 | ||
7006 | : translate upper to lower if necessary | |
7007 | case "$mydomain" in | |
7008 | *[A-Z]*) | |
7009 | echo "(Normalizing case in your domain name)" | |
7010 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` | |
7011 | ;; | |
7012 | esac | |
7013 | ||
7014 | : a little sanity check here | |
7015 | case "$phostname" in | |
7016 | '') ;; | |
7017 | *) | |
7018 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in | |
7019 | $myhostname$mydomain|$myhostname) ;; | |
7020 | *) | |
7021 | case "$phostname" in | |
7022 | sed*) | |
7023 | echo "(That doesn't agree with your whoami.h file, by the way.)" | |
7024 | ;; | |
7025 | *) | |
7026 | echo "(That doesn't agree with your $phostname command, by the way.)" | |
7027 | ;; | |
7028 | esac | |
7029 | ;; | |
7030 | esac | |
7031 | ;; | |
7032 | esac | |
7033 | ||
7034 | $cat <<EOM | |
7035 | ||
7036 | I need to get your e-mail address in Internet format if possible, i.e. | |
7037 | something like user@host.domain. Please answer accurately since I have | |
7038 | no easy means to double check it. The default value provided below | |
7f95ee77 | 7039 | is most probably close to reality but may not be valid from outside |
2afac517 | 7040 | your organization... |
7041 | ||
7042 | EOM | |
7043 | cont=x | |
7044 | while test "$cont"; do | |
7045 | case "$cf_email" in | |
7046 | '') dflt="$cf_by@$myhostname$mydomain";; | |
7047 | *) dflt="$cf_email";; | |
7048 | esac | |
7049 | rp='What is your e-mail address?' | |
7050 | . ./myread | |
7051 | cf_email="$ans" | |
7052 | case "$cf_email" in | |
7053 | *@*.*) cont='' ;; | |
7054 | *) | |
7055 | rp='Address does not look like an Internet one. Use it anyway?' | |
7056 | case "$fastread" in | |
7057 | yes) dflt=y ;; | |
7058 | *) dflt=n ;; | |
7059 | esac | |
7060 | . ./myread | |
7061 | case "$ans" in | |
7062 | y*) cont='' ;; | |
7063 | *) echo " " ;; | |
7064 | esac | |
7065 | ;; | |
7066 | esac | |
7067 | done | |
7068 | ||
7069 | $cat <<EOM | |
7070 | ||
7071 | If you or somebody else will be maintaining perl at your site, please | |
7072 | fill in the correct e-mail address here so that they may be contacted | |
7073 | if necessary. Currently, the "perlbug" program included with perl | |
7074 | will send mail to this address in addition to perlbug@perl.com. You may | |
7075 | enter "none" for no administrator. | |
7076 | ||
7077 | EOM | |
7078 | case "$perladmin" in | |
7079 | '') dflt="$cf_email";; | |
7080 | *) dflt="$perladmin";; | |
7081 | esac | |
7082 | rp='Perl administrator e-mail address' | |
7083 | . ./myread | |
7084 | perladmin="$ans" | |
7085 | ||
5f05dabc | 7086 | : figure out how to guarantee perl startup |
7087 | case "$startperl" in | |
7088 | '') | |
7089 | case "$sharpbang" in | |
7090 | *!) | |
7091 | $cat <<EOH | |
7092 | ||
7093 | I can use the #! construct to start perl on your system. This will | |
7094 | make startup of perl scripts faster, but may cause problems if you | |
7095 | want to share those scripts and perl is not in a standard place | |
7096 | ($binexp/perl) on all your platforms. The alternative is to force | |
7097 | a shell by starting the script with a single ':' character. | |
7098 | ||
7099 | EOH | |
7100 | dflt="$binexp/perl" | |
7101 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' | |
7102 | . ./myread | |
7103 | case "$ans" in | |
68dc0745 | 7104 | none) startperl=": # use perl";; |
7105 | *) startperl="#!$ans" | |
3e3baf6d | 7106 | if $test 30 -lt `echo "$ans" | wc -c`; then |
68dc0745 | 7107 | $cat >&4 <<EOM |
7108 | ||
7109 | WARNING: Some systems limit the #! command to 32 characters. | |
7110 | If you experience difficulty running Perl scripts with #!, try | |
7111 | installing Perl in a directory with a shorter pathname. | |
7112 | ||
7113 | EOM | |
7114 | fi ;; | |
5f05dabc | 7115 | esac |
7116 | ;; | |
7117 | *) startperl=": # use perl" | |
7118 | ;; | |
7119 | esac | |
7120 | ;; | |
7121 | esac | |
7122 | echo "I'll use $startperl to start perl scripts." | |
7123 | ||
7124 | : figure best path for perl in scripts | |
7125 | case "$perlpath" in | |
7126 | '') | |
7127 | perlpath="$binexp/perl" | |
7128 | case "$startperl" in | |
7129 | *!*) ;; | |
7130 | *) | |
7131 | $cat <<EOH | |
7132 | ||
7133 | I will use the "eval 'exec'" idiom to start Perl on your system. | |
7134 | I can use the full path of your Perl binary for this purpose, but | |
7135 | doing so may cause problems if you want to share those scripts and | |
7136 | Perl is not always in a standard place ($binexp/perl). | |
7137 | ||
7138 | EOH | |
7139 | dflt="$binexp/perl" | |
7140 | rp="What path shall I use in \"eval 'exec'\"?" | |
7141 | . ./myread | |
7142 | perlpath="$ans" | |
7143 | ;; | |
7144 | esac | |
7145 | ;; | |
7146 | esac | |
7147 | case "$startperl" in | |
7148 | *!*) ;; | |
7149 | *) echo "I'll use $perlpath in \"eval 'exec'\"" ;; | |
7150 | esac | |
7151 | ||
dc45a647 MB |
7152 | : determine where public executable scripts go |
7153 | set scriptdir scriptdir | |
7154 | eval $prefixit | |
7155 | case "$scriptdir" in | |
7156 | '') | |
7157 | dflt="$bin" | |
7158 | : guess some guesses | |
7159 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
dd4e71fd JH |
7160 | $test -d /usr/share/bin && dflt=/usr/share/bin |
7161 | $test -d /usr/local/script && dflt=/usr/local/script | |
7162 | $test -d /usr/local/scripts && dflt=/usr/local/scripts | |
7163 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
dc45a647 MB |
7164 | set dflt |
7165 | eval $prefixup | |
7166 | ;; | |
7167 | *) dflt="$scriptdir" | |
7168 | ;; | |
7169 | esac | |
7170 | $cat <<EOM | |
7171 | ||
7172 | Some installations have a separate directory just for executable scripts so | |
7173 | that they can mount it across multiple architectures but keep the scripts in | |
7174 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
7175 | Or you might just lump your scripts in with all your other executables. | |
7176 | ||
7177 | EOM | |
7178 | fn=d~ | |
7179 | rp='Where do you keep publicly executable scripts?' | |
7180 | . ./getfile | |
7181 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
7182 | installscript='' | |
7183 | fi | |
7184 | scriptdir="$ans" | |
7185 | scriptdirexp="$ansexp" | |
dd4e71fd JH |
7186 | : Change installation prefix, if necessary. |
7187 | if $test X"$prefix" != X"$installprefix"; then | |
ec897fb9 | 7188 | installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"` |
dd4e71fd JH |
7189 | else |
7190 | installscript="$scriptdirexp" | |
7191 | fi | |
dc45a647 | 7192 | |
dc45a647 | 7193 | : determine where site specific architecture-dependent libraries go. |
273cf8d1 GS |
7194 | : sitelib default is /usr/local/lib/perl5/site_perl/$version |
7195 | : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname | |
3a6175e1 | 7196 | : sitelib may have an optional trailing /share. |
dc45a647 | 7197 | case "$sitearch" in |
49c10eea JH |
7198 | '') dflt=`echo $sitelib | $sed 's,/share$,,'` |
7199 | dflt="$dflt/$archname" | |
7200 | ;; | |
7201 | *) dflt="$sitearch" | |
7202 | ;; | |
dc45a647 | 7203 | esac |
49c10eea JH |
7204 | set sitearch sitearch none |
7205 | eval $prefixit | |
dc45a647 MB |
7206 | $cat <<EOM |
7207 | ||
7208 | The installation process will also create a directory for | |
7209 | architecture-dependent site-specific extensions and modules. | |
7210 | ||
7211 | EOM | |
49c10eea | 7212 | fn=d~+ |
dc45a647 MB |
7213 | rp='Pathname for the site-specific architecture-dependent library files?' |
7214 | . ./getfile | |
dc45a647 MB |
7215 | sitearch="$ans" |
7216 | sitearchexp="$ansexp" | |
dd4e71fd JH |
7217 | : Change installation prefix, if necessary. |
7218 | if $test X"$prefix" != X"$installprefix"; then | |
ec897fb9 | 7219 | installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"` |
71c4afb4 JH |
7220 | else |
7221 | installsitearch="$sitearchexp" | |
dc45a647 MB |
7222 | fi |
7223 | ||
717c4fcc JH |
7224 | : determine where add-on public executables go |
7225 | case "$sitebin" in | |
7226 | '') dflt=$siteprefix/bin ;; | |
49c10eea | 7227 | *) dflt=$sitebin ;; |
717c4fcc JH |
7228 | esac |
7229 | fn=d~ | |
7230 | rp='Pathname where the add-on public executables should be installed?' | |
7231 | . ./getfile | |
7232 | sitebin="$ans" | |
7233 | sitebinexp="$ansexp" | |
7234 | : Change installation prefix, if necessary. | |
7235 | if $test X"$prefix" != X"$installprefix"; then | |
7236 | installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"` | |
7237 | else | |
7238 | installsitebin="$sitebinexp" | |
7239 | fi | |
7240 | ||
43999f95 JH |
7241 | : see if sqrtl exists |
7242 | set sqrtl d_sqrtl | |
7243 | eval $inlibc | |
7244 | ||
d7d93a81 JH |
7245 | case "$ccflags" in |
7246 | *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;; | |
7247 | esac | |
7248 | ||
b0ce926a JH |
7249 | case "$uselongdouble" in |
7250 | $define|true|[yY]*) dflt='y';; | |
7251 | *) dflt='n';; | |
7252 | esac | |
0f0995ae JH |
7253 | cat <<EOM |
7254 | ||
7255 | Perl can be built to take advantage of long doubles which | |
7256 | (if available) may give more accuracy and range for floating point numbers. | |
7257 | ||
7258 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
7259 | EOM | |
b0ce926a JH |
7260 | rp='Try to use long doubles if available?' |
7261 | . ./myread | |
7262 | case "$ans" in | |
309d43cf JH |
7263 | y|Y) val="$define" ;; |
7264 | *) val="$undef" ;; | |
b0ce926a JH |
7265 | esac |
7266 | set uselongdouble | |
7267 | eval $setvar | |
7268 | ||
d9b3e12d | 7269 | case "$uselongdouble" in |
d7d93a81 JH |
7270 | true|[yY]*) uselongdouble="$define" ;; |
7271 | esac | |
7272 | ||
7273 | case "$uselongdouble" in | |
7274 | $define) | |
d9b3e12d JH |
7275 | : Look for a hint-file generated 'call-back-unit'. If the |
7276 | : user has specified that long doubles should be used, | |
7277 | : we may need to set or change some other defaults. | |
7278 | if $test -f uselongdouble.cbu; then | |
7279 | echo "Your platform has some specific hints for long doubles, using them..." | |
7280 | . ./uselongdouble.cbu | |
7281 | else | |
7282 | $cat <<EOM | |
7283 | (Your platform doesn't have any specific hints for long doubles.) | |
7284 | EOM | |
7285 | fi | |
7286 | ;; | |
7287 | esac | |
b0ce926a | 7288 | |
43999f95 JH |
7289 | case "$uselongdouble:$d_sqrtl" in |
7290 | $define:$undef) | |
7291 | $cat <<EOM >&4 | |
7292 | ||
3d68f8d4 JH |
7293 | *** You requested the use of long doubles but you do not seem to have |
7294 | *** the mathematic functions for long doubles. I'm disabling the use | |
7295 | *** of long doubles. | |
7296 | ||
43999f95 JH |
7297 | EOM |
7298 | uselongdouble=$undef | |
7299 | ;; | |
7300 | esac | |
7301 | ||
0f0995ae JH |
7302 | case "$useperlio" in |
7303 | $define|true|[yY]*) dflt='y';; | |
7304 | *) dflt='n';; | |
7305 | esac | |
d7d93a81 JH |
7306 | cat <<EOM |
7307 | ||
85aff577 CS |
7308 | Previous version of $package used the standard IO mechanisms as defined |
7309 | in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO | |
2afac517 | 7310 | mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still |
85aff577 CS |
7311 | the default. This abstraction layer can use AT&T's sfio (if you already |
7312 | have sfio installed) or regular stdio. Using PerlIO with sfio may cause | |
7313 | problems with some extension modules. Using PerlIO with stdio is safe, | |
7314 | but it is slower than plain stdio and therefore is not the default. | |
2afac517 | 7315 | |
0f0995ae | 7316 | If this doesn't make any sense to you, just accept the default '$dflt'. |
2afac517 | 7317 | EOM |
2afac517 | 7318 | rp='Use the experimental PerlIO abstraction layer?' |
7319 | . ./myread | |
7320 | case "$ans" in | |
7321 | y|Y) | |
7322 | val="$define" | |
7323 | ;; | |
7324 | *) | |
7325 | echo "Ok, doing things the stdio way" | |
7326 | val="$undef" | |
7327 | ;; | |
7328 | esac | |
7329 | set useperlio | |
7330 | eval $setvar | |
2304df62 | 7331 | |
717c4fcc JH |
7332 | case "$vendorprefix" in |
7333 | '') d_vendorbin="$undef" | |
7334 | vendorbin='' | |
7335 | vendorbinexp='' | |
7336 | ;; | |
7337 | *) d_vendorbin="$define" | |
7338 | : determine where vendor-supplied executables go. | |
49c10eea JH |
7339 | case "$vendorbin" in |
7340 | '') dflt=$vendorprefix/bin ;; | |
7341 | *) dflt="$vendorbin" ;; | |
7342 | esac | |
717c4fcc JH |
7343 | fn=d~+ |
7344 | rp='Pathname for the vendor-supplied executables directory?' | |
7345 | . ./getfile | |
7346 | vendorbin="$ans" | |
7347 | vendorbinexp="$ansexp" | |
717c4fcc JH |
7348 | ;; |
7349 | esac | |
49c10eea JH |
7350 | : Change installation prefix, if necessary. |
7351 | if $test X"$prefix" != X"$installprefix"; then | |
7352 | installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"` | |
7353 | else | |
7354 | installvendorbin="$vendorbinexp" | |
7355 | fi | |
717c4fcc | 7356 | |
bbe6c963 JH |
7357 | : see if qgcvt exists |
7358 | set qgcvt d_qgcvt | |
7359 | eval $inlibc | |
7360 | ||
628e1a40 JH |
7361 | : check for length of double |
7362 | echo " " | |
7363 | case "$doublesize" in | |
7364 | '') | |
49c10eea | 7365 | echo "Checking to see how big your double precision numbers are..." >&4 |
628e1a40 JH |
7366 | $cat >try.c <<'EOCP' |
7367 | #include <stdio.h> | |
7368 | int main() | |
7369 | { | |
7370 | printf("%d\n", (int)sizeof(double)); | |
7371 | exit(0); | |
7372 | } | |
7373 | EOCP | |
7374 | set try | |
7375 | if eval $compile_ok; then | |
7376 | doublesize=`./try` | |
49c10eea | 7377 | echo "Your double is $doublesize bytes long." |
628e1a40 JH |
7378 | else |
7379 | dflt='8' | |
7380 | echo "(I can't seem to compile the test program. Guessing...)" | |
7381 | rp="What is the size of a double precision number (in bytes)?" | |
7382 | . ./myread | |
7383 | doublesize="$ans" | |
7384 | fi | |
7385 | ;; | |
7386 | esac | |
7387 | $rm -f try.c try | |
7388 | ||
7389 | : check for long doubles | |
7390 | echo " " | |
c5f05a91 | 7391 | echo "Checking to see if you have long double..." >&4 |
628e1a40 JH |
7392 | echo 'int main() { long double x = 7.0; }' > try.c |
7393 | set try | |
7394 | if eval $compile; then | |
7395 | val="$define" | |
ce65dbcf | 7396 | echo "You have long double." |
628e1a40 JH |
7397 | else |
7398 | val="$undef" | |
ce65dbcf | 7399 | echo "You do not have long double." |
628e1a40 JH |
7400 | fi |
7401 | $rm try.* | |
7402 | set d_longdbl | |
7403 | eval $setvar | |
7404 | ||
7405 | : check for length of long double | |
7406 | case "${d_longdbl}${longdblsize}" in | |
7407 | $define) | |
7408 | echo " " | |
49c10eea | 7409 | echo "Checking to see how big your long doubles are..." >&4 |
628e1a40 JH |
7410 | $cat >try.c <<'EOCP' |
7411 | #include <stdio.h> | |
7412 | int main() | |
7413 | { | |
7414 | printf("%d\n", sizeof(long double)); | |
7415 | } | |
7416 | EOCP | |
7417 | set try | |
7418 | set try | |
7419 | if eval $compile; then | |
7420 | longdblsize=`./try$exe_ext` | |
49c10eea | 7421 | echo "Your long doubles are $longdblsize bytes long." |
628e1a40 JH |
7422 | else |
7423 | dflt='8' | |
7424 | echo " " | |
7425 | echo "(I can't seem to compile the test program. Guessing...)" >&4 | |
7426 | rp="What is the size of a long double (in bytes)?" | |
7427 | . ./myread | |
7428 | longdblsize="$ans" | |
7429 | fi | |
7430 | if $test "X$doublesize" = "X$longdblsize"; then | |
7431 | echo "(That isn't any different from an ordinary double.)" | |
7432 | fi | |
7433 | ;; | |
7434 | esac | |
7435 | $rm -f try.* try | |
ff935051 | 7436 | |
cf2093f6 JH |
7437 | echo " " |
7438 | ||
ea1c3b15 | 7439 | if $test X"$d_longdbl" = X"$define"; then |
cf2093f6 JH |
7440 | |
7441 | echo "Checking how to print long doubles..." >&4 | |
7442 | ||
7443 | if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then | |
7444 | $cat >try.c <<'EOCP' | |
7445 | #include <sys/types.h> | |
7446 | #include <stdio.h> | |
7447 | int main() { | |
7448 | double d = 123.456; | |
7449 | printf("%.3f\n", d); | |
7450 | } | |
7451 | EOCP | |
7452 | set try | |
7453 | if eval $compile; then | |
7454 | yyy=`./try$exe_ext` | |
7455 | case "$yyy" in | |
7456 | 123.456) | |
7457 | sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; | |
7458 | sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"'; | |
7459 | echo "We will use %f." | |
7460 | ;; | |
7461 | esac | |
7462 | fi | |
7463 | fi | |
7464 | ||
7465 | if $test X"$sPRIfldbl" = X; then | |
7466 | $cat >try.c <<'EOCP' | |
7467 | #include <sys/types.h> | |
7468 | #include <stdio.h> | |
7469 | int main() { | |
7470 | long double d = 123.456; | |
ea1c3b15 | 7471 | printf("%.3llf\n", d); |
cf2093f6 JH |
7472 | } |
7473 | EOCP | |
7474 | set try | |
7475 | if eval $compile; then | |
7476 | yyy=`./try$exe_ext` | |
7477 | case "$yyy" in | |
7478 | 123.456) | |
ea1c3b15 JH |
7479 | sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; |
7480 | sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"'; | |
7481 | echo "We will use %llf." | |
cf2093f6 JH |
7482 | ;; |
7483 | esac | |
7484 | fi | |
7485 | fi | |
7486 | ||
7487 | if $test X"$sPRIfldbl" = X; then | |
7488 | $cat >try.c <<'EOCP' | |
7489 | #include <sys/types.h> | |
7490 | #include <stdio.h> | |
7491 | int main() { | |
7492 | long double d = 123.456; | |
ea1c3b15 | 7493 | printf("%.3Lf\n", d); |
cf2093f6 JH |
7494 | } |
7495 | EOCP | |
7496 | set try | |
7497 | if eval $compile; then | |
7498 | yyy=`./try$exe_ext` | |
7499 | case "$yyy" in | |
7500 | 123.456) | |
ea1c3b15 JH |
7501 | sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; |
7502 | sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"'; | |
7503 | echo "We will use %Lf." | |
cf2093f6 JH |
7504 | ;; |
7505 | esac | |
7506 | fi | |
7507 | fi | |
7508 | ||
11dc3f68 | 7509 | if $test X"$sPRIfldbl" = X; then |
cf2093f6 JH |
7510 | $cat >try.c <<'EOCP' |
7511 | #include <sys/types.h> | |
7512 | #include <stdio.h> | |
7513 | int main() { | |
7514 | long double d = 123.456; | |
ea1c3b15 | 7515 | printf("%.3lf\n", d); |
cf2093f6 JH |
7516 | } |
7517 | EOCP | |
7518 | set try | |
7519 | if eval $compile; then | |
7520 | yyy=`./try$exe_ext` | |
7521 | case "$yyy" in | |
7522 | 123.456) | |
ea1c3b15 JH |
7523 | sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; |
7524 | sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"'; | |
7525 | echo "We will use %lf." | |
cf2093f6 JH |
7526 | ;; |
7527 | esac | |
7528 | fi | |
7529 | fi | |
7530 | ||
09e3ef00 JH |
7531 | if $test X"$sPRIfldbl" = X; then |
7532 | echo "Cannot figure out how to print long doubles." >&4 | |
7533 | fi | |
7534 | ||
ea1c3b15 | 7535 | $rm -f try try.* |
cf2093f6 | 7536 | |
ea1c3b15 | 7537 | fi # d_longdbl |
cf2093f6 JH |
7538 | |
7539 | case "$sPRIfldbl" in | |
7540 | '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; | |
7541 | d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef"; | |
7542 | ;; | |
7543 | *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; | |
7544 | d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define"; | |
7545 | ;; | |
7546 | esac | |
7547 | ||
bbe6c963 JH |
7548 | : Check how to convert floats to strings. |
7549 | if test "X$d_Gconvert" = X; then | |
7550 | echo " " | |
7551 | echo "Checking for an efficient way to convert floats to strings." | |
7552 | echo " " > try.c | |
7553 | case "$uselongdouble" in | |
7554 | "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;; | |
7555 | esac | |
7556 | case "$d_longdbl" in | |
7557 | "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;; | |
7558 | esac | |
7559 | case "$d_PRIgldbl" in | |
7560 | "$define") echo "#define HAS_PRIgldbl" >>try.c ;; | |
7561 | esac | |
7562 | $cat >>try.c <<EOP | |
7563 | #ifdef TRY_gconvert | |
7564 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) | |
7565 | char *myname = "gconvert"; | |
7566 | #endif | |
7567 | #ifdef TRY_gcvt | |
7568 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) | |
7569 | char *myname = "gcvt"; | |
7570 | #endif | |
7571 | #ifdef TRY_qgcvt | |
7572 | #define Gconvert(x,n,t,b) qgcvt((x),(n),(b)) | |
7573 | char *myname = "qgcvt"; | |
7574 | #define DOUBLETYPE long double | |
7575 | #endif | |
7576 | #ifdef TRY_sprintf | |
7577 | #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl) | |
7578 | #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x)) | |
7579 | #else | |
7580 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) | |
7581 | #endif | |
7582 | char *myname = "sprintf"; | |
7583 | #endif | |
7584 | ||
7585 | #ifndef DOUBLETYPE | |
7586 | #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) | |
7587 | #define DOUBLETYPE long double | |
7588 | #else | |
7589 | #define DOUBLETYPE double | |
7590 | #endif | |
7591 | #endif | |
7592 | ||
7593 | #include <stdio.h> | |
7594 | ||
7595 | #define I_STDLIB $i_stdlib | |
7596 | #ifdef I_STDLIB | |
7597 | #include <stdlib.h> | |
7598 | #endif | |
7599 | ||
7600 | int | |
7601 | checkit(expect, got) | |
7602 | char *expect; | |
7603 | char *got; | |
7604 | { | |
7605 | if (strcmp(expect, got)) { | |
7606 | printf("%s oddity: Expected %s, got %s\n", | |
7607 | myname, expect, got); | |
7608 | exit(1); | |
7609 | } | |
7610 | } | |
7611 | ||
7612 | int main() | |
7613 | { | |
7614 | char buf[64]; | |
7615 | buf[63] = '\0'; | |
7616 | ||
7617 | /* This must be 1st test on (which?) platform */ | |
7618 | /* Alan Burlison <AlanBurlsin@unn.unisys.com> */ | |
7619 | Gconvert((DOUBLETYPE)0.1, 8, 0, buf); | |
7620 | checkit("0.1", buf); | |
7621 | ||
7622 | Gconvert((DOUBLETYPE)1.0, 8, 0, buf); | |
7623 | checkit("1", buf); | |
7624 | ||
7625 | Gconvert((DOUBLETYPE)1.1, 8, 0, buf); | |
7626 | checkit("1.1", buf); | |
7627 | ||
7628 | Gconvert((DOUBLETYPE)1.01, 8, 0, buf); | |
7629 | checkit("1.01", buf); | |
7630 | ||
7631 | Gconvert((DOUBLETYPE)1.001, 8, 0, buf); | |
7632 | checkit("1.001", buf); | |
7633 | ||
7634 | Gconvert((DOUBLETYPE)1.0001, 8, 0, buf); | |
7635 | checkit("1.0001", buf); | |
7636 | ||
7637 | Gconvert((DOUBLETYPE)1.00001, 8, 0, buf); | |
7638 | checkit("1.00001", buf); | |
7639 | ||
7640 | Gconvert((DOUBLETYPE)1.000001, 8, 0, buf); | |
7641 | checkit("1.000001", buf); | |
7642 | ||
7643 | Gconvert((DOUBLETYPE)0.0, 8, 0, buf); | |
7644 | checkit("0", buf); | |
7645 | ||
7646 | Gconvert((DOUBLETYPE)-1.0, 8, 0, buf); | |
7647 | checkit("-1", buf); | |
7648 | ||
7649 | /* Some Linux gcvt's give 1.e+5 here. */ | |
7650 | Gconvert((DOUBLETYPE)100000.0, 8, 0, buf); | |
7651 | checkit("100000", buf); | |
7652 | ||
7653 | /* Some Linux gcvt's give -1.e+5 here. */ | |
7654 | Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf); | |
7655 | checkit("-100000", buf); | |
7656 | ||
7657 | exit(0); | |
7658 | } | |
7659 | EOP | |
7660 | case "$d_Gconvert" in | |
7661 | gconvert*) xxx_list='gconvert gcvt sprintf' ;; | |
7662 | gcvt*) xxx_list='gcvt gconvert sprintf' ;; | |
7663 | sprintf*) xxx_list='sprintf gconvert gcvt' ;; | |
7664 | *) xxx_list='gconvert gcvt sprintf' ;; | |
7665 | esac | |
7666 | ||
7667 | case "$d_longdbl$uselongdouble$d_qgcvt" in | |
7668 | "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;; | |
7669 | esac | |
7670 | ||
7671 | for xxx_convert in $xxx_list; do | |
7672 | echo "Trying $xxx_convert..." | |
7673 | $rm -f try try$_o | |
7674 | set try -DTRY_$xxx_convert | |
7675 | if eval $compile; then | |
7676 | echo "$xxx_convert() found." >&4 | |
7677 | if ./try; then | |
7678 | echo "I'll use $xxx_convert to convert floats into a string." >&4 | |
7679 | break; | |
7680 | else | |
7681 | echo "...But $xxx_convert didn't work as I expected." | |
7682 | fi | |
7683 | else | |
7684 | echo "$xxx_convert NOT found." >&4 | |
7685 | fi | |
7686 | done | |
7687 | ||
7688 | case "$xxx_convert" in | |
7689 | gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; | |
7690 | gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; | |
7691 | qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;; | |
7692 | *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in | |
7693 | "$define$define$define") | |
7694 | d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;; | |
7695 | *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; | |
7696 | esac | |
7697 | ;; | |
7698 | esac | |
7699 | fi | |
7700 | ||
a0d0e21e LW |
7701 | : Initialize h_fcntl |
7702 | h_fcntl=false | |
7703 | ||
7704 | : Initialize h_sysfile | |
7705 | h_sysfile=false | |
2304df62 | 7706 | |
2304df62 AD |
7707 | : access call always available on UNIX |
7708 | set access d_access | |
7709 | eval $inlibc | |
7710 | ||
7711 | : locate the flags for 'access()' | |
7712 | case "$d_access" in | |
7713 | "$define") | |
7714 | echo " " | |
7715 | $cat >access.c <<'EOCP' | |
7716 | #include <sys/types.h> | |
7717 | #ifdef I_FCNTL | |
7718 | #include <fcntl.h> | |
7719 | #endif | |
7720 | #ifdef I_SYS_FILE | |
7721 | #include <sys/file.h> | |
7722 | #endif | |
7723 | #ifdef I_UNISTD | |
7724 | #include <unistd.h> | |
7725 | #endif | |
d674cd6d | 7726 | int main() { |
2304df62 AD |
7727 | exit(R_OK); |
7728 | } | |
8e07c86e AD |
7729 | EOCP |
7730 | : check sys/file.h first, no particular reason here | |
7731 | if $test `./findhdr sys/file.h` && \ | |
dfe9444c | 7732 | $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then |
8e07c86e AD |
7733 | h_sysfile=true; |
7734 | echo "<sys/file.h> defines the *_OK access constants." >&4 | |
7735 | elif $test `./findhdr fcntl.h` && \ | |
dfe9444c | 7736 | $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then |
8e07c86e AD |
7737 | h_fcntl=true; |
7738 | echo "<fcntl.h> defines the *_OK access constants." >&4 | |
7739 | elif $test `./findhdr unistd.h` && \ | |
dfe9444c | 7740 | $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then |
8e07c86e AD |
7741 | echo "<unistd.h> defines the *_OK access constants." >&4 |
7742 | else | |
7743 | echo "I can't find the four *_OK access constants--I'll use mine." >&4 | |
7744 | fi | |
7745 | ;; | |
7746 | esac | |
7747 | $rm -f access* | |
a0d0e21e | 7748 | |
5ff3f7a4 GS |
7749 | : see if accessx exists |
7750 | set accessx d_accessx | |
7751 | eval $inlibc | |
7752 | ||
8e07c86e AD |
7753 | : see if alarm exists |
7754 | set alarm d_alarm | |
7755 | eval $inlibc | |
2304df62 | 7756 | |
cf2093f6 JH |
7757 | : see if atolf exists |
7758 | set atolf d_atolf | |
7759 | eval $inlibc | |
7760 | ||
7761 | : see if atoll exists | |
7762 | set atoll d_atoll | |
7763 | eval $inlibc | |
7764 | ||
ecfc5424 | 7765 | : Look for GNU-cc style attribute checking |
2304df62 | 7766 | echo " " |
a0d0e21e LW |
7767 | echo "Checking whether your compiler can handle __attribute__ ..." >&4 |
7768 | $cat >attrib.c <<'EOCP' | |
1aef975c | 7769 | #include <stdio.h> |
ecfc5424 | 7770 | void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn)); |
a0d0e21e LW |
7771 | EOCP |
7772 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then | |
7773 | if $contains 'warning' attrib.out >/dev/null 2>&1; then | |
ecfc5424 | 7774 | echo "Your C compiler doesn't fully support __attribute__." |
a0d0e21e LW |
7775 | val="$undef" |
7776 | else | |
ecfc5424 | 7777 | echo "Your C compiler supports __attribute__." |
a0d0e21e LW |
7778 | val="$define" |
7779 | fi | |
7780 | else | |
ecfc5424 | 7781 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
a0d0e21e LW |
7782 | val="$undef" |
7783 | fi | |
ecfc5424 | 7784 | set d_attribut |
a0d0e21e LW |
7785 | eval $setvar |
7786 | $rm -f attrib* | |
7787 | ||
7788 | : see if bcmp exists | |
7789 | set bcmp d_bcmp | |
7790 | eval $inlibc | |
7791 | ||
7792 | : see if bcopy exists | |
7793 | set bcopy d_bcopy | |
7794 | eval $inlibc | |
7795 | ||
2afac517 | 7796 | : see if this is a unistd.h system |
7797 | set unistd.h i_unistd | |
7798 | eval $inhdr | |
7799 | ||
7800 | : see if getpgrp exists | |
7801 | set getpgrp d_getpgrp | |
7802 | eval $inlibc | |
7803 | ||
2afac517 | 7804 | case "$d_getpgrp" in |
7805 | "$define") | |
7806 | echo " " | |
dfe9444c | 7807 | echo "Checking to see which flavor of getpgrp is in use..." |
2afac517 | 7808 | $cat >set.c <<EOP |
7809 | #$i_unistd I_UNISTD | |
7810 | #include <sys/types.h> | |
7811 | #ifdef I_UNISTD | |
7812 | # include <unistd.h> | |
7813 | #endif | |
5a411a32 | 7814 | int main() |
2afac517 | 7815 | { |
7816 | if (getuid() == 0) { | |
7817 | printf("(I see you are running Configure as super-user...)\n"); | |
7818 | setuid(1); | |
7819 | } | |
7820 | #ifdef TRY_BSD_PGRP | |
7821 | if (getpgrp(1) == 0) | |
7822 | exit(0); | |
7823 | #else | |
7824 | if (getpgrp() > 0) | |
7825 | exit(0); | |
7826 | #endif | |
7827 | exit(1); | |
7828 | } | |
7829 | EOP | |
7830 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
7831 | echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 | |
7832 | val="$define" | |
7833 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
7834 | echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 | |
7835 | val="$undef" | |
7836 | else | |
7837 | echo "I can't seem to compile and run the test program." | |
7838 | if ./usg; then | |
7839 | xxx="a USG one, i.e. you use getpgrp()." | |
7840 | else | |
7841 | # SVR4 systems can appear rather BSD-ish. | |
7842 | case "$i_unistd" in | |
7843 | $undef) | |
7844 | xxx="a BSD one, i.e. you use getpgrp(pid)." | |
7845 | val="$define" | |
7846 | ;; | |
7847 | $define) | |
7848 | xxx="probably a USG one, i.e. you use getpgrp()." | |
7849 | val="$undef" | |
7850 | ;; | |
7851 | esac | |
7852 | fi | |
7853 | echo "Assuming your getpgrp is $xxx" >&4 | |
7854 | fi | |
7855 | ;; | |
7856 | *) val="$undef";; | |
7857 | esac | |
7858 | set d_bsdgetpgrp | |
7859 | eval $setvar | |
7860 | $rm -f set set.c | |
7861 | ||
a0d0e21e LW |
7862 | : see if setpgrp exists |
7863 | set setpgrp d_setpgrp | |
7864 | eval $inlibc | |
7865 | ||
a0d0e21e LW |
7866 | case "$d_setpgrp" in |
7867 | "$define") | |
7868 | echo " " | |
dfe9444c | 7869 | echo "Checking to see which flavor of setpgrp is in use..." |
a0d0e21e | 7870 | $cat >set.c <<EOP |
2afac517 | 7871 | #$i_unistd I_UNISTD |
7872 | #include <sys/types.h> | |
7873 | #ifdef I_UNISTD | |
7874 | # include <unistd.h> | |
7875 | #endif | |
5a411a32 | 7876 | int main() |
a0d0e21e LW |
7877 | { |
7878 | if (getuid() == 0) { | |
7879 | printf("(I see you are running Configure as super-user...)\n"); | |
7880 | setuid(1); | |
7881 | } | |
2afac517 | 7882 | #ifdef TRY_BSD_PGRP |
a0d0e21e | 7883 | if (-1 == setpgrp(1, 1)) |
2afac517 | 7884 | exit(0); |
7885 | #else | |
7886 | if (setpgrp() != -1) | |
7887 | exit(0); | |
7888 | #endif | |
7889 | exit(1); | |
a0d0e21e LW |
7890 | } |
7891 | EOP | |
2afac517 | 7892 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
7893 | echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 | |
7894 | val="$define" | |
7895 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
7896 | echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 | |
7897 | val="$undef" | |
a0d0e21e | 7898 | else |
dfe9444c | 7899 | echo "(I can't seem to compile and run the test program.)" |
ecfc5424 | 7900 | if ./usg; then |
2afac517 | 7901 | xxx="a USG one, i.e. you use setpgrp()." |
a0d0e21e | 7902 | else |
2afac517 | 7903 | # SVR4 systems can appear rather BSD-ish. |
7904 | case "$i_unistd" in | |
7905 | $undef) | |
7906 | xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." | |
7907 | val="$define" | |
7908 | ;; | |
7909 | $define) | |
7910 | xxx="probably a USG one, i.e. you use setpgrp()." | |
7911 | val="$undef" | |
7912 | ;; | |
7913 | esac | |
a0d0e21e | 7914 | fi |
2afac517 | 7915 | echo "Assuming your setpgrp is $xxx" >&4 |
a0d0e21e LW |
7916 | fi |
7917 | ;; | |
7918 | *) val="$undef";; | |
7919 | esac | |
2afac517 | 7920 | set d_bsdsetpgrp |
a0d0e21e LW |
7921 | eval $setvar |
7922 | $rm -f set set.c | |
a0d0e21e LW |
7923 | : see if bzero exists |
7924 | set bzero d_bzero | |
7925 | eval $inlibc | |
7926 | ||
ecfc5424 | 7927 | : see if signal is declared as pointer to function returning int or void |
a0d0e21e | 7928 | echo " " |
ecfc5424 AD |
7929 | xxx=`./findhdr signal.h` |
7930 | $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null | |
7931 | if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
7932 | echo "You have int (*signal())() instead of void." >&4 | |
7933 | val="$undef" | |
7934 | elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
dfe9444c | 7935 | echo "You have void (*signal())()." >&4 |
ecfc5424 AD |
7936 | val="$define" |
7937 | elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then | |
7938 | echo "You have int (*signal())() instead of void." >&4 | |
7939 | val="$undef" | |
dfe9444c AD |
7940 | elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then |
7941 | echo "You have void (*signal())()." >&4 | |
7942 | val="$define" | |
a0d0e21e | 7943 | else |
ecfc5424 AD |
7944 | case "$d_voidsig" in |
7945 | '') | |
7946 | echo "I can't determine whether signal handler returns void or int..." >&4 | |
7947 | dflt=void | |
7948 | rp="What type does your signal handler return?" | |
7949 | . ./myread | |
7950 | case "$ans" in | |
7951 | v*) val="$define";; | |
7952 | *) val="$undef";; | |
7953 | esac;; | |
7954 | "$define") | |
dfe9444c AD |
7955 | echo "As you already told me, signal handler returns void." >&4 |
7956 | val="$define" | |
7957 | ;; | |
7958 | *) echo "As you already told me, signal handler returns int." >&4 | |
7959 | val="$undef" | |
7960 | ;; | |
ecfc5424 AD |
7961 | esac |
7962 | fi | |
7963 | set d_voidsig | |
7964 | eval $setvar | |
7965 | case "$d_voidsig" in | |
7966 | "$define") signal_t="void";; | |
7967 | *) signal_t="int";; | |
7968 | esac | |
7969 | $rm -f $$.tmp | |
7970 | ||
7971 | : check for ability to cast large floats to 32-bit ints. | |
7972 | echo " " | |
7973 | echo 'Checking whether your C compiler can cast large floats to int32.' >&4 | |
e5c9fcd0 | 7974 | if $test "$intsize" -ge 4; then |
ecfc5424 AD |
7975 | xxx=int |
7976 | else | |
7977 | xxx=long | |
7978 | fi | |
7979 | $cat >try.c <<EOCP | |
e5c9fcd0 | 7980 | #include <stdio.h> |
ecfc5424 AD |
7981 | #include <sys/types.h> |
7982 | #include <signal.h> | |
a1896f58 | 7983 | $signal_t blech(s) int s; { exit(3); } |
d674cd6d | 7984 | int main() |
2304df62 | 7985 | { |
a0d0e21e | 7986 | $xxx i32; |
e5c9fcd0 | 7987 | double f, g; |
2304df62 | 7988 | int result = 0; |
89434db5 | 7989 | char str[16]; |
2304df62 AD |
7990 | signal(SIGFPE, blech); |
7991 | ||
89434db5 AD |
7992 | /* Don't let compiler optimize the test away. Store the number |
7993 | in a writable string for gcc to pass to sscanf under HP/UX. | |
7994 | */ | |
7995 | sprintf(str, "2147483647"); | |
7996 | sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */ | |
e5c9fcd0 AD |
7997 | g = 10 * f; |
7998 | i32 = ($xxx) g; | |
2304df62 | 7999 | |
e5c9fcd0 AD |
8000 | /* x86 processors will probably give 0x8000 0000, which is a |
8001 | sign change. We don't want that. We want to mimic SPARC | |
8002 | behavior here, which is to preserve the sign and give | |
8003 | back 0x7fff ffff. | |
8004 | */ | |
a0d0e21e | 8005 | if (i32 != ($xxx) f) |
2304df62 AD |
8006 | result |= 1; |
8007 | exit(result); | |
8008 | } | |
8009 | EOCP | |
dfe9444c | 8010 | set try |
dc45a647 | 8011 | if eval $compile_ok; then |
2304df62 AD |
8012 | ./try |
8013 | yyy=$? | |
8014 | else | |
a0d0e21e | 8015 | echo "(I can't seem to compile the test program--assuming it can't)" |
2304df62 AD |
8016 | yyy=1 |
8017 | fi | |
8018 | case "$yyy" in | |
8019 | 0) val="$define" | |
8020 | echo "Yup, it can." | |
8021 | ;; | |
8022 | *) val="$undef" | |
8023 | echo "Nope, it can't." | |
8024 | ;; | |
8025 | esac | |
8026 | set d_casti32 | |
8027 | eval $setvar | |
85e6fe83 | 8028 | $rm -f try try.* |
a0d0e21e | 8029 | |
2304df62 AD |
8030 | : check for ability to cast negative floats to unsigned |
8031 | echo " " | |
8032 | echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 | |
ecfc5424 | 8033 | $cat >try.c <<EOCP |
e5c9fcd0 | 8034 | #include <stdio.h> |
ecfc5424 | 8035 | #include <sys/types.h> |
2304df62 | 8036 | #include <signal.h> |
a1896f58 AD |
8037 | $signal_t blech(s) int s; { exit(7); } |
8038 | $signal_t blech_in_list(s) int s; { exit(4); } | |
232e078e AD |
8039 | unsigned long dummy_long(p) unsigned long p; { return p; } |
8040 | unsigned int dummy_int(p) unsigned int p; { return p; } | |
8041 | unsigned short dummy_short(p) unsigned short p; { return p; } | |
d674cd6d | 8042 | int main() |
2304df62 | 8043 | { |
e5c9fcd0 | 8044 | double f; |
2304df62 AD |
8045 | unsigned long along; |
8046 | unsigned int aint; | |
8047 | unsigned short ashort; | |
8048 | int result = 0; | |
89434db5 AD |
8049 | char str[16]; |
8050 | ||
e5c9fcd0 AD |
8051 | /* Frustrate gcc-2.7.2's optimizer which failed this test with |
8052 | a direct f = -123. assignment. gcc-2.8.0 reportedly | |
8053 | optimized the whole file away | |
8054 | */ | |
89434db5 AD |
8055 | /* Store the number in a writable string for gcc to pass to |
8056 | sscanf under HP/UX. | |
8057 | */ | |
8058 | sprintf(str, "-123"); | |
8059 | sscanf(str, "%lf", &f); /* f = -123.; */ | |
2304df62 AD |
8060 | |
8061 | signal(SIGFPE, blech); | |
8062 | along = (unsigned long)f; | |
8063 | aint = (unsigned int)f; | |
8064 | ashort = (unsigned short)f; | |
8065 | if (along != (unsigned long)-123) | |
8066 | result |= 1; | |
8067 | if (aint != (unsigned int)-123) | |
8068 | result |= 1; | |
8069 | if (ashort != (unsigned short)-123) | |
8070 | result |= 1; | |
89434db5 AD |
8071 | sprintf(str, "1073741824."); |
8072 | sscanf(str, "%lf", &f); /* f = (double)0x40000000; */ | |
2304df62 AD |
8073 | f = f + f; |
8074 | along = 0; | |
8075 | along = (unsigned long)f; | |
8076 | if (along != 0x80000000) | |
8077 | result |= 2; | |
8078 | f -= 1.; | |
8079 | along = 0; | |
8080 | along = (unsigned long)f; | |
8081 | if (along != 0x7fffffff) | |
8082 | result |= 1; | |
8083 | f += 2.; | |
8084 | along = 0; | |
8085 | along = (unsigned long)f; | |
8086 | if (along != 0x80000001) | |
8087 | result |= 2; | |
232e078e AD |
8088 | if (result) |
8089 | exit(result); | |
8090 | signal(SIGFPE, blech_in_list); | |
89434db5 AD |
8091 | sprintf(str, "123."); |
8092 | sscanf(str, "%lf", &f); /* f = 123.; */ | |
232e078e AD |
8093 | along = dummy_long((unsigned long)f); |
8094 | aint = dummy_int((unsigned int)f); | |
8095 | ashort = dummy_short((unsigned short)f); | |
8096 | if (along != (unsigned long)123) | |
8097 | result |= 4; | |
8098 | if (aint != (unsigned int)123) | |
8099 | result |= 4; | |
8100 | if (ashort != (unsigned short)123) | |
8101 | result |= 4; | |
2304df62 AD |
8102 | exit(result); |
8103 | ||
8104 | } | |
8105 | EOCP | |
dfe9444c | 8106 | set try |
dc45a647 | 8107 | if eval $compile_ok; then |
2304df62 AD |
8108 | ./try |
8109 | castflags=$? | |
8110 | else | |
ecfc5424 | 8111 | echo "(I can't seem to compile the test program--assuming it can't)" |
232e078e | 8112 | castflags=7 |
2304df62 AD |
8113 | fi |
8114 | case "$castflags" in | |
8115 | 0) val="$define" | |
8116 | echo "Yup, it can." | |
8117 | ;; | |
8118 | *) val="$undef" | |
8119 | echo "Nope, it can't." | |
8120 | ;; | |
8121 | esac | |
8122 | set d_castneg | |
8123 | eval $setvar | |
8124 | $rm -f try.* | |
8125 | ||
2304df62 AD |
8126 | : see if vprintf exists |
8127 | echo " " | |
8128 | if set vprintf val -f d_vprintf; eval $csym; $val; then | |
8129 | echo 'vprintf() found.' >&4 | |
8130 | val="$define" | |
8131 | $cat >vprintf.c <<'EOF' | |
8132 | #include <varargs.h> | |
8133 | ||
d674cd6d | 8134 | int main() { xxx("foo"); } |
2304df62 AD |
8135 | |
8136 | xxx(va_alist) | |
8137 | va_dcl | |
8138 | { | |
8139 | va_list args; | |
8140 | char buf[10]; | |
8141 | ||
8142 | va_start(args); | |
8143 | exit((unsigned long)vsprintf(buf,"%s",args) > 10L); | |
8144 | } | |
8145 | EOF | |
dfe9444c AD |
8146 | set vprintf |
8147 | if eval $compile && ./vprintf; then | |
2304df62 AD |
8148 | echo "Your vsprintf() returns (int)." >&4 |
8149 | val2="$undef" | |
8150 | else | |
8151 | echo "Your vsprintf() returns (char*)." >&4 | |
8152 | val2="$define" | |
8153 | fi | |
8154 | else | |
8155 | echo 'vprintf() NOT found.' >&4 | |
8156 | val="$undef" | |
8157 | val2="$undef" | |
8158 | fi | |
8159 | set d_vprintf | |
8160 | eval $setvar | |
8161 | val=$val2 | |
8162 | set d_charvspr | |
8163 | eval $setvar | |
8164 | ||
a0d0e21e LW |
8165 | : see if chown exists |
8166 | set chown d_chown | |
8167 | eval $inlibc | |
8168 | ||
8169 | : see if chroot exists | |
8170 | set chroot d_chroot | |
8171 | eval $inlibc | |
8172 | ||
2304df62 AD |
8173 | : see if chsize exists |
8174 | set chsize d_chsize | |
8175 | eval $inlibc | |
8176 | ||
8177 | : check for const keyword | |
8178 | echo " " | |
8179 | echo 'Checking to see if your C compiler knows about "const"...' >&4 | |
8180 | $cat >const.c <<'EOCP' | |
8181 | typedef struct spug { int drokk; } spug; | |
5a411a32 | 8182 | int main() |
2304df62 AD |
8183 | { |
8184 | const char *foo; | |
8185 | const spug y; | |
8186 | } | |
8187 | EOCP | |
8188 | if $cc -c $ccflags const.c >/dev/null 2>&1 ; then | |
8189 | val="$define" | |
8190 | echo "Yup, it does." | |
8191 | else | |
8192 | val="$undef" | |
8193 | echo "Nope, it doesn't." | |
8194 | fi | |
8195 | set d_const | |
8196 | eval $setvar | |
8197 | ||
8198 | : see if crypt exists | |
8199 | echo " " | |
8200 | if set crypt val -f d_crypt; eval $csym; $val; then | |
8201 | echo 'crypt() found.' >&4 | |
8202 | val="$define" | |
8203 | cryptlib='' | |
8204 | else | |
dfe9444c | 8205 | cryptlib=`./loc Slibcrypt$_a "" $xlibpth` |
2304df62 | 8206 | if $test -z "$cryptlib"; then |
dfe9444c | 8207 | cryptlib=`./loc Mlibcrypt$_a "" $xlibpth` |
2304df62 AD |
8208 | else |
8209 | cryptlib=-lcrypt | |
8210 | fi | |
8211 | if $test -z "$cryptlib"; then | |
dfe9444c | 8212 | cryptlib=`./loc Llibcrypt$_a "" $xlibpth` |
2304df62 AD |
8213 | else |
8214 | cryptlib=-lcrypt | |
8215 | fi | |
8216 | if $test -z "$cryptlib"; then | |
dfe9444c | 8217 | cryptlib=`./loc libcrypt$_a "" $libpth` |
2304df62 AD |
8218 | else |
8219 | cryptlib=-lcrypt | |
8220 | fi | |
8221 | if $test -z "$cryptlib"; then | |
8222 | echo 'crypt() NOT found.' >&4 | |
8223 | val="$undef" | |
8224 | else | |
8225 | val="$define" | |
8226 | fi | |
8227 | fi | |
8228 | set d_crypt | |
8229 | eval $setvar | |
8230 | ||
921b2963 JH |
8231 | : get csh whereabouts |
8232 | case "$csh" in | |
8233 | 'csh') val="$undef" ;; | |
8234 | *) val="$define" ;; | |
8235 | esac | |
8236 | set d_csh | |
8237 | eval $setvar | |
8238 | : Respect a hint or command line value for full_csh. | |
8239 | case "$full_csh" in | |
8240 | '') full_csh=$csh ;; | |
8241 | esac | |
8242 | ||
a0d0e21e LW |
8243 | : see if cuserid exists |
8244 | set cuserid d_cuserid | |
2304df62 AD |
8245 | eval $inlibc |
8246 | ||
a0d0e21e LW |
8247 | : see if this is a limits.h system |
8248 | set limits.h i_limits | |
85e6fe83 LW |
8249 | eval $inhdr |
8250 | ||
a0d0e21e LW |
8251 | : see if this is a float.h system |
8252 | set float.h i_float | |
8253 | eval $inhdr | |
8254 | ||
8255 | : See if number of significant digits in a double precision number is known | |
8256 | echo " " | |
8257 | $cat >dbl_dig.c <<EOM | |
8258 | #$i_limits I_LIMITS | |
8259 | #$i_float I_FLOAT | |
8260 | #ifdef I_LIMITS | |
8261 | #include <limits.h> | |
85e6fe83 | 8262 | #endif |
a0d0e21e LW |
8263 | #ifdef I_FLOAT |
8264 | #include <float.h> | |
8265 | #endif | |
8266 | #ifdef DBL_DIG | |
8267 | printf("Contains DBL_DIG"); | |
85e6fe83 | 8268 | #endif |
85e6fe83 | 8269 | EOM |
a0d0e21e LW |
8270 | $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null |
8271 | if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then | |
8272 | echo "DBL_DIG found." >&4 | |
8273 | val="$define" | |
2304df62 | 8274 | else |
a0d0e21e LW |
8275 | echo "DBL_DIG NOT found." >&4 |
8276 | val="$undef" | |
2304df62 | 8277 | fi |
a0d0e21e LW |
8278 | $rm -f dbl_dig.? |
8279 | set d_dbl_dig | |
2304df62 | 8280 | eval $setvar |
2304df62 | 8281 | |
a0d0e21e LW |
8282 | : see if difftime exists |
8283 | set difftime d_difftime | |
2304df62 AD |
8284 | eval $inlibc |
8285 | ||
a0d0e21e LW |
8286 | : see if this is a dirent system |
8287 | echo " " | |
8288 | if xinc=`./findhdr dirent.h`; $test "$xinc"; then | |
8289 | val="$define" | |
8290 | echo "<dirent.h> found." >&4 | |
8291 | else | |
8292 | val="$undef" | |
8293 | if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then | |
8294 | echo "<sys/dir.h> found." >&4 | |
8295 | echo " " | |
8296 | else | |
8297 | xinc=`./findhdr sys/ndir.h` | |
8298 | fi | |
8299 | echo "<dirent.h> NOT found." >&4 | |
8300 | fi | |
8301 | set i_dirent | |
8302 | eval $setvar | |
8303 | ||
8304 | : Look for type of directory structure. | |
8305 | echo " " | |
8306 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
8307 | ||
8308 | case "$direntrytype" in | |
8309 | ''|' ') | |
8310 | case "$i_dirent" in | |
8311 | $define) guess1='struct dirent' ;; | |
8312 | *) guess1='struct direct' ;; | |
2afac517 | 8313 | esac |
8314 | ;; | |
8315 | *) guess1="$direntrytype" | |
8316 | ;; | |
8e07c86e AD |
8317 | esac |
8318 | ||
2afac517 | 8319 | case "$guess1" in |
8320 | 'struct dirent') guess2='struct direct' ;; | |
8321 | *) guess2='struct dirent' ;; | |
8322 | esac | |
8323 | ||
8324 | if $contains "$guess1" try.c >/dev/null 2>&1; then | |
8325 | direntrytype="$guess1" | |
8326 | echo "Your directory entries are $direntrytype." >&4 | |
8327 | elif $contains "$guess2" try.c >/dev/null 2>&1; then | |
8328 | direntrytype="$guess2" | |
8329 | echo "Your directory entries seem to be $direntrytype." >&4 | |
8330 | else | |
8331 | echo "I don't recognize your system's directory entries." >&4 | |
8332 | rp="What type is used for directory entries on this system?" | |
8333 | dflt="$guess1" | |
8334 | . ./myread | |
8335 | direntrytype="$ans" | |
8336 | fi | |
8337 | $rm -f try.c | |
a0d0e21e | 8338 | |
a0d0e21e | 8339 | |
2afac517 | 8340 | : see if the directory entry stores field length |
8341 | echo " " | |
8342 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
8343 | if $contains 'd_namlen' try.c >/dev/null 2>&1; then | |
8344 | echo "Good, your directory entry keeps length information in d_namlen." >&4 | |
8345 | val="$define" | |
8346 | else | |
8347 | echo "Your directory entry does not know about the d_namlen field." >&4 | |
8348 | val="$undef" | |
8349 | fi | |
8350 | set d_dirnamlen | |
8351 | eval $setvar | |
8352 | $rm -f try.c | |
a0d0e21e | 8353 | |
5ff3f7a4 GS |
8354 | : see if dlerror exists |
8355 | xxx_runnm="$runnm" | |
8356 | runnm=false | |
8357 | set dlerror d_dlerror | |
8358 | eval $inlibc | |
8359 | runnm="$xxx_runnm" | |
8360 | ||
8361 | : see if dlfcn is available | |
8362 | set dlfcn.h i_dlfcn | |
8363 | eval $inhdr | |
8364 | ||
8365 | case "$usedl" in | |
8366 | $define|y|true) | |
8367 | $cat << EOM | |
8368 | ||
8369 | On a few systems, the dynamically loaded modules that perl generates and uses | |
8370 | will need a different extension than shared libs. The default will probably | |
8371 | be appropriate. | |
8372 | ||
8373 | EOM | |
8374 | case "$dlext" in | |
8375 | '') dflt="$so" ;; | |
8376 | *) dflt="$dlext" ;; | |
8377 | esac | |
8378 | rp='What is the extension of dynamically loaded modules' | |
8379 | . ./myread | |
8380 | dlext="$ans" | |
8381 | ;; | |
8382 | *) | |
8383 | dlext="none" | |
8384 | ;; | |
8385 | esac | |
8386 | ||
8387 | : Check if dlsym need a leading underscore | |
a0d0e21e LW |
8388 | echo " " |
8389 | val="$undef" | |
8390 | ||
8391 | case "$dlsrc" in | |
8392 | dl_dlopen.xs) | |
8393 | echo "Checking whether your dlsym() needs a leading underscore ..." >&4 | |
8394 | $cat >dyna.c <<'EOM' | |
8395 | fred () { } | |
8396 | EOM | |
8397 | ||
8398 | $cat >fred.c<<EOM | |
8399 | ||
8400 | #include <stdio.h> | |
8401 | #$i_dlfcn I_DLFCN | |
8402 | #ifdef I_DLFCN | |
8403 | #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */ | |
8404 | #else | |
8405 | #include <sys/types.h> | |
8406 | #include <nlist.h> | |
8407 | #include <link.h> | |
8408 | #endif | |
8409 | ||
8410 | extern int fred() ; | |
8411 | ||
5a411a32 | 8412 | int main() |
a0d0e21e LW |
8413 | { |
8414 | void * handle ; | |
8415 | void * symbol ; | |
8416 | #ifndef RTLD_LAZY | |
8417 | int mode = 1 ; | |
8418 | #else | |
8419 | int mode = RTLD_LAZY ; | |
8420 | #endif | |
8421 | handle = dlopen("./dyna.$dlext", mode) ; | |
8422 | if (handle == NULL) { | |
5f05dabc | 8423 | printf ("1\n") ; |
8424 | fflush (stdout) ; | |
8425 | exit(0); | |
a0d0e21e LW |
8426 | } |
8427 | symbol = dlsym(handle, "fred") ; | |
8428 | if (symbol == NULL) { | |
5f05dabc | 8429 | /* try putting a leading underscore */ |
8430 | symbol = dlsym(handle, "_fred") ; | |
8431 | if (symbol == NULL) { | |
8432 | printf ("2\n") ; | |
8433 | fflush (stdout) ; | |
8434 | exit(0); | |
8435 | } | |
8436 | printf ("3\n") ; | |
a0d0e21e LW |
8437 | } |
8438 | else | |
5f05dabc | 8439 | printf ("4\n") ; |
36477c24 | 8440 | fflush (stdout) ; |
8441 | exit(0); | |
a0d0e21e LW |
8442 | } |
8443 | EOM | |
760ac839 | 8444 | : Call the object file tmp-dyna.o in case dlext=o. |
a0d0e21e | 8445 | if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && |
dfe9444c AD |
8446 | mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && |
8447 | $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 && | |
87563a30 | 8448 | $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then |
a0d0e21e LW |
8449 | xxx=`./fred` |
8450 | case $xxx in | |
8451 | 1) echo "Test program failed using dlopen." >&4 | |
8452 | echo "Perhaps you should not use dynamic loading." >&4;; | |
8453 | 2) echo "Test program failed using dlsym." >&4 | |
8454 | echo "Perhaps you should not use dynamic loading." >&4;; | |
8455 | 3) echo "dlsym needs a leading underscore" >&4 | |
8456 | val="$define" ;; | |
8457 | 4) echo "dlsym doesn't need a leading underscore." >&4;; | |
8458 | esac | |
8459 | else | |
8460 | echo "I can't compile and run the test program." >&4 | |
88d5303d | 8461 | echo "I'm guessing that dlsym doesn't need a leading underscore." >&4 |
a0d0e21e LW |
8462 | fi |
8463 | ;; | |
8464 | esac | |
8465 | ||
a78b0d02 | 8466 | $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.? |
a0d0e21e LW |
8467 | |
8468 | set d_dlsymun | |
8469 | eval $setvar | |
8470 | ||
85ab1d1d JH |
8471 | hasproto='varname=$1; func=$2; shift; shift; |
8472 | while $test $# -ge 2; do | |
8473 | case "$1" in | |
8474 | $define) echo "#include <$2>";; | |
8475 | esac ; | |
8476 | shift 2; | |
8477 | done > try.c; | |
8478 | $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null; | |
8479 | if $contains "$func.*(" tryout.c >/dev/null 2>&1; then | |
8480 | echo "$func() prototype found."; | |
8481 | val="$define"; | |
8482 | else | |
8483 | echo "$func() prototype NOT found."; | |
8484 | val="$undef"; | |
8485 | fi; | |
8486 | set $varname; | |
8487 | eval $setvar; | |
8488 | $rm -f try.c tryout.c' | |
8489 | ||
8490 | : see if prototype for drand48 is available | |
8491 | echo " " | |
8492 | set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h | |
8493 | eval $hasproto | |
8494 | ||
a0d0e21e LW |
8495 | : see if dup2 exists |
8496 | set dup2 d_dup2 | |
8497 | eval $inlibc | |
8498 | ||
5ff3f7a4 GS |
8499 | : see if eaccess exists |
8500 | set eaccess d_eaccess | |
8501 | eval $inlibc | |
8502 | ||
8503 | : see if endgrent exists | |
8504 | set endgrent d_endgrent | |
8505 | eval $inlibc | |
8506 | ||
e5c9fcd0 AD |
8507 | : see if endhostent exists |
8508 | set endhostent d_endhent | |
8509 | eval $inlibc | |
8510 | ||
8511 | : see if endnetent exists | |
8512 | set endnetent d_endnent | |
8513 | eval $inlibc | |
8514 | ||
8515 | : see if endprotoent exists | |
8516 | set endprotoent d_endpent | |
8517 | eval $inlibc | |
8518 | ||
5ff3f7a4 GS |
8519 | : see if endpwent exists |
8520 | set endpwent d_endpwent | |
8521 | eval $inlibc | |
8522 | ||
e5c9fcd0 AD |
8523 | : see if endservent exists |
8524 | set endservent d_endsent | |
8525 | eval $inlibc | |
8526 | ||
f1066039 JH |
8527 | : see if endspent exists |
8528 | set endspent d_endspent | |
8529 | eval $inlibc | |
8530 | ||
8e07c86e AD |
8531 | : Locate the flags for 'open()' |
8532 | echo " " | |
8533 | $cat >open3.c <<'EOCP' | |
8534 | #include <sys/types.h> | |
8535 | #ifdef I_FCNTL | |
8536 | #include <fcntl.h> | |
8537 | #endif | |
8538 | #ifdef I_SYS_FILE | |
8539 | #include <sys/file.h> | |
8540 | #endif | |
d674cd6d | 8541 | int main() { |
8e07c86e AD |
8542 | if(O_RDONLY); |
8543 | #ifdef O_TRUNC | |
8544 | exit(0); | |
8545 | #else | |
8546 | exit(1); | |
8547 | #endif | |
8548 | } | |
8549 | EOCP | |
8550 | : check sys/file.h first to get FREAD on Sun | |
8551 | if $test `./findhdr sys/file.h` && \ | |
dfe9444c | 8552 | set open3 -DI_SYS_FILE && eval $compile; then |
8e07c86e AD |
8553 | h_sysfile=true; |
8554 | echo "<sys/file.h> defines the O_* constants..." >&4 | |
8555 | if ./open3; then | |
8556 | echo "and you have the 3 argument form of open()." >&4 | |
8557 | val="$define" | |
8558 | else | |
8559 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
8560 | val="$undef" | |
8561 | fi | |
8562 | elif $test `./findhdr fcntl.h` && \ | |
dfe9444c | 8563 | set open3 -DI_FCNTL && eval $compile; then |
8e07c86e AD |
8564 | h_fcntl=true; |
8565 | echo "<fcntl.h> defines the O_* constants..." >&4 | |
8566 | if ./open3; then | |
8567 | echo "and you have the 3 argument form of open()." >&4 | |
8568 | val="$define" | |
8569 | else | |
8570 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
8571 | val="$undef" | |
8572 | fi | |
8573 | else | |
8574 | val="$undef" | |
8575 | echo "I can't find the O_* constant definitions! You got problems." >&4 | |
8576 | fi | |
8577 | set d_open3 | |
8578 | eval $setvar | |
8579 | $rm -f open3* | |
8580 | ||
213c275f JH |
8581 | : see which of string.h or strings.h is needed |
8582 | echo " " | |
8583 | strings=`./findhdr string.h` | |
8584 | if $test "$strings" && $test -r "$strings"; then | |
8585 | echo "Using <string.h> instead of <strings.h>." >&4 | |
8586 | val="$define" | |
8587 | else | |
8588 | val="$undef" | |
8589 | strings=`./findhdr strings.h` | |
8590 | if $test "$strings" && $test -r "$strings"; then | |
8591 | echo "Using <strings.h> instead of <string.h>." >&4 | |
8592 | else | |
8593 | echo "No string header found -- You'll surely have problems." >&4 | |
8594 | fi | |
8595 | fi | |
8596 | set i_string | |
8597 | eval $setvar | |
8598 | case "$i_string" in | |
8599 | "$undef") strings=`./findhdr strings.h`;; | |
8600 | *) strings=`./findhdr string.h`;; | |
8601 | esac | |
8602 | ||
8e07c86e AD |
8603 | : check for non-blocking I/O stuff |
8604 | case "$h_sysfile" in | |
8605 | true) echo "#include <sys/file.h>" > head.c;; | |
8606 | *) | |
8607 | case "$h_fcntl" in | |
8608 | true) echo "#include <fcntl.h>" > head.c;; | |
8609 | *) echo "#include <sys/fcntl.h>" > head.c;; | |
8610 | esac | |
8611 | ;; | |
8612 | esac | |
8613 | echo " " | |
8614 | echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 | |
8615 | case "$o_nonblock" in | |
8616 | '') | |
8617 | $cat head.c > try.c | |
8618 | $cat >>try.c <<'EOCP' | |
213c275f | 8619 | #include <stdio.h> |
d674cd6d | 8620 | int main() { |
8e07c86e AD |
8621 | #ifdef O_NONBLOCK |
8622 | printf("O_NONBLOCK\n"); | |
8623 | exit(0); | |
8624 | #endif | |
8625 | #ifdef O_NDELAY | |
8626 | printf("O_NDELAY\n"); | |
8627 | exit(0); | |
8628 | #endif | |
8629 | #ifdef FNDELAY | |
8630 | printf("FNDELAY\n"); | |
8631 | exit(0); | |
8632 | #endif | |
8633 | exit(0); | |
8634 | } | |
8635 | EOCP | |
dfe9444c | 8636 | set try |
dc45a647 | 8637 | if eval $compile_ok; then |
8e07c86e AD |
8638 | o_nonblock=`./try` |
8639 | case "$o_nonblock" in | |
8640 | '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; | |
8641 | *) echo "Seems like we can use $o_nonblock.";; | |
8642 | esac | |
8643 | else | |
8644 | echo "(I can't compile the test program; pray O_NONBLOCK is right!)" | |
8645 | fi | |
8646 | ;; | |
8647 | *) echo "Using $hint value $o_nonblock.";; | |
8648 | esac | |
8649 | $rm -f try try.* .out core | |
8650 | ||
8651 | echo " " | |
8652 | echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 | |
8653 | case "$eagain" in | |
8654 | '') | |
8655 | $cat head.c > try.c | |
8656 | $cat >>try.c <<EOCP | |
8657 | #include <errno.h> | |
8658 | #include <sys/types.h> | |
8659 | #include <signal.h> | |
213c275f | 8660 | #include <stdio.h> |
4633a7c4 | 8661 | #define MY_O_NONBLOCK $o_nonblock |
dc45a647 | 8662 | #ifndef errno /* XXX need better Configure test */ |
8e07c86e | 8663 | extern int errno; |
dc45a647 | 8664 | #endif |
14e4fe40 JH |
8665 | #$i_unistd I_UNISTD |
8666 | #ifdef I_UNISTD | |
213c275f JH |
8667 | #include <unistd.h> |
8668 | #endif | |
1acc7ade JH |
8669 | #$i_string I_STRING |
8670 | #ifdef I_STRING | |
213c275f JH |
8671 | #include <string.h> |
8672 | #else | |
8673 | #include <strings.h> | |
8674 | #endif | |
8e07c86e | 8675 | $signal_t blech(x) int x; { exit(3); } |
4633a7c4 LW |
8676 | EOCP |
8677 | $cat >> try.c <<'EOCP' | |
d674cd6d | 8678 | int main() |
8e07c86e AD |
8679 | { |
8680 | int pd[2]; | |
8681 | int pu[2]; | |
8682 | char buf[1]; | |
8683 | char string[100]; | |
8684 | ||
8685 | pipe(pd); /* Down: child -> parent */ | |
8686 | pipe(pu); /* Up: parent -> child */ | |
8687 | if (0 != fork()) { | |
8688 | int ret; | |
8689 | close(pd[1]); /* Parent reads from pd[0] */ | |
8690 | close(pu[0]); /* Parent writes (blocking) to pu[1] */ | |
4633a7c4 | 8691 | if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) |
8e07c86e AD |
8692 | exit(1); |
8693 | signal(SIGALRM, blech); | |
8694 | alarm(5); | |
8695 | if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ | |
8696 | exit(2); | |
8697 | sprintf(string, "%d\n", ret); | |
8698 | write(2, string, strlen(string)); | |
8699 | alarm(0); | |
8700 | #ifdef EAGAIN | |
8701 | if (errno == EAGAIN) { | |
8702 | printf("EAGAIN\n"); | |
8703 | goto ok; | |
8704 | } | |
8705 | #endif | |
8706 | #ifdef EWOULDBLOCK | |
8707 | if (errno == EWOULDBLOCK) | |
8708 | printf("EWOULDBLOCK\n"); | |
8709 | #endif | |
8710 | ok: | |
8711 | write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ | |
8712 | sleep(2); /* Give it time to close our pipe */ | |
8713 | alarm(5); | |
8714 | ret = read(pd[0], buf, 1); /* Should read EOF */ | |
8715 | alarm(0); | |
8716 | sprintf(string, "%d\n", ret); | |
8717 | write(3, string, strlen(string)); | |
8718 | exit(0); | |
8719 | } | |
8720 | ||
8721 | close(pd[0]); /* We write to pd[1] */ | |
8722 | close(pu[1]); /* We read from pu[0] */ | |
8723 | read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ | |
8724 | close(pd[1]); /* Pipe pd is now fully closed! */ | |
8725 | exit(0); /* Bye bye, thank you for playing! */ | |
8726 | } | |
8727 | EOCP | |
dfe9444c | 8728 | set try |
dc45a647 | 8729 | if eval $compile_ok; then |
774d564b | 8730 | echo "$startsh" >mtry |
40a7a20a | 8731 | echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry |
8e07c86e AD |
8732 | chmod +x mtry |
8733 | ./mtry >/dev/null 2>&1 | |
8734 | case $? in | |
8735 | 0) eagain=`$cat try.out`;; | |
8736 | 1) echo "Could not perform non-blocking setting!";; | |
8737 | 2) echo "I did a successful read() for something that was not there!";; | |
8738 | 3) echo "Hmm... non-blocking I/O does not seem to be working!";; | |
8739 | *) echo "Something terribly wrong happened during testing.";; | |
8740 | esac | |
8741 | rd_nodata=`$cat try.ret` | |
8742 | echo "A read() system call with no data present returns $rd_nodata." | |
8743 | case "$rd_nodata" in | |
8744 | 0|-1) ;; | |
8745 | *) | |
8746 | echo "(That's peculiar, fixing that to be -1.)" | |
8747 | rd_nodata=-1 | |
8748 | ;; | |
8749 | esac | |
8750 | case "$eagain" in | |
8751 | '') | |
8752 | echo "Forcing errno EAGAIN on read() with no data available." | |
8753 | eagain=EAGAIN | |
8754 | ;; | |
8755 | *) | |
8756 | echo "Your read() sets errno to $eagain when no data is available." | |
8757 | ;; | |
8758 | esac | |
8759 | status=`$cat try.err` | |
8760 | case "$status" in | |
8761 | 0) echo "And it correctly returns 0 to signal EOF.";; | |
8762 | -1) echo "But it also returns -1 to signal EOF, so be careful!";; | |
8763 | *) echo "However, your read() returns '$status' on EOF??";; | |
8764 | esac | |
8765 | val="$define" | |
28757baa | 8766 | if test "$status" = "$rd_nodata"; then |
8e07c86e AD |
8767 | echo "WARNING: you can't distinguish between EOF and no data!" |
8768 | val="$undef" | |
8769 | fi | |
8770 | else | |
8771 | echo "I can't compile the test program--assuming errno EAGAIN will do." | |
8772 | eagain=EAGAIN | |
8773 | fi | |
8774 | set d_eofnblk | |
8775 | eval $setvar | |
8776 | ;; | |
8777 | *) | |
8778 | echo "Using $hint value $eagain." | |
8779 | echo "Your read() returns $rd_nodata when no data is present." | |
8780 | case "$d_eofnblk" in | |
8781 | "$define") echo "And you can see EOF because read() returns 0.";; | |
8782 | "$undef") echo "But you can't see EOF status from read() returned value.";; | |
8783 | *) | |
8784 | echo "(Assuming you can't see EOF status from read anyway.)" | |
8785 | d_eofnblk=$undef | |
8786 | ;; | |
8787 | esac | |
8788 | ;; | |
8789 | esac | |
8790 | $rm -f try try.* .out core head.c mtry | |
8791 | ||
a0d0e21e LW |
8792 | : see if fchmod exists |
8793 | set fchmod d_fchmod | |
8794 | eval $inlibc | |
8795 | ||
8796 | : see if fchown exists | |
8797 | set fchown d_fchown | |
8798 | eval $inlibc | |
8799 | ||
8800 | : see if this is an fcntl system | |
8801 | set fcntl d_fcntl | |
8802 | eval $inlibc | |
8803 | ||
b7b35fc2 JH |
8804 | hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift; |
8805 | while $test $# -ge 2; do | |
8806 | case "$1" in | |
8807 | $define) echo "#include <$2>";; | |
8808 | esac ; | |
8809 | shift 2; | |
8810 | done > try.c; | |
8811 | echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c; | |
8812 | set try; | |
8813 | if eval $compile; then | |
8814 | val="$define"; | |
8815 | else | |
8816 | val="$undef"; | |
8817 | fi; | |
8818 | set $varname; | |
8819 | eval $setvar; | |
8820 | $rm -f try.c try.o' | |
8821 | ||
8822 | socketlib='' | |
8823 | sockethdr='' | |
8824 | : see whether socket exists | |
8825 | echo " " | |
8826 | $echo $n "Hmm... $c" >&4 | |
8827 | if set socket val -f d_socket; eval $csym; $val; then | |
8828 | echo "Looks like you have Berkeley networking support." >&4 | |
8829 | d_socket="$define" | |
8830 | if set setsockopt val -f; eval $csym; $val; then | |
8831 | d_oldsock="$undef" | |
8832 | else | |
8833 | echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4 | |
8834 | d_oldsock="$define" | |
8835 | fi | |
8836 | else | |
8837 | if $contains socklib libc.list >/dev/null 2>&1; then | |
8838 | echo "Looks like you have Berkeley networking support." >&4 | |
8839 | d_socket="$define" | |
8840 | : we will have to assume that it supports the 4.2 BSD interface | |
8841 | d_oldsock="$undef" | |
8842 | else | |
8843 | echo "You don't have Berkeley networking in libc$_a..." >&4 | |
8844 | if test "X$d_socket" = "X$define"; then | |
8845 | echo "...but you seem to believe that you have sockets." >&4 | |
8846 | else | |
8847 | for net in net socket | |
8848 | do | |
8849 | if test -f /usr/lib/lib$net$_a; then | |
8850 | ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \ | |
8851 | $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list | |
8852 | if $contains socket libc.list >/dev/null 2>&1; then | |
8853 | d_socket="$define" | |
8854 | socketlib="-l$net" | |
8855 | case "$net" in | |
8856 | net) | |
8857 | echo "...but the Wollongong group seems to have hacked it in." >&4 | |
8858 | sockethdr="-I/usr/netinclude" | |
8859 | ;; | |
8860 | esac | |
8861 | echo "Found Berkeley sockets interface in lib$net." >& 4 | |
8862 | if $contains setsockopt libc.list >/dev/null 2>&1; then | |
8863 | d_oldsock="$undef" | |
8864 | else | |
8865 | echo "...using the old BSD 4.1c interface, rather than 4.2." >&4 | |
8866 | d_oldsock="$define" | |
8867 | fi | |
8868 | break | |
8869 | fi | |
8870 | fi | |
8871 | done | |
8872 | if test "X$d_socket" != "X$define"; then | |
8873 | echo "or anywhere else I see." >&4 | |
8874 | d_socket="$undef" | |
8875 | d_oldsock="$undef" | |
8876 | fi | |
8877 | fi | |
8878 | fi | |
8879 | fi | |
8880 | ||
8881 | : see if socketpair exists | |
8882 | set socketpair d_sockpair | |
8883 | eval $inlibc | |
8884 | ||
8885 | ||
8886 | echo " " | |
8887 | echo "Checking the availability of certain socket constants..." >& 4 | |
8888 | for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do | |
8889 | enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'` | |
8890 | $cat >try.c <<EOF | |
8891 | #include <sys/types.h> | |
8892 | #include <sys/socket.h> | |
8893 | int main() { | |
8894 | int i = $ENUM; | |
8895 | } | |
8896 | EOF | |
8897 | val="$undef" | |
8898 | set try; if eval $compile; then | |
8899 | val="$define" | |
8900 | fi | |
8901 | set d_${enum}; eval $setvar | |
8902 | $rm -f try.c try | |
8903 | done | |
8904 | ||
921b2963 JH |
8905 | : see if sys/select.h has to be included |
8906 | set sys/select.h i_sysselct | |
8907 | eval $inhdr | |
8908 | ||
8909 | : see if we should include time.h, sys/time.h, or both | |
8910 | echo " " | |
8911 | if test "X$timeincl" = X; then | |
8912 | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 | |
8913 | $echo $n "I'm now running the test program...$c" | |
8914 | $cat >try.c <<'EOCP' | |
8915 | #include <sys/types.h> | |
8916 | #ifdef I_TIME | |
8917 | #include <time.h> | |
8918 | #endif | |
8919 | #ifdef I_SYSTIME | |
8920 | #ifdef SYSTIMEKERNEL | |
8921 | #define KERNEL | |
8922 | #endif | |
8923 | #include <sys/time.h> | |
8924 | #endif | |
8925 | #ifdef I_SYSSELECT | |
8926 | #include <sys/select.h> | |
8927 | #endif | |
d674cd6d | 8928 | int main() |
921b2963 JH |
8929 | { |
8930 | struct tm foo; | |
8931 | #ifdef S_TIMEVAL | |
8932 | struct timeval bar; | |
8933 | #endif | |
8934 | #ifdef S_TIMEZONE | |
8935 | struct timezone tzp; | |
8936 | #endif | |
8937 | if (foo.tm_sec == foo.tm_sec) | |
8938 | exit(0); | |
8939 | #ifdef S_TIMEVAL | |
8940 | if (bar.tv_sec == bar.tv_sec) | |
8941 | exit(0); | |
8942 | #endif | |
8943 | exit(1); | |
8944 | } | |
8945 | EOCP | |
8946 | flags='' | |
8947 | for s_timezone in '-DS_TIMEZONE' ''; do | |
8948 | sysselect='' | |
8949 | for s_timeval in '-DS_TIMEVAL' ''; do | |
8950 | for i_systimek in '' '-DSYSTIMEKERNEL'; do | |
8951 | for i_time in '' '-DI_TIME'; do | |
8952 | for i_systime in '-DI_SYSTIME' ''; do | |
8953 | case "$flags" in | |
8954 | '') $echo $n ".$c" | |
8955 | set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone | |
8956 | if eval $compile; then | |
8957 | set X $i_time $i_systime $i_systimek $sysselect $s_timeval | |
8958 | shift | |
8959 | flags="$*" | |
8960 | echo " " | |
8961 | $echo $n "Succeeded with $flags$c" | |
8962 | fi | |
8963 | ;; | |
8964 | esac | |
8965 | done | |
8966 | done | |
8967 | done | |
8968 | done | |
8969 | done | |
8970 | timeincl='' | |
8971 | echo " " | |
8972 | case "$flags" in | |
8973 | *SYSTIMEKERNEL*) i_systimek="$define" | |
8974 | timeincl=`./findhdr sys/time.h` | |
8975 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; | |
8976 | *) i_systimek="$undef";; | |
8977 | esac | |
8978 | case "$flags" in | |
8979 | *I_TIME*) i_time="$define" | |
8980 | timeincl=`./findhdr time.h`" $timeincl" | |
8981 | echo "We'll include <time.h>." >&4;; | |
8982 | *) i_time="$undef";; | |
8983 | esac | |
8984 | case "$flags" in | |
8985 | *I_SYSTIME*) i_systime="$define" | |
8986 | timeincl=`./findhdr sys/time.h`" $timeincl" | |
8987 | echo "We'll include <sys/time.h>." >&4;; | |
8988 | *) i_systime="$undef";; | |
8989 | esac | |
8990 | $rm -f try.c try | |
8991 | fi | |
8992 | ||
8993 | : check for fd_set items | |
8994 | $cat <<EOM | |
8995 | ||
8996 | Checking to see how well your C compiler handles fd_set and friends ... | |
8997 | EOM | |
8998 | $cat >fd_set.c <<EOCP | |
8999 | #$i_systime I_SYS_TIME | |
9000 | #$i_sysselct I_SYS_SELECT | |
9001 | #$d_socket HAS_SOCKET | |
9002 | #include <sys/types.h> | |
9003 | #ifdef HAS_SOCKET | |
9004 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
9005 | #endif | |
9006 | #ifdef I_SYS_TIME | |
9007 | #include <sys/time.h> | |
9008 | #endif | |
9009 | #ifdef I_SYS_SELECT | |
9010 | #include <sys/select.h> | |
9011 | #endif | |
d674cd6d | 9012 | int main() { |
921b2963 JH |
9013 | fd_set fds; |
9014 | ||
9015 | #ifdef TRYBITS | |
9016 | if(fds.fds_bits); | |
9017 | #endif | |
9018 | ||
9019 | #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) | |
9020 | exit(0); | |
9021 | #else | |
9022 | exit(1); | |
9023 | #endif | |
9024 | } | |
9025 | EOCP | |
9026 | set fd_set -DTRYBITS | |
9027 | if eval $compile; then | |
9028 | d_fds_bits="$define" | |
9029 | d_fd_set="$define" | |
9030 | echo "Well, your system knows about the normal fd_set typedef..." >&4 | |
9031 | if ./fd_set; then | |
9032 | echo "and you have the normal fd_set macros (just as I'd expect)." >&4 | |
9033 | d_fd_macros="$define" | |
9034 | else | |
9035 | $cat >&4 <<'EOM' | |
9036 | but not the normal fd_set macros! Gaaack! I'll have to cover for you. | |
9037 | EOM | |
9038 | d_fd_macros="$undef" | |
9039 | fi | |
9040 | else | |
9041 | $cat <<'EOM' | |
9042 | Hmm, your compiler has some difficulty with fd_set. Checking further... | |
9043 | EOM | |
9044 | set fd_set | |
9045 | if eval $compile; then | |
9046 | d_fds_bits="$undef" | |
9047 | d_fd_set="$define" | |
9048 | echo "Well, your system has some sort of fd_set available..." >&4 | |
9049 | if ./fd_set; then | |
9050 | echo "and you have the normal fd_set macros." >&4 | |
9051 | d_fd_macros="$define" | |
9052 | else | |
9053 | $cat <<'EOM' | |
9054 | but not the normal fd_set macros! Gross! More work for me... | |
9055 | EOM | |
9056 | d_fd_macros="$undef" | |
9057 | fi | |
9058 | else | |
9059 | echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 | |
9060 | d_fd_set="$undef" | |
9061 | d_fds_bits="$undef" | |
9062 | d_fd_macros="$undef" | |
9063 | fi | |
9064 | fi | |
9065 | $rm -f fd_set* | |
9066 | ||
a0d0e21e LW |
9067 | : see if fgetpos exists |
9068 | set fgetpos d_fgetpos | |
9069 | eval $inlibc | |
9070 | ||
8175356b JH |
9071 | : see if flock exists |
9072 | set flock d_flock | |
9073 | eval $inlibc | |
9074 | ||
9075 | : see if fork exists | |
9076 | set fork d_fork | |
9077 | eval $inlibc | |
9078 | ||
9079 | : see if pathconf exists | |
9080 | set pathconf d_pathconf | |
9081 | eval $inlibc | |
9082 | ||
9083 | : see if fpathconf exists | |
9084 | set fpathconf d_fpathconf | |
9085 | eval $inlibc | |
9086 | ||
d9b3e12d | 9087 | |
d9b3e12d JH |
9088 | : check for fpos64_t |
9089 | echo " " | |
c5f05a91 | 9090 | echo "Checking to see if you have fpos64_t..." >&4 |
d9b3e12d | 9091 | $cat >try.c <<EOCP |
ce65dbcf | 9092 | #include <stdio.h> |
3c96ce7f | 9093 | int main() { fpos64_t x = 7; } |
d9b3e12d | 9094 | EOCP |
8175356b JH |
9095 | set try |
9096 | if eval $compile; then | |
d9b3e12d | 9097 | val="$define" |
c5f05a91 | 9098 | echo "You have fpos64_t." |
d9b3e12d JH |
9099 | else |
9100 | val="$undef" | |
c5f05a91 | 9101 | echo "You do not have fpos64_t." |
8175356b | 9102 | case "$fpossize" in |
1eeb0f31 | 9103 | 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;; |
8175356b | 9104 | esac |
d9b3e12d | 9105 | fi |
8175356b | 9106 | $rm -f try.* try |
d9b3e12d JH |
9107 | set d_fpos64_t |
9108 | eval $setvar | |
9109 | ||
a3540c92 JH |
9110 | : see if frexpl exists |
9111 | set frexpl d_frexpl | |
9112 | eval $inlibc | |
9113 | ||
0545a864 JH |
9114 | hasstruct='varname=$1; struct=$2; shift; shift; |
9115 | while $test $# -ge 2; do | |
9116 | case "$1" in | |
9117 | $define) echo "#include <$2>";; | |
9118 | esac ; | |
9119 | shift 2; | |
9120 | done > try.c; | |
9121 | echo "int main () { struct $struct foo; }" >> try.c; | |
9122 | set try; | |
9123 | if eval $compile; then | |
9124 | val="$define"; | |
9125 | else | |
9126 | val="$undef"; | |
9127 | fi; | |
9128 | set $varname; | |
9129 | eval $setvar; | |
9130 | $rm -f try.c try.o' | |
d9b3e12d | 9131 | |
9b9c89a3 JH |
9132 | : see if this is a sys/param system |
9133 | set sys/param.h i_sysparam | |
9134 | eval $inhdr | |
9135 | ||
104d25b7 JH |
9136 | : see if this is a sys/mount.h system |
9137 | set sys/mount.h i_sysmount | |
9138 | eval $inhdr | |
9139 | ||
0545a864 JH |
9140 | : see if sys/types.h has to be included |
9141 | set sys/types.h i_systypes | |
9142 | eval $inhdr | |
9143 | ||
0545a864 | 9144 | |
ad27e871 | 9145 | echo " " |
8175356b | 9146 | echo "Checking to see if your system supports struct fs_data..." >&4 |
0545a864 JH |
9147 | set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h |
9148 | eval $hasstruct | |
9149 | case "$d_fs_data_s" in | |
a22e52b9 JH |
9150 | "$define") echo "Yes, it does." ;; |
9151 | *) echo "No, it doesn't." ;; | |
0545a864 JH |
9152 | esac |
9153 | ||
9154 | : see if fseeko exists | |
9155 | set fseeko d_fseeko | |
9156 | eval $inlibc | |
1eeb0f31 | 9157 | case "$longsize" in |
43999f95 | 9158 | 8) echo "(Your long is 64 bits, so you could use fseek.)" ;; |
1eeb0f31 | 9159 | esac |
0545a864 JH |
9160 | |
9161 | : see if fsetpos exists | |
9162 | set fsetpos d_fsetpos | |
9163 | eval $inlibc | |
9164 | ||
9165 | ||
9166 | : see if fstatfs exists | |
9167 | set fstatfs d_fstatfs | |
9168 | eval $inlibc | |
104d25b7 JH |
9169 | |
9170 | ||
9171 | : see if statvfs exists | |
9172 | set statvfs d_statvfs | |
9173 | eval $inlibc | |
9174 | ||
9175 | : see if fstatvfs exists | |
9176 | set fstatvfs d_fstatvfs | |
9177 | eval $inlibc | |
9178 | ||
9179 | ||
5ff3f7a4 GS |
9180 | : see if ftello exists |
9181 | set ftello d_ftello | |
9182 | eval $inlibc | |
1eeb0f31 | 9183 | case "$longsize" in |
43999f95 | 9184 | 8) echo "(Your long is 64 bits, so you could use ftell.)" ;; |
1eeb0f31 | 9185 | esac |
5ff3f7a4 | 9186 | |
49dabb45 JH |
9187 | : see if getcwd exists |
9188 | set getcwd d_getcwd | |
9189 | eval $inlibc | |
9190 | ||
c890dc6c JH |
9191 | |
9192 | : see if getfsstat exists | |
9193 | set getfsstat d_getfsstat | |
9194 | eval $inlibc | |
9195 | ||
5ff3f7a4 GS |
9196 | : see if getgrent exists |
9197 | set getgrent d_getgrent | |
9198 | eval $inlibc | |
9199 | ||
693762b4 AD |
9200 | : see if gethostbyaddr exists |
9201 | set gethostbyaddr d_gethbyaddr | |
9202 | eval $inlibc | |
9203 | ||
9204 | : see if gethostbyname exists | |
9205 | set gethostbyname d_gethbyname | |
9206 | eval $inlibc | |
9207 | ||
a0d0e21e LW |
9208 | : see if gethostent exists |
9209 | set gethostent d_gethent | |
9210 | eval $inlibc | |
9211 | ||
921b2963 JH |
9212 | : see how we will look up host name |
9213 | echo " " | |
a63faeb8 JH |
9214 | call='' |
9215 | if set gethostname val -f d_gethname; eval $csym; $val; then | |
921b2963 JH |
9216 | echo 'gethostname() found.' >&4 |
9217 | d_gethname="$define" | |
9218 | call=gethostname | |
a63faeb8 JH |
9219 | fi |
9220 | if set uname val -f d_uname; eval $csym; $val; then | |
921b2963 JH |
9221 | if ./xenix; then |
9222 | $cat <<'EOM' | |
9223 | uname() was found, but you're running xenix, and older versions of xenix | |
9224 | have a broken uname(). If you don't really know whether your xenix is old | |
9225 | enough to have a broken system call, use the default answer. | |
9226 | ||
9227 | EOM | |
9228 | dflt=y | |
9229 | case "$d_uname" in | |
9230 | "$define") dflt=n;; | |
9231 | esac | |
9232 | rp='Is your uname() broken?' | |
9233 | . ./myread | |
9234 | case "$ans" in | |
9235 | n*) d_uname="$define"; call=uname;; | |
9236 | esac | |
9237 | else | |
9238 | echo 'uname() found.' >&4 | |
9239 | d_uname="$define" | |
a63faeb8 JH |
9240 | case "$call" in |
9241 | '') call=uname ;; | |
9242 | esac | |
921b2963 JH |
9243 | fi |
9244 | fi | |
9245 | case "$d_gethname" in | |
9246 | '') d_gethname="$undef";; | |
9247 | esac | |
9248 | case "$d_uname" in | |
9249 | '') d_uname="$undef";; | |
9250 | esac | |
9251 | case "$d_uname$d_gethname" in | |
9252 | *define*) | |
9253 | dflt=n | |
9254 | cat <<EOM | |
9255 | ||
9256 | Every now and then someone has a $call() that lies about the hostname | |
9257 | but can't be fixed for political or economic reasons. If you wish, I can | |
9258 | pretend $call() isn't there and maybe compute hostname at run-time | |
9259 | thanks to the '$phostname' command. | |
9260 | ||
9261 | EOM | |
9262 | rp="Shall I ignore $call() from now on?" | |
9263 | . ./myread | |
9264 | case "$ans" in | |
9265 | y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";; | |
9266 | esac;; | |
9267 | esac | |
9268 | case "$phostname" in | |
9269 | '') aphostname='';; | |
9270 | *) case "$aphostname" in | |
9271 | /*) ;; | |
9272 | *) set X $phostname | |
9273 | shift | |
9274 | file=$1 | |
9275 | shift | |
9276 | file=`./loc $file $file $pth` | |
9277 | aphostname=`echo $file $*` | |
9278 | ;; | |
9279 | esac | |
9280 | ;; | |
9281 | esac | |
9282 | case "$d_uname$d_gethname" in | |
9283 | *define*) ;; | |
9284 | *) | |
9285 | case "$phostname" in | |
9286 | '') | |
9287 | echo "There will be no way for $package to get your hostname." >&4;; | |
9288 | *) | |
9289 | echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4 | |
9290 | ;; | |
9291 | esac;; | |
9292 | esac | |
9293 | case "$d_phostname" in | |
9294 | '') d_phostname="$undef";; | |
9295 | esac | |
9296 | ||
dc45a647 MB |
9297 | : see if this is a netdb.h system |
9298 | set netdb.h i_netdb | |
9299 | eval $inhdr | |
9300 | ||
9301 | : see if prototypes for various gethostxxx netdb.h functions are available | |
9302 | echo " " | |
9303 | set d_gethostprotos gethostent $i_netdb netdb.h | |
9304 | eval $hasproto | |
9305 | ||
a0d0e21e LW |
9306 | : see if getlogin exists |
9307 | set getlogin d_getlogin | |
9308 | eval $inlibc | |
9309 | ||
ad27e871 JH |
9310 | : see if getmnt exists |
9311 | set getmnt d_getmnt | |
9312 | eval $inlibc | |
9313 | ||
ccc7f9b3 KS |
9314 | : see if getmntent exists |
9315 | set getmntent d_getmntent | |
9316 | eval $inlibc | |
9317 | ||
693762b4 AD |
9318 | : see if getnetbyaddr exists |
9319 | set getnetbyaddr d_getnbyaddr | |
9320 | eval $inlibc | |
9321 | ||
9322 | : see if getnetbyname exists | |
9323 | set getnetbyname d_getnbyname | |
9324 | eval $inlibc | |
9325 | ||
e5c9fcd0 AD |
9326 | : see if getnetent exists |
9327 | set getnetent d_getnent | |
9328 | eval $inlibc | |
9329 | ||
dc45a647 MB |
9330 | : see if prototypes for various getnetxxx netdb.h functions are available |
9331 | echo " " | |
9332 | set d_getnetprotos getnetent $i_netdb netdb.h | |
9333 | eval $hasproto | |
9334 | ||
693762b4 AD |
9335 | |
9336 | : see if getprotobyname exists | |
9337 | set getprotobyname d_getpbyname | |
9338 | eval $inlibc | |
9339 | ||
9340 | : see if getprotobynumber exists | |
9341 | set getprotobynumber d_getpbynumber | |
9342 | eval $inlibc | |
e5c9fcd0 AD |
9343 | |
9344 | : see if getprotoent exists | |
9345 | set getprotoent d_getpent | |
9346 | eval $inlibc | |
9347 | ||
2afac517 | 9348 | : see if getpgid exists |
9349 | set getpgid d_getpgid | |
a0d0e21e LW |
9350 | eval $inlibc |
9351 | ||
9352 | : see if getpgrp2 exists | |
9353 | set getpgrp2 d_getpgrp2 | |
9354 | eval $inlibc | |
9355 | ||
9356 | : see if getppid exists | |
9357 | set getppid d_getppid | |
9358 | eval $inlibc | |
9359 | ||
9360 | : see if getpriority exists | |
9361 | set getpriority d_getprior | |
9362 | eval $inlibc | |
9363 | ||
dc45a647 MB |
9364 | : see if prototypes for various getprotoxxx netdb.h functions are available |
9365 | echo " " | |
9366 | set d_getprotoprotos getprotoent $i_netdb netdb.h | |
9367 | eval $hasproto | |
9368 | ||
5ff3f7a4 GS |
9369 | : see if getpwent exists |
9370 | set getpwent d_getpwent | |
9371 | eval $inlibc | |
9372 | ||
9373 | ||
693762b4 AD |
9374 | : see if getservbyname exists |
9375 | set getservbyname d_getsbyname | |
9376 | eval $inlibc | |
9377 | ||
9378 | : see if getservbyport exists | |
9379 | set getservbyport d_getsbyport | |
9380 | eval $inlibc | |
e5c9fcd0 AD |
9381 | |
9382 | : see if getservent exists | |
9383 | set getservent d_getsent | |
9384 | eval $inlibc | |
9385 | ||
dc45a647 MB |
9386 | : see if prototypes for various getservxxx netdb.h functions are available |
9387 | echo " " | |
9388 | set d_getservprotos getservent $i_netdb netdb.h | |
9389 | eval $hasproto | |
9390 | ||
f1066039 JH |
9391 | : see if getspent exists |
9392 | set getspent d_getspent | |
9393 | eval $inlibc | |
9394 | ||
9395 | : see if getspnam exists | |
9396 | set getspnam d_getspnam | |
9397 | eval $inlibc | |
9398 | ||
5f05dabc | 9399 | : see if gettimeofday or ftime exists |
9400 | set gettimeofday d_gettimeod | |
9401 | eval $inlibc | |
9402 | case "$d_gettimeod" in | |
9403 | "$undef") | |
9404 | set ftime d_ftime | |
9405 | eval $inlibc | |
9406 | ;; | |
9407 | *) | |
9408 | val="$undef"; set d_ftime; eval $setvar | |
9409 | ;; | |
9410 | esac | |
9411 | case "$d_gettimeod$d_ftime" in | |
9412 | "$undef$undef") | |
9413 | echo " " | |
9414 | echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 | |
9415 | ;; | |
9416 | esac | |
9417 | ||
5ff3f7a4 GS |
9418 | : see if this is an grp system |
9419 | set grp.h i_grp | |
9420 | eval $inhdr | |
9421 | ||
9422 | case "$i_grp" in | |
9423 | $define) | |
9424 | xxx=`./findhdr grp.h` | |
9425 | $cppstdin $cppflags $cppminus < $xxx >$$.h | |
9426 | ||
9427 | if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then | |
9428 | val="$define" | |
9429 | else | |
9430 | val="$undef" | |
9431 | fi | |
9432 | set d_grpasswd | |
9433 | eval $setvar | |
9434 | ||
9435 | $rm -f $$.h | |
9436 | ;; | |
9437 | *) | |
9438 | val="$undef"; | |
9439 | set d_grpasswd; eval $setvar | |
9440 | ;; | |
9441 | esac | |
9442 | ||
ccc7f9b3 KS |
9443 | : see if hasmntopt exists |
9444 | set hasmntopt d_hasmntopt | |
9445 | eval $inlibc | |
9446 | ||
a0d0e21e LW |
9447 | : see if this is a netinet/in.h or sys/in.h system |
9448 | set netinet/in.h i_niin sys/in.h i_sysin | |
9449 | eval $inhdr | |
9450 | ||
5ff3f7a4 | 9451 | : see if arpa/inet.h has to be included |
93341792 | 9452 | set arpa/inet.h i_arpainet |
28e8609d JH |
9453 | eval $inhdr |
9454 | ||
a0d0e21e LW |
9455 | : see if htonl --and friends-- exists |
9456 | val='' | |
9457 | set htonl val | |
9458 | eval $inlibc | |
9459 | ||
9460 | : Maybe they are macros. | |
9461 | case "$val" in | |
9462 | $undef) | |
9463 | $cat >htonl.c <<EOM | |
9464 | #include <stdio.h> | |
9465 | #include <sys/types.h> | |
9466 | #$i_niin I_NETINET_IN | |
9467 | #$i_sysin I_SYS_IN | |
93341792 | 9468 | #$i_arpainet I_ARPA_INET |
a0d0e21e LW |
9469 | #ifdef I_NETINET_IN |
9470 | #include <netinet/in.h> | |
9471 | #endif | |
9472 | #ifdef I_SYS_IN | |
9473 | #include <sys/in.h> | |
9474 | #endif | |
28e8609d JH |
9475 | #ifdef I_ARPA_INET |
9476 | #include <arpa/inet.h> | |
9477 | #endif | |
a0d0e21e LW |
9478 | #ifdef htonl |
9479 | printf("Defined as a macro."); | |
9480 | #endif | |
9481 | EOM | |
9482 | $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null | |
9483 | if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then | |
9484 | val="$define" | |
9485 | echo "But it seems to be defined as a macro." >&4 | |
9486 | fi | |
9487 | $rm -f htonl.? | |
9488 | ;; | |
9489 | esac | |
9490 | set d_htonl | |
9491 | eval $setvar | |
9492 | ||
43999f95 JH |
9493 | : see if iconv exists |
9494 | set iconv d_iconv | |
9495 | eval $inlibc | |
9496 | ||
a0d0e21e LW |
9497 | : index or strchr |
9498 | echo " " | |
9499 | if set index val -f; eval $csym; $val; then | |
9500 | if set strchr val -f d_strchr; eval $csym; $val; then | |
9501 | if $contains strchr "$strings" >/dev/null 2>&1 ; then | |
9502 | val="$define" | |
9503 | vali="$undef" | |
9504 | echo "strchr() found." >&4 | |
9505 | else | |
9506 | val="$undef" | |
9507 | vali="$define" | |
9508 | echo "index() found." >&4 | |
9509 | fi | |
9510 | else | |
9511 | val="$undef" | |
9512 | vali="$define" | |
9513 | echo "index() found." >&4 | |
9514 | fi | |
9515 | else | |
9516 | if set strchr val -f d_strchr; eval $csym; $val; then | |
9517 | val="$define" | |
9518 | vali="$undef" | |
9519 | echo "strchr() found." >&4 | |
9520 | else | |
9521 | echo "No index() or strchr() found!" >&4 | |
9522 | val="$undef" | |
9523 | vali="$undef" | |
9524 | fi | |
9525 | fi | |
9526 | set d_strchr; eval $setvar | |
9527 | val="$vali" | |
9528 | set d_index; eval $setvar | |
9529 | ||
7e1af8bc | 9530 | : check whether inet_aton exists |
9531 | set inet_aton d_inetaton | |
9532 | eval $inlibc | |
9533 | ||
fe749a9f JH |
9534 | : see if inttypes.h is available |
9535 | : we want a real compile instead of Inhdr because some systems | |
9536 | : have an inttypes.h which includes non-existent headers | |
9537 | echo " " | |
9538 | $cat >try.c <<EOCP | |
9539 | #include <inttypes.h> | |
9540 | int main() { | |
9541 | static int32_t foo32 = 0x12345678; | |
9542 | } | |
9543 | EOCP | |
9544 | set try | |
9545 | if eval $compile; then | |
9546 | echo "<inttypes.h> found." >&4 | |
9547 | val="$define" | |
9548 | else | |
9549 | echo "<inttypes.h> NOT found." >&4 | |
9550 | val="$undef" | |
9551 | fi | |
9552 | $rm -f try.c try | |
9553 | set i_inttypes | |
9554 | eval $setvar | |
9555 | ||
9556 | : check for int64_t | |
9557 | echo " " | |
c5f05a91 | 9558 | echo "Checking to see if you have int64_t..." >&4 |
fe749a9f JH |
9559 | $cat >try.c <<EOCP |
9560 | #include <sys/types.h> | |
9561 | #$i_inttypes I_INTTYPES | |
9562 | #ifdef I_INTTYPES | |
9563 | #include <inttypes.h> | |
9564 | #endif | |
9565 | int main() { int64_t x = 7; } | |
9566 | EOCP | |
9567 | set try | |
9568 | if eval $compile; then | |
9569 | val="$define" | |
ce65dbcf | 9570 | echo "You have int64_t." |
fe749a9f JH |
9571 | else |
9572 | val="$undef" | |
ce65dbcf | 9573 | echo "You do not have int64_t." |
fe749a9f JH |
9574 | fi |
9575 | $rm -f try try.* | |
13b3f787 | 9576 | set d_int64_t |
fe749a9f JH |
9577 | eval $setvar |
9578 | ||
a0d0e21e LW |
9579 | : Look for isascii |
9580 | echo " " | |
9581 | $cat >isascii.c <<'EOCP' | |
9582 | #include <stdio.h> | |
9583 | #include <ctype.h> | |
d674cd6d | 9584 | int main() { |
a0d0e21e LW |
9585 | int c = 'A'; |
9586 | if (isascii(c)) | |
9587 | exit(0); | |
9588 | else | |
9589 | exit(1); | |
9590 | } | |
9591 | EOCP | |
dfe9444c AD |
9592 | set isascii |
9593 | if eval $compile; then | |
a0d0e21e LW |
9594 | echo "isascii() found." >&4 |
9595 | val="$define" | |
9596 | else | |
9597 | echo "isascii() NOT found." >&4 | |
9598 | val="$undef" | |
9599 | fi | |
9600 | set d_isascii | |
9601 | eval $setvar | |
9602 | $rm -f isascii* | |
9603 | ||
a3540c92 JH |
9604 | : see if isnan exists |
9605 | set isnan d_isnan | |
9606 | eval $inlibc | |
9607 | ||
9608 | : see if isnanl exists | |
9609 | set isnanl d_isnanl | |
9610 | eval $inlibc | |
9611 | ||
a0d0e21e LW |
9612 | : see if killpg exists |
9613 | set killpg d_killpg | |
9614 | eval $inlibc | |
9615 | ||
dd64f1c3 AD |
9616 | : see if lchown exists |
9617 | echo " " | |
9618 | $cat > try.c <<'EOCP' | |
9619 | /* System header to define __stub macros and hopefully few prototypes, | |
9620 | which can conflict with char lchown(); below. */ | |
9621 | #include <assert.h> | |
9622 | /* Override any gcc2 internal prototype to avoid an error. */ | |
9623 | /* We use char because int might match the return type of a gcc2 | |
9624 | builtin and then its argument prototype would still apply. */ | |
9625 | char lchown(); | |
9626 | int main() { | |
9627 | /* The GNU C library defines this for functions which it implements | |
9628 | to always fail with ENOSYS. Some functions are actually named | |
9629 | something starting with __ and the normal name is an alias. */ | |
9630 | #if defined (__stub_lchown) || defined (__stub___lchown) | |
9631 | choke me | |
9632 | #else | |
9633 | lchown(); | |
9634 | #endif | |
9635 | ; return 0; } | |
9636 | EOCP | |
9637 | set try | |
9638 | if eval $compile; then | |
9639 | $echo "lchown() found." >&4 | |
9640 | val="$define" | |
9641 | else | |
9642 | $echo "lchown() NOT found." >&4 | |
9643 | val="$undef" | |
9644 | fi | |
9645 | set d_lchown | |
9646 | eval $setvar | |
9647 | ||
2d4389e4 JH |
9648 | : See if number of significant digits in a double precision number is known |
9649 | echo " " | |
9650 | $cat >ldbl_dig.c <<EOM | |
9651 | #$i_limits I_LIMITS | |
9652 | #$i_float I_FLOAT | |
9653 | #ifdef I_LIMITS | |
9654 | #include <limits.h> | |
9655 | #endif | |
9656 | #ifdef I_FLOAT | |
9657 | #include <float.h> | |
9658 | #endif | |
9659 | #ifdef LDBL_DIG | |
9660 | printf("Contains LDBL_DIG"); | |
9661 | #endif | |
9662 | EOM | |
9663 | $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null | |
9664 | if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then | |
9665 | echo "LDBL_DIG found." >&4 | |
9666 | val="$define" | |
9667 | else | |
9668 | echo "LDBL_DIG NOT found." >&4 | |
9669 | val="$undef" | |
9670 | fi | |
9671 | $rm -f ldbl_dig.? | |
9672 | set d_ldbl_dig | |
9673 | eval $setvar | |
9674 | ||
a0d0e21e LW |
9675 | : see if link exists |
9676 | set link d_link | |
9677 | eval $inlibc | |
9678 | ||
a0d0e21e LW |
9679 | : see if localeconv exists |
9680 | set localeconv d_locconv | |
9681 | eval $inlibc | |
9682 | ||
9683 | : see if lockf exists | |
9684 | set lockf d_lockf | |
9685 | eval $inlibc | |
9686 | ||
8175356b JH |
9687 | : check for long long |
9688 | echo " " | |
c5f05a91 | 9689 | echo "Checking to see if you have long long..." >&4 |
213c275f | 9690 | echo 'int main() { long long x = 7; return 0; }' > try.c |
8175356b JH |
9691 | set try |
9692 | if eval $compile; then | |
9693 | val="$define" | |
ce65dbcf | 9694 | echo "You have have long long." |
8175356b JH |
9695 | else |
9696 | val="$undef" | |
ce65dbcf | 9697 | echo "You do not have long long." |
8175356b JH |
9698 | fi |
9699 | $rm try.* | |
9700 | set d_longlong | |
9701 | eval $setvar | |
9702 | ||
9703 | : check for length of long long | |
9704 | case "${d_longlong}${longlongsize}" in | |
9705 | $define) | |
9706 | echo " " | |
49c10eea | 9707 | echo "Checking to see how big your long longs are..." >&4 |
8175356b JH |
9708 | $cat >try.c <<'EOCP' |
9709 | #include <stdio.h> | |
9710 | int main() | |
9711 | { | |
213c275f JH |
9712 | printf("%d\n", (int)sizeof(long long)); |
9713 | return(0); | |
8175356b JH |
9714 | } |
9715 | EOCP | |
9716 | set try | |
9717 | if eval $compile_ok; then | |
9718 | longlongsize=`./try$exe_ext` | |
49c10eea | 9719 | echo "Your long longs are $longlongsize bytes long." |
8175356b JH |
9720 | else |
9721 | dflt='8' | |
9722 | echo " " | |
9723 | echo "(I can't seem to compile the test program. Guessing...)" | |
9724 | rp="What is the size of a long long (in bytes)?" | |
9725 | . ./myread | |
9726 | longlongsize="$ans" | |
9727 | fi | |
9728 | if $test "X$longsize" = "X$longlongsize"; then | |
9729 | echo "(That isn't any different from an ordinary long.)" | |
9730 | fi | |
9731 | ;; | |
9732 | esac | |
9733 | $rm -f try.* try | |
9734 | ||
49c10eea JH |
9735 | : see if prototype for lseek is available |
9736 | echo " " | |
9737 | set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h | |
9738 | eval $hasproto | |
9739 | ||
a0d0e21e LW |
9740 | : see if lstat exists |
9741 | set lstat d_lstat | |
9742 | eval $inlibc | |
9743 | ||
1e8c3fde JH |
9744 | : see if madvise exists |
9745 | set madvise d_madvise | |
9746 | eval $inlibc | |
9747 | ||
a0d0e21e LW |
9748 | : see if mblen exists |
9749 | set mblen d_mblen | |
9750 | eval $inlibc | |
9751 | ||
9752 | : see if mbstowcs exists | |
9753 | set mbstowcs d_mbstowcs | |
9754 | eval $inlibc | |
9755 | ||
9756 | : see if mbtowc exists | |
9757 | set mbtowc d_mbtowc | |
9758 | eval $inlibc | |
9759 | ||
0f27ced1 JH |
9760 | : see if memchr exists |
9761 | set memchr d_memchr | |
9762 | eval $inlibc | |
9763 | ||
a0d0e21e LW |
9764 | : see if memcmp exists |
9765 | set memcmp d_memcmp | |
9766 | eval $inlibc | |
9767 | ||
9768 | : see if memcpy exists | |
9769 | set memcpy d_memcpy | |
9770 | eval $inlibc | |
9771 | ||
9772 | : see if memmove exists | |
9773 | set memmove d_memmove | |
2304df62 AD |
9774 | eval $inlibc |
9775 | ||
9776 | : see if memset exists | |
9777 | set memset d_memset | |
9778 | eval $inlibc | |
9779 | ||
9780 | : see if mkdir exists | |
9781 | set mkdir d_mkdir | |
9782 | eval $inlibc | |
9783 | ||
fe749a9f JH |
9784 | : see if mkdtemp exists |
9785 | set mkdtemp d_mkdtemp | |
9786 | eval $inlibc | |
9787 | ||
a0d0e21e LW |
9788 | : see if mkfifo exists |
9789 | set mkfifo d_mkfifo | |
9790 | eval $inlibc | |
9791 | ||
fe749a9f JH |
9792 | : see if mkstemp exists |
9793 | set mkstemp d_mkstemp | |
9794 | eval $inlibc | |
9795 | ||
9796 | : see if mkstemps exists | |
9797 | set mkstemps d_mkstemps | |
9798 | eval $inlibc | |
9799 | ||
a0d0e21e LW |
9800 | : see if mktime exists |
9801 | set mktime d_mktime | |
9802 | eval $inlibc | |
9803 | ||
87b71857 JH |
9804 | : see if this is a sys/mman.h system |
9805 | set sys/mman.h i_sysmman | |
9806 | eval $inhdr | |
9807 | ||
9808 | : see if mmap exists | |
9809 | set mmap d_mmap | |
9810 | eval $inlibc | |
9811 | : see what shmat returns | |
9812 | : default to something harmless | |
9813 | mmaptype='void *' | |
9814 | case "$i_sysmman$d_mmap" in | |
9815 | "$define$define") | |
9816 | $cat >mmap.c <<'END' | |
9817 | #include <sys/mman.h> | |
9818 | void *mmap(); | |
9819 | END | |
9820 | if $cc $ccflags -c mmap.c >/dev/null 2>&1; then | |
9821 | mmaptype='void *' | |
9822 | else | |
9823 | mmaptype='caddr_t' | |
9824 | fi | |
9825 | echo "and it returns ($mmaptype)." >&4 | |
9826 | ;; | |
9827 | esac | |
9828 | ||
9829 | ||
9830 | ||
a3540c92 JH |
9831 | : see if modfl exists |
9832 | set modfl d_modfl | |
9833 | eval $inlibc | |
9834 | ||
fe749a9f JH |
9835 | : see if mprotect exists |
9836 | set mprotect d_mprotect | |
9837 | eval $inlibc | |
9838 | ||
2304df62 AD |
9839 | : see if msgctl exists |
9840 | set msgctl d_msgctl | |
9841 | eval $inlibc | |
9842 | ||
9843 | : see if msgget exists | |
9844 | set msgget d_msgget | |
9845 | eval $inlibc | |
9846 | ||
9847 | : see if msgsnd exists | |
9848 | set msgsnd d_msgsnd | |
9849 | eval $inlibc | |
9850 | ||
9851 | : see if msgrcv exists | |
9852 | set msgrcv d_msgrcv | |
9853 | eval $inlibc | |
9854 | ||
9855 | : see how much of the 'msg*(2)' library is present. | |
9856 | h_msg=true | |
9857 | echo " " | |
9858 | case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in | |
9859 | *"$undef"*) h_msg=false;; | |
9860 | esac | |
6087ac44 JH |
9861 | case "$osname" in |
9862 | freebsd) | |
9863 | case "`ipcs 2>&1`" in | |
9864 | "SVID messages"*"not configured"*) | |
5ff3f7a4 | 9865 | echo "Your $osname does not have the msg*(2) configured." >&4 |
6087ac44 JH |
9866 | h_msg=false |
9867 | val="$undef" | |
9868 | set msgctl d_msgctl | |
9869 | eval $setvar | |
9870 | set msgget d_msgget | |
9871 | eval $setvar | |
9872 | set msgsnd d_msgsnd | |
9873 | eval $setvar | |
9874 | set msgrcv d_msgrcv | |
9875 | eval $setvar | |
9876 | ;; | |
9877 | esac | |
9878 | ;; | |
9879 | esac | |
2304df62 AD |
9880 | : we could also check for sys/ipc.h ... |
9881 | if $h_msg && $test `./findhdr sys/msg.h`; then | |
9882 | echo "You have the full msg*(2) library." >&4 | |
9883 | val="$define" | |
9884 | else | |
9885 | echo "You don't have the full msg*(2) library." >&4 | |
9886 | val="$undef" | |
9887 | fi | |
9888 | set d_msg | |
9889 | eval $setvar | |
9890 | ||
fe749a9f JH |
9891 | : see if msync exists |
9892 | set msync d_msync | |
dfe9444c AD |
9893 | eval $inlibc |
9894 | ||
fe749a9f JH |
9895 | : see if munmap exists |
9896 | set munmap d_munmap | |
9897 | eval $inlibc | |
ff935051 | 9898 | |
fe749a9f JH |
9899 | : see if nice exists |
9900 | set nice d_nice | |
9901 | eval $inlibc | |
ff935051 | 9902 | |
de1c2614 JH |
9903 | |
9904 | echo " " | |
6b8eaf93 | 9905 | echo "Checking which 64-bit integer type we could use..." >&4 |
de1c2614 JH |
9906 | |
9907 | case "$intsize" in | |
9908 | 8) val=int | |
9909 | set quadtype | |
9910 | eval $setvar | |
9911 | val='"unsigned int"' | |
9912 | set uquadtype | |
9913 | eval $setvar | |
6b8eaf93 | 9914 | quadkind=1 |
de1c2614 JH |
9915 | ;; |
9916 | *) case "$longsize" in | |
9917 | 8) val=long | |
9918 | set quadtype | |
9919 | eval $setvar | |
9920 | val='"unsigned long"' | |
9921 | set uquadtype | |
9922 | eval $setvar | |
6b8eaf93 | 9923 | quadkind=2 |
de1c2614 | 9924 | ;; |
43999f95 JH |
9925 | *) case "$d_longlong:$longlongsize" in |
9926 | define:8) | |
de1c2614 JH |
9927 | val='"long long"' |
9928 | set quadtype | |
9929 | eval $setvar | |
9930 | val='"unsigned long long"' | |
9931 | set uquadtype | |
9932 | eval $setvar | |
6b8eaf93 | 9933 | quadkind=3 |
de1c2614 | 9934 | ;; |
13b3f787 | 9935 | *) case "$d_int64_t" in |
de1c2614 JH |
9936 | define) |
9937 | val=int64_t | |
9938 | set quadtype | |
9939 | eval $setvar | |
9940 | val=uint64_t | |
9941 | set uquadtype | |
9942 | eval $setvar | |
6b8eaf93 | 9943 | quadkind=4 |
de1c2614 JH |
9944 | ;; |
9945 | esac | |
9946 | ;; | |
9947 | esac | |
9948 | ;; | |
9949 | esac | |
9950 | ;; | |
9951 | esac | |
9952 | ||
9953 | case "$quadtype" in | |
ad551343 | 9954 | '') echo "Alas, no 64-bit integer types in sight." >&4 |
de1c2614 JH |
9955 | d_quad="$undef" |
9956 | ;; | |
10cc9d2a | 9957 | *) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then |
1eeb0f31 JH |
9958 | verb="will" |
9959 | else | |
9960 | verb="could" | |
9961 | fi | |
9962 | echo "We $verb use '$quadtype' for 64-bit integers." >&4 | |
de1c2614 JH |
9963 | d_quad="$define" |
9964 | ;; | |
9965 | esac | |
9966 | ||
cce08f5b JH |
9967 | : check for length of character |
9968 | echo " " | |
9969 | case "$charsize" in | |
9970 | '') | |
9971 | echo "Checking to see how big your characters are (hey, you never know)..." >&4 | |
9972 | $cat >try.c <<'EOCP' | |
9973 | #include <stdio.h> | |
9974 | int main() | |
9975 | { | |
9976 | printf("%d\n", (int)sizeof(char)); | |
9977 | exit(0); | |
9978 | } | |
9979 | EOCP | |
9980 | set try | |
9981 | if eval $compile_ok; then | |
9982 | dflt=`./try` | |
9983 | else | |
9984 | dflt='1' | |
9985 | echo "(I can't seem to compile the test program. Guessing...)" | |
9986 | fi | |
9987 | ;; | |
9988 | *) | |
9989 | dflt="$charsize" | |
9990 | ;; | |
9991 | esac | |
9992 | rp="What is the size of a character (in bytes)?" | |
9993 | . ./myread | |
9994 | charsize="$ans" | |
9995 | $rm -f try.c try | |
9996 | ||
9997 | ||
9998 | echo " " | |
9999 | $echo "Choosing the C types to be used for Perl's internal types..." >&4 | |
10000 | ||
10cc9d2a | 10001 | case "$use64bitint:$d_quad:$quadtype" in |
cce08f5b JH |
10002 | define:define:?*) |
10003 | ivtype="$quadtype" | |
10004 | uvtype="$uquadtype" | |
10005 | ivsize=8 | |
10006 | uvsize=8 | |
10007 | ;; | |
10008 | *) ivtype="long" | |
10009 | uvtype="unsigned long" | |
10010 | ivsize=$longsize | |
10011 | uvsize=$longsize | |
10012 | ;; | |
10013 | esac | |
10014 | ||
10015 | case "$uselongdouble:$d_longdbl" in | |
10016 | define:define) | |
10017 | nvtype="long double" | |
10018 | nvsize=$longdblsize | |
10019 | ;; | |
10020 | *) nvtype=double | |
10021 | nvsize=$doublesize | |
10022 | ;; | |
10023 | esac | |
10024 | ||
10025 | $echo "(IV will be "$ivtype", $ivsize bytes)" | |
10026 | $echo "(UV will be "$uvtype", $uvsize bytes)" | |
10027 | $echo "(NV will be "$nvtype", $nvsize bytes)" | |
10028 | ||
10029 | $cat >try.c <<EOCP | |
10030 | #$i_inttypes I_INTTYPES | |
10031 | #ifdef I_INTTYPES | |
10032 | #include <inttypes.h> | |
10033 | #endif | |
10034 | #include <stdio.h> | |
10035 | int main() { | |
10036 | #ifdef INT8 | |
10037 | int8_t i = INT8_MAX; | |
10038 | uint8_t u = UINT8_MAX; | |
10039 | printf("int8_t\n"); | |
10040 | #endif | |
10041 | #ifdef INT16 | |
10042 | int16_t i = INT16_MAX; | |
10043 | uint16_t i = UINT16_MAX; | |
10044 | printf("int16_t\n"); | |
10045 | #endif | |
10046 | #ifdef INT32 | |
10047 | int32_t i = INT32_MAX; | |
10048 | uint32_t u = UINT32_MAX; | |
10049 | printf("int32_t\n"); | |
10050 | #endif | |
10051 | } | |
10052 | EOCP | |
10053 | ||
10054 | case "$i8type" in | |
10055 | '') case "$charsize" in | |
10056 | 1) i8type=char | |
10057 | u8type="unsigned char" | |
10058 | i8size=$charsize | |
10059 | u8size=$charsize | |
10060 | ;; | |
10061 | esac | |
10062 | ;; | |
10063 | esac | |
10064 | case "$i8type" in | |
10065 | '') set try -DINT8 | |
10066 | if eval $compile; then | |
10067 | case "`./try$exe_ext`" in | |
10068 | int8_t) i8type=int8_t | |
10069 | u8type=uint8_t | |
10070 | i8size=1 | |
10071 | u8size=1 | |
10072 | ;; | |
10073 | esac | |
10074 | fi | |
10075 | ;; | |
10076 | esac | |
10077 | case "$i8type" in | |
10078 | '') if $test $charsize -ge 1; then | |
10079 | i8type=char | |
10080 | u8type="unsigned char" | |
10081 | i8size=$charsize | |
10082 | u8size=$charsize | |
10083 | fi | |
10084 | ;; | |
10085 | esac | |
10086 | ||
10087 | case "$i16type" in | |
10088 | '') case "$shortsize" in | |
10089 | 2) i16type=short | |
10090 | u16type="unsigned short" | |
10091 | i16size=$shortsize | |
10092 | u16size=$shortsize | |
10093 | ;; | |
10094 | esac | |
10095 | ;; | |
10096 | esac | |
10097 | case "$i16type" in | |
10098 | '') set try -DINT16 | |
10099 | if eval $compile; then | |
10100 | case "`./try$exe_ext`" in | |
10101 | int16_t) | |
10102 | i16type=int16_t | |
10103 | u16type=uint16_t | |
10104 | i16size=2 | |
10105 | u16size=2 | |
10106 | ;; | |
10107 | esac | |
10108 | fi | |
10109 | ;; | |
10110 | esac | |
10111 | case "$i16type" in | |
10112 | '') if $test $shortsize -ge 2; then | |
10113 | i16type=short | |
10114 | u16type="unsigned short" | |
10115 | i16size=$shortsize | |
10116 | u16size=$shortsize | |
10117 | fi | |
10118 | ;; | |
10119 | esac | |
10120 | ||
10121 | case "$i32type" in | |
10122 | '') case "$longsize" in | |
10123 | 4) i32type=long | |
10124 | u32type="unsigned long" | |
10125 | i32size=$longsize | |
10126 | u32size=$longsize | |
10127 | ;; | |
10128 | *) case "$intsize" in | |
10129 | 4) i32type=int | |
10130 | u32type="unsigned int" | |
10131 | i32size=$intsize | |
10132 | u32size=$intsize | |
10133 | ;; | |
10134 | esac | |
10135 | ;; | |
10136 | esac | |
10137 | ;; | |
10138 | esac | |
10139 | case "$i32type" in | |
10140 | '') set try -DINT32 | |
10141 | if eval $compile; then | |
10142 | case "`./try$exe_ext`" in | |
10143 | int32_t) | |
10144 | i32type=int32_t | |
10145 | u32type=uint32_t | |
10146 | i32size=4 | |
10147 | u32size=4 | |
10148 | ;; | |
10149 | esac | |
10150 | fi | |
10151 | ;; | |
10152 | esac | |
10153 | case "$i32type" in | |
10154 | '') if $test $intsize -ge 4; then | |
10155 | i32type=int | |
10156 | u32type="unsigned int" | |
10157 | i32size=$intsize | |
10158 | u32size=$intsize | |
10159 | fi | |
10160 | ;; | |
10161 | esac | |
10162 | ||
10163 | case "$i64type" in | |
10164 | '') case "$d_quad:$quadtype" in | |
10165 | define:?*) | |
10166 | i64type="$quadtype" | |
10167 | u64type="$uquadtype" | |
10168 | i64size=8 | |
10169 | u64size=8 | |
10170 | ;; | |
10171 | esac | |
10172 | ;; | |
10173 | esac | |
10174 | ||
10175 | $echo "Checking whether your NVs can preserve your UVs..." >&4 | |
10176 | $cat <<EOP >try.c | |
10177 | #include <stdio.h> | |
10178 | int main() { | |
10179 | $uvtype k = ($uvtype)~0, l; | |
10180 | $nvtype d; | |
10181 | l = k; | |
10182 | d = ($nvtype)l; | |
10183 | l = ($uvtype)d; | |
10184 | if (l == k) | |
10185 | printf("preserve\n"); | |
10186 | exit(0); | |
10187 | } | |
10188 | EOP | |
10189 | set try | |
10190 | if eval $compile; then | |
10191 | case "`./try$exe_ext`" in | |
78691af5 | 10192 | preserve) d_nv_preserves_uv="$define" ;; |
cce08f5b JH |
10193 | esac |
10194 | fi | |
78691af5 | 10195 | case "$d_nv_preserves_uv" in |
cce08f5b JH |
10196 | $define) $echo "Yes, they can." 2>&1 ;; |
10197 | *) $echo "No, they can't." 2>&1 | |
78691af5 | 10198 | d_nv_preserves_uv="$undef" |
cce08f5b JH |
10199 | ;; |
10200 | esac | |
10201 | ||
10202 | $rm -f try.* try | |
10203 | ||
c5f05a91 JH |
10204 | |
10205 | : check for off64_t | |
10206 | echo " " | |
10207 | echo "Checking to see if you have off64_t..." >&4 | |
10208 | $cat >try.c <<EOCP | |
10209 | #include <sys/types.h> | |
10210 | #include <unistd.h> | |
10211 | int main() { off64_t x = 7; } | |
10212 | EOCP | |
10213 | set try | |
10214 | if eval $compile; then | |
10215 | val="$define" | |
10216 | echo "You have off64_t." | |
10217 | else | |
10218 | val="$undef" | |
10219 | echo "You do not have off64_t." | |
10220 | case "$lseeksize" in | |
10221 | 8) echo "(Your off_t is 64 bits, so you could use that.)" ;; | |
10222 | esac | |
10223 | fi | |
10224 | $rm -f try.* try | |
10225 | set d_off64_t | |
10226 | eval $setvar | |
10227 | ||
c4747d3e | 10228 | : see if POSIX threads are available |
1f5ae88c JH |
10229 | set pthread.h i_pthread |
10230 | eval $inhdr | |
10231 | ||
c4747d3e JH |
10232 | |
10233 | ||
10234 | ||
10235 | : how to create joinable pthreads | |
10236 | if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then | |
13666627 JH |
10237 | echo " " |
10238 | echo "Checking what constant to use for creating joinable pthreads..." >&4 | |
10239 | $cat >try.c <<'EOCP' | |
10240 | #include <pthread.h> | |
10241 | int main() { | |
10242 | int detachstate = JOINABLE; | |
10243 | } | |
10244 | EOCP | |
10245 | set try -DJOINABLE=PTHREAD_CREATE_JOINABLE | |
10246 | if eval $compile; then | |
c6912327 | 10247 | echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4 |
ef4af2be JH |
10248 | val="$undef" # Yes, undef. |
10249 | set d_old_pthread_create_joinable | |
13666627 | 10250 | eval $setvar |
ef4af2be JH |
10251 | val="" |
10252 | set old_pthread_create_joinable | |
13666627 JH |
10253 | eval $setvar |
10254 | else | |
10255 | set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED | |
10256 | if eval $compile; then | |
c6912327 | 10257 | echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4 |
13666627 | 10258 | val="$define" |
ef4af2be | 10259 | set d_old_pthread_create_joinable |
13666627 JH |
10260 | eval $setvar |
10261 | val=PTHREAD_CREATE_UNDETACHED | |
ef4af2be | 10262 | set old_pthread_create_joinable |
13666627 JH |
10263 | eval $setvar |
10264 | else | |
10265 | set try -DJOINABLE=__UNDETACHED | |
10266 | if eval $compile; then | |
c6912327 | 10267 | echo "You seem to use __UNDETACHED." >&4 |
13666627 | 10268 | val="$define" |
ef4af2be | 10269 | set d_old_pthread_create_joinable |
13666627 JH |
10270 | eval $setvar |
10271 | val=__UNDETACHED | |
ef4af2be | 10272 | set old_pthread_create_joinable |
13666627 JH |
10273 | eval $setvar |
10274 | else | |
c6912327 | 10275 | echo "Egads, nothing obvious found. Guessing that you use 0." >&4 |
13666627 | 10276 | val="$define" |
ef4af2be | 10277 | set d_old_pthread_create_joinable |
13666627 JH |
10278 | eval $setvar |
10279 | val=0 | |
ef4af2be | 10280 | set old_pthread_create_joinable |
13666627 JH |
10281 | eval $setvar |
10282 | fi | |
10283 | fi | |
10284 | fi | |
10285 | $rm -f try try.* | |
10286 | else | |
ef4af2be JH |
10287 | d_old_pthread_create_joinable="$undef" |
10288 | old_pthread_create_joinable="" | |
13666627 JH |
10289 | fi |
10290 | ||
ef4af2be JH |
10291 | : see if pause exists |
10292 | set pause d_pause | |
10293 | eval $inlibc | |
10294 | ||
10295 | : see if pipe exists | |
10296 | set pipe d_pipe | |
10297 | eval $inlibc | |
10298 | ||
10299 | : see if poll exists | |
10300 | set poll d_poll | |
10301 | eval $inlibc | |
10302 | ||
31dfa2f6 JH |
10303 | |
10304 | : see whether the various POSIXish _yields exist | |
10305 | $cat >try.c <<EOP | |
10306 | #include <pthread.h> | |
10307 | #include <stdio.h> | |
5a411a32 | 10308 | int main() { |
31dfa2f6 JH |
10309 | #ifdef SCHED_YIELD |
10310 | sched_yield(); | |
10311 | #else | |
10312 | #ifdef PTHREAD_YIELD | |
10313 | pthread_yield(); | |
10314 | #else | |
10315 | #ifdef PTHREAD_YIELD_NULL | |
10316 | pthread_yield(NULL); | |
10317 | #endif | |
10318 | #endif | |
10319 | #endif | |
10320 | } | |
10321 | EOP | |
10322 | : see if sched_yield exists | |
10323 | set try -DSCHED_YIELD | |
10324 | if eval $compile; then | |
10325 | val="$define" | |
10326 | sched_yield='sched_yield()' | |
10327 | else | |
10328 | val="$undef" | |
10329 | fi | |
10330 | case "$usethreads" in | |
10331 | $define) | |
10332 | case "$val" in | |
10333 | $define) echo 'sched_yield() found.' >&4 ;; | |
10334 | *) echo 'sched_yield() NOT found.' >&4 ;; | |
10335 | esac | |
10336 | esac | |
10337 | set d_sched_yield | |
10338 | eval $setvar | |
10339 | ||
10340 | : see if pthread_yield exists | |
10341 | set try -DPTHREAD_YIELD | |
10342 | if eval $compile; then | |
10343 | val="$define" | |
10344 | case "$sched_yield" in | |
10345 | '') sched_yield='pthread_yield()' ;; | |
10346 | esac | |
10347 | else | |
10348 | set try -DPTHREAD_YIELD_NULL | |
10349 | if eval $compile; then | |
10350 | val="$define" | |
10351 | case "$sched_yield" in | |
10352 | '') sched_yield='pthread_yield(NULL)' ;; | |
10353 | esac | |
10354 | else | |
10355 | val="$undef" | |
10356 | fi | |
10357 | fi | |
10358 | case "$usethreads" in | |
10359 | $define) | |
10360 | case "$val" in | |
10361 | $define) echo 'pthread_yield() found.' >&4 ;; | |
10362 | *) echo 'pthread_yield() NOT found.' >&4 ;; | |
10363 | esac | |
10364 | ;; | |
10365 | esac | |
10366 | set d_pthread_yield | |
10367 | eval $setvar | |
10368 | ||
10369 | case "$sched_yield" in | |
10370 | '') sched_yield=undef ;; | |
10371 | esac | |
10372 | ||
10373 | $rm -f try try.* | |
10374 | ||
4aa0a1f7 AD |
10375 | : see if this is a pwd.h system |
10376 | set pwd.h i_pwd | |
10377 | eval $inhdr | |
10378 | ||
10379 | case "$i_pwd" in | |
10380 | $define) | |
10381 | xxx=`./findhdr pwd.h` | |
85e6fe83 | 10382 | $cppstdin $cppflags $cppminus < $xxx >$$.h |
4aa0a1f7 | 10383 | |
2304df62 | 10384 | if $contains 'pw_quota' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 10385 | val="$define" |
2304df62 | 10386 | else |
4aa0a1f7 | 10387 | val="$undef" |
2304df62 | 10388 | fi |
4aa0a1f7 AD |
10389 | set d_pwquota |
10390 | eval $setvar | |
10391 | ||
2304df62 | 10392 | if $contains 'pw_age' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 10393 | val="$define" |
2304df62 | 10394 | else |
4aa0a1f7 | 10395 | val="$undef" |
2304df62 | 10396 | fi |
4aa0a1f7 AD |
10397 | set d_pwage |
10398 | eval $setvar | |
10399 | ||
2304df62 | 10400 | if $contains 'pw_change' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 10401 | val="$define" |
2304df62 | 10402 | else |
4aa0a1f7 | 10403 | val="$undef" |
2304df62 | 10404 | fi |
4aa0a1f7 AD |
10405 | set d_pwchange |
10406 | eval $setvar | |
10407 | ||
2304df62 | 10408 | if $contains 'pw_class' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 10409 | val="$define" |
2304df62 | 10410 | else |
4aa0a1f7 | 10411 | val="$undef" |
2304df62 | 10412 | fi |
4aa0a1f7 AD |
10413 | set d_pwclass |
10414 | eval $setvar | |
10415 | ||
2304df62 | 10416 | if $contains 'pw_expire' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 10417 | val="$define" |
2304df62 | 10418 | else |
4aa0a1f7 | 10419 | val="$undef" |
2304df62 | 10420 | fi |
4aa0a1f7 | 10421 | set d_pwexpire |
cce08f5b | 10422 | eval $setvar |
de1c2614 | 10423 | |
cce08f5b JH |
10424 | if $contains 'pw_comment' $$.h >/dev/null 2>&1; then |
10425 | val="$define" | |
1eeb0f31 | 10426 | else |
cce08f5b | 10427 | val="$undef" |
1eeb0f31 | 10428 | fi |
cce08f5b JH |
10429 | set d_pwcomment |
10430 | eval $setvar | |
10431 | ||
10432 | if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then | |
10433 | val="$define" | |
10434 | else | |
10435 | val="$undef" | |
10436 | fi | |
10437 | set d_pwgecos | |
10438 | eval $setvar | |
10439 | ||
10440 | if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then | |
10441 | val="$define" | |
10442 | else | |
10443 | val="$undef" | |
10444 | fi | |
10445 | set d_pwpasswd | |
10446 | eval $setvar | |
10447 | ||
10448 | $rm -f $$.h | |
10449 | ;; | |
10450 | *) | |
10451 | val="$undef"; | |
10452 | set d_pwquota; eval $setvar | |
10453 | set d_pwage; eval $setvar | |
10454 | set d_pwchange; eval $setvar | |
10455 | set d_pwclass; eval $setvar | |
10456 | set d_pwexpire; eval $setvar | |
10457 | set d_pwcomment; eval $setvar | |
10458 | set d_pwgecos; eval $setvar | |
10459 | set d_pwpasswd; eval $setvar | |
de1c2614 JH |
10460 | ;; |
10461 | esac | |
10462 | ||
85e6fe83 | 10463 | : see if readdir and friends exist |
2304df62 AD |
10464 | set readdir d_readdir |
10465 | eval $inlibc | |
85e6fe83 LW |
10466 | set seekdir d_seekdir |
10467 | eval $inlibc | |
10468 | set telldir d_telldir | |
10469 | eval $inlibc | |
10470 | set rewinddir d_rewinddir | |
10471 | eval $inlibc | |
2304df62 | 10472 | |
a0d0e21e LW |
10473 | : see if readlink exists |
10474 | set readlink d_readlink | |
10475 | eval $inlibc | |
10476 | ||
2304df62 AD |
10477 | : see if rename exists |
10478 | set rename d_rename | |
10479 | eval $inlibc | |
10480 | ||
10481 | : see if rmdir exists | |
10482 | set rmdir d_rmdir | |
10483 | eval $inlibc | |
10484 | ||
8ff267be | 10485 | : see if memory.h is available. |
10486 | val='' | |
10487 | set memory.h val | |
10488 | eval $inhdr | |
10489 | ||
10490 | : See if it conflicts with string.h | |
10491 | case "$val" in | |
10492 | $define) | |
10493 | case "$strings" in | |
10494 | '') ;; | |
10495 | *) | |
10496 | $cppstdin $cppflags $cppminus < $strings > mem.h | |
10497 | if $contains 'memcpy' mem.h >/dev/null 2>&1; then | |
10498 | echo " " | |
10499 | echo "We won't be including <memory.h>." | |
10500 | val="$undef" | |
10501 | fi | |
10502 | $rm -f mem.h | |
10503 | ;; | |
10504 | esac | |
10505 | esac | |
10506 | set i_memory | |
10507 | eval $setvar | |
10508 | ||
2304df62 AD |
10509 | : can bcopy handle overlapping blocks? |
10510 | val="$undef" | |
10511 | case "$d_bcopy" in | |
10512 | "$define") | |
10513 | echo " " | |
10514 | echo "Checking to see if your bcopy() can do overlapping copies..." >&4 | |
dfe9444c | 10515 | $cat >try.c <<EOCP |
8ff267be | 10516 | #$i_memory I_MEMORY |
10517 | #$i_stdlib I_STDLIB | |
10518 | #$i_string I_STRING | |
10519 | #$i_unistd I_UNISTD | |
10520 | EOCP | |
dfe9444c | 10521 | $cat >>try.c <<'EOCP' |
8ff267be | 10522 | #include <stdio.h> |
8ff267be | 10523 | #ifdef I_MEMORY |
10524 | # include <memory.h> | |
10525 | #endif | |
10526 | #ifdef I_STDLIB | |
10527 | # include <stdlib.h> | |
10528 | #endif | |
10529 | #ifdef I_STRING | |
10530 | # include <string.h> | |
10531 | #else | |
10532 | # include <strings.h> | |
10533 | #endif | |
10534 | #ifdef I_UNISTD | |
10535 | # include <unistd.h> /* Needed for NetBSD */ | |
10536 | #endif | |
d674cd6d | 10537 | int main() |
2304df62 | 10538 | { |
85e6fe83 LW |
10539 | char buf[128], abc[128]; |
10540 | char *b; | |
10541 | int len; | |
10542 | int off; | |
10543 | int align; | |
a0d0e21e | 10544 | |
85e6fe83 | 10545 | bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36); |
2304df62 AD |
10546 | |
10547 | for (align = 7; align >= 0; align--) { | |
10548 | for (len = 36; len; len--) { | |
10549 | b = buf+align; | |
85e6fe83 | 10550 | bcopy(abc, b, len); |
2304df62 AD |
10551 | for (off = 1; off <= len; off++) { |
10552 | bcopy(b, b+off, len); | |
10553 | bcopy(b+off, b, len); | |
85e6fe83 | 10554 | if (bcmp(b, abc, len)) |
2304df62 AD |
10555 | exit(1); |
10556 | } | |
10557 | } | |
10558 | } | |
10559 | exit(0); | |
10560 | } | |
10561 | EOCP | |
dfe9444c | 10562 | set try |
dc45a647 | 10563 | if eval $compile_ok; then |
dfe9444c | 10564 | if ./try 2>/dev/null; then |
2304df62 AD |
10565 | echo "Yes, it can." |
10566 | val="$define" | |
10567 | else | |
10568 | echo "It can't, sorry." | |
8ff267be | 10569 | case "$d_memmove" in |
10570 | "$define") echo "But that's Ok since you have memmove()." ;; | |
10571 | esac | |
2304df62 AD |
10572 | fi |
10573 | else | |
10574 | echo "(I can't compile the test program, so we'll assume not...)" | |
8ff267be | 10575 | case "$d_memmove" in |
10576 | "$define") echo "But that's Ok since you have memmove()." ;; | |
10577 | esac | |
2304df62 AD |
10578 | fi |
10579 | ;; | |
10580 | esac | |
dfe9444c | 10581 | $rm -f try.* try core |
2304df62 AD |
10582 | set d_safebcpy |
10583 | eval $setvar | |
10584 | ||
10585 | : can memcpy handle overlapping blocks? | |
10586 | val="$undef" | |
10587 | case "$d_memcpy" in | |
10588 | "$define") | |
10589 | echo " " | |
10590 | echo "Checking to see if your memcpy() can do overlapping copies..." >&4 | |
dfe9444c | 10591 | $cat >try.c <<EOCP |
8ff267be | 10592 | #$i_memory I_MEMORY |
10593 | #$i_stdlib I_STDLIB | |
10594 | #$i_string I_STRING | |
10595 | #$i_unistd I_UNISTD | |
10596 | EOCP | |
dfe9444c | 10597 | $cat >>try.c <<'EOCP' |
8ff267be | 10598 | #include <stdio.h> |
8ff267be | 10599 | #ifdef I_MEMORY |
10600 | # include <memory.h> | |
10601 | #endif | |
10602 | #ifdef I_STDLIB | |
10603 | # include <stdlib.h> | |
10604 | #endif | |
10605 | #ifdef I_STRING | |
10606 | # include <string.h> | |
10607 | #else | |
10608 | # include <strings.h> | |
10609 | #endif | |
10610 | #ifdef I_UNISTD | |
10611 | # include <unistd.h> /* Needed for NetBSD */ | |
10612 | #endif | |
d674cd6d | 10613 | int main() |
2304df62 | 10614 | { |
85e6fe83 LW |
10615 | char buf[128], abc[128]; |
10616 | char *b; | |
10617 | int len; | |
10618 | int off; | |
10619 | int align; | |
10620 | ||
8ff267be | 10621 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
10622 | try to store the string in read-only memory. */ | |
85e6fe83 | 10623 | memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36); |
2304df62 AD |
10624 | |
10625 | for (align = 7; align >= 0; align--) { | |
10626 | for (len = 36; len; len--) { | |
10627 | b = buf+align; | |
232e078e | 10628 | memcpy(b, abc, len); |
2304df62 | 10629 | for (off = 1; off <= len; off++) { |
2304df62 | 10630 | memcpy(b+off, b, len); |
232e078e | 10631 | memcpy(b, b+off, len); |
85e6fe83 | 10632 | if (memcmp(b, abc, len)) |
2304df62 AD |
10633 | exit(1); |
10634 | } | |
10635 | } | |
10636 | } | |
10637 | exit(0); | |
10638 | } | |
10639 | EOCP | |
dfe9444c | 10640 | set try |
dc45a647 | 10641 | if eval $compile_ok; then |
dfe9444c | 10642 | if ./try 2>/dev/null; then |
2304df62 AD |
10643 | echo "Yes, it can." |
10644 | val="$define" | |
10645 | else | |
10646 | echo "It can't, sorry." | |
8ff267be | 10647 | case "$d_memmove" in |
10648 | "$define") echo "But that's Ok since you have memmove()." ;; | |
10649 | esac | |
2304df62 AD |
10650 | fi |
10651 | else | |
10652 | echo "(I can't compile the test program, so we'll assume not...)" | |
8ff267be | 10653 | case "$d_memmove" in |
10654 | "$define") echo "But that's Ok since you have memmove()." ;; | |
10655 | esac | |
2304df62 AD |
10656 | fi |
10657 | ;; | |
10658 | esac | |
dfe9444c | 10659 | $rm -f try.* try core |
2304df62 AD |
10660 | set d_safemcpy |
10661 | eval $setvar | |
10662 | ||
36477c24 | 10663 | : can memcmp be trusted to compare relative magnitude? |
10664 | val="$undef" | |
10665 | case "$d_memcmp" in | |
10666 | "$define") | |
10667 | echo " " | |
dfe9444c AD |
10668 | echo "Checking if your memcmp() can compare relative magnitude..." >&4 |
10669 | $cat >try.c <<EOCP | |
36477c24 | 10670 | #$i_memory I_MEMORY |
10671 | #$i_stdlib I_STDLIB | |
10672 | #$i_string I_STRING | |
10673 | #$i_unistd I_UNISTD | |
10674 | EOCP | |
dfe9444c | 10675 | $cat >>try.c <<'EOCP' |
36477c24 | 10676 | #include <stdio.h> |
36477c24 | 10677 | #ifdef I_MEMORY |
10678 | # include <memory.h> | |
10679 | #endif | |
10680 | #ifdef I_STDLIB | |
10681 | # include <stdlib.h> | |
10682 | #endif | |
10683 | #ifdef I_STRING | |
10684 | # include <string.h> | |
10685 | #else | |
10686 | # include <strings.h> | |
10687 | #endif | |
10688 | #ifdef I_UNISTD | |
10689 | # include <unistd.h> /* Needed for NetBSD */ | |
10690 | #endif | |
d674cd6d | 10691 | int main() |
36477c24 | 10692 | { |
10693 | char a = -1; | |
10694 | char b = 0; | |
10695 | if ((a < b) && memcmp(&a, &b, 1) < 0) | |
10696 | exit(1); | |
10697 | exit(0); | |
10698 | } | |
10699 | EOCP | |
dfe9444c | 10700 | set try |
dc45a647 | 10701 | if eval $compile_ok; then |
dfe9444c | 10702 | if ./try 2>/dev/null; then |
36477c24 | 10703 | echo "Yes, it can." |
10704 | val="$define" | |
10705 | else | |
10706 | echo "No, it can't (it uses signed chars)." | |
10707 | fi | |
10708 | else | |
10709 | echo "(I can't compile the test program, so we'll assume not...)" | |
10710 | fi | |
10711 | ;; | |
10712 | esac | |
dfe9444c | 10713 | $rm -f try.* try core |
36477c24 | 10714 | set d_sanemcmp |
10715 | eval $setvar | |
10716 | ||
2304df62 AD |
10717 | : see if select exists |
10718 | set select d_select | |
10719 | eval $inlibc | |
10720 | ||
10721 | : see if semctl exists | |
10722 | set semctl d_semctl | |
10723 | eval $inlibc | |
10724 | ||
10725 | : see if semget exists | |
10726 | set semget d_semget | |
10727 | eval $inlibc | |
10728 | ||
10729 | : see if semop exists | |
10730 | set semop d_semop | |
10731 | eval $inlibc | |
10732 | ||
10733 | : see how much of the 'sem*(2)' library is present. | |
10734 | h_sem=true | |
10735 | echo " " | |
10736 | case "$d_semctl$d_semget$d_semop" in | |
10737 | *"$undef"*) h_sem=false;; | |
10738 | esac | |
6087ac44 JH |
10739 | case "$osname" in |
10740 | freebsd) | |
10741 | case "`ipcs 2>&1`" in | |
10742 | "SVID messages"*"not configured"*) | |
5ff3f7a4 | 10743 | echo "Your $osname does not have the sem*(2) configured." >&4 |
6087ac44 JH |
10744 | h_sem=false |
10745 | val="$undef" | |
10746 | set semctl d_semctl | |
10747 | eval $setvar | |
10748 | set semget d_semget | |
10749 | eval $setvar | |
10750 | set semop d_semop | |
10751 | eval $setvar | |
10752 | ;; | |
10753 | esac | |
10754 | ;; | |
10755 | esac | |
2304df62 AD |
10756 | : we could also check for sys/ipc.h ... |
10757 | if $h_sem && $test `./findhdr sys/sem.h`; then | |
10758 | echo "You have the full sem*(2) library." >&4 | |
10759 | val="$define" | |
10760 | else | |
10761 | echo "You don't have the full sem*(2) library." >&4 | |
10762 | val="$undef" | |
10763 | fi | |
10764 | set d_sem | |
10765 | eval $setvar | |
10766 | ||
bd89102f AD |
10767 | : see whether sys/sem.h defines union semun |
10768 | echo " " | |
10769 | $cat > try.c <<'END' | |
10770 | #include <sys/types.h> | |
10771 | #include <sys/ipc.h> | |
10772 | #include <sys/sem.h> | |
10773 | int main () { union semun semun; semun.buf = 0; } | |
10774 | END | |
10775 | set try | |
10776 | if eval $compile; then | |
10777 | echo "You have union semun in <sys/sem.h>." >&4 | |
10778 | val="$define" | |
10779 | else | |
10780 | echo "You do not have union semun in <sys/sem.h>." >&4 | |
10781 | val="$undef" | |
10782 | fi | |
85ab1d1d | 10783 | $rm -f try try.c try.h |
bd89102f AD |
10784 | set d_union_semun |
10785 | eval $setvar | |
10786 | ||
10787 | : see how to do semctl IPC_STAT | |
10788 | case "$d_sem" in | |
10789 | $define) | |
10790 | : see whether semctl IPC_STAT can use union semun | |
10791 | echo " " | |
85ab1d1d JH |
10792 | $cat > try.h <<END |
10793 | #ifndef S_IRUSR | |
10794 | # ifdef S_IREAD | |
10795 | # define S_IRUSR S_IREAD | |
10796 | # define S_IWUSR S_IWRITE | |
10797 | # define S_IXUSR S_IEXEC | |
10798 | # else | |
10799 | # define S_IRUSR 0400 | |
10800 | # define S_IWUSR 0200 | |
10801 | # define S_IXUSR 0100 | |
10802 | # endif | |
10803 | # define S_IRGRP (S_IRUSR>>3) | |
10804 | # define S_IWGRP (S_IWUSR>>3) | |
10805 | # define S_IXGRP (S_IXUSR>>3) | |
10806 | # define S_IROTH (S_IRUSR>>6) | |
10807 | # define S_IWOTH (S_IWUSR>>6) | |
10808 | # define S_IXOTH (S_IXUSR>>6) | |
10809 | #endif | |
10810 | #ifndef S_IRWXU | |
10811 | # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) | |
10812 | # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) | |
10813 | # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) | |
10814 | #endif | |
10815 | END | |
10816 | ||
bd89102f AD |
10817 | $cat > try.c <<END |
10818 | #include <sys/types.h> | |
10819 | #include <sys/ipc.h> | |
10820 | #include <sys/sem.h> | |
10821 | #include <sys/stat.h> | |
10822 | #include <stdio.h> | |
10823 | #include <errno.h> | |
85ab1d1d | 10824 | #include "try.h" |
bd89102f AD |
10825 | #ifndef errno |
10826 | extern int errno; | |
10827 | #endif | |
10828 | #$d_union_semun HAS_UNION_SEMUN | |
10829 | int main() { | |
10830 | union semun | |
10831 | #ifndef HAS_UNION_SEMUN | |
10832 | { | |
10833 | int val; | |
10834 | struct semid_ds *buf; | |
10835 | unsigned short *array; | |
10836 | } | |
10837 | #endif | |
10838 | arg; | |
10839 | int sem, st; | |
10840 | ||
10841 | #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) | |
10842 | sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); | |
10843 | if (sem > -1) { | |
10844 | struct semid_ds argbuf; | |
10845 | arg.buf = &argbuf; | |
10846 | # ifdef IPC_STAT | |
10847 | st = semctl(sem, 0, IPC_STAT, arg); | |
10848 | if (st == 0) | |
10849 | printf("semun\n"); | |
10850 | else | |
10851 | # endif /* IPC_STAT */ | |
10852 | printf("semctl IPC_STAT failed: errno = %d\n", errno); | |
10853 | # ifdef IPC_RMID | |
10854 | if (semctl(sem, 0, IPC_RMID, arg) != 0) | |
10855 | # endif /* IPC_RMID */ | |
10856 | printf("semctl IPC_RMID failed: errno = %d\n", errno); | |
10857 | } else | |
10858 | #endif /* IPC_PRIVATE && ... */ | |
10859 | printf("semget failed: errno = %d\n", errno); | |
10860 | return 0; | |
10861 | } | |
10862 | END | |
10863 | val="$undef" | |
10864 | set try | |
10865 | if eval $compile; then | |
10866 | xxx=`./try` | |
10867 | case "$xxx" in | |
10868 | semun) val="$define" ;; | |
10869 | esac | |
10870 | fi | |
10871 | $rm -f try try.c | |
10872 | set d_semctl_semun | |
10873 | eval $setvar | |
10874 | case "$d_semctl_semun" in | |
10875 | $define) | |
10876 | echo "You can use union semun for semctl IPC_STAT." >&4 | |
10877 | also='also' | |
10878 | ;; | |
10879 | *) echo "You cannot use union semun for semctl IPC_STAT." >&4 | |
10880 | also='' | |
10881 | ;; | |
10882 | esac | |
10883 | ||
10884 | : see whether semctl IPC_STAT can use struct semid_ds pointer | |
10885 | $cat > try.c <<'END' | |
10886 | #include <sys/types.h> | |
10887 | #include <sys/ipc.h> | |
10888 | #include <sys/sem.h> | |
10889 | #include <sys/stat.h> | |
85ab1d1d | 10890 | #include "try.h" |
bd89102f AD |
10891 | #include <stdio.h> |
10892 | #include <errno.h> | |
10893 | #ifndef errno | |
10894 | extern int errno; | |
10895 | #endif | |
10896 | int main() { | |
10897 | struct semid_ds arg; | |
10898 | int sem, st; | |
10899 | ||
10900 | #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) | |
10901 | sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); | |
10902 | if (sem > -1) { | |
10903 | # ifdef IPC_STAT | |
10904 | st = semctl(sem, 0, IPC_STAT, &arg); | |
10905 | if (st == 0) | |
10906 | printf("semid_ds\n"); | |
10907 | else | |
10908 | # endif /* IPC_STAT */ | |
10909 | printf("semctl IPC_STAT failed: errno = %d\n", errno); | |
10910 | # ifdef IPC_RMID | |
10911 | if (semctl(sem, 0, IPC_RMID, &arg) != 0) | |
10912 | # endif /* IPC_RMID */ | |
10913 | printf("semctl IPC_RMID failed: errno = %d\n", errno); | |
10914 | } else | |
10915 | #endif /* IPC_PRIVATE && ... */ | |
10916 | printf("semget failed: errno = %d\n", errno); | |
10917 | ||
10918 | return 0; | |
10919 | } | |
10920 | END | |
10921 | val="$undef" | |
10922 | set try | |
10923 | if eval $compile; then | |
10924 | xxx=`./try` | |
10925 | case "$xxx" in | |
10926 | semid_ds) val="$define" ;; | |
10927 | esac | |
10928 | fi | |
10929 | $rm -f try try.c | |
10930 | set d_semctl_semid_ds | |
10931 | eval $setvar | |
10932 | case "$d_semctl_semid_ds" in | |
10933 | $define) | |
7f3d1cf1 | 10934 | echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4 |
bd89102f | 10935 | ;; |
7f3d1cf1 | 10936 | *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4 |
bd89102f AD |
10937 | ;; |
10938 | esac | |
85ab1d1d | 10939 | $rm -f try.h |
bd89102f AD |
10940 | ;; |
10941 | *) val="$undef" | |
10942 | ||
10943 | # We do not have the full sem*(2) library, so assume we can not | |
10944 | # use either. | |
10945 | ||
10946 | set d_semctl_semun | |
10947 | eval $setvar | |
10948 | ||
10949 | set d_semctl_semid_ds | |
10950 | eval $setvar | |
10951 | ;; | |
10952 | esac | |
10953 | ||
2304df62 AD |
10954 | : see if setegid exists |
10955 | set setegid d_setegid | |
10956 | eval $inlibc | |
10957 | ||
10958 | : see if seteuid exists | |
10959 | set seteuid d_seteuid | |
10960 | eval $inlibc | |
10961 | ||
5ff3f7a4 GS |
10962 | : see if setgrent exists |
10963 | set setgrent d_setgrent | |
10964 | eval $inlibc | |
10965 | ||
693762b4 AD |
10966 | : see if sethostent exists |
10967 | set sethostent d_sethent | |
10968 | eval $inlibc | |
10969 | ||
a0d0e21e LW |
10970 | : see if setlinebuf exists |
10971 | set setlinebuf d_setlinebuf | |
10972 | eval $inlibc | |
10973 | ||
2304df62 AD |
10974 | : see if setlocale exists |
10975 | set setlocale d_setlocale | |
10976 | eval $inlibc | |
a0d0e21e | 10977 | |
e5c9fcd0 AD |
10978 | : see if setnetent exists |
10979 | set setnetent d_setnent | |
10980 | eval $inlibc | |
10981 | ||
10982 | : see if setprotoent exists | |
10983 | set setprotoent d_setpent | |
10984 | eval $inlibc | |
10985 | ||
2304df62 AD |
10986 | : see if setpgid exists |
10987 | set setpgid d_setpgid | |
10988 | eval $inlibc | |
10989 | ||
2304df62 AD |
10990 | : see if setpgrp2 exists |
10991 | set setpgrp2 d_setpgrp2 | |
10992 | eval $inlibc | |
10993 | ||
10994 | : see if setpriority exists | |
10995 | set setpriority d_setprior | |
10996 | eval $inlibc | |
10997 | ||
5ff3f7a4 GS |
10998 | : see if setpwent exists |
10999 | set setpwent d_setpwent | |
11000 | eval $inlibc | |
11001 | ||
2304df62 AD |
11002 | : see if setregid exists |
11003 | set setregid d_setregid | |
11004 | eval $inlibc | |
11005 | set setresgid d_setresgid | |
11006 | eval $inlibc | |
11007 | ||
11008 | : see if setreuid exists | |
11009 | set setreuid d_setreuid | |
11010 | eval $inlibc | |
11011 | set setresuid d_setresuid | |
11012 | eval $inlibc | |
11013 | ||
11014 | : see if setrgid exists | |
11015 | set setrgid d_setrgid | |
11016 | eval $inlibc | |
11017 | ||
11018 | : see if setruid exists | |
11019 | set setruid d_setruid | |
11020 | eval $inlibc | |
11021 | ||
e5c9fcd0 AD |
11022 | : see if setservent exists |
11023 | set setservent d_setsent | |
11024 | eval $inlibc | |
11025 | ||
2304df62 AD |
11026 | : see if setsid exists |
11027 | set setsid d_setsid | |
11028 | eval $inlibc | |
11029 | ||
f1066039 JH |
11030 | : see if setspent exists |
11031 | set setspent d_setspent | |
11032 | eval $inlibc | |
11033 | ||
e5c9fcd0 AD |
11034 | : see if setvbuf exists |
11035 | set setvbuf d_setvbuf | |
11036 | eval $inlibc | |
11037 | ||
760ac839 LW |
11038 | : see if sfio.h is available |
11039 | set sfio.h i_sfio | |
11040 | eval $inhdr | |
11041 | ||
11042 | ||
8ff267be | 11043 | : see if sfio library is available |
760ac839 LW |
11044 | case "$i_sfio" in |
11045 | $define) | |
11046 | val='' | |
11047 | set sfreserve val | |
11048 | eval $inlibc | |
11049 | ;; | |
11050 | *) | |
11051 | val="$undef" | |
11052 | ;; | |
11053 | esac | |
8ff267be | 11054 | : Ok, but do we want to use it. |
760ac839 LW |
11055 | case "$val" in |
11056 | $define) | |
11057 | case "$usesfio" in | |
8ff267be | 11058 | true|$define|[yY]*) dflt='y';; |
760ac839 LW |
11059 | *) dflt='n';; |
11060 | esac | |
8ff267be | 11061 | echo "$package can use the sfio library, but it is experimental." |
760ac839 LW |
11062 | rp="You seem to have sfio available, do you want to try using it?" |
11063 | . ./myread | |
11064 | case "$ans" in | |
8ff267be | 11065 | y|Y) ;; |
11066 | *) echo "Ok, avoiding sfio this time. I'll use stdio instead." | |
760ac839 | 11067 | val="$undef" |
ff0cee69 | 11068 | : Remove sfio from list of libraries to use |
11069 | set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` | |
11070 | shift | |
11071 | libs="$*" | |
11072 | echo "libs = $libs" >&4 | |
760ac839 LW |
11073 | ;; |
11074 | esac | |
11075 | ;; | |
8ff267be | 11076 | *) case "$usesfio" in |
11077 | true|$define|[yY]*) | |
11078 | echo "Sorry, cannot find sfio on this machine" >&4 | |
11079 | echo "Ignoring your setting of usesfio=$usesfio" >&4 | |
760ac839 LW |
11080 | ;; |
11081 | esac | |
11082 | ;; | |
11083 | esac | |
8ff267be | 11084 | set d_sfio |
11085 | eval $setvar | |
760ac839 LW |
11086 | case "$d_sfio" in |
11087 | $define) usesfio='true';; | |
11088 | *) usesfio='false';; | |
11089 | esac | |
11090 | ||
2304df62 AD |
11091 | : see if shmctl exists |
11092 | set shmctl d_shmctl | |
11093 | eval $inlibc | |
11094 | ||
11095 | : see if shmget exists | |
11096 | set shmget d_shmget | |
11097 | eval $inlibc | |
11098 | ||
a0d0e21e LW |
11099 | : see if shmat exists |
11100 | set shmat d_shmat | |
11101 | eval $inlibc | |
11102 | : see what shmat returns | |
11103 | case "$d_shmat" in | |
11104 | "$define") | |
11105 | $cat >shmat.c <<'END' | |
11106 | #include <sys/shm.h> | |
11107 | void *shmat(); | |
11108 | END | |
11109 | if $cc $ccflags -c shmat.c >/dev/null 2>&1; then | |
11110 | shmattype='void *' | |
11111 | else | |
11112 | shmattype='char *' | |
11113 | fi | |
11114 | echo "and it returns ($shmattype)." >&4 | |
11115 | : see if a prototype for shmat is available | |
e50aee73 AD |
11116 | xxx=`./findhdr sys/shm.h` |
11117 | $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null | |
a0d0e21e LW |
11118 | if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then |
11119 | val="$define" | |
11120 | else | |
11121 | val="$undef" | |
11122 | fi | |
11123 | $rm -f shmat.[co] | |
11124 | ;; | |
11125 | *) | |
11126 | val="$undef" | |
11127 | ;; | |
11128 | esac | |
11129 | set d_shmatprototype | |
11130 | eval $setvar | |
11131 | ||
11132 | : see if shmdt exists | |
11133 | set shmdt d_shmdt | |
11134 | eval $inlibc | |
11135 | ||
11136 | : see how much of the 'shm*(2)' library is present. | |
11137 | h_shm=true | |
11138 | echo " " | |
11139 | case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in | |
11140 | *"$undef"*) h_shm=false;; | |
11141 | esac | |
6087ac44 JH |
11142 | case "$osname" in |
11143 | freebsd) | |
11144 | case "`ipcs 2>&1`" in | |
11145 | "SVID shared memory"*"not configured"*) | |
5ff3f7a4 | 11146 | echo "Your $osname does not have the shm*(2) configured." >&4 |
6087ac44 JH |
11147 | h_shm=false |
11148 | val="$undef" | |
11149 | set shmctl d_shmctl | |
11150 | evat $setvar | |
11151 | set shmget d_shmget | |
11152 | evat $setvar | |
11153 | set shmat d_shmat | |
11154 | evat $setvar | |
11155 | set shmdt d_shmdt | |
11156 | evat $setvar | |
11157 | ;; | |
11158 | esac | |
11159 | ;; | |
11160 | esac | |
a0d0e21e LW |
11161 | : we could also check for sys/ipc.h ... |
11162 | if $h_shm && $test `./findhdr sys/shm.h`; then | |
11163 | echo "You have the full shm*(2) library." >&4 | |
11164 | val="$define" | |
11165 | else | |
11166 | echo "You don't have the full shm*(2) library." >&4 | |
11167 | val="$undef" | |
11168 | fi | |
11169 | set d_shm | |
11170 | eval $setvar | |
11171 | ||
2c7991dc | 11172 | echo " " |
8ff267be | 11173 | : see if we have sigaction |
11174 | if set sigaction val -f d_sigaction; eval $csym; $val; then | |
11175 | echo 'sigaction() found.' >&4 | |
dc45a647 | 11176 | $cat > try.c <<'EOP' |
8ff267be | 11177 | #include <stdio.h> |
11178 | #include <sys/types.h> | |
11179 | #include <signal.h> | |
d674cd6d | 11180 | int main() |
8ff267be | 11181 | { |
11182 | struct sigaction act, oact; | |
190b66db | 11183 | act.sa_flags = 0; |
48159a0c | 11184 | oact.sa_handler = 0; |
14e4fe40 JH |
11185 | /* so that act and oact are used */ |
11186 | exit(act.sa_flags == 0 && oact.sa_handler == 0); | |
8ff267be | 11187 | } |
11188 | EOP | |
dc45a647 MB |
11189 | set try |
11190 | if eval $compile_ok; then | |
11191 | val="$define" | |
11192 | else | |
11193 | echo "But you don't seem to have a useable struct sigaction." >&4 | |
11194 | val="$undef" | |
11195 | fi | |
8ff267be | 11196 | else |
dc45a647 | 11197 | echo 'sigaction NOT found.' >&4 |
8ff267be | 11198 | val="$undef" |
11199 | fi | |
11200 | set d_sigaction; eval $setvar | |
dfe9444c | 11201 | $rm -f try try$_o try.c |
2c7991dc | 11202 | |
a5f75d66 AD |
11203 | : see if sigsetjmp exists |
11204 | echo " " | |
921b2963 JH |
11205 | case "$d_sigsetjmp" in |
11206 | '') | |
11207 | $cat >try.c <<'EOP' | |
11208 | #include <setjmp.h> | |
11209 | sigjmp_buf env; | |
11210 | int set = 1; | |
d674cd6d | 11211 | int main() |
921b2963 JH |
11212 | { |
11213 | if (sigsetjmp(env,1)) | |
11214 | exit(set); | |
11215 | set = 0; | |
11216 | siglongjmp(env, 1); | |
11217 | exit(1); | |
11218 | } | |
11219 | EOP | |
11220 | set try | |
11221 | if eval $compile; then | |
11222 | if ./try >/dev/null 2>&1; then | |
11223 | echo "POSIX sigsetjmp found." >&4 | |
11224 | val="$define" | |
11225 | else | |
11226 | $cat >&4 <<EOM | |
11227 | Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!! | |
11228 | I'll ignore them. | |
11229 | EOM | |
11230 | val="$undef" | |
a0d0e21e | 11231 | fi |
921b2963 JH |
11232 | else |
11233 | echo "sigsetjmp not found." >&4 | |
11234 | val="$undef" | |
a0d0e21e | 11235 | fi |
921b2963 JH |
11236 | ;; |
11237 | *) val="$d_sigsetjmp" | |
11238 | case "$d_sigsetjmp" in | |
11239 | $define) echo "POSIX sigsetjmp found." >&4;; | |
11240 | $undef) echo "sigsetjmp not found." >&4;; | |
11241 | esac | |
11242 | ;; | |
11243 | esac | |
11244 | set d_sigsetjmp | |
11245 | eval $setvar | |
11246 | $rm -f try.c try | |
2304df62 | 11247 | |
d9b3e12d JH |
11248 | : see if sys/stat.h is available |
11249 | set sys/stat.h i_sysstat | |
11250 | eval $inhdr | |
11251 | ||
b7b35fc2 | 11252 | |
2304df62 AD |
11253 | : see if stat knows about block sizes |
11254 | echo " " | |
b7b35fc2 | 11255 | echo "Checking to see if your struct stat has st_blocks field..." >&4 |
5ff3f7a4 GS |
11256 | set d_statblks stat st_blocks $i_sysstat sys/stat.h |
11257 | eval $hasfield | |
2304df62 | 11258 | |
b7b35fc2 | 11259 | |
ad27e871 JH |
11260 | : see if this is a sys/vfs.h system |
11261 | set sys/vfs.h i_sysvfs | |
11262 | eval $inhdr | |
11263 | ||
b7b35fc2 | 11264 | |
ad27e871 JH |
11265 | : see if this is a sys/statfs.h system |
11266 | set sys/statfs.h i_sysstatfs | |
11267 | eval $inhdr | |
11268 | ||
11269 | ||
11270 | echo " " | |
8175356b | 11271 | echo "Checking to see if your system supports struct statfs..." >&4 |
ad27e871 JH |
11272 | 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 |
11273 | eval $hasstruct | |
11274 | case "$d_statfs_s" in | |
a22e52b9 JH |
11275 | "$define") echo "Yes, it does." ;; |
11276 | *) echo "No, it doesn't." ;; | |
ad27e871 JH |
11277 | esac |
11278 | ||
11279 | ||
11280 | ||
11281 | : see if struct statfs knows about f_flags | |
11282 | case "$d_statfs_s" in | |
11283 | define) | |
11284 | echo " " | |
8175356b | 11285 | echo "Checking to see if your struct statfs has f_flags field..." >&4 |
ad27e871 JH |
11286 | 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 |
11287 | eval $hasfield | |
11288 | ;; | |
11289 | *) val="$undef" | |
11290 | set d_statfs_f_flags | |
11291 | eval $setvar | |
11292 | ;; | |
11293 | esac | |
11294 | case "$d_statfs_f_flags" in | |
a22e52b9 JH |
11295 | "$define") echo "Yes, it does." ;; |
11296 | *) echo "No, it doesn't." ;; | |
ad27e871 JH |
11297 | esac |
11298 | ||
16d20bd9 AD |
11299 | : see if _ptr and _cnt from stdio act std |
11300 | echo " " | |
dca663ed | 11301 | if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then |
16d20bd9 AD |
11302 | echo "(Looks like you have stdio.h from Linux.)" |
11303 | case "$stdio_ptr" in | |
c2960299 AD |
11304 | '') stdio_ptr='((fp)->_IO_read_ptr)' |
11305 | ptr_lval=$define | |
11306 | ;; | |
8e07c86e | 11307 | *) ptr_lval=$d_stdio_ptr_lval;; |
16d20bd9 AD |
11308 | esac |
11309 | case "$stdio_cnt" in | |
c2960299 AD |
11310 | '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' |
11311 | cnt_lval=$undef | |
11312 | ;; | |
8e07c86e | 11313 | *) cnt_lval=$d_stdio_cnt_lval;; |
16d20bd9 AD |
11314 | esac |
11315 | case "$stdio_base" in | |
11316 | '') stdio_base='((fp)->_IO_read_base)';; | |
11317 | esac | |
11318 | case "$stdio_bufsiz" in | |
c2960299 | 11319 | '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; |
16d20bd9 AD |
11320 | esac |
11321 | else | |
11322 | case "$stdio_ptr" in | |
c2960299 AD |
11323 | '') stdio_ptr='((fp)->_ptr)' |
11324 | ptr_lval=$define | |
11325 | ;; | |
8e07c86e | 11326 | *) ptr_lval=$d_stdio_ptr_lval;; |
16d20bd9 AD |
11327 | esac |
11328 | case "$stdio_cnt" in | |
c2960299 AD |
11329 | '') stdio_cnt='((fp)->_cnt)' |
11330 | cnt_lval=$define | |
11331 | ;; | |
8e07c86e | 11332 | *) cnt_lval=$d_stdio_cnt_lval;; |
16d20bd9 AD |
11333 | esac |
11334 | case "$stdio_base" in | |
11335 | '') stdio_base='((fp)->_base)';; | |
11336 | esac | |
11337 | case "$stdio_bufsiz" in | |
11338 | '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; | |
11339 | esac | |
11340 | fi | |
11341 | : test whether _ptr and _cnt really work | |
11342 | echo "Checking how std your stdio is..." >&4 | |
11343 | $cat >try.c <<EOP | |
11344 | #include <stdio.h> | |
11345 | #define FILE_ptr(fp) $stdio_ptr | |
11346 | #define FILE_cnt(fp) $stdio_cnt | |
d674cd6d | 11347 | int main() { |
16d20bd9 AD |
11348 | FILE *fp = fopen("try.c", "r"); |
11349 | char c = getc(fp); | |
11350 | if ( | |
11351 | 18 <= FILE_cnt(fp) && | |
11352 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 | |
11353 | ) | |
11354 | exit(0); | |
11355 | exit(1); | |
11356 | } | |
11357 | EOP | |
11358 | val="$undef" | |
dfe9444c AD |
11359 | set try |
11360 | if eval $compile; then | |
16d20bd9 AD |
11361 | if ./try; then |
11362 | echo "Your stdio acts pretty std." | |
11363 | val="$define" | |
11364 | else | |
11365 | echo "Your stdio isn't very std." | |
11366 | fi | |
11367 | else | |
11368 | echo "Your stdio doesn't appear very std." | |
11369 | fi | |
11370 | $rm -f try.c try | |
11371 | set d_stdstdio | |
11372 | eval $setvar | |
11373 | ||
8e07c86e | 11374 | : Can _ptr be used as an lvalue? |
e50aee73 AD |
11375 | case "$d_stdstdio$ptr_lval" in |
11376 | $define$define) val=$define ;; | |
c2960299 AD |
11377 | *) val=$undef ;; |
11378 | esac | |
11379 | set d_stdio_ptr_lval | |
11380 | eval $setvar | |
11381 | ||
8e07c86e | 11382 | : Can _cnt be used as an lvalue? |
e50aee73 AD |
11383 | case "$d_stdstdio$cnt_lval" in |
11384 | $define$define) val=$define ;; | |
c2960299 AD |
11385 | *) val=$undef ;; |
11386 | esac | |
11387 | set d_stdio_cnt_lval | |
11388 | eval $setvar | |
11389 | ||
16d20bd9 AD |
11390 | : see if _base is also standard |
11391 | val="$undef" | |
11392 | case "$d_stdstdio" in | |
11393 | $define) | |
11394 | $cat >try.c <<EOP | |
11395 | #include <stdio.h> | |
11396 | #define FILE_base(fp) $stdio_base | |
11397 | #define FILE_bufsiz(fp) $stdio_bufsiz | |
d674cd6d | 11398 | int main() { |
16d20bd9 AD |
11399 | FILE *fp = fopen("try.c", "r"); |
11400 | char c = getc(fp); | |
11401 | if ( | |
11402 | 19 <= FILE_bufsiz(fp) && | |
11403 | strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0 | |
11404 | ) | |
11405 | exit(0); | |
11406 | exit(1); | |
11407 | } | |
11408 | EOP | |
dfe9444c AD |
11409 | set try |
11410 | if eval $compile; then | |
16d20bd9 | 11411 | if ./try; then |
8ff267be | 11412 | echo "And its _base field acts std." |
16d20bd9 AD |
11413 | val="$define" |
11414 | else | |
11415 | echo "But its _base field isn't std." | |
11416 | fi | |
11417 | else | |
11418 | echo "However, it seems to be lacking the _base field." | |
11419 | fi | |
11420 | $rm -f try.c try | |
11421 | ;; | |
11422 | esac | |
11423 | set d_stdiobase | |
11424 | eval $setvar | |
11425 | ||
ed39a0f2 JH |
11426 | $cat >&4 <<EOM |
11427 | Checking how to access stdio streams by file descriptor number... | |
11428 | EOM | |
11429 | case "$stdio_stream_array" in | |
11430 | '') $cat >try.c <<EOCP | |
11431 | #include <stdio.h> | |
11432 | int main() { | |
11433 | if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin) | |
11434 | printf("yes\n"); | |
11435 | } | |
11436 | EOCP | |
11437 | for s in _iob __iob __sF | |
11438 | do | |
11439 | set try -DSTDIO_STREAM_ARRAY=$s | |
11440 | if eval $compile; then | |
11441 | case "`./try$exe_ext`" in | |
11442 | yes) stdio_stream_array=$s; break ;; | |
11443 | esac | |
11444 | fi | |
11445 | done | |
11446 | $rm -f try.* try$exe_ext | |
11447 | esac | |
11448 | case "$stdio_stream_array" in | |
11449 | '') $cat >&4 <<EOM | |
11450 | I can't figure out how to access stdio streams by file descriptor number. | |
11451 | EOM | |
11452 | d_stdio_stream_array="$undef" | |
11453 | ;; | |
11454 | *) $cat >&4 <<EOM | |
11455 | You can access stdio streams by file descriptor number by the $stdio_stream_array array. | |
11456 | EOM | |
11457 | d_stdio_stream_array="$define" | |
11458 | ;; | |
11459 | esac | |
11460 | ||
a0d0e21e LW |
11461 | : see if strcoll exists |
11462 | set strcoll d_strcoll | |
11463 | eval $inlibc | |
2304df62 AD |
11464 | |
11465 | : check for structure copying | |
11466 | echo " " | |
11467 | echo "Checking to see if your C compiler can copy structs..." >&4 | |
11468 | $cat >try.c <<'EOCP' | |
5a411a32 | 11469 | int main() |
2304df62 AD |
11470 | { |
11471 | struct blurfl { | |
11472 | int dyick; | |
11473 | } foo, bar; | |
11474 | ||
11475 | foo = bar; | |
11476 | } | |
11477 | EOCP | |
11478 | if $cc -c try.c >/dev/null 2>&1 ; then | |
11479 | val="$define" | |
11480 | echo "Yup, it can." | |
11481 | else | |
11482 | val="$undef" | |
11483 | echo "Nope, it can't." | |
11484 | fi | |
11485 | set d_strctcpy | |
11486 | eval $setvar | |
11487 | $rm -f try.* | |
11488 | ||
11489 | : see if strerror and/or sys_errlist[] exist | |
11490 | echo " " | |
28e8609d JH |
11491 | if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then |
11492 | if set strerror val -f d_strerror; eval $csym; $val; then | |
5ff3f7a4 GS |
11493 | echo 'strerror() found.' >&4 |
11494 | d_strerror="$define" | |
11495 | d_strerrm='strerror(e)' | |
11496 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
11497 | echo "(You also have sys_errlist[], so we could roll our own strerror.)" | |
11498 | d_syserrlst="$define" | |
11499 | else | |
11500 | echo "(Since you don't have sys_errlist[], sterror() is welcome.)" | |
11501 | d_syserrlst="$undef" | |
11502 | fi | |
28e8609d | 11503 | elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \ |
5ff3f7a4 GS |
11504 | $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then |
11505 | echo 'strerror() found in string header.' >&4 | |
11506 | d_strerror="$define" | |
11507 | d_strerrm='strerror(e)' | |
11508 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
11509 | echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)" | |
11510 | d_syserrlst="$define" | |
11511 | else | |
11512 | echo "(You don't appear to have any sys_errlist[], how can this be?)" | |
11513 | d_syserrlst="$undef" | |
11514 | fi | |
28e8609d | 11515 | elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
5ff3f7a4 GS |
11516 | echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4 |
11517 | d_strerror="$undef" | |
11518 | d_syserrlst="$define" | |
11519 | d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])' | |
28e8609d | 11520 | else |
5ff3f7a4 GS |
11521 | echo 'strerror() and sys_errlist[] NOT found.' >&4 |
11522 | d_strerror="$undef" | |
11523 | d_syserrlst="$undef" | |
11524 | d_strerrm='"unknown"' | |
28e8609d | 11525 | fi |
2304df62 AD |
11526 | fi |
11527 | ||
a89d8a78 DH |
11528 | : see if strtod exists |
11529 | set strtod d_strtod | |
11530 | eval $inlibc | |
11531 | ||
11532 | : see if strtol exists | |
11533 | set strtol d_strtol | |
11534 | eval $inlibc | |
11535 | ||
ff935051 JH |
11536 | : see if strtold exists |
11537 | set strtold d_strtold | |
11538 | eval $inlibc | |
11539 | ||
76d49b1c JH |
11540 | : see if strtoll exists |
11541 | set strtoll d_strtoll | |
11542 | eval $inlibc | |
11543 | ||
358a0a84 JH |
11544 | case "$d_longlong-$d_strtoll" in |
11545 | "$define-$define") | |
11546 | $cat <<EOM | |
11547 | Checking whether your strtoll() works okay... | |
11548 | EOM | |
11549 | $cat >try.c <<'EOCP' | |
11550 | #include <errno.h> | |
11551 | #ifdef __hpux | |
11552 | #define strtoll __strtoll | |
11553 | #endif | |
11554 | #include <stdio.h> | |
11555 | extern long long int strtoll(char *s, char **, int); | |
11556 | static int bad = 0; | |
11557 | int check(char *s, long long ell, int een) { | |
11558 | long long gll; | |
11559 | errno = 0; | |
11560 | gll = strtoll(s, 0, 10); | |
11561 | if (!((gll == ell) && (errno == een))) | |
11562 | bad++; | |
11563 | } | |
11564 | int main() { | |
11565 | check(" 1", 1LL, 0); | |
11566 | check(" 0", 0LL, 0); | |
11567 | check("-1", -1LL, 0); | |
11568 | check("-9223372036854775808", -9223372036854775808LL, 0); | |
11569 | check("-9223372036854775808", -9223372036854775808LL, 0); | |
11570 | check(" 9223372036854775807", 9223372036854775807LL, 0); | |
11571 | check("-9223372036854775808", -9223372036854775808LL, 0); | |
11572 | check(" 9223372036854775808", 9223372036854775807LL, ERANGE); | |
11573 | check("-9223372036854775809", -9223372036854775808LL, ERANGE); | |
11574 | if (!bad) | |
11575 | printf("ok\n"); | |
11576 | } | |
11577 | EOCP | |
11578 | set try | |
11579 | if eval $compile; then | |
11580 | case "`./try`" in | |
11581 | ok) echo "Your strtoll() seems to be working okay." ;; | |
11582 | *) cat <<EOM >&4 | |
11583 | Your strtoll() doesn't seem to be working okay. | |
11584 | EOM | |
11585 | d_strtoll="$undef" | |
11586 | ;; | |
11587 | esac | |
11588 | fi | |
11589 | ;; | |
11590 | esac | |
11591 | ||
a89d8a78 DH |
11592 | : see if strtoul exists |
11593 | set strtoul d_strtoul | |
11594 | eval $inlibc | |
11595 | ||
cf2093f6 JH |
11596 | : see if strtoull exists |
11597 | set strtoull d_strtoull | |
11598 | eval $inlibc | |
11599 | ||
358a0a84 JH |
11600 | case "$d_longlong-$d_strtoull" in |
11601 | "$define-$define") | |
11602 | $cat <<EOM | |
11603 | Checking whether your strtoull() works okay... | |
11604 | EOM | |
11605 | $cat >try.c <<'EOCP' | |
11606 | #include <errno.h> | |
11607 | #ifdef __hpux | |
11608 | #define strtoull __strtoull | |
11609 | #endif | |
11610 | #include <stdio.h> | |
11611 | extern unsigned long long int strtoull(char *s, char **, int); | |
11612 | static int bad = 0; | |
11613 | int check(char *s, long long eull, int een) { | |
11614 | long long gull; | |
11615 | errno = 0; | |
11616 | gull = strtoull(s, 0, 10); | |
11617 | if (!((gull == eull) && (errno == een))) | |
11618 | bad++; | |
11619 | } | |
11620 | int main() { | |
11621 | check(" 1", 1LL, 0); | |
11622 | check(" 0", 0LL, 0); | |
11623 | check("18446744073709551615", 18446744073709551615ULL, 0); | |
11624 | check("18446744073709551616", 18446744073709551615ULL, ERANGE); | |
11625 | if (!bad) | |
11626 | printf("ok\n"); | |
11627 | } | |
11628 | EOCP | |
11629 | set try | |
11630 | if eval $compile; then | |
11631 | case "`./try`" in | |
11632 | ok) echo "Your strtoull() seems to be working okay." ;; | |
11633 | *) cat <<EOM >&4 | |
11634 | Your strtoull() doesn't seem to be working okay. | |
11635 | EOM | |
11636 | d_strtoull="$undef" | |
11637 | ;; | |
11638 | esac | |
11639 | fi | |
11640 | ;; | |
11641 | esac | |
11642 | ||
ff935051 JH |
11643 | : see if strtouq exists |
11644 | set strtouq d_strtouq | |
11645 | eval $inlibc | |
11646 | ||
a0d0e21e LW |
11647 | : see if strxfrm exists |
11648 | set strxfrm d_strxfrm | |
11649 | eval $inlibc | |
11650 | ||
8175356b JH |
11651 | : see if symlink exists |
11652 | set symlink d_symlink | |
11653 | eval $inlibc | |
11654 | ||
11655 | : see if syscall exists | |
11656 | set syscall d_syscall | |
11657 | eval $inlibc | |
11658 | ||
11659 | : see if sysconf exists | |
11660 | set sysconf d_sysconf | |
11661 | eval $inlibc | |
11662 | ||
11663 | : see if system exists | |
11664 | set system d_system | |
11665 | eval $inlibc | |
11666 | ||
11667 | : see if tcgetpgrp exists | |
11668 | set tcgetpgrp d_tcgetpgrp | |
11669 | eval $inlibc | |
11670 | ||
11671 | : see if tcsetpgrp exists | |
11672 | set tcsetpgrp d_tcsetpgrp | |
11673 | eval $inlibc | |
11674 | ||
11675 | : see if prototype for telldir is available | |
11676 | echo " " | |
11677 | set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h | |
11678 | eval $hasproto | |
dc45a647 | 11679 | |
2c7991dc | 11680 | : see if this is a sys/times.h system |
11681 | set sys/times.h i_systimes | |
11682 | eval $inhdr | |
4633a7c4 | 11683 | |
2c7991dc | 11684 | : see if times exists |
4633a7c4 | 11685 | echo " " |
2c7991dc | 11686 | if set times val -f d_times; eval $csym; $val; then |
11687 | echo 'times() found.' >&4 | |
11688 | d_times="$define" | |
11689 | inc='' | |
11690 | case "$i_systimes" in | |
11691 | "$define") inc='sys/times.h';; | |
11692 | esac | |
dc45a647 | 11693 | rp="What is the type returned by times() on this system?" |
2c7991dc | 11694 | set clock_t clocktype long stdio.h sys/types.h $inc |
dc45a647 | 11695 | eval $typedef_ask |
2c7991dc | 11696 | else |
11697 | echo 'times() NOT found, hope that will do.' >&4 | |
11698 | d_times="$undef" | |
11699 | clocktype='int' | |
11700 | fi | |
2304df62 | 11701 | |
2c7991dc | 11702 | : see if truncate exists |
11703 | set truncate d_truncate | |
11704 | eval $inlibc | |
2304df62 | 11705 | |
2c7991dc | 11706 | : see if tzname[] exists |
11707 | echo " " | |
11708 | if set tzname val -a d_tzname; eval $csym; $val; then | |
11709 | val="$define" | |
11710 | echo 'tzname[] found.' >&4 | |
11711 | else | |
11712 | val="$undef" | |
11713 | echo 'tzname[] NOT found.' >&4 | |
11714 | fi | |
11715 | set d_tzname | |
11716 | eval $setvar | |
11717 | ||
11718 | : see if umask exists | |
11719 | set umask d_umask | |
11720 | eval $inlibc | |
85e6fe83 | 11721 | |
0545a864 JH |
11722 | : see if ustat exists |
11723 | set ustat d_ustat | |
11724 | eval $inlibc | |
11725 | ||
4633a7c4 LW |
11726 | : backward compatibility for d_hvfork |
11727 | if test X$d_hvfork != X; then | |
11728 | d_vfork="$d_hvfork" | |
11729 | d_hvfork='' | |
11730 | fi | |
11731 | : see if there is a vfork | |
11732 | val='' | |
11733 | set vfork val | |
11734 | eval $inlibc | |
ecfc5424 | 11735 | |
4633a7c4 LW |
11736 | : Ok, but do we want to use it. vfork is reportedly unreliable in |
11737 | : perl on Solaris 2.x, and probably elsewhere. | |
11738 | case "$val" in | |
11739 | $define) | |
16d20bd9 | 11740 | echo " " |
4633a7c4 LW |
11741 | case "$usevfork" in |
11742 | false) dflt='n';; | |
11743 | *) dflt='y';; | |
11744 | esac | |
f10488a3 JH |
11745 | cat <<'EOM' |
11746 | ||
11747 | Perl can only use a vfork() that doesn't suffer from strict | |
11748 | restrictions on calling functions or modifying global data in | |
11749 | the child. For example, glibc-2.1 contains such a vfork() | |
11750 | that is unsuitable. If your system provides a proper fork() | |
11751 | call, chances are that you do NOT want perl to use vfork(). | |
11752 | ||
11753 | EOM | |
11754 | rp="Do you still want to use vfork()?" | |
4633a7c4 LW |
11755 | . ./myread |
11756 | case "$ans" in | |
11757 | y|Y) ;; | |
11758 | *) | |
11759 | echo "Ok, we won't use vfork()." | |
11760 | val="$undef" | |
11761 | ;; | |
11762 | esac | |
ecfc5424 AD |
11763 | ;; |
11764 | esac | |
4633a7c4 LW |
11765 | set d_vfork |
11766 | eval $setvar | |
11767 | case "$d_vfork" in | |
11768 | $define) usevfork='true';; | |
11769 | *) usevfork='false';; | |
11770 | esac | |
ecfc5424 | 11771 | |
4633a7c4 LW |
11772 | : see if this is an sysdir system |
11773 | set sys/dir.h i_sysdir | |
11774 | eval $inhdr | |
11775 | ||
11776 | : see if this is an sysndir system | |
11777 | set sys/ndir.h i_sysndir | |
11778 | eval $inhdr | |
11779 | ||
11780 | : see if closedir exists | |
11781 | set closedir d_closedir | |
11782 | eval $inlibc | |
11783 | ||
11784 | case "$d_closedir" in | |
11785 | "$define") | |
16d20bd9 | 11786 | echo " " |
4633a7c4 LW |
11787 | echo "Checking whether closedir() returns a status..." >&4 |
11788 | cat > closedir.c <<EOM | |
11789 | #$i_dirent I_DIRENT /**/ | |
11790 | #$i_sysdir I_SYS_DIR /**/ | |
11791 | #$i_sysndir I_SYS_NDIR /**/ | |
bfb7748a | 11792 | #$i_systypes I_SYS_TYPES /**/ |
4633a7c4 | 11793 | |
bfb7748a AD |
11794 | #if defined(I_SYS_TYPES) |
11795 | #include <sys/types.h> | |
11796 | #endif | |
4633a7c4 LW |
11797 | #if defined(I_DIRENT) |
11798 | #include <dirent.h> | |
11799 | #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ | |
11800 | #include <sys/dir.h> | |
4aa0a1f7 | 11801 | #endif |
4633a7c4 LW |
11802 | #else |
11803 | #ifdef I_SYS_NDIR | |
11804 | #include <sys/ndir.h> | |
11805 | #else | |
11806 | #ifdef I_SYS_DIR | |
11807 | #ifdef hp9000s500 | |
11808 | #include <ndir.h> /* may be wrong in the future */ | |
11809 | #else | |
11810 | #include <sys/dir.h> | |
11811 | #endif | |
11812 | #endif | |
11813 | #endif | |
11814 | #endif | |
11815 | int main() { return closedir(opendir(".")); } | |
11816 | EOM | |
dfe9444c | 11817 | set closedir |
dc45a647 | 11818 | if eval $compile_ok; then |
4633a7c4 LW |
11819 | if ./closedir > /dev/null 2>&1 ; then |
11820 | echo "Yes, it does." | |
11821 | val="$undef" | |
ecfc5424 | 11822 | else |
4633a7c4 LW |
11823 | echo "No, it doesn't." |
11824 | val="$define" | |
ecfc5424 AD |
11825 | fi |
11826 | else | |
4633a7c4 LW |
11827 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
11828 | val="$define" | |
ecfc5424 | 11829 | fi |
ecfc5424 | 11830 | ;; |
4633a7c4 LW |
11831 | *) |
11832 | val="$undef"; | |
ecfc5424 AD |
11833 | ;; |
11834 | esac | |
4633a7c4 LW |
11835 | set d_void_closedir |
11836 | eval $setvar | |
11837 | $rm -f closedir* | |
11838 | : check for volatile keyword | |
ecfc5424 | 11839 | echo " " |
4633a7c4 LW |
11840 | echo 'Checking to see if your C compiler knows about "volatile"...' >&4 |
11841 | $cat >try.c <<'EOCP' | |
5a411a32 | 11842 | int main() |
4633a7c4 LW |
11843 | { |
11844 | typedef struct _goo_struct goo_struct; | |
11845 | goo_struct * volatile goo = ((goo_struct *)0); | |
11846 | struct _goo_struct { | |
11847 | long long_int; | |
11848 | int reg_int; | |
11849 | char char_var; | |
11850 | }; | |
11851 | typedef unsigned short foo_t; | |
11852 | char *volatile foo; | |
11853 | volatile int bar; | |
11854 | volatile foo_t blech; | |
11855 | foo = foo; | |
a0d0e21e LW |
11856 | } |
11857 | EOCP | |
4633a7c4 LW |
11858 | if $cc -c $ccflags try.c >/dev/null 2>&1 ; then |
11859 | val="$define" | |
11860 | echo "Yup, it does." | |
11861 | else | |
11862 | val="$undef" | |
11863 | echo "Nope, it doesn't." | |
11864 | fi | |
11865 | set d_volatile | |
11866 | eval $setvar | |
11867 | $rm -f try.* | |
a0d0e21e | 11868 | |
4633a7c4 LW |
11869 | : see if there is a wait4 |
11870 | set wait4 d_wait4 | |
8e07c86e AD |
11871 | eval $inlibc |
11872 | ||
4633a7c4 LW |
11873 | : see if waitpid exists |
11874 | set waitpid d_waitpid | |
11875 | eval $inlibc | |
11876 | ||
11877 | : see if wcstombs exists | |
11878 | set wcstombs d_wcstombs | |
11879 | eval $inlibc | |
11880 | ||
11881 | : see if wctomb exists | |
11882 | set wctomb d_wctomb | |
11883 | eval $inlibc | |
11884 | ||
11885 | : preserve RCS keywords in files with variable substitution, grrr | |
11886 | Date='$Date' | |
11887 | Id='$Id' | |
11888 | Log='$Log' | |
11889 | RCSfile='$RCSfile' | |
11890 | Revision='$Revision' | |
11891 | ||
ca8cfa54 JH |
11892 | case "$crosscompile" in |
11893 | ''|[nN]*) crosscompile="$undef" ;; | |
11894 | esac | |
11895 | ||
11896 | case "$osname" in | |
f556e5b9 | 11897 | next|rhapsody|darwin) multiarch="$define" ;; |
ca8cfa54 JH |
11898 | esac |
11899 | case "$multiarch" in | |
11900 | ''|[nN]*) multiarch="$undef" ;; | |
11901 | esac | |
11902 | ||
4633a7c4 LW |
11903 | : check for alignment requirements |
11904 | echo " " | |
68c15b6f HM |
11905 | case "$crosscompile$multiarch" in |
11906 | *$define*) | |
ca8cfa54 JH |
11907 | $cat <<EOM |
11908 | You seem to be either cross-compiling or doing a multiarchitecture build, | |
11909 | skipping the memory alignment check. | |
68c15b6f HM |
11910 | |
11911 | EOM | |
11912 | case "$alignbytes" in | |
11913 | '') alignbytes=8 ;; | |
11914 | esac | |
11915 | ;; | |
11916 | *) | |
11917 | case "$alignbytes" in | |
11918 | '') echo "Checking alignment constraints..." >&4 | |
87b71857 JH |
11919 | if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then |
11920 | $cat >try.c <<'EOCP' | |
11921 | typedef long double NV; | |
11922 | EOCP | |
11923 | else | |
11924 | $cat >try.c <<'EOCP' | |
11925 | typedef double NV; | |
11926 | EOCP | |
11927 | fi | |
11928 | $cat >>try.c <<'EOCP' | |
14e4fe40 | 11929 | #include <stdio.h> |
4633a7c4 LW |
11930 | struct foobar { |
11931 | char foo; | |
87b71857 | 11932 | NV bar; |
732c9516 | 11933 | } try_algn; |
d674cd6d | 11934 | int main() |
4633a7c4 | 11935 | { |
213c275f JH |
11936 | printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo)); |
11937 | return(0); | |
4633a7c4 LW |
11938 | } |
11939 | EOCP | |
68c15b6f HM |
11940 | set try |
11941 | if eval $compile_ok; then | |
11942 | dflt=`./try` | |
11943 | else | |
11944 | dflt='8' | |
11945 | echo "(I can't seem to compile the test program...)" | |
11946 | fi | |
11947 | ;; | |
11948 | *) dflt="$alignbytes" | |
11949 | ;; | |
11950 | esac | |
11951 | rp="Doubles must be aligned on a how-many-byte boundary?" | |
11952 | . ./myread | |
11953 | alignbytes="$ans" | |
11954 | $rm -f try.c try | |
8e07c86e | 11955 | ;; |
ecfc5424 | 11956 | esac |
68c15b6f | 11957 | |
85e6fe83 | 11958 | |
49c10eea JH |
11959 | : set the base revision |
11960 | baserev=5.0 | |
11961 | ||
4633a7c4 | 11962 | : check for ordering of bytes in a long |
68c15b6f HM |
11963 | echo " " |
11964 | case "$crosscompile$multiarch" in | |
11965 | *$define*) | |
11966 | $cat <<EOM | |
ca8cfa54 JH |
11967 | You seem to be either cross-compiling or doing a multiarchitecture build, |
11968 | skipping the byteorder check. | |
68c15b6f HM |
11969 | |
11970 | EOM | |
d9b3e12d | 11971 | byteorder='0xffff' |
68c15b6f HM |
11972 | ;; |
11973 | *) | |
11974 | case "$byteorder" in | |
11975 | '') | |
11976 | $cat <<'EOM' | |
4633a7c4 LW |
11977 | In the following, larger digits indicate more significance. A big-endian |
11978 | machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A | |
11979 | little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other | |
d9b3e12d JH |
11980 | machines may have weird orders like 3412. A Cray will report 87654321, |
11981 | an Alpha will report 12345678. If the test program works the default is | |
11982 | probably right. | |
4633a7c4 LW |
11983 | I'm now running the test program... |
11984 | EOM | |
68c15b6f | 11985 | $cat >try.c <<'EOCP' |
4633a7c4 | 11986 | #include <stdio.h> |
d674cd6d | 11987 | int main() |
4633a7c4 LW |
11988 | { |
11989 | int i; | |
11990 | union { | |
11991 | unsigned long l; | |
11992 | char c[sizeof(long)]; | |
11993 | } u; | |
11994 | ||
11995 | if (sizeof(long) > 4) | |
11996 | u.l = (0x08070605L << 32) | 0x04030201L; | |
11997 | else | |
11998 | u.l = 0x04030201L; | |
11999 | for (i = 0; i < sizeof(long); i++) | |
12000 | printf("%c", u.c[i]+'0'); | |
12001 | printf("\n"); | |
12002 | exit(0); | |
12003 | } | |
12004 | EOCP | |
68c15b6f HM |
12005 | xxx_prompt=y |
12006 | set try | |
12007 | if eval $compile && ./try > /dev/null; then | |
12008 | dflt=`./try` | |
12009 | case "$dflt" in | |
12010 | [1-4][1-4][1-4][1-4]|12345678|87654321) | |
12011 | echo "(The test program ran ok.)" | |
12012 | echo "byteorder=$dflt" | |
12013 | xxx_prompt=n | |
4633a7c4 | 12014 | ;; |
68c15b6f HM |
12015 | ????|????????) echo "(The test program ran ok.)" ;; |
12016 | *) echo "(The test program didn't run right for some reason.)" ;; | |
12017 | esac | |
12018 | else | |
12019 | dflt='4321' | |
12020 | cat <<'EOM' | |
4633a7c4 LW |
12021 | (I can't seem to compile the test program. Guessing big-endian...) |
12022 | EOM | |
68c15b6f HM |
12023 | fi |
12024 | case "$xxx_prompt" in | |
12025 | y) | |
12026 | rp="What is the order of bytes in a long?" | |
12027 | . ./myread | |
12028 | byteorder="$ans" | |
12029 | ;; | |
12030 | *) byteorder=$dflt | |
12031 | ;; | |
12032 | esac | |
ecfc5424 AD |
12033 | ;; |
12034 | esac | |
68c15b6f | 12035 | $rm -f try.c try |
ecfc5424 AD |
12036 | ;; |
12037 | esac | |
68c15b6f | 12038 | |
85e6fe83 | 12039 | |
4633a7c4 | 12040 | : how do we catenate cpp tokens here? |
2304df62 | 12041 | echo " " |
4633a7c4 LW |
12042 | echo "Checking to see how your cpp does stuff like catenate tokens..." >&4 |
12043 | $cat >cpp_stuff.c <<'EOCP' | |
12044 | #define RCAT(a,b)a/**/b | |
12045 | #define ACAT(a,b)a ## b | |
12046 | RCAT(Rei,ser) | |
12047 | ACAT(Cir,cus) | |
12048 | EOCP | |
12049 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 | |
12050 | if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then | |
dfe9444c | 12051 | echo "Oh! Smells like ANSI's been here." >&4 |
4633a7c4 LW |
12052 | echo "We can catify or stringify, separately or together!" |
12053 | cpp_stuff=42 | |
12054 | elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then | |
dfe9444c | 12055 | echo "Ah, yes! The good old days!" >&4 |
4633a7c4 LW |
12056 | echo "However, in the good old days we don't know how to stringify and" |
12057 | echo "catify at the same time." | |
12058 | cpp_stuff=1 | |
12059 | else | |
12060 | $cat >&4 <<EOM | |
12061 | Hmm, I don't seem to be able to catenate tokens with your cpp. You're going | |
12062 | to have to edit the values of CAT[2-5] in config.h... | |
a0d0e21e | 12063 | EOM |
4633a7c4 LW |
12064 | cpp_stuff="/* Help! How do we handle cpp_stuff? */*/" |
12065 | fi | |
12066 | $rm -f cpp_stuff.* | |
a0d0e21e | 12067 | |
4633a7c4 LW |
12068 | : see if this is a db.h system |
12069 | set db.h i_db | |
12070 | eval $inhdr | |
12071 | ||
12072 | case "$i_db" in | |
68dc0745 | 12073 | $define) |
1f70e1ea | 12074 | : Check db version. |
68dc0745 | 12075 | echo " " |
12076 | echo "Checking Berkeley DB version ..." >&4 | |
12077 | $cat >try.c <<EOCP | |
12078 | #$d_const HASCONST | |
12079 | #ifndef HASCONST | |
12080 | #define const | |
12081 | #endif | |
12082 | #include <sys/types.h> | |
12083 | #include <stdio.h> | |
12084 | #include <db.h> | |
d674cd6d | 12085 | int main() |
68dc0745 | 12086 | { |
1f70e1ea PM |
12087 | #ifdef DB_VERSION_MAJOR /* DB version >= 2 */ |
12088 | int Major, Minor, Patch ; | |
ee02776e | 12089 | unsigned long Version ; |
1f70e1ea PM |
12090 | (void)db_version(&Major, &Minor, &Patch) ; |
12091 | printf("You have Berkeley DB Version 2 or greater\n"); | |
12092 | ||
12093 | printf("db.h is from Berkeley DB Version %d.%d.%d\n", | |
12094 | DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH); | |
12095 | printf("libdb is from Berkeley DB Version %d.%d.%d\n", | |
12096 | Major, Minor, Patch) ; | |
12097 | ||
12098 | /* check that db.h & libdb are compatible */ | |
12099 | if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) { | |
12100 | printf("db.h and libdb are incompatible\n") ; | |
12101 | exit(3); | |
12102 | } | |
12103 | ||
12104 | printf("db.h and libdb are compatible\n") ; | |
ee02776e PM |
12105 | |
12106 | Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000 | |
693762b4 | 12107 | + DB_VERSION_PATCH ; |
ee02776e PM |
12108 | |
12109 | /* needs to be >= 2.3.4 */ | |
12110 | if (Version < 2003004) { | |
693762b4 | 12111 | /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */ |
ee02776e | 12112 | printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ; |
1f70e1ea PM |
12113 | exit(2); |
12114 | } | |
12115 | ||
12116 | exit(0); | |
68dc0745 | 12117 | #else |
6a1b87e5 | 12118 | #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) |
1f70e1ea | 12119 | printf("You have Berkeley DB Version 1\n"); |
6a1b87e5 JH |
12120 | exit(0); /* DB version < 2: the coast is clear. */ |
12121 | #else | |
12122 | exit(1); /* <db.h> not Berkeley DB? */ | |
12123 | #endif | |
68dc0745 | 12124 | #endif |
12125 | } | |
12126 | EOCP | |
dfe9444c | 12127 | set try |
cf21f3c6 | 12128 | if eval $compile_ok && ./try; then |
1f70e1ea | 12129 | echo 'Looks OK.' >&4 |
68dc0745 | 12130 | else |
c90c0ff4 | 12131 | echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4 |
68dc0745 | 12132 | i_db=$undef |
12133 | case " $libs " in | |
12134 | *"-ldb "*) | |
12135 | : Remove db from list of libraries to use | |
12136 | echo "Removing unusable -ldb from library list" >&4 | |
12137 | set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'` | |
12138 | shift | |
12139 | libs="$*" | |
12140 | echo "libs = $libs" >&4 | |
12141 | ;; | |
12142 | esac | |
12143 | fi | |
12144 | $rm -f try.* | |
12145 | ;; | |
12146 | esac | |
12147 | ||
12148 | case "$i_db" in | |
4633a7c4 | 12149 | define) |
dc45a647 MB |
12150 | : Check the return type needed for hash |
12151 | echo " " | |
12152 | echo "Checking return type needed for hash for Berkeley DB ..." >&4 | |
12153 | $cat >try.c <<EOCP | |
12154 | #$d_const HASCONST | |
12155 | #ifndef HASCONST | |
12156 | #define const | |
12157 | #endif | |
12158 | #include <sys/types.h> | |
12159 | #include <db.h> | |
12160 | ||
12161 | #ifndef DB_VERSION_MAJOR | |
12162 | u_int32_t hash_cb (ptr, size) | |
12163 | const void *ptr; | |
12164 | size_t size; | |
12165 | { | |
12166 | } | |
12167 | HASHINFO info; | |
d674cd6d | 12168 | int main() |
dc45a647 MB |
12169 | { |
12170 | info.hash = hash_cb; | |
12171 | } | |
12172 | #endif | |
12173 | EOCP | |
12174 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
12175 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
12176 | db_hashtype='int' | |
12177 | else | |
12178 | db_hashtype='u_int32_t' | |
12179 | fi | |
12180 | else | |
12181 | : XXX Maybe we should just give up here. | |
12182 | db_hashtype=u_int32_t | |
12183 | $cat try.out >&4 | |
12184 | echo "Help: I can't seem to compile the db test program." >&4 | |
12185 | echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 | |
12186 | fi | |
12187 | $rm -f try.* | |
12188 | echo "Your version of Berkeley DB uses $db_hashtype for hash." | |
12189 | ;; | |
12190 | *) db_hashtype=u_int32_t | |
12191 | ;; | |
12192 | esac | |
12193 | case "$i_db" in | |
12194 | define) | |
4633a7c4 LW |
12195 | : Check the return type needed for prefix |
12196 | echo " " | |
12197 | echo "Checking return type needed for prefix for Berkeley DB ..." >&4 | |
12198 | cat >try.c <<EOCP | |
12199 | #$d_const HASCONST | |
12200 | #ifndef HASCONST | |
12201 | #define const | |
12202 | #endif | |
12203 | #include <sys/types.h> | |
12204 | #include <db.h> | |
1f70e1ea PM |
12205 | |
12206 | #ifndef DB_VERSION_MAJOR | |
4633a7c4 LW |
12207 | size_t prefix_cb (key1, key2) |
12208 | const DBT *key1; | |
12209 | const DBT *key2; | |
12210 | { | |
12211 | } | |
12212 | BTREEINFO info; | |
d674cd6d | 12213 | int main() |
4633a7c4 LW |
12214 | { |
12215 | info.prefix = prefix_cb; | |
12216 | } | |
1f70e1ea | 12217 | #endif |
4633a7c4 LW |
12218 | EOCP |
12219 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
12220 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
12221 | db_prefixtype='int' | |
12222 | else | |
12223 | db_prefixtype='size_t' | |
12224 | fi | |
12225 | else | |
68dc0745 | 12226 | db_prefixtype='size_t' |
12227 | : XXX Maybe we should just give up here. | |
dc45a647 | 12228 | $cat try.out >&4 |
68dc0745 | 12229 | echo "Help: I can't seem to compile the db test program." >&4 |
12230 | echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 | |
4633a7c4 LW |
12231 | fi |
12232 | $rm -f try.* | |
12233 | echo "Your version of Berkeley DB uses $db_prefixtype for prefix." | |
a0d0e21e | 12234 | ;; |
68dc0745 | 12235 | *) db_prefixtype='size_t' |
4633a7c4 LW |
12236 | ;; |
12237 | esac | |
a0d0e21e | 12238 | |
4633a7c4 LW |
12239 | : check for void type |
12240 | echo " " | |
12241 | echo "Checking to see how well your C compiler groks the void type..." >&4 | |
4633a7c4 LW |
12242 | case "$voidflags" in |
12243 | '') | |
12244 | $cat >try.c <<'EOCP' | |
12245 | #if TRY & 1 | |
760ac839 | 12246 | void sub() { |
4633a7c4 | 12247 | #else |
760ac839 | 12248 | sub() { |
4633a7c4 LW |
12249 | #endif |
12250 | extern void moo(); /* function returning void */ | |
12251 | void (*goo)(); /* ptr to func returning void */ | |
12252 | #if TRY & 8 | |
12253 | void *hue; /* generic ptr */ | |
12254 | #endif | |
12255 | #if TRY & 2 | |
12256 | void (*foo[10])(); | |
12257 | #endif | |
a0d0e21e | 12258 | |
4633a7c4 LW |
12259 | #if TRY & 4 |
12260 | if(goo == moo) { | |
12261 | exit(0); | |
12262 | } | |
12263 | #endif | |
12264 | exit(0); | |
12265 | } | |
d674cd6d | 12266 | int main() { sub(); } |
4633a7c4 | 12267 | EOCP |
760ac839 | 12268 | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then |
4633a7c4 | 12269 | voidflags=$defvoidused |
bfb7748a | 12270 | echo "Good. It appears to support void to the level $package wants.">&4 |
4633a7c4 LW |
12271 | if $contains warning .out >/dev/null 2>&1; then |
12272 | echo "However, you might get some warnings that look like this:" | |
12273 | $cat .out | |
12274 | fi | |
12275 | else | |
12276 | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 | |
760ac839 | 12277 | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then |
4633a7c4 | 12278 | echo "It supports 1..." |
760ac839 | 12279 | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then |
4633a7c4 | 12280 | echo "It also supports 2..." |
760ac839 | 12281 | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
12282 | voidflags=7 |
12283 | echo "And it supports 4 but not 8 definitely." | |
12284 | else | |
12285 | echo "It doesn't support 4..." | |
760ac839 | 12286 | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
12287 | voidflags=11 |
12288 | echo "But it supports 8." | |
12289 | else | |
12290 | voidflags=3 | |
12291 | echo "Neither does it support 8." | |
12292 | fi | |
12293 | fi | |
12294 | else | |
12295 | echo "It does not support 2..." | |
760ac839 | 12296 | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
12297 | voidflags=13 |
12298 | echo "But it supports 4 and 8." | |
12299 | else | |
760ac839 | 12300 | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
12301 | voidflags=5 |
12302 | echo "And it supports 4 but has not heard about 8." | |
12303 | else | |
12304 | echo "However it supports 8 but not 4." | |
12305 | fi | |
12306 | fi | |
12307 | fi | |
12308 | else | |
12309 | echo "There is no support at all for void." | |
12310 | voidflags=0 | |
12311 | fi | |
12312 | fi | |
12313 | esac | |
4633a7c4 | 12314 | case "$voidflags" in |
2c7991dc | 12315 | "$defvoidused") ;; |
bfb7748a AD |
12316 | *) $cat >&4 <<'EOM' |
12317 | Support flag bits are: | |
12318 | 1: basic void declarations. | |
12319 | 2: arrays of pointers to functions returning void. | |
12320 | 4: operations between pointers to and addresses of void functions. | |
12321 | 8: generic void pointers. | |
12322 | EOM | |
2c7991dc | 12323 | dflt="$voidflags"; |
4633a7c4 | 12324 | rp="Your void support flags add up to what?" |
a0d0e21e | 12325 | . ./myread |
4633a7c4 | 12326 | voidflags="$ans" |
a0d0e21e LW |
12327 | ;; |
12328 | esac | |
4633a7c4 | 12329 | $rm -f try.* .out |
a0d0e21e | 12330 | |
85ab1d1d JH |
12331 | |
12332 | : How can we generate normalized random numbers ? | |
693762b4 | 12333 | echo " " |
de4597cb | 12334 | echo "Looking for a random number function..." >&4 |
85ab1d1d | 12335 | case "$randfunc" in |
693762b4 | 12336 | '') |
85ab1d1d JH |
12337 | if set drand48 val -f; eval $csym; $val; then |
12338 | dflt="drand48" | |
12339 | echo "Good, found drand48()." >&4 | |
12340 | elif set random val -f; eval $csym; $val; then | |
12341 | dflt="random" | |
12342 | echo "OK, found random()." >&4 | |
12343 | else | |
12344 | dflt="rand" | |
12345 | echo "Yick, looks like I have to use rand()." >&4 | |
12346 | fi | |
12347 | echo " " | |
12348 | ;; | |
12349 | *) | |
12350 | dflt="$randfunc" | |
12351 | ;; | |
12352 | esac | |
12353 | cont=true | |
12354 | ||
12355 | case "$ccflags" in | |
12356 | *-Dmy_rand=*|*-Dmy_srand=*) | |
12357 | echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4 | |
12358 | ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`" | |
12359 | ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`" | |
12360 | ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`" | |
12361 | ;; | |
12362 | esac | |
12363 | ||
12364 | while $test "$cont"; do | |
12365 | rp="Use which function to generate random numbers?" | |
12366 | . ./myread | |
12367 | if $test "$ans" = "$dflt"; then | |
12368 | : null | |
12369 | else | |
12370 | randbits='' | |
12371 | fi | |
12372 | randfunc="$ans" | |
12373 | if set $ans val -f; eval $csym; $val; then | |
12374 | cont='' | |
12375 | else | |
ef4af2be JH |
12376 | dflt=y |
12377 | rp="I cannot find function $ans. Use that name anyway?" | |
85ab1d1d JH |
12378 | . ./myread |
12379 | dflt=rand | |
12380 | case "$ans" in | |
12381 | [yY]*) cont='';; | |
12382 | esac | |
12383 | fi | |
12384 | case "$cont" in | |
12385 | '') | |
12386 | case "$randfunc" in | |
12387 | drand48) | |
12388 | drand01="drand48()" | |
12389 | seedfunc="srand48" | |
12390 | randbits=48 | |
12391 | randseedtype=long | |
12392 | ;; | |
12393 | rand|random) | |
12394 | case "$randbits" in | |
12395 | '') | |
12396 | echo "Checking to see how many bits your $randfunc() function produces..." >&4 | |
12397 | $cat >try.c <<EOCP | |
12398 | #$i_unistd I_UNISTD | |
12399 | #$i_stdlib I_STDLIB | |
693762b4 | 12400 | #include <stdio.h> |
85ab1d1d JH |
12401 | #ifdef I_UNISTD |
12402 | # include <unistd.h> | |
12403 | #endif | |
12404 | #ifdef I_STDLIB | |
12405 | # include <stdlib.h> | |
12406 | #endif | |
d674cd6d | 12407 | int main() |
693762b4 | 12408 | { |
85ab1d1d JH |
12409 | register int i; |
12410 | register unsigned long tmp; | |
12411 | register unsigned long max = 0L; | |
12412 | ||
12413 | for (i = 1000; i; i--) { | |
12414 | tmp = (unsigned long) $randfunc(); | |
12415 | if (tmp > max) max = tmp; | |
12416 | } | |
12417 | for (i = 0; max; i++) | |
12418 | max /= 2; | |
12419 | printf("%d\n",i); | |
693762b4 AD |
12420 | } |
12421 | EOCP | |
85ab1d1d JH |
12422 | set try |
12423 | if eval $compile_ok; then | |
12424 | dflt=`try` | |
12425 | else | |
12426 | dflt='?' | |
12427 | echo "(I can't seem to compile the test program...)" | |
12428 | fi | |
12429 | ;; | |
12430 | *) | |
12431 | dflt="$randbits" | |
12432 | ;; | |
12433 | esac | |
12434 | rp="How many bits does your $randfunc() function produce?" | |
12435 | . ./myread | |
12436 | randbits="$ans" | |
12437 | $rm -f try.c try | |
12438 | drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))" | |
12439 | seedfunc="s$randfunc" | |
12440 | randseedtype=unsigned | |
12441 | ;; | |
12442 | *) | |
12443 | dflt="31" | |
12444 | rp="How many bits does your $randfunc() function produce?" | |
12445 | . ./myread | |
12446 | randbits="$ans" | |
12447 | seedfunc="s$randfunc" | |
12448 | drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))" | |
12449 | if set $seedfunc val -f; eval $csym; $val; then | |
12450 | echo "(Using $seedfunc() to seed random generator)" | |
12451 | else | |
12452 | echo "(Warning: no $seedfunc() to seed random generator)" | |
12453 | seedfunc=rand | |
12454 | fi | |
12455 | randseedtype=unsigned | |
12456 | ;; | |
12457 | esac | |
12458 | ;; | |
12459 | esac | |
12460 | done | |
693762b4 | 12461 | |
5ff3f7a4 GS |
12462 | echo " " |
12463 | echo "Determining whether or not we are on an EBCDIC system..." >&4 | |
12464 | $cat >tebcdic.c <<'EOM' | |
12465 | int main() | |
12466 | { | |
12467 | if ('M'==0xd4) return 0; | |
12468 | return 1; | |
12469 | } | |
12470 | EOM | |
12471 | ||
12472 | val=$undef | |
12473 | set tebcdic | |
12474 | if eval $compile_ok; then | |
12475 | if ./tebcdic; then | |
12476 | echo "You have EBCDIC." >&4 | |
12477 | val="$define" | |
12478 | else | |
57def98f | 12479 | echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4 |
5ff3f7a4 GS |
12480 | fi |
12481 | else | |
5cc3184f | 12482 | echo "I'm unable to compile the test program." >&4 |
5ff3f7a4 GS |
12483 | echo "I'll assume ASCII or some ISO Latin." >&4 |
12484 | fi | |
12485 | $rm -f tebcdic.c tebcdic | |
12486 | set ebcdic | |
12487 | eval $setvar | |
12488 | ||
29209bc5 | 12489 | echo " " |
767df6a1 JH |
12490 | $cat >&4 <<EOM |
12491 | Checking how to flush all pending stdio output... | |
66fe083f | 12492 | EOM |
d2201af2 AD |
12493 | # I only know how to find the first 32 possibly open files on SunOS. |
12494 | # See also hints/sunos_4_1.sh and util.c --AD | |
12495 | case "$osname" in | |
12496 | sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;; | |
12497 | esac | |
12498 | $cat >>try.c <<EOCP | |
66fe083f | 12499 | #include <stdio.h> |
d2201af2 | 12500 | #$i_unistd I_UNISTD |
767df6a1 | 12501 | #ifdef I_UNISTD |
a32a45b6 | 12502 | # include <unistd.h> |
767df6a1 JH |
12503 | #endif |
12504 | #$d_sysconf HAS_SYSCONF | |
a71cd7cd JH |
12505 | #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY |
12506 | #ifdef HAS_STDIO_STREAM_ARRAY | |
12507 | # define STDIO_STREAM_ARRAY $stdio_stream_array | |
12508 | #endif | |
66fe083f JH |
12509 | int main() { |
12510 | FILE* p = fopen("try.out", "w"); | |
0f27ced1 | 12511 | #ifdef TRY_FPUTC |
66fe083f | 12512 | fputc('x', p); |
0f27ced1 JH |
12513 | #else |
12514 | # ifdef TRY_FPRINTF | |
12515 | fprintf(p, "x"); | |
12516 | # endif | |
12517 | #endif | |
767df6a1 | 12518 | #ifdef TRY_FFLUSH_NULL |
66fe083f | 12519 | fflush(NULL); |
767df6a1 JH |
12520 | #endif |
12521 | #ifdef TRY_FFLUSH_ALL | |
12522 | { | |
12523 | long open_max = -1; | |
d2201af2 AD |
12524 | # ifdef PERL_FFLUSH_ALL_FOPEN_MAX |
12525 | open_max = PERL_FFLUSH_ALL_FOPEN_MAX; | |
767df6a1 | 12526 | # else |
d2201af2 AD |
12527 | # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) |
12528 | open_max = sysconf(_SC_OPEN_MAX); | |
767df6a1 | 12529 | # else |
4b257aef | 12530 | # ifdef FOPEN_MAX |
d2201af2 | 12531 | open_max = FOPEN_MAX; |
767df6a1 | 12532 | # else |
d2201af2 AD |
12533 | # ifdef OPEN_MAX |
12534 | open_max = OPEN_MAX; | |
12535 | # else | |
12536 | # ifdef _NFILE | |
12537 | open_max = _NFILE; | |
12538 | # endif | |
767df6a1 JH |
12539 | # endif |
12540 | # endif | |
12541 | # endif | |
4b257aef | 12542 | # endif |
ed39a0f2 | 12543 | # ifdef HAS_STDIO_STREAM_ARRAY |
767df6a1 JH |
12544 | if (open_max > 0) { |
12545 | long i; | |
12546 | for (i = 0; i < open_max; i++) | |
d2201af2 AD |
12547 | if (STDIO_STREAM_ARRAY[i]._file >= 0 && |
12548 | STDIO_STREAM_ARRAY[i]._file < open_max && | |
12549 | STDIO_STREAM_ARRAY[i]._flag) | |
12550 | fflush(&STDIO_STREAM_ARRAY[i]); | |
767df6a1 JH |
12551 | } |
12552 | } | |
ed39a0f2 | 12553 | # endif |
767df6a1 JH |
12554 | #endif |
12555 | _exit(42); | |
66fe083f JH |
12556 | } |
12557 | EOCP | |
0f27ced1 JH |
12558 | : first we have to find out how _not_ to flush |
12559 | if $test "X$fflushNULL" = X -o "X$fflushall" = X; then | |
12560 | output='' | |
12561 | set try -DTRY_FPUTC | |
6626660c | 12562 | if eval $compile; then |
4b257aef | 12563 | $rm -f try.out |
0f27ced1 JH |
12564 | ./try$exe_ext 2>/dev/null |
12565 | if $test ! -s try.out -a "X$?" = X42; then | |
12566 | output=-DTRY_FPUTC | |
12567 | fi | |
12568 | fi | |
12569 | case "$output" in | |
12570 | '') | |
12571 | set try -DTRY_FPRINTF | |
12572 | $rm -f try.out | |
6626660c | 12573 | if eval $compile; then |
4b257aef | 12574 | $rm -f try.out |
0f27ced1 JH |
12575 | ./try$exe_ext 2>/dev/null |
12576 | if $test ! -s try.out -a "X$?" = X42; then | |
12577 | output=-DTRY_FPRINTF | |
12578 | fi | |
12579 | fi | |
12580 | ;; | |
12581 | esac | |
12582 | fi | |
767df6a1 JH |
12583 | : check for fflush NULL behaviour |
12584 | case "$fflushNULL" in | |
0f27ced1 | 12585 | '') set try -DTRY_FFLUSH_NULL $output |
6626660c | 12586 | if eval $compile; then |
4b257aef | 12587 | $rm -f try.out |
196fa3d2 | 12588 | ./try$exe_ext 2>/dev/null |
a32a45b6 JH |
12589 | code="$?" |
12590 | if $test -s try.out -a "X$code" = X42; then | |
c2fddd50 | 12591 | fflushNULL="`$cat try.out`" |
a32a45b6 JH |
12592 | else |
12593 | if $test "X$code" != X42; then | |
12594 | $cat >&4 <<EOM | |
12595 | (If this test failed, don't worry, we'll try another method shortly.) | |
12596 | EOM | |
12597 | fi | |
c2fddd50 JH |
12598 | fi |
12599 | fi | |
0f27ced1 | 12600 | $rm -f core try.core core.try.* |
c2fddd50 | 12601 | case "$fflushNULL" in |
6626660c | 12602 | x) $cat >&4 <<EOM |
2b8ee124 JH |
12603 | Your fflush(NULL) works okay for output streams. |
12604 | Let's see if it clobbers input pipes... | |
66fe083f | 12605 | EOM |
2b8ee124 JH |
12606 | # As of mid-March 2000 all versions of Solaris appear to have a stdio |
12607 | # bug that improperly flushes the input end of pipes. So we avoid the | |
12608 | # autoflush on fork/system/exec support for now. :-( | |
12609 | $cat >tryp.c <<EOCP | |
12610 | #include <stdio.h> | |
12611 | int | |
12612 | main(int argc, char **argv) | |
12613 | { | |
12614 | char buf[1024]; | |
12615 | int i; | |
12616 | char *bp = buf; | |
12617 | while (1) { | |
12618 | while ((i = getc(stdin)) != -1 | |
12619 | && (*bp++ = i) != '\n' | |
12620 | && bp < &buf[1024]) | |
12621 | /* DO NOTHING */ ; | |
12622 | *bp = '\0'; | |
12623 | fprintf(stdout, "%s", buf); | |
12624 | fflush(NULL); | |
12625 | if (i == -1) | |
b354742d | 12626 | return 0; |
2b8ee124 JH |
12627 | bp = buf; |
12628 | } | |
12629 | } | |
12630 | EOCP | |
12631 | fflushNULL="$define" | |
12632 | set tryp | |
12633 | if eval $compile; then | |
12634 | $rm -f tryp.out | |
12635 | $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out | |
12636 | if cmp tryp.c tryp.out >/dev/null 2>&1; then | |
12637 | $cat >&4 <<EOM | |
12638 | fflush(NULL) seems to behave okay with input streams. | |
12639 | EOM | |
12640 | fflushNULL="$define" | |
12641 | else | |
12642 | $cat >&4 <<EOM | |
12643 | Ouch, fflush(NULL) clobbers input pipes! We will not use it. | |
12644 | EOM | |
12645 | fflushNULL="$undef" | |
12646 | fi | |
12647 | fi | |
b354742d | 12648 | $rm -f core tryp.c tryp.core core.tryp.* |
c2fddd50 | 12649 | ;; |
6626660c | 12650 | '') $cat >&4 <<EOM |
66fe083f JH |
12651 | Your fflush(NULL) isn't working (contrary to ANSI C). |
12652 | EOM | |
ed39a0f2 | 12653 | fflushNULL="$undef" |
c2fddd50 | 12654 | ;; |
6626660c | 12655 | *) $cat >&4 <<EOM |
66fe083f JH |
12656 | Cannot figure out whether your fflush(NULL) works or not. |
12657 | I'm assuming it doesn't (contrary to ANSI C). | |
12658 | EOM | |
ed39a0f2 | 12659 | fflushNULL="$undef" |
c2fddd50 JH |
12660 | ;; |
12661 | esac | |
66fe083f JH |
12662 | ;; |
12663 | $define|true|[yY]*) | |
ed39a0f2 | 12664 | fflushNULL="$define" |
66fe083f JH |
12665 | ;; |
12666 | *) | |
ed39a0f2 | 12667 | fflushNULL="$undef" |
66fe083f JH |
12668 | ;; |
12669 | esac | |
b354742d GS |
12670 | : check explicit looping only if NULL did not work, and if the pipe |
12671 | : bug does not show up on an explicit flush too | |
a32a45b6 JH |
12672 | case "$fflushNULL" in |
12673 | "$undef") | |
b354742d GS |
12674 | $cat >tryp.c <<EOCP |
12675 | #include <stdio.h> | |
12676 | int | |
12677 | main(int argc, char **argv) | |
12678 | { | |
12679 | char buf[1024]; | |
12680 | int i; | |
12681 | char *bp = buf; | |
12682 | while (1) { | |
12683 | while ((i = getc(stdin)) != -1 | |
12684 | && (*bp++ = i) != '\n' | |
12685 | && bp < &buf[1024]) | |
12686 | /* DO NOTHING */ ; | |
12687 | *bp = '\0'; | |
12688 | fprintf(stdout, "%s", buf); | |
12689 | fflush(stdin); | |
12690 | if (i == -1) | |
12691 | return 0; | |
12692 | bp = buf; | |
12693 | } | |
12694 | } | |
12695 | EOCP | |
12696 | set tryp | |
12697 | if eval $compile; then | |
12698 | $rm -f tryp.out | |
12699 | $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out | |
12700 | if cmp tryp.c tryp.out >/dev/null 2>&1; then | |
12701 | $cat >&4 <<EOM | |
12702 | Good, at least fflush(stdin) seems to behave okay when stdin is a pipe. | |
a71cd7cd | 12703 | EOM |
b354742d | 12704 | : now check for fflushall behaviour |
a32a45b6 | 12705 | case "$fflushall" in |
b354742d GS |
12706 | '') set try -DTRY_FFLUSH_ALL $output |
12707 | if eval $compile; then | |
12708 | $cat >&4 <<EOM | |
12709 | (Now testing the other method--but note that this also may fail.) | |
12710 | EOM | |
12711 | $rm -f try.out | |
12712 | ./try$exe_ext 2>/dev/null | |
12713 | if $test -s try.out -a "X$?" = X42; then | |
12714 | fflushall="`$cat try.out`" | |
12715 | fi | |
12716 | fi | |
12717 | $rm -f core try.core core.try.* | |
12718 | case "$fflushall" in | |
12719 | x) $cat >&4 <<EOM | |
a32a45b6 | 12720 | Whew. Flushing explicitly all the stdio streams works. |
767df6a1 | 12721 | EOM |
b354742d GS |
12722 | fflushall="$define" |
12723 | ;; | |
12724 | '') $cat >&4 <<EOM | |
a32a45b6 | 12725 | Sigh. Flushing explicitly all the stdio streams doesn't work. |
767df6a1 | 12726 | EOM |
b354742d GS |
12727 | fflushall="$undef" |
12728 | ;; | |
12729 | *) $cat >&4 <<EOM | |
6626660c | 12730 | Cannot figure out whether flushing stdio streams explicitly works or not. |
767df6a1 JH |
12731 | I'm assuming it doesn't. |
12732 | EOM | |
b354742d GS |
12733 | fflushall="$undef" |
12734 | ;; | |
12735 | esac | |
12736 | ;; | |
12737 | "$define"|true|[yY]*) | |
12738 | fflushall="$define" | |
12739 | ;; | |
12740 | *) | |
a32a45b6 JH |
12741 | fflushall="$undef" |
12742 | ;; | |
12743 | esac | |
b354742d GS |
12744 | else |
12745 | $cat >&4 <<EOM | |
12746 | All is futile. Even fflush(stdin) clobbers input pipes! | |
12747 | EOM | |
a32a45b6 | 12748 | fflushall="$undef" |
b354742d GS |
12749 | fi |
12750 | else | |
12751 | fflushall="$undef" | |
12752 | fi | |
12753 | $rm -f core tryp.c tryp.core core.tryp.* | |
767df6a1 | 12754 | ;; |
b354742d | 12755 | *) fflushall="$undef" |
767df6a1 JH |
12756 | ;; |
12757 | esac | |
b354742d | 12758 | |
767df6a1 JH |
12759 | case "$fflushNULL$fflushall" in |
12760 | undefundef) | |
6626660c | 12761 | $cat <<EOM |
b354742d GS |
12762 | OK, I give up. I cannot figure out how to flush pending stdio output. |
12763 | We won't be flushing handles at all before fork/exec/popen. | |
767df6a1 JH |
12764 | EOM |
12765 | ;; | |
12766 | esac | |
12767 | $rm -f try.* try$exe_ext | |
66fe083f | 12768 | |
ccc7f9b3 KS |
12769 | : Store the full pathname to the ar program for use in the C program |
12770 | : Respect a hint or command line value for full_ar. | |
12771 | case "$full_ar" in | |
12772 | '') full_ar=$ar ;; | |
12773 | esac | |
12774 | ||
1aef975c AD |
12775 | : Store the full pathname to the sed program for use in the C program |
12776 | full_sed=$sed | |
12777 | ||
2304df62 | 12778 | : see what type gids are declared as in the kernel |
dc45a647 MB |
12779 | echo " " |
12780 | echo "Looking for the type for group ids returned by getgid()." | |
a0d0e21e LW |
12781 | set gid_t gidtype xxx stdio.h sys/types.h |
12782 | eval $typedef | |
2304df62 | 12783 | case "$gidtype" in |
a0d0e21e LW |
12784 | xxx) |
12785 | xxx=`./findhdr sys/user.h` | |
12786 | set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short | |
12787 | case $1 in | |
12788 | unsigned) dflt="$1 $2" ;; | |
12789 | *) dflt="$1" ;; | |
12790 | esac | |
2304df62 | 12791 | ;; |
8175356b JH |
12792 | *) dflt="$gidtype";; |
12793 | esac | |
12794 | case "$gidtype" in | |
12795 | gid_t) echo "gid_t found." ;; | |
12796 | *) rp="What is the type for group ids returned by getgid()?" | |
12797 | . ./myread | |
12798 | gidtype="$ans" | |
12799 | ;; | |
12800 | esac | |
12801 | ||
12802 | echo " " | |
12803 | case "$gidtype" in | |
12804 | *_t) zzz="$gidtype" ;; | |
12805 | *) zzz="gid" ;; | |
12806 | esac | |
a22e52b9 | 12807 | echo "Checking the size of $zzz..." >&4 |
8175356b JH |
12808 | cat > try.c <<EOCP |
12809 | #include <sys/types.h> | |
12810 | #include <stdio.h> | |
12811 | int main() { | |
213c275f | 12812 | printf("%d\n", (int)sizeof($gidtype)); |
14e4fe40 | 12813 | exit(0); |
8175356b JH |
12814 | } |
12815 | EOCP | |
12816 | set try | |
a22e52b9 | 12817 | if eval $compile_ok; then |
8175356b JH |
12818 | yyy=`./try` |
12819 | case "$yyy" in | |
a22e52b9 JH |
12820 | '') gidsize=4 |
12821 | echo "(I can't execute the test program--guessing $gidsize.)" >&4 | |
8175356b | 12822 | ;; |
a22e52b9 | 12823 | *) gidsize=$yyy |
49c10eea | 12824 | echo "Your $zzz is $gidsize bytes long." |
8175356b JH |
12825 | ;; |
12826 | esac | |
12827 | else | |
a22e52b9 JH |
12828 | gidsize=4 |
12829 | echo "(I can't compile the test program--guessing $gidsize.)" >&4 | |
8175356b JH |
12830 | fi |
12831 | ||
12832 | ||
12833 | echo " " | |
12834 | case "$gidtype" in | |
12835 | *_t) zzz="$gidtype" ;; | |
12836 | *) zzz="gid" ;; | |
12837 | esac | |
a22e52b9 | 12838 | echo "Checking the sign of $zzz..." >&4 |
8175356b JH |
12839 | cat > try.c <<EOCP |
12840 | #include <sys/types.h> | |
12841 | #include <stdio.h> | |
12842 | int main() { | |
a22e52b9 JH |
12843 | $gidtype foo = -1; |
12844 | if (foo < 0) | |
12845 | printf("-1\n"); | |
12846 | else | |
12847 | printf("1\n"); | |
8175356b JH |
12848 | } |
12849 | EOCP | |
12850 | set try | |
a22e52b9 | 12851 | if eval $compile; then |
8175356b JH |
12852 | yyy=`./try` |
12853 | case "$yyy" in | |
a22e52b9 JH |
12854 | '') gidsign=1 |
12855 | echo "(I can't execute the test program--guessing unsigned.)" >&4 | |
8175356b | 12856 | ;; |
a22e52b9 JH |
12857 | *) gidsign=$yyy |
12858 | case "$gidsign" in | |
12859 | 1) echo "Your $zzz is unsigned." ;; | |
12860 | -1) echo "Your $zzz is signed." ;; | |
12861 | esac | |
8175356b JH |
12862 | ;; |
12863 | esac | |
12864 | else | |
a22e52b9 JH |
12865 | gidsign=1 |
12866 | echo "(I can't compile the test program--guessing unsigned.)" >&4 | |
8175356b JH |
12867 | fi |
12868 | ||
12869 | ||
785fb66b | 12870 | echo " " |
8175356b JH |
12871 | |
12872 | if $test X"$quadtype" != X; then | |
12873 | ||
12874 | echo "Checking how to print 64-bit integers..." >&4 | |
12875 | ||
12876 | if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then | |
12877 | $cat >try.c <<'EOCP' | |
785fb66b JH |
12878 | #include <sys/types.h> |
12879 | #include <stdio.h> | |
12880 | int main() { | |
8175356b JH |
12881 | int q = 12345678901; |
12882 | printf("%ld\n", q); | |
785fb66b JH |
12883 | } |
12884 | EOCP | |
8175356b JH |
12885 | set try |
12886 | if eval $compile; then | |
12887 | yyy=`./try$exe_ext` | |
12888 | case "$yyy" in | |
12889 | 12345678901) | |
12890 | sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"'; | |
12891 | sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"'; | |
12892 | echo "We will use %d." | |
12893 | ;; | |
785fb66b | 12894 | esac |
8175356b | 12895 | fi |
785fb66b JH |
12896 | fi |
12897 | ||
8175356b JH |
12898 | if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then |
12899 | $cat >try.c <<'EOCP' | |
12900 | #include <sys/types.h> | |
12901 | #include <stdio.h> | |
12902 | int main() { | |
12903 | long q = 12345678901; | |
12904 | printf("%ld\n", q); | |
12905 | } | |
12906 | EOCP | |
12907 | set try | |
12908 | if eval $compile; then | |
12909 | yyy=`./try$exe_ext` | |
12910 | case "$yyy" in | |
12911 | 12345678901) | |
12912 | sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"'; | |
12913 | sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"'; | |
12914 | echo "We will use %ld." | |
12915 | ;; | |
12916 | esac | |
12917 | fi | |
12918 | fi | |
785fb66b | 12919 | |
8afc5b8d | 12920 | if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then |
8175356b | 12921 | $cat >try.c <<'EOCP' |
785fb66b | 12922 | #include <sys/types.h> |
8175356b | 12923 | #include <inttypes.h> |
785fb66b JH |
12924 | #include <stdio.h> |
12925 | int main() { | |
8175356b JH |
12926 | int64_t q = 12345678901; |
12927 | printf("%" PRId64 "\n", q); | |
785fb66b JH |
12928 | } |
12929 | EOCP | |
8175356b JH |
12930 | set try |
12931 | if eval $compile; then | |
12932 | yyy=`./try$exe_ext` | |
12933 | case "$yyy" in | |
12934 | 12345678901) | |
12935 | sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64; | |
12936 | sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64; | |
12937 | echo "We will use the C9X style." | |
12938 | ;; | |
12939 | esac | |
12940 | fi | |
12941 | fi | |
12942 | ||
12943 | if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then | |
12944 | $cat >try.c <<'EOCP' | |
12945 | #include <sys/types.h> | |
12946 | #include <stdio.h> | |
12947 | int main() { | |
12948 | long long q = 12345678901LL; /* AIX cc requires the LL prefix. */ | |
12949 | printf("%lld\n", q); | |
12950 | } | |
12951 | EOCP | |
12952 | set try | |
12953 | if eval $compile; then | |
12954 | yyy=`./try$exe_ext` | |
12955 | case "$yyy" in | |
12956 | 12345678901) | |
12957 | sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"'; | |
12958 | sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"'; | |
12959 | echo "We will use the %lld style." | |
12960 | ;; | |
12961 | esac | |
12962 | fi | |
785fb66b JH |
12963 | fi |
12964 | ||
8175356b JH |
12965 | if $test X"$sPRId64" = X -a X"$quadtype" != X; then |
12966 | $cat >try.c <<EOCP | |
12967 | #include <sys/types.h> | |
12968 | #include <stdio.h> | |
12969 | int main() { | |
12970 | $quadtype q = 12345678901; | |
12971 | printf("%Ld\n", q); | |
12972 | } | |
12973 | EOCP | |
12974 | set try | |
12975 | if eval $compile; then | |
12976 | yyy=`./try$exe_ext` | |
12977 | case "$yyy" in | |
12978 | 12345678901) | |
12979 | sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"'; | |
12980 | sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"'; | |
12981 | echo "We will use %Ld." | |
12982 | ;; | |
12983 | esac | |
12984 | fi | |
12985 | fi | |
785fb66b | 12986 | |
8175356b JH |
12987 | if $test X"$sPRId64" = X -a X"$quadtype" != X; then |
12988 | $cat >try.c <<EOCP | |
12989 | #include <sys/types.h> | |
12990 | #include <stdio.h> | |
12991 | int main() { | |
12992 | $quadtype q = 12345678901; | |
12993 | printf("%qd\n", q); | |
12994 | } | |
12995 | EOCP | |
12996 | set try | |
12997 | if eval $compile; then | |
12998 | yyy=`./try$exe_ext` | |
12999 | case "$yyy" in | |
13000 | 12345678901) | |
13001 | sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"'; | |
13002 | sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"'; | |
13003 | echo "We will use %qd." | |
13004 | ;; | |
13005 | esac | |
13006 | fi | |
13007 | fi | |
2304df62 | 13008 | |
8175356b JH |
13009 | if $test X"$sPRId64" = X; then |
13010 | echo "Cannot figure out how to print 64-bit integers." >&4 | |
13011 | fi | |
5cd24f17 | 13012 | |
8175356b | 13013 | $rm -f try try.* |
dfe9444c | 13014 | |
8175356b | 13015 | fi |
2304df62 | 13016 | |
8175356b JH |
13017 | case "$sPRId64" in |
13018 | '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; | |
13019 | d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef"; | |
13020 | ;; | |
13021 | *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; | |
13022 | d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define"; | |
a0d0e21e | 13023 | ;; |
2304df62 | 13024 | esac |
2304df62 | 13025 | |
2304df62 | 13026 | |
8ff267be | 13027 | echo " " |
8175356b JH |
13028 | $echo "Checking the format strings to be used for Perl's internal types..." >&4 |
13029 | ||
13030 | if $test X"$ivsize" = X8; then | |
13031 | ivdformat="$sPRId64" | |
13032 | uvuformat="$sPRIu64" | |
13033 | uvoformat="$sPRIo64" | |
13034 | uvxformat="$sPRIx64" | |
5ff3f7a4 | 13035 | else |
8175356b JH |
13036 | if $test X"$ivsize" = X"$longsize"; then |
13037 | ivdformat='"ld"' | |
13038 | uvuformat='"lu"' | |
13039 | uvoformat='"lo"' | |
13040 | uvxformat='"lx"' | |
13041 | else | |
13042 | if $test X"$ivsize" = X"$intsize"; then | |
13043 | ivdformat='"d"' | |
13044 | uvuformat='"u"' | |
13045 | uvoformat='"o"' | |
13046 | uvxformat='"x"' | |
13047 | else | |
13048 | : far out | |
13049 | if $test X"$ivsize" = X"$shortsize"; then | |
13050 | ivdformat='"hd"' | |
13051 | uvuformat='"hu"' | |
13052 | uvoformat='"ho"' | |
13053 | uvxformat='"hx"' | |
13054 | fi | |
13055 | fi | |
13056 | fi | |
5ff3f7a4 | 13057 | fi |
8175356b JH |
13058 | |
13059 | case "$ivdformat" in | |
13060 | '') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4 | |
13061 | exit 1 | |
13062 | ;; | |
13063 | esac | |
5ff3f7a4 | 13064 | |
a22e52b9 JH |
13065 | |
13066 | echo " " | |
13067 | $echo "Checking the format string to be used for gids..." >&4 | |
13068 | ||
13069 | case "$gidsign" in | |
13070 | -1) if $test X"$gidsize" = X"$ivsize"; then | |
13071 | gidformat="$ivdformat" | |
13072 | else | |
13073 | if $test X"$gidsize" = X"$longsize"; then | |
13074 | gidformat='"ld"' | |
13075 | else | |
13076 | if $test X"$gidsize" = X"$intsize"; then | |
13077 | gidformat='"d"' | |
13078 | else | |
13079 | if $test X"$gidsize" = X"$shortsize"; then | |
13080 | gidformat='"hd"' | |
13081 | fi | |
13082 | fi | |
13083 | fi | |
13084 | fi | |
13085 | ;; | |
13086 | *) if $test X"$gidsize" = X"$uvsize"; then | |
13087 | gidformat="$uvuformat" | |
13088 | else | |
13089 | if $test X"$gidsize" = X"$longsize"; then | |
13090 | gidformat='"lu"' | |
13091 | else | |
13092 | if $test X"$gidsize" = X"$intsize"; then | |
13093 | gidformat='"u"' | |
13094 | else | |
13095 | if $test X"$gidsize" = X"$shortsize"; then | |
13096 | gidformat='"hu"' | |
13097 | fi | |
13098 | fi | |
13099 | fi | |
13100 | fi | |
13101 | ;; | |
13102 | esac | |
13103 | ||
13104 | : see if getgroups exists | |
13105 | set getgroups d_getgrps | |
13106 | eval $inlibc | |
13107 | ||
13108 | : see if setgroups exists | |
13109 | set setgroups d_setgrps | |
13110 | eval $inlibc | |
13111 | ||
13112 | ||
13113 | : Find type of 2nd arg to 'getgroups()' and 'setgroups()' | |
13114 | echo " " | |
13115 | case "$d_getgrps$d_setgrps" in | |
13116 | *define*) | |
13117 | case "$groupstype" in | |
13118 | '') dflt="$gidtype" ;; | |
13119 | *) dflt="$groupstype" ;; | |
13120 | esac | |
13121 | $cat <<EOM | |
13122 | What type of pointer is the second argument to getgroups() and setgroups()? | |
13123 | Usually this is the same as group ids, $gidtype, but not always. | |
13124 | ||
13125 | EOM | |
13126 | rp='What type pointer is the second argument to getgroups() and setgroups()?' | |
13127 | . ./myread | |
13128 | groupstype="$ans" | |
13129 | ;; | |
13130 | *) groupstype="$gidtype";; | |
13131 | esac | |
13132 | ||
5ff3f7a4 | 13133 | echo " " |
dfe9444c | 13134 | echo "Checking if your $make program sets \$(MAKE)..." >&4 |
8ff267be | 13135 | case "$make_set_make" in |
13136 | '') | |
13137 | $sed 's/^X //' > testmake.mak << 'EOF' | |
13138 | Xall: | |
dfe9444c | 13139 | X @echo 'maketemp="$(MAKE)"' |
8ff267be | 13140 | EOF |
8ff267be | 13141 | case "`$make -f testmake.mak 2>/dev/null`" in |
dfe9444c | 13142 | *maketemp=*) make_set_make='#' ;; |
8ff267be | 13143 | *) make_set_make="MAKE=$make" ;; |
13144 | esac | |
dfe9444c AD |
13145 | $rm -f testmake.mak |
13146 | ;; | |
13147 | esac | |
13148 | case "$make_set_make" in | |
13149 | '#') echo "Yup, it does.";; | |
13150 | *) echo "Nope, it doesn't.";; | |
13151 | esac | |
13152 | ||
13153 | : see what type is used for mode_t | |
dc45a647 | 13154 | rp="What is the type used for file modes for system calls (e.g. fchmod())?" |
dfe9444c | 13155 | set mode_t modetype int stdio.h sys/types.h |
dc45a647 | 13156 | eval $typedef_ask |
dfe9444c | 13157 | |
dfe9444c AD |
13158 | : define a fucntion to check prototypes |
13159 | $cat > protochk <<EOSH | |
13160 | $startsh | |
13161 | cc="$cc" | |
13162 | optimize="$optimize" | |
13163 | ccflags="$ccflags" | |
13164 | prototype="$prototype" | |
13165 | define="$define" | |
13166 | rm=$rm | |
13167 | EOSH | |
13168 | ||
13169 | $cat >> protochk <<'EOSH' | |
13170 | ||
13171 | $rm -f try.c | |
13172 | foo="$1" | |
13173 | shift | |
13174 | while test $# -ge 2; do | |
13175 | case "$1" in | |
13176 | $define) echo "#include <$2>" >> try.c ;; | |
13177 | literal) echo "$2" >> try.c ;; | |
13178 | esac | |
13179 | shift 2 | |
13180 | done | |
13181 | test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c | |
13182 | cat >> try.c <<'EOCP' | |
13183 | #ifdef CAN_PROTOTYPE | |
13184 | #define _(args) args | |
13185 | #else | |
13186 | #define _(args) () | |
13187 | #endif | |
13188 | EOCP | |
13189 | echo "$foo" >> try.c | |
13190 | echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c | |
13191 | $cc $optimize $ccflags -c try.c > /dev/null 2>&1 | |
13192 | status=$? | |
13193 | $rm -f try.[co] | |
13194 | exit $status | |
13195 | EOSH | |
13196 | chmod +x protochk | |
13197 | $eunicefix protochk | |
13198 | ||
c890dc6c JH |
13199 | : see what type is used for size_t |
13200 | rp="What is the type used for the length parameter for string functions?" | |
13201 | set size_t sizetype 'unsigned int' stdio.h sys/types.h | |
13202 | eval $typedef_ask | |
13203 | ||
dfe9444c AD |
13204 | : check for type of arguments to gethostbyaddr. |
13205 | if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then | |
13206 | case "$d_gethbyaddr" in | |
13207 | $define) | |
13208 | $cat <<EOM | |
13209 | ||
13210 | Checking to see what type of arguments are accepted by gethostbyaddr(). | |
13211 | EOM | |
13212 | hdrs="$define sys/types.h | |
13213 | $d_socket sys/socket.h | |
13214 | $i_niin netinet/in.h | |
13215 | $i_netdb netdb.h | |
13216 | $i_unistd unistd.h" | |
13217 | : The first arg can 'char *' or 'void *' | |
13218 | : The second arg is some of integral type | |
13219 | for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do | |
13220 | for yyy in size_t long int; do | |
13221 | case "$netdb_host_type" in | |
13222 | '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);" | |
13223 | if ./protochk "$try" $hdrs; then | |
13224 | echo "Your system accepts $xxx for the first arg." | |
13225 | echo "...and $yyy for the second arg." | |
13226 | netdb_host_type="$xxx" | |
13227 | netdb_hlen_type="$yyy" | |
13228 | fi | |
13229 | ;; | |
13230 | esac | |
13231 | done | |
13232 | done | |
13233 | : In case none of those worked, prompt the user. | |
13234 | case "$netdb_host_type" in | |
13235 | '') rp='What is the type for the 1st argument to gethostbyaddr?' | |
13236 | dflt='char *' | |
13237 | . ./myread | |
13238 | netdb_host_type=$ans | |
13239 | rp='What is the type for the 2nd argument to gethostbyaddr?' | |
13240 | dflt="$sizetype" | |
13241 | . ./myread | |
13242 | netdb_hlen_type=$ans | |
13243 | ;; | |
13244 | esac | |
13245 | ;; | |
13246 | *) : no gethostbyaddr, so pick harmless defaults | |
13247 | netdb_host_type='char *' | |
13248 | netdb_hlen_type="$sizetype" | |
13249 | ;; | |
13250 | esac | |
13251 | # Remove the "const" if needed. -- but then we'll have a | |
13252 | # prototype clash! | |
13253 | # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'` | |
13254 | fi | |
13255 | ||
13256 | : check for type of argument to gethostbyname. | |
13257 | if test "X$netdb_name_type" = X ; then | |
13258 | case "$d_gethbyname" in | |
13259 | $define) | |
13260 | $cat <<EOM | |
13261 | ||
13262 | Checking to see what type of argument is accepted by gethostbyname(). | |
13263 | EOM | |
13264 | hdrs="$define sys/types.h | |
13265 | $d_socket sys/socket.h | |
13266 | $i_niin netinet/in.h | |
13267 | $i_netdb netdb.h | |
13268 | $i_unistd unistd.h" | |
13269 | for xxx in "const char *" "char *"; do | |
13270 | case "$netdb_name_type" in | |
13271 | '') try="extern struct hostent *gethostbyname($xxx);" | |
13272 | if ./protochk "$try" $hdrs; then | |
13273 | echo "Your system accepts $xxx." | |
13274 | netdb_name_type="$xxx" | |
13275 | fi | |
13276 | ;; | |
13277 | esac | |
13278 | done | |
13279 | : In case none of those worked, prompt the user. | |
13280 | case "$netdb_name_type" in | |
13281 | '') rp='What is the type for the 1st argument to gethostbyname?' | |
13282 | dflt='char *' | |
13283 | . ./myread | |
13284 | netdb_name_type=$ans | |
13285 | ;; | |
13286 | esac | |
13287 | ;; | |
13288 | *) : no gethostbyname, so pick harmless default | |
13289 | netdb_name_type='char *' | |
13290 | ;; | |
13291 | esac | |
13292 | fi | |
8ff267be | 13293 | |
dfe9444c AD |
13294 | : check for type of 1st argument to getnetbyaddr. |
13295 | if test "X$netdb_net_type" = X ; then | |
13296 | case "$d_getnbyaddr" in | |
13297 | $define) | |
13298 | $cat <<EOM | |
85e6fe83 | 13299 | |
dfe9444c AD |
13300 | Checking to see what type of 1st argument is accepted by getnetbyaddr(). |
13301 | EOM | |
13302 | hdrs="$define sys/types.h | |
13303 | $d_socket sys/socket.h | |
13304 | $i_niin netinet/in.h | |
13305 | $i_netdb netdb.h | |
13306 | $i_unistd unistd.h" | |
13307 | for xxx in in_addr_t "unsigned long" long "unsigned int" int; do | |
13308 | case "$netdb_net_type" in | |
13309 | '') try="extern struct netent *getnetbyaddr($xxx, int);" | |
13310 | if ./protochk "$try" $hdrs; then | |
13311 | echo "Your system accepts $xxx." | |
13312 | netdb_net_type="$xxx" | |
13313 | fi | |
13314 | ;; | |
13315 | esac | |
13316 | done | |
13317 | : In case none of those worked, prompt the user. | |
13318 | case "$netdb_net_type" in | |
13319 | '') rp='What is the type for the 1st argument to getnetbyaddr?' | |
13320 | dflt='long' | |
13321 | . ./myread | |
13322 | netdb_net_type=$ans | |
13323 | ;; | |
13324 | esac | |
13325 | ;; | |
13326 | *) : no getnetbyaddr, so pick harmless default | |
e5c9fcd0 | 13327 | netdb_net_type='long' |
dfe9444c AD |
13328 | ;; |
13329 | esac | |
13330 | fi | |
2c7991dc | 13331 | : locate the preferred pager for this system |
13332 | case "$pager" in | |
13333 | '') | |
13334 | dflt='' | |
13335 | case "$pg" in | |
13336 | /*) dflt=$pg;; | |
13337 | esac | |
13338 | case "$more" in | |
13339 | /*) dflt=$more;; | |
13340 | esac | |
13341 | case "$less" in | |
13342 | /*) dflt=$less;; | |
13343 | esac | |
13344 | case "$dflt" in | |
13345 | '') dflt=/usr/ucb/more;; | |
13346 | esac | |
13347 | ;; | |
13348 | *) dflt="$pager";; | |
13349 | esac | |
13350 | echo " " | |
13351 | fn=f/ | |
13352 | rp='What pager is used on your system?' | |
13353 | . ./getfile | |
13354 | pager="$ans" | |
13355 | ||
dfe9444c | 13356 | : see what type pids are declared as in the kernel |
dc45a647 | 13357 | rp="What is the type of process ids on this system?" |
dfe9444c | 13358 | set pid_t pidtype int stdio.h sys/types.h |
dc45a647 | 13359 | eval $typedef_ask |
2304df62 | 13360 | |
fe749a9f JH |
13361 | : Find earliest binary compatible site_perl subdirectory perl can use. |
13362 | case "$bincompat5005" in | |
13363 | "$define") xs_apiversion='5.005' ;; | |
13364 | *) xs_apiversion=$version ;; # The current site_perl version. | |
13365 | esac | |
13366 | : Find earliest pure perl site_perl subdirectory perl can use. | |
13367 | : The versioned directories started at 5.005. | |
13368 | pm_apiversion='5.005' | |
13369 | ||
693762b4 AD |
13370 | : check for length of pointer |
13371 | echo " " | |
13372 | case "$ptrsize" in | |
13373 | '') | |
49c10eea | 13374 | echo "Checking to see how big your pointers are..." >&4 |
693762b4 AD |
13375 | if test "$voidflags" -gt 7; then |
13376 | echo '#define VOID_PTR char *' > try.c | |
13377 | else | |
13378 | echo '#define VOID_PTR void *' > try.c | |
13379 | fi | |
13380 | $cat >>try.c <<'EOCP' | |
13381 | #include <stdio.h> | |
d674cd6d | 13382 | int main() |
693762b4 | 13383 | { |
213c275f | 13384 | printf("%d\n", (int)sizeof(VOID_PTR)); |
14e4fe40 | 13385 | exit(0); |
693762b4 AD |
13386 | } |
13387 | EOCP | |
13388 | set try | |
dc45a647 | 13389 | if eval $compile_ok; then |
693762b4 | 13390 | ptrsize=`./try` |
49c10eea | 13391 | echo "Your pointers are $ptrsize bytes long." |
693762b4 AD |
13392 | else |
13393 | dflt='4' | |
13394 | echo "(I can't seem to compile the test program. Guessing...)" >&4 | |
13395 | rp="What is the size of a pointer (in bytes)?" | |
13396 | . ./myread | |
13397 | ptrsize="$ans" | |
13398 | fi | |
13399 | ;; | |
13400 | esac | |
13401 | $rm -f try.c try | |
13402 | ||
a0d0e21e LW |
13403 | : see if ar generates random libraries by itself |
13404 | echo " " | |
13405 | echo "Checking how to generate random libraries on your machine..." >&4 | |
13406 | echo 'int bar1() { return bar2(); }' > bar1.c | |
13407 | echo 'int bar2() { return 2; }' > bar2.c | |
13408 | $cat > foo.c <<'EOP' | |
d674cd6d | 13409 | int main() { printf("%d\n", bar1()); exit(0); } |
a0d0e21e LW |
13410 | EOP |
13411 | $cc $ccflags -c bar1.c >/dev/null 2>&1 | |
13412 | $cc $ccflags -c bar2.c >/dev/null 2>&1 | |
13413 | $cc $ccflags -c foo.c >/dev/null 2>&1 | |
dfe9444c AD |
13414 | $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1 |
13415 | if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 && | |
a0d0e21e | 13416 | ./foobar >/dev/null 2>&1; then |
4e2a5f63 | 13417 | echo "$ar appears to generate random libraries itself." |
a0d0e21e LW |
13418 | orderlib=false |
13419 | ranlib=":" | |
dfe9444c AD |
13420 | elif $ar ts bar$_a >/dev/null 2>&1 && |
13421 | $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 && | |
a0d0e21e | 13422 | ./foobar >/dev/null 2>&1; then |
4e2a5f63 | 13423 | echo "a table of contents needs to be added with '$ar ts'." |
a0d0e21e | 13424 | orderlib=false |
dfe9444c | 13425 | ranlib="$ar ts" |
a0d0e21e | 13426 | else |
ecfc5424 AD |
13427 | case "$ranlib" in |
13428 | :) ranlib='';; | |
13429 | '') | |
13430 | ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin` | |
13431 | $test -f $ranlib || ranlib='' | |
13432 | ;; | |
13433 | esac | |
a0d0e21e | 13434 | if $test -n "$ranlib"; then |
ecfc5424 | 13435 | echo "your system has '$ranlib'; we'll use that." |
a0d0e21e LW |
13436 | orderlib=false |
13437 | else | |
13438 | echo "your system doesn't seem to support random libraries" | |
13439 | echo "so we'll use lorder and tsort to order the libraries." | |
13440 | orderlib=true | |
13441 | ranlib=":" | |
13442 | fi | |
13443 | fi | |
13444 | $rm -f foo* bar* | |
13445 | ||
dfe9444c AD |
13446 | : check for type of arguments to select. |
13447 | case "$selecttype" in | |
13448 | '') case "$d_select" in | |
13449 | $define) | |
cce08f5b | 13450 | echo " " |
dfe9444c AD |
13451 | $cat <<EOM |
13452 | Checking to see what type of arguments are accepted by select(). | |
13453 | EOM | |
13454 | hdrs="$define sys/types.h | |
13455 | $i_systime sys/time.h | |
13456 | $i_sysselct sys/select.h | |
13457 | $d_socket sys/socket.h" | |
13458 | : The first arg can be int, unsigned, or size_t | |
13459 | : The last arg may or may not be 'const' | |
13460 | val='' | |
7f3d1cf1 BH |
13461 | : void pointer has been seen but using that |
13462 | : breaks the selectminbits test | |
13463 | for xxx in 'fd_set *' 'int *'; do | |
1cfa4ec7 | 13464 | for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do |
dfe9444c AD |
13465 | for tmo in 'struct timeval *' 'const struct timeval *'; do |
13466 | case "$val" in | |
13467 | '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));" | |
13468 | if ./protochk "$try" $hdrs; then | |
13469 | echo "Your system accepts $xxx." | |
13470 | val="$xxx" | |
13471 | fi | |
13472 | ;; | |
13473 | esac | |
13474 | done | |
13475 | done | |
13476 | done | |
13477 | case "$val" in | |
13478 | '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?' | |
13479 | case "$d_fd_set" in | |
13480 | $define) dflt="fd_set *" ;; | |
13481 | *) dflt="int *" ;; | |
13482 | esac | |
13483 | . ./myread | |
13484 | val=$ans | |
13485 | ;; | |
a0d0e21e | 13486 | esac |
dfe9444c | 13487 | selecttype="$val" |
a0d0e21e | 13488 | ;; |
dfe9444c AD |
13489 | *) : no select, so pick a harmless default |
13490 | selecttype='int *' | |
a0d0e21e LW |
13491 | ;; |
13492 | esac | |
a0d0e21e LW |
13493 | ;; |
13494 | esac | |
2304df62 | 13495 | |
5ff3f7a4 GS |
13496 | : check for the select 'width' |
13497 | case "$selectminbits" in | |
13498 | '') case "$d_select" in | |
13499 | $define) | |
13500 | $cat <<EOM | |
13501 | ||
85ab1d1d | 13502 | Checking to see on how many bits at a time your select() operates... |
5ff3f7a4 GS |
13503 | EOM |
13504 | $cat >try.c <<EOCP | |
13505 | #include <sys/types.h> | |
13506 | #$i_time I_TIME | |
13507 | #$i_systime I_SYS_TIME | |
13508 | #$i_systimek I_SYS_TIME_KERNEL | |
13509 | #ifdef I_TIME | |
13510 | # include <time.h> | |
13511 | #endif | |
13512 | #ifdef I_SYS_TIME | |
13513 | # ifdef I_SYS_TIME_KERNEL | |
13514 | # define KERNEL | |
13515 | # endif | |
13516 | # include <sys/time.h> | |
13517 | # ifdef I_SYS_TIME_KERNEL | |
13518 | # undef KERNEL | |
13519 | # endif | |
13520 | #endif | |
13521 | #$i_sysselct I_SYS_SELECT | |
13522 | #ifdef I_SYS_SELECT | |
13523 | #include <sys/select.h> | |
13524 | #endif | |
bd628c73 AD |
13525 | #$d_socket HAS_SOCKET |
13526 | #ifdef HAS_SOCKET | |
13527 | # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
13528 | #endif | |
5ff3f7a4 | 13529 | #include <stdio.h> |
fb164848 JH |
13530 | $selecttype b; |
13531 | #define S sizeof(*(b)) | |
5ff3f7a4 GS |
13532 | #define MINBITS 64 |
13533 | #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8) | |
13534 | #define NBITS (NBYTES * 8) | |
13535 | int main() { | |
13536 | char s[NBYTES]; | |
5ff3f7a4 GS |
13537 | struct timeval t; |
13538 | int i; | |
13539 | FILE* fp; | |
13540 | int fd; | |
13541 | ||
13542 | fclose(stdin); | |
13543 | fp = fopen("try.c", "r"); | |
13544 | if (fp == 0) | |
13545 | exit(1); | |
13546 | fd = fileno(fp); | |
13547 | if (fd < 0) | |
13548 | exit(2); | |
13549 | b = ($selecttype)s; | |
13550 | for (i = 0; i < NBITS; i++) | |
13551 | FD_SET(i, b); | |
13552 | t.tv_sec = 0; | |
13553 | t.tv_usec = 0; | |
13554 | select(fd + 1, b, 0, 0, &t); | |
13555 | for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--); | |
13556 | printf("%d\n", i + 1); | |
13557 | return 0; | |
13558 | } | |
13559 | EOCP | |
13560 | set try | |
13561 | if eval $compile_ok; then | |
13562 | selectminbits=`./try` | |
85ab1d1d | 13563 | case "$selectminbits" in |
fb164848 JH |
13564 | '') cat >&4 <<EOM |
13565 | Cannot figure out on how many bits at a time your select() operates. | |
13566 | I'll play safe and guess it is 32 bits. | |
13567 | EOM | |
13568 | selectminbits=32 | |
13569 | bits="32 bits" | |
13570 | ;; | |
85ab1d1d JH |
13571 | 1) bits="1 bit" ;; |
13572 | *) bits="$selectminbits bits" ;; | |
13573 | esac | |
13574 | echo "Your select() operates on $bits at a time." >&4 | |
5ff3f7a4 GS |
13575 | else |
13576 | rp='What is the minimum number of bits your select() operates on?' | |
13577 | case "$byteorder" in | |
13578 | 1234|12345678) dflt=32 ;; | |
13579 | *) dflt=1 ;; | |
13580 | esac | |
13581 | . ./myread | |
13582 | val=$ans | |
13583 | selectminbits="$val" | |
13584 | fi | |
13585 | $rm -f try.* try | |
13586 | ;; | |
13587 | *) : no select, so pick a harmless default | |
13588 | selectminbits='32' | |
13589 | ;; | |
13590 | esac | |
13591 | ;; | |
13592 | esac | |
13593 | ||
8e07c86e AD |
13594 | : Trace out the files included by signal.h, then look for SIGxxx names. |
13595 | : Remove SIGARRAYSIZE used by HPUX. | |
af4c28eb CS |
13596 | : Remove SIGSTKSIZE used by Linux. |
13597 | : Remove SIGSTKSZ used by Posix. | |
4633a7c4 | 13598 | : Remove SIGTYP void lines used by OS2. |
6764938d | 13599 | : Some cpps, like os390, dont give the file name anywhere |
53d4e464 | 13600 | if [ "X$fieldn" = X ]; then |
6764938d GS |
13601 | : Just make some guesses. We check them later. |
13602 | xxx='/usr/include/signal.h /usr/include/sys/signal.h' | |
53d4e464 | 13603 | else |
6764938d | 13604 | xxx=`echo '#include <signal.h>' | |
8e07c86e AD |
13605 | $cppstdin $cppminus $cppflags 2>/dev/null | |
13606 | $grep '^[ ]*#.*include' | | |
13607 | $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq` | |
53d4e464 | 13608 | fi |
8e07c86e AD |
13609 | : Check this list of files to be sure we have parsed the cpp output ok. |
13610 | : This will also avoid potentially non-existent files, such | |
13611 | : as ../foo/bar.h | |
13612 | xxxfiles='' | |
13613 | for xx in $xxx /dev/null ; do | |
13614 | $test -f "$xx" && xxxfiles="$xxxfiles $xx" | |
13615 | done | |
13616 | : If we have found no files, at least try signal.h | |
13617 | case "$xxxfiles" in | |
13618 | '') xxxfiles=`./findhdr signal.h` ;; | |
13619 | esac | |
13620 | xxx=`awk ' | |
af4c28eb | 13621 | $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ { |
8e07c86e AD |
13622 | print substr($2, 4, 20) |
13623 | } | |
4633a7c4 | 13624 | $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { |
8e07c86e AD |
13625 | print substr($3, 4, 20) |
13626 | }' $xxxfiles` | |
13627 | : Append some common names just in case the awk scan failed. | |
6764938d GS |
13628 | xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE" |
13629 | xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE" | |
13630 | xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP" | |
13631 | xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2" | |
13632 | xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ" | |
13633 | ||
8e07c86e | 13634 | : generate a few handy files for later |
dc45a647 | 13635 | $cat > signal.c <<'EOCP' |
4633a7c4 LW |
13636 | #include <sys/types.h> |
13637 | #include <signal.h> | |
dc45a647 | 13638 | #include <stdio.h> |
4633a7c4 | 13639 | int main() { |
760ac839 LW |
13640 | |
13641 | /* Strange style to avoid deeply-nested #if/#else/#endif */ | |
13642 | #ifndef NSIG | |
13643 | # ifdef _NSIG | |
13644 | # define NSIG (_NSIG) | |
13645 | # endif | |
13646 | #endif | |
13647 | ||
13648 | #ifndef NSIG | |
13649 | # ifdef SIGMAX | |
13650 | # define NSIG (SIGMAX+1) | |
13651 | # endif | |
13652 | #endif | |
13653 | ||
13654 | #ifndef NSIG | |
13655 | # ifdef SIG_MAX | |
13656 | # define NSIG (SIG_MAX+1) | |
13657 | # endif | |
13658 | #endif | |
13659 | ||
13660 | #ifndef NSIG | |
13661 | # ifdef MAXSIG | |
13662 | # define NSIG (MAXSIG+1) | |
13663 | # endif | |
4633a7c4 | 13664 | #endif |
760ac839 LW |
13665 | |
13666 | #ifndef NSIG | |
13667 | # ifdef MAX_SIG | |
13668 | # define NSIG (MAX_SIG+1) | |
13669 | # endif | |
13670 | #endif | |
13671 | ||
13672 | #ifndef NSIG | |
13673 | # ifdef SIGARRAYSIZE | |
13674 | # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ | |
13675 | # endif | |
13676 | #endif | |
13677 | ||
13678 | #ifndef NSIG | |
13679 | # ifdef _sys_nsig | |
13680 | # define NSIG (_sys_nsig) /* Solaris 2.5 */ | |
13681 | # endif | |
13682 | #endif | |
13683 | ||
13684 | /* Default to some arbitrary number that's big enough to get most | |
13685 | of the common signals. | |
13686 | */ | |
13687 | #ifndef NSIG | |
13688 | # define NSIG 50 | |
4633a7c4 | 13689 | #endif |
760ac839 LW |
13690 | |
13691 | printf("NSIG %d\n", NSIG); | |
13692 | ||
dc45a647 MB |
13693 | #ifndef JUST_NSIG |
13694 | ||
13695 | EOCP | |
13696 | ||
28e8609d | 13697 | echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk ' |
8e07c86e AD |
13698 | { |
13699 | printf "#ifdef SIG"; printf $1; printf "\n" | |
13700 | printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; | |
13701 | printf $1; printf ");\n" | |
13702 | printf "#endif\n" | |
2304df62 | 13703 | } |
2304df62 | 13704 | END { |
dc45a647 | 13705 | printf "#endif /* JUST_NSIG */\n"; |
14e4fe40 | 13706 | printf "exit(0);\n}\n"; |
2304df62 | 13707 | } |
4633a7c4 LW |
13708 | ' >>signal.c |
13709 | $cat >signal.awk <<'EOP' | |
13710 | BEGIN { ndups = 0 } | |
13711 | $1 ~ /^NSIG$/ { nsig = $2 } | |
13712 | ($1 !~ /^NSIG$/) && (NF == 2) { | |
13713 | if ($2 > maxsig) { maxsig = $2 } | |
13714 | if (sig_name[$2]) { | |
13715 | dup_name[ndups] = $1 | |
13716 | dup_num[ndups] = $2 | |
13717 | ndups++ | |
13718 | } | |
13719 | else { | |
13720 | sig_name[$2] = $1 | |
13721 | sig_num[$2] = $2 | |
13722 | } | |
4633a7c4 LW |
13723 | } |
13724 | END { | |
af4c28eb CS |
13725 | if (nsig == 0) { |
13726 | nsig = maxsig + 1 | |
13727 | } | |
13728 | printf("NSIG %d\n", nsig); | |
13729 | for (n = 1; n < nsig; n++) { | |
13730 | if (sig_name[n]) { | |
13731 | printf("%s %d\n", sig_name[n], sig_num[n]) | |
4633a7c4 | 13732 | } |
af4c28eb CS |
13733 | else { |
13734 | printf("NUM%d %d\n", n, n) | |
13735 | } | |
13736 | } | |
4633a7c4 | 13737 | for (n = 0; n < ndups; n++) { |
af4c28eb | 13738 | printf("%s %d\n", dup_name[n], dup_num[n]) |
4633a7c4 LW |
13739 | } |
13740 | } | |
13741 | EOP | |
13742 | $cat >signal_cmd <<EOS | |
8e07c86e | 13743 | $startsh |
dc45a647 MB |
13744 | if $test -s signal.lst; then |
13745 | echo "Using your existing signal.lst file" | |
13746 | exit 0 | |
13747 | fi | |
13748 | xxx="$xxx" | |
13749 | EOS | |
13750 | $cat >>signal_cmd <<'EOS' | |
13751 | ||
13752 | set signal | |
13753 | if eval $compile_ok; then | |
dfe9444c | 13754 | ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst |
8e07c86e | 13755 | else |
dc45a647 MB |
13756 | echo "(I can't seem be able to compile the whole test program)" >&4 |
13757 | echo "(I'll try it in little pieces.)" >&4 | |
13758 | set signal -DJUST_NSIG | |
13759 | if eval $compile_ok; then | |
13760 | ./signal$_exe > signal.nsg | |
13761 | $cat signal.nsg | |
13762 | else | |
13763 | echo "I can't seem to figure out how many signals you have." >&4 | |
13764 | echo "Guessing 50." >&4 | |
13765 | echo 'NSIG 50' > signal.nsg | |
13766 | fi | |
13767 | : Now look at all the signal names, one at a time. | |
28e8609d | 13768 | for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do |
dc45a647 MB |
13769 | $cat > signal.c <<EOCP |
13770 | #include <sys/types.h> | |
13771 | #include <signal.h> | |
13772 | #include <stdio.h> | |
13773 | int main() { | |
13774 | printf("$xx %d\n", SIG${xx}); | |
13775 | return 0; | |
13776 | } | |
13777 | EOCP | |
13778 | set signal | |
13779 | if eval $compile; then | |
13780 | echo "SIG${xx} found." | |
13781 | ./signal$_exe >> signal.ls1 | |
13782 | else | |
13783 | echo "SIG${xx} NOT found." | |
13784 | fi | |
13785 | done | |
13786 | if $test -s signal.ls1; then | |
13787 | $cat signal.nsg signal.ls1 | | |
13788 | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst | |
13789 | fi | |
13790 | ||
13791 | fi | |
13792 | if $test -s signal.lst; then | |
13793 | : | |
13794 | else | |
13795 | echo "(AAK! I can't compile the test programs -- Guessing)" >&4 | |
8e07c86e | 13796 | echo 'kill -l' >signal |
dc45a647 | 13797 | set X `csh -f <signal` |
8e07c86e | 13798 | $rm -f signal |
2304df62 | 13799 | shift |
dc45a647 | 13800 | case $# in |
8e07c86e | 13801 | 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; |
2304df62 | 13802 | esac |
28e8609d | 13803 | echo $@ | $tr ' ' $trnl | \ |
af4c28eb CS |
13804 | $awk '{ printf "%s %d\n", $1, ++s; } |
13805 | END { printf "NSIG %d\n", ++s }' >signal.lst | |
8e07c86e | 13806 | fi |
dc45a647 | 13807 | $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1 |
8e07c86e | 13808 | EOS |
4633a7c4 LW |
13809 | chmod a+x signal_cmd |
13810 | $eunicefix signal_cmd | |
8e07c86e AD |
13811 | |
13812 | : generate list of signal names | |
13813 | echo " " | |
dfe9444c | 13814 | case "$sig_name_init" in |
6626bf4c JH |
13815 | '') doinit=yes ;; |
13816 | *) case "$sig_num_init" in | |
13817 | ''|*,*) doinit=yes ;; | |
13818 | esac ;; | |
13819 | esac | |
13820 | case "$doinit" in | |
13821 | yes) | |
4633a7c4 | 13822 | echo "Generating a list of signal names and numbers..." >&4 |
dc45a647 | 13823 | . ./signal_cmd |
af4c28eb CS |
13824 | sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst` |
13825 | sig_name=`$awk 'BEGIN { printf "ZERO " } | |
13826 | !/^NSIG/ { printf "%s ", $1 }' signal.lst` | |
13827 | sig_num=`$awk 'BEGIN { printf "0 " } | |
13828 | !/^NSIG/ { printf "%d ", $2 }' signal.lst` | |
13829 | sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " } | |
13830 | !/^NSIG/ { printf "\"%s\", ", $1 } | |
13831 | END { printf "0\n" }' signal.lst` | |
13832 | sig_num_init=`$awk 'BEGIN { printf "0, " } | |
13833 | !/^NSIG/ { printf "%d, ", $2} | |
13834 | END { printf "0\n"}' signal.lst` | |
13835 | ;; | |
13836 | esac | |
13837 | echo "The following $sig_count signals are available:" | |
a0d0e21e LW |
13838 | echo " " |
13839 | echo $sig_name | $awk \ | |
13840 | 'BEGIN { linelen = 0 } | |
13841 | { | |
8e07c86e | 13842 | for (i = 1; i <= NF; i++) { |
a0d0e21e LW |
13843 | name = "SIG" $i " " |
13844 | linelen = linelen + length(name) | |
13845 | if (linelen > 70) { | |
13846 | printf "\n" | |
13847 | linelen = length(name) | |
13848 | } | |
13849 | printf "%s", name | |
13850 | } | |
8e07c86e | 13851 | printf "\n" |
a0d0e21e | 13852 | }' |
4633a7c4 | 13853 | $rm -f signal signal.c signal.awk signal.lst signal_cmd |
a0d0e21e | 13854 | |
8c99d73e GS |
13855 | echo " " |
13856 | case "$sizetype" in | |
13857 | *_t) zzz="$sizetype" ;; | |
13858 | *) zzz="filesize" ;; | |
13859 | esac | |
13860 | echo "Checking the size of $zzz..." >&4 | |
13861 | cat > try.c <<EOCP | |
13862 | #include <sys/types.h> | |
13863 | #include <stdio.h> | |
13864 | int main() { | |
13865 | printf("%d\n", (int)sizeof($sizetype)); | |
13866 | exit(0); | |
13867 | } | |
13868 | EOCP | |
13869 | set try | |
13870 | if eval $compile_ok; then | |
13871 | yyy=`./try` | |
13872 | case "$yyy" in | |
13873 | '') sizesize=4 | |
13874 | echo "(I can't execute the test program--guessing $sizesize.)" >&4 | |
13875 | ;; | |
13876 | *) sizesize=$yyy | |
13877 | echo "Your $zzz size is $sizesize bytes." | |
13878 | ;; | |
13879 | esac | |
13880 | else | |
13881 | sizesize=4 | |
13882 | echo "(I can't compile the test program--guessing $sizesize.)" >&4 | |
13883 | fi | |
13884 | ||
13885 | ||
c890dc6c JH |
13886 | : check for socklen_t |
13887 | echo " " | |
13888 | echo "Checking to see if you have socklen_t..." >&4 | |
13889 | $cat >try.c <<EOCP | |
13890 | #include <sys/types.h> | |
13891 | #$d_socket HAS_SOCKET | |
13892 | #ifdef HAS_SOCKET | |
13893 | #include <sys/socket.h> | |
13894 | #endif | |
13895 | int main() { socklen_t x = 16; } | |
13896 | EOCP | |
13897 | set try | |
13898 | if eval $compile; then | |
13899 | val="$define" | |
13900 | echo "You have socklen_t." | |
13901 | else | |
13902 | val="$undef" | |
13903 | echo "You do not have socklen_t." | |
13904 | case "$sizetype" in | |
8c99d73e | 13905 | size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;; |
c890dc6c JH |
13906 | esac |
13907 | fi | |
13908 | $rm -f try try.* | |
13909 | set d_socklen_t | |
13910 | eval $setvar | |
13911 | ||
13912 | : check for type of the size argument to socket calls | |
13913 | case "$d_socket" in | |
13914 | "$define") | |
13915 | $cat <<EOM | |
13916 | ||
13917 | Checking to see what type is the last argument of accept(). | |
13918 | EOM | |
13919 | hdrs="$define sys/types.h $d_socket sys/socket.h" | |
13920 | yyy='' | |
13921 | case "$d_socklen_t" in | |
13922 | "$define") yyy="$yyy socklen_t" | |
13923 | esac | |
6c85e8b0 | 13924 | yyy="$yyy $sizetype int long unsigned" |
c890dc6c JH |
13925 | for xxx in $yyy; do |
13926 | case "$socksizetype" in | |
13927 | '') try="extern int accept(int, struct sockaddr *, $xxx *);" | |
13928 | if ./protochk "$try" $hdrs; then | |
13929 | echo "Your system accepts '$xxx *' for the last argument of accept()." | |
10cc9d2a | 13930 | socksizetype="$xxx" |
c890dc6c JH |
13931 | fi |
13932 | ;; | |
13933 | esac | |
13934 | done | |
13935 | : In case none of those worked, prompt the user. | |
13936 | case "$socksizetype" in | |
4f309e22 | 13937 | '') rp='What is the type for socket address structure sizes?' |
10cc9d2a | 13938 | dflt='int' |
c890dc6c JH |
13939 | . ./myread |
13940 | socksizetype=$ans | |
13941 | ;; | |
13942 | esac | |
13943 | ;; | |
6c85e8b0 JH |
13944 | *) : no sockets, so pick relatively harmless default |
13945 | socksizetype='int' | |
c890dc6c JH |
13946 | ;; |
13947 | esac | |
13948 | ||
a0d0e21e LW |
13949 | : see what type is used for signed size_t |
13950 | set ssize_t ssizetype int stdio.h sys/types.h | |
13951 | eval $typedef | |
13952 | dflt="$ssizetype" | |
13953 | $cat > ssize.c <<EOM | |
13954 | #include <stdio.h> | |
13955 | #include <sys/types.h> | |
13956 | #define Size_t $sizetype | |
13957 | #define SSize_t $dflt | |
d674cd6d | 13958 | int main() |
a0d0e21e LW |
13959 | { |
13960 | if (sizeof(Size_t) == sizeof(SSize_t)) | |
13961 | printf("$dflt\n"); | |
13962 | else if (sizeof(Size_t) == sizeof(int)) | |
13963 | printf("int\n"); | |
13964 | else | |
13965 | printf("long\n"); | |
760ac839 | 13966 | exit(0); |
a0d0e21e LW |
13967 | } |
13968 | EOM | |
13969 | echo " " | |
dfe9444c | 13970 | set ssize |
dc45a647 | 13971 | if eval $compile_ok && ./ssize > /dev/null; then |
dfe9444c | 13972 | ssizetype=`./ssize` |
a0d0e21e LW |
13973 | echo "I'll be using $ssizetype for functions returning a byte count." >&4 |
13974 | else | |
24fef2a7 | 13975 | $cat >&4 <<EOM |
24fef2a7 AD |
13976 | Help! I can't compile and run the ssize_t test program: please enlighten me! |
13977 | (This is probably a misconfiguration in your system or libraries, and | |
13978 | you really ought to fix it. Still, I'll try anyway.) | |
a0d0e21e LW |
13979 | |
13980 | I need a type that is the same size as $sizetype, but is guaranteed to | |
24fef2a7 | 13981 | be signed. Common values are ssize_t, int and long. |
a0d0e21e LW |
13982 | |
13983 | EOM | |
13984 | rp="What signed type is the same size as $sizetype?" | |
13985 | . ./myread | |
13986 | ssizetype="$ans" | |
13987 | fi | |
dfe9444c | 13988 | $rm -f ssize ssize.* |
3fd537d4 | 13989 | |
a0d0e21e LW |
13990 | : see what type of char stdio uses. |
13991 | echo " " | |
13992 | if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then | |
13993 | echo "Your stdio uses unsigned chars." >&4 | |
13994 | stdchar="unsigned char" | |
13995 | else | |
13996 | echo "Your stdio uses signed chars." >&4 | |
13997 | stdchar="char" | |
13998 | fi | |
13999 | ||
14000 | : see if time exists | |
14001 | echo " " | |
28e8609d JH |
14002 | if test "X$d_time" = X -o X"$timetype" = X; then |
14003 | if set time val -f d_time; eval $csym; $val; then | |
5ff3f7a4 GS |
14004 | echo 'time() found.' >&4 |
14005 | val="$define" | |
14006 | rp="What is the type returned by time() on this system?" | |
14007 | set time_t timetype long stdio.h sys/types.h | |
14008 | eval $typedef_ask | |
28e8609d | 14009 | else |
5ff3f7a4 GS |
14010 | echo 'time() not found, hope that will do.' >&4 |
14011 | val="$undef" | |
14012 | timetype='int'; | |
28e8609d JH |
14013 | fi |
14014 | set d_time | |
14015 | eval $setvar | |
a0d0e21e | 14016 | fi |
a0d0e21e LW |
14017 | |
14018 | : see what type uids are declared as in the kernel | |
dc45a647 MB |
14019 | echo " " |
14020 | echo "Looking for the type for user ids returned by getuid()." | |
a0d0e21e LW |
14021 | set uid_t uidtype xxx stdio.h sys/types.h |
14022 | eval $typedef | |
14023 | case "$uidtype" in | |
14024 | xxx) | |
14025 | xxx=`./findhdr sys/user.h` | |
14026 | set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short | |
14027 | case $1 in | |
14028 | unsigned) dflt="$1 $2" ;; | |
14029 | *) dflt="$1" ;; | |
14030 | esac | |
14031 | ;; | |
4633a7c4 LW |
14032 | *) dflt="$uidtype";; |
14033 | esac | |
dc45a647 MB |
14034 | case "$uidtype" in |
14035 | uid_t) echo "uid_t found." ;; | |
14036 | *) rp="What is the type for user ids returned by getuid()?" | |
14037 | . ./myread | |
14038 | uidtype="$ans" | |
14039 | ;; | |
14040 | esac | |
4633a7c4 | 14041 | |
57def98f JH |
14042 | echo " " |
14043 | case "$uidtype" in | |
14044 | *_t) zzz="$uidtype" ;; | |
14045 | *) zzz="uid" ;; | |
14046 | esac | |
a22e52b9 | 14047 | echo "Checking the size of $zzz..." >&4 |
57def98f JH |
14048 | cat > try.c <<EOCP |
14049 | #include <sys/types.h> | |
14050 | #include <stdio.h> | |
14051 | int main() { | |
213c275f | 14052 | printf("%d\n", (int)sizeof($uidtype)); |
14e4fe40 | 14053 | exit(0); |
57def98f JH |
14054 | } |
14055 | EOCP | |
d4265146 | 14056 | set try |
a22e52b9 | 14057 | if eval $compile_ok; then |
57def98f JH |
14058 | yyy=`./try` |
14059 | case "$yyy" in | |
a22e52b9 JH |
14060 | '') uidsize=4 |
14061 | echo "(I can't execute the test program--guessing $uidsize.)" >&4 | |
57def98f | 14062 | ;; |
a22e52b9 | 14063 | *) uidsize=$yyy |
49c10eea | 14064 | echo "Your $zzz is $uidsize bytes long." |
57def98f JH |
14065 | ;; |
14066 | esac | |
14067 | else | |
a22e52b9 JH |
14068 | uidsize=4 |
14069 | echo "(I can't compile the test program--guessing $uidsize.)" >&4 | |
57def98f JH |
14070 | fi |
14071 | ||
785fb66b JH |
14072 | echo " " |
14073 | case "$uidtype" in | |
14074 | *_t) zzz="$uidtype" ;; | |
14075 | *) zzz="uid" ;; | |
14076 | esac | |
a22e52b9 | 14077 | echo "Checking the sign of $zzz..." >&4 |
785fb66b JH |
14078 | cat > try.c <<EOCP |
14079 | #include <sys/types.h> | |
14080 | #include <stdio.h> | |
14081 | int main() { | |
a22e52b9 JH |
14082 | $uidtype foo = -1; |
14083 | if (foo < 0) | |
14084 | printf("-1\n"); | |
14085 | else | |
14086 | printf("1\n"); | |
785fb66b JH |
14087 | } |
14088 | EOCP | |
14089 | set try | |
a22e52b9 | 14090 | if eval $compile; then |
785fb66b JH |
14091 | yyy=`./try` |
14092 | case "$yyy" in | |
a22e52b9 JH |
14093 | '') uidsign=1 |
14094 | echo "(I can't execute the test program--guessing unsigned.)" >&4 | |
785fb66b | 14095 | ;; |
a22e52b9 JH |
14096 | *) uidsign=$yyy |
14097 | case "$uidsign" in | |
14098 | 1) echo "Your $zzz is unsigned." ;; | |
14099 | -1) echo "Your $zzz is signed." ;; | |
14100 | esac | |
785fb66b JH |
14101 | ;; |
14102 | esac | |
14103 | else | |
a22e52b9 JH |
14104 | uidsign=1 |
14105 | echo "(I can't compile the test program--guessing unsigned.)" >&4 | |
785fb66b JH |
14106 | fi |
14107 | ||
a22e52b9 JH |
14108 | |
14109 | ||
14110 | echo " " | |
14111 | $echo "Checking the format string to be used for uids..." >&4 | |
14112 | ||
14113 | case "$uidsign" in | |
14114 | -1) if $test X"$uidsize" = X"$ivsize"; then | |
14115 | uidformat="$ivdformat" | |
14116 | else | |
14117 | if $test X"$uidsize" = X"$longsize"; then | |
14118 | uidformat='"ld"' | |
14119 | else | |
14120 | if $test X"$uidsize" = X"$intsize"; then | |
14121 | uidformat='"d"' | |
14122 | else | |
14123 | if $test X"$uidsize" = X"$shortsize"; then | |
14124 | uidformat='"hd"' | |
14125 | fi | |
14126 | fi | |
14127 | fi | |
14128 | fi | |
14129 | ;; | |
14130 | *) if $test X"$uidsize" = X"$uvsize"; then | |
14131 | uidformat="$uvuformat" | |
14132 | else | |
14133 | if $test X"$uidsize" = X"$longsize"; then | |
14134 | uidformat='"lu"' | |
14135 | else | |
14136 | if $test X"$uidsize" = X"$intsize"; then | |
14137 | uidformat='"u"' | |
14138 | else | |
14139 | if $test X"$uidsize" = X"$shortsize"; then | |
14140 | uidformat='"hu"' | |
14141 | fi | |
14142 | fi | |
14143 | fi | |
14144 | fi | |
14145 | ;; | |
14146 | esac | |
14147 | ||
4633a7c4 LW |
14148 | : see if dbm.h is available |
14149 | : see if dbmclose exists | |
14150 | set dbmclose d_dbmclose | |
14151 | eval $inlibc | |
14152 | ||
14153 | case "$d_dbmclose" in | |
14154 | $define) | |
14155 | set dbm.h i_dbm | |
14156 | eval $inhdr | |
5f80c64f JH |
14157 | case "$i_dbm" in |
14158 | $define) | |
14159 | val="$undef" | |
14160 | set i_rpcsvcdbm | |
14161 | eval $setvar | |
14162 | ;; | |
14163 | *) set rpcsvc/dbm.h i_rpcsvcdbm | |
14164 | eval $inhdr | |
14165 | ;; | |
14166 | esac | |
14167 | ;; | |
14168 | *) echo "We won't be including <dbm.h>" | |
14169 | val="$undef" | |
14170 | set i_dbm | |
14171 | eval $setvar | |
14172 | val="$undef" | |
14173 | set i_rpcsvcdbm | |
14174 | eval $setvar | |
14175 | ;; | |
14176 | esac | |
14177 | ||
14178 | : see if this is a sys/file.h system | |
14179 | val='' | |
14180 | set sys/file.h val | |
14181 | eval $inhdr | |
14182 | ||
14183 | : do we need to include sys/file.h ? | |
14184 | case "$val" in | |
14185 | "$define") | |
14186 | echo " " | |
14187 | if $h_sysfile; then | |
14188 | val="$define" | |
14189 | echo "We'll be including <sys/file.h>." >&4 | |
14190 | else | |
14191 | val="$undef" | |
14192 | echo "We won't be including <sys/file.h>." >&4 | |
14193 | fi | |
14194 | ;; | |
14195 | *) | |
14196 | h_sysfile=false | |
14197 | ;; | |
14198 | esac | |
14199 | set i_sysfile | |
14200 | eval $setvar | |
14201 | ||
14202 | : see if fcntl.h is there | |
14203 | val='' | |
14204 | set fcntl.h val | |
14205 | eval $inhdr | |
14206 | ||
14207 | : see if we can include fcntl.h | |
14208 | case "$val" in | |
14209 | "$define") | |
14210 | echo " " | |
14211 | if $h_fcntl; then | |
14212 | val="$define" | |
14213 | echo "We'll be including <fcntl.h>." >&4 | |
14214 | else | |
14215 | val="$undef" | |
14216 | if $h_sysfile; then | |
14217 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 | |
14218 | else | |
14219 | echo "We won't be including <fcntl.h>." >&4 | |
14220 | fi | |
14221 | fi | |
14222 | ;; | |
14223 | *) | |
14224 | h_fcntl=false | |
14225 | val="$undef" | |
14226 | ;; | |
14227 | esac | |
14228 | set i_fcntl | |
14229 | eval $setvar | |
14230 | ||
43999f95 JH |
14231 | : see if this is a iconv.h system |
14232 | set iconv.h i_iconv | |
14233 | eval $inhdr | |
14234 | ||
792d8dab JH |
14235 | : see if this is a ieeefp.h system |
14236 | set ieeefp.h i_ieeefp | |
14237 | eval $inhdr | |
14238 | ||
5f80c64f JH |
14239 | : see if locale.h is available |
14240 | set locale.h i_locale | |
14241 | eval $inhdr | |
14242 | ||
7f3d1cf1 | 14243 | : see if mach cthreads are available |
13666627 JH |
14244 | if test "X$usethreads" = "X$define"; then |
14245 | set mach/cthreads.h i_machcthr | |
14246 | eval $inhdr | |
14247 | else | |
14248 | i_machcthr="$undef" | |
14249 | fi | |
14250 | ||
14251 | ||
7f3d1cf1 | 14252 | |
5f80c64f JH |
14253 | : see if this is a math.h system |
14254 | set math.h i_math | |
14255 | eval $inhdr | |
14256 | ||
e7fb4fcc JH |
14257 | : see if this is a mntent.h system |
14258 | set mntent.h i_mntent | |
14259 | eval $inhdr | |
14260 | ||
5f80c64f JH |
14261 | : see if ndbm.h is available |
14262 | set ndbm.h t_ndbm | |
14263 | eval $inhdr | |
14264 | case "$t_ndbm" in | |
14265 | $define) | |
14266 | : see if dbm_open exists | |
14267 | set dbm_open d_dbm_open | |
14268 | eval $inlibc | |
14269 | case "$d_dbm_open" in | |
14270 | $undef) | |
14271 | t_ndbm="$undef" | |
14272 | echo "We won't be including <ndbm.h>" | |
14273 | ;; | |
14274 | esac | |
14275 | ;; | |
14276 | esac | |
14277 | val="$t_ndbm" | |
14278 | set i_ndbm | |
14279 | eval $setvar | |
14280 | ||
14281 | : see if net/errno.h is available | |
14282 | val='' | |
14283 | set net/errno.h val | |
14284 | eval $inhdr | |
14285 | ||
14286 | : Unfortunately, it causes problems on some systems. Arrgh. | |
14287 | case "$val" in | |
14288 | $define) | |
14289 | cat > try.c <<'EOM' | |
14290 | #include <stdio.h> | |
14291 | #include <errno.h> | |
14292 | #include <net/errno.h> | |
14293 | int func() | |
14294 | { | |
14295 | return ENOTSOCK; | |
14296 | } | |
14297 | EOM | |
14298 | if $cc $ccflags -c try.c >/dev/null 2>&1; then | |
14299 | echo "We'll be including <net/errno.h>." >&4 | |
14300 | else | |
14301 | echo "We won't be including <net/errno.h>." >&4 | |
14302 | val="$undef" | |
14303 | fi | |
14304 | $rm -f try.* try | |
14305 | ;; | |
14306 | esac | |
14307 | set i_neterrno | |
14308 | eval $setvar | |
14309 | ||
9cc6feab JH |
14310 | : see if netinet/tcp.h is available |
14311 | set netinet/tcp.h i_netinettcp | |
14312 | eval $inhdr | |
14313 | ||
5b34fd99 JH |
14314 | : see if this is a poll.h system |
14315 | set poll.h i_poll | |
14316 | eval $inhdr | |
14317 | ||
5f80c64f | 14318 | echo " " |
78691af5 | 14319 | $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 |
43999f95 JH |
14320 | $cat <<'EOSH' > Cppsym.know |
14321 | a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370 | |
14322 | AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE | |
14323 | alliant alpha am29000 AM29000 amiga AMIGAOS AMIX | |
14324 | ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS | |
14325 | BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4 | |
14326 | BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi | |
14327 | bull c cadmus clipper CMU COFF COMPILER_VERSION | |
14328 | concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX | |
14329 | CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO | |
14330 | Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS | |
14331 | FreeBSD GCC_NEW_VARARGS gcos gcx gimpel | |
14332 | GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN | |
14333 | H3050R H3050RX hbullx20 hcx host_mips | |
14334 | hp200 hp300 hp700 HP700 hp800 hp9000 | |
14335 | hp9000s200 hp9000s300 hp9000s400 hp9000s500 | |
14336 | hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE | |
14337 | i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 | |
14338 | iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64 | |
14339 | INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1 | |
14340 | LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE | |
14341 | LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE | |
14342 | Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG | |
14343 | LONGDOUBLE LONGLONG LP64 luna luna88k Lynx | |
14344 | M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF | |
14345 | M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3 | |
14346 | M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen | |
14347 | MATH_HAS_NO_SIDE_EFFECTS | |
14348 | mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040 | |
14349 | mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin | |
14350 | mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT | |
14351 | MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola | |
14352 | mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr | |
14353 | NetBSD news1500 news1700 news1800 news1900 news3700 | |
14354 | news700 news800 news900 NeXT NLS ns16000 ns32000 | |
14355 | ns32016 ns32332 ns32k nsc32000 | |
14356 | OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE | |
14357 | pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc | |
14358 | pc532 pdp11 PGC PIC plexus PORTAR posix | |
14359 | POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE | |
14360 | POSIX_C_SOURCE POSIX_SOURCE POWER | |
14361 | PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000 | |
14362 | riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix | |
14363 | SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE | |
14364 | sony sony_news sonyrisc sparc sparclite spectrum | |
14365 | stardent stdc STDC_EXT stratos sun sun3 sun386 | |
14366 | Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5 | |
14367 | SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44 | |
14368 | SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5 | |
14369 | sysV68 sysV88 Tek4132 Tek4300 titan | |
14370 | tower tower32 tower32_200 tower32_600 tower32_700 | |
14371 | tower32_800 tower32_850 tss | |
14372 | u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 | |
14373 | ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK | |
14374 | unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2 | |
14375 | Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286 | |
14376 | XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED | |
14377 | XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED | |
14378 | z8000 | |
14379 | EOSH | |
14380 | # Maybe put other stuff here too. | |
14381 | cat <<EOSH >>Cppsym.know | |
14382 | $osname | |
14383 | EOSH | |
9b97abf7 JH |
14384 | ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a |
14385 | ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b | |
43999f95 JH |
14386 | $cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know |
14387 | $rm -f Cppsym.a Cppsym.b | |
14388 | cat <<EOSH > Cppsym | |
5f80c64f | 14389 | $startsh |
43999f95 JH |
14390 | if $test \$# -gt 0; then |
14391 | echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got | |
14392 | if $test -s Cppsym.got; then | |
14393 | $rm -f Cppsym.got | |
14394 | exit 0 | |
14395 | fi | |
14396 | $rm -f Cppsym.got | |
14397 | exit 1 | |
14398 | else | |
14399 | $tr " " "$trnl" | ./Cppsym.try | |
14400 | exit 0 | |
14401 | fi | |
14402 | EOSH | |
5f80c64f JH |
14403 | chmod +x Cppsym |
14404 | $eunicefix Cppsym | |
43999f95 JH |
14405 | cat <<EOSH > Cppsym.try |
14406 | $startsh | |
14407 | cat <<'EOCP' > try.c | |
14408 | #include <stdio.h> | |
14409 | int main() { | |
14410 | EOCP | |
14411 | $awk \\ | |
14412 | EOSH | |
14413 | cat <<'EOSH' >> Cppsym.try | |
14414 | 'length($1) > 0 { | |
14415 | printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
14416 | printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
14417 | printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
14418 | printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1 | |
14419 | }' >> try.c | |
14420 | echo '}' >> try.c | |
14421 | EOSH | |
14422 | cat <<EOSH >> Cppsym.try | |
43999f95 | 14423 | ccflags="$ccflags" |
a3489f11 JH |
14424 | case "$osname-$gccversion" in |
14425 | irix-) ccflags="\$ccflags -woff 1178" ;; | |
14426 | esac | |
14427 | $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext | |
43999f95 JH |
14428 | EOSH |
14429 | chmod +x Cppsym.try | |
14430 | $eunicefix Cppsym.try | |
14431 | ./Cppsym < Cppsym.know > Cppsym.true | |
5f80c64f | 14432 | : now check the C compiler for additional symbols |
c4747d3e JH |
14433 | postprocess_cc_v='' |
14434 | case "$osname" in | |
14435 | aix) postprocess_cc_v="|$tr , ' '" ;; | |
14436 | esac | |
5f80c64f JH |
14437 | $cat >ccsym <<EOS |
14438 | $startsh | |
14439 | $cat >tmp.c <<EOF | |
14440 | extern int foo; | |
14441 | EOF | |
c4747d3e | 14442 | for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\` |
5f80c64f JH |
14443 | do |
14444 | case "\$i" in | |
14445 | -D*) echo "\$i" | $sed 's/^-D//';; | |
14446 | -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';; | |
14447 | esac | |
14448 | done | |
14449 | $rm -f try.c | |
14450 | EOS | |
2000072c | 14451 | postprocess_cc_v='' |
5f80c64f JH |
14452 | chmod +x ccsym |
14453 | $eunicefix ccsym | |
14454 | ./ccsym > ccsym1.raw | |
14455 | if $test -s ccsym1.raw; then | |
14456 | $sort ccsym1.raw | $uniq >ccsym.raw | |
14457 | else | |
14458 | mv ccsym1.raw ccsym.raw | |
14459 | fi | |
14460 | ||
14461 | $awk '/\=/ { print $0; next } | |
14462 | { print $0"=1" }' ccsym.raw >ccsym.list | |
43999f95 JH |
14463 | $awk '/\=/ { print $0; next } |
14464 | { print $0"=1" }' Cppsym.true >ccsym.true | |
5f80c64f JH |
14465 | $comm -13 ccsym.true ccsym.list >ccsym.own |
14466 | $comm -12 ccsym.true ccsym.list >ccsym.com | |
14467 | $comm -23 ccsym.true ccsym.list >ccsym.cpp | |
14468 | also='' | |
5f80c64f | 14469 | if $test -z ccsym.raw; then |
ff49bff8 | 14470 | echo "Your C compiler doesn't seem to define any symbols!" >&4 |
5f80c64f | 14471 | echo " " |
ff49bff8 | 14472 | echo "However, your C preprocessor defines the following symbols:" |
5f80c64f | 14473 | $cat Cppsym.true |
ff49bff8 JH |
14474 | ccsymbols='' |
14475 | cppsymbols=`$cat Cppsym.true` | |
918c3d21 | 14476 | cppsymbols=`echo $cppsymbols` |
ff49bff8 | 14477 | cppccsymbols="$cppsymbols" |
5f80c64f JH |
14478 | else |
14479 | if $test -s ccsym.com; then | |
14480 | echo "Your C compiler and pre-processor define these symbols:" | |
14481 | $sed -e 's/\(.*\)=.*/\1/' ccsym.com | |
14482 | also='also ' | |
14483 | symbols='ones' | |
ff49bff8 | 14484 | cppccsymbols=`$cat ccsym.com` |
918c3d21 | 14485 | cppccsymbols=`echo $cppccsymbols` |
5f80c64f JH |
14486 | $test "$silent" || sleep 1 |
14487 | fi | |
14488 | if $test -s ccsym.cpp; then | |
14489 | $test "$also" && echo " " | |
ff49bff8 | 14490 | echo "Your C pre-processor ${also}defines the following symbols:" |
5f80c64f JH |
14491 | $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp |
14492 | also='further ' | |
ff49bff8 | 14493 | cppsymbols=`$cat ccsym.cpp` |
918c3d21 | 14494 | cppsymbols=`echo $cppsymbols` |
5f80c64f JH |
14495 | $test "$silent" || sleep 1 |
14496 | fi | |
14497 | if $test -s ccsym.own; then | |
14498 | $test "$also" && echo " " | |
ff49bff8 | 14499 | echo "Your C compiler ${also}defines the following cpp symbols:" |
5f80c64f JH |
14500 | $sed -e 's/\(.*\)=1/\1/' ccsym.own |
14501 | $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true | |
ff49bff8 | 14502 | ccsymbols=`$cat ccsym.own` |
918c3d21 | 14503 | ccsymbols=`echo $ccsymbols` |
5f80c64f JH |
14504 | $test "$silent" || sleep 1 |
14505 | fi | |
14506 | fi | |
14507 | $rm -f ccsym* | |
14508 | ||
14509 | : see if this is a termio system | |
14510 | val="$undef" | |
14511 | val2="$undef" | |
14512 | val3="$undef" | |
14513 | if $test `./findhdr termios.h`; then | |
14514 | set tcsetattr i_termios | |
14515 | eval $inlibc | |
14516 | val3="$i_termios" | |
14517 | fi | |
14518 | echo " " | |
14519 | case "$val3" in | |
14520 | "$define") echo "You have POSIX termios.h... good!" >&4;; | |
14521 | *) if ./Cppsym pyr; then | |
14522 | case "`/bin/universe`" in | |
14523 | ucb) if $test `./findhdr sgtty.h`; then | |
14524 | val2="$define" | |
14525 | echo "<sgtty.h> found." >&4 | |
14526 | else | |
14527 | echo "System is pyramid with BSD universe." | |
14528 | echo "<sgtty.h> not found--you could have problems." >&4 | |
14529 | fi;; | |
14530 | *) if $test `./findhdr termio.h`; then | |
14531 | val="$define" | |
14532 | echo "<termio.h> found." >&4 | |
14533 | else | |
14534 | echo "System is pyramid with USG universe." | |
14535 | echo "<termio.h> not found--you could have problems." >&4 | |
14536 | fi;; | |
14537 | esac | |
14538 | elif ./usg; then | |
14539 | if $test `./findhdr termio.h`; then | |
14540 | echo "<termio.h> found." >&4 | |
14541 | val="$define" | |
14542 | elif $test `./findhdr sgtty.h`; then | |
14543 | echo "<sgtty.h> found." >&4 | |
14544 | val2="$define" | |
14545 | else | |
14546 | echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4 | |
14547 | fi | |
14548 | else | |
14549 | if $test `./findhdr sgtty.h`; then | |
14550 | echo "<sgtty.h> found." >&4 | |
14551 | val2="$define" | |
14552 | elif $test `./findhdr termio.h`; then | |
14553 | echo "<termio.h> found." >&4 | |
14554 | val="$define" | |
14555 | else | |
14556 | echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4 | |
14557 | fi | |
14558 | fi;; | |
14559 | esac | |
14560 | set i_termio; eval $setvar | |
14561 | val=$val2; set i_sgtty; eval $setvar | |
14562 | val=$val3; set i_termios; eval $setvar | |
14563 | ||
f1066039 JH |
14564 | : see if this is a shadow.h system |
14565 | set shadow.h i_shadow | |
14566 | eval $inhdr | |
14567 | ||
86959918 JH |
14568 | : see if this is a socks.h system |
14569 | set socks.h i_socks | |
14570 | eval $inhdr | |
14571 | ||
5f80c64f JH |
14572 | : see if stdarg is available |
14573 | echo " " | |
14574 | if $test `./findhdr stdarg.h`; then | |
14575 | echo "<stdarg.h> found." >&4 | |
14576 | valstd="$define" | |
14577 | else | |
14578 | echo "<stdarg.h> NOT found." >&4 | |
14579 | valstd="$undef" | |
14580 | fi | |
14581 | ||
14582 | : see if varags is available | |
14583 | echo " " | |
14584 | if $test `./findhdr varargs.h`; then | |
14585 | echo "<varargs.h> found." >&4 | |
14586 | else | |
14587 | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 | |
14588 | fi | |
14589 | ||
14590 | : set up the varargs testing programs | |
14591 | $cat > varargs.c <<EOP | |
14592 | #ifdef I_STDARG | |
14593 | #include <stdarg.h> | |
14594 | #endif | |
14595 | #ifdef I_VARARGS | |
14596 | #include <varargs.h> | |
14597 | #endif | |
14598 | ||
14599 | #ifdef I_STDARG | |
14600 | int f(char *p, ...) | |
14601 | #else | |
14602 | int f(va_alist) | |
14603 | va_dcl | |
14604 | #endif | |
14605 | { | |
14606 | va_list ap; | |
14607 | #ifndef I_STDARG | |
14608 | char *p; | |
14609 | #endif | |
14610 | #ifdef I_STDARG | |
14611 | va_start(ap,p); | |
14612 | #else | |
14613 | va_start(ap); | |
14614 | p = va_arg(ap, char *); | |
14615 | #endif | |
14616 | va_end(ap); | |
14617 | } | |
14618 | EOP | |
14619 | $cat > varargs <<EOP | |
14620 | $startsh | |
14621 | if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then | |
14622 | echo "true" | |
14623 | else | |
14624 | echo "false" | |
14625 | fi | |
14626 | $rm -f varargs$_o | |
14627 | EOP | |
14628 | chmod +x varargs | |
14629 | ||
14630 | : now check which varargs header should be included | |
14631 | echo " " | |
14632 | i_varhdr='' | |
14633 | case "$valstd" in | |
14634 | "$define") | |
14635 | if `./varargs I_STDARG`; then | |
14636 | val='stdarg.h' | |
14637 | elif `./varargs I_VARARGS`; then | |
14638 | val='varargs.h' | |
14639 | fi | |
14640 | ;; | |
14641 | *) | |
14642 | if `./varargs I_VARARGS`; then | |
14643 | val='varargs.h' | |
14644 | fi | |
14645 | ;; | |
14646 | esac | |
14647 | case "$val" in | |
14648 | '') | |
14649 | echo "I could not find the definition for va_dcl... You have problems..." >&4 | |
14650 | val="$undef"; set i_stdarg; eval $setvar | |
14651 | val="$undef"; set i_varargs; eval $setvar | |
14652 | ;; | |
14653 | *) | |
14654 | set i_varhdr | |
14655 | eval $setvar | |
14656 | case "$i_varhdr" in | |
14657 | stdarg.h) | |
14658 | val="$define"; set i_stdarg; eval $setvar | |
14659 | val="$undef"; set i_varargs; eval $setvar | |
14660 | ;; | |
14661 | varargs.h) | |
14662 | val="$undef"; set i_stdarg; eval $setvar | |
14663 | val="$define"; set i_varargs; eval $setvar | |
14664 | ;; | |
14665 | esac | |
14666 | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; | |
14667 | esac | |
14668 | $rm -f varargs* | |
14669 | ||
14670 | : see if stddef is available | |
14671 | set stddef.h i_stddef | |
14672 | eval $inhdr | |
14673 | ||
923fc586 JH |
14674 | : see if this is a sunmath.h system |
14675 | set sunmath.h i_sunmath | |
14676 | eval $inhdr | |
14677 | ||
5f80c64f JH |
14678 | : see if sys/access.h is available |
14679 | set sys/access.h i_sysaccess | |
14680 | eval $inhdr | |
14681 | ||
14682 | : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl | |
14683 | set sys/filio.h i_sysfilio | |
14684 | eval $inhdr | |
14685 | echo " " | |
14686 | if $test `./findhdr sys/ioctl.h`; then | |
14687 | val="$define" | |
14688 | echo '<sys/ioctl.h> found.' >&4 | |
14689 | else | |
14690 | val="$undef" | |
14691 | if $test $i_sysfilio = "$define"; then | |
14692 | echo '<sys/ioctl.h> NOT found.' >&4 | |
14693 | else | |
14694 | $test $i_sgtty = "$define" && xxx="sgtty.h" | |
14695 | $test $i_termio = "$define" && xxx="termio.h" | |
14696 | $test $i_termios = "$define" && xxx="termios.h" | |
14697 | echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4 | |
14698 | fi | |
14699 | fi | |
14700 | set i_sysioctl | |
14701 | eval $setvar | |
14702 | ||
ca52efda JH |
14703 | |
14704 | : see if this is a syslog.h system | |
14705 | set syslog.h i_syslog | |
14706 | eval $inhdr | |
14707 | ||
bf0c440f JH |
14708 | |
14709 | : see if this is a sys/mode.h system | |
14710 | set sys/mode.h i_sysmode | |
14711 | eval $inhdr | |
14712 | ||
5f80c64f JH |
14713 | : see if sys/resource.h has to be included |
14714 | set sys/resource.h i_sysresrc | |
14715 | eval $inhdr | |
14716 | ||
14717 | : see if sys/security.h is available | |
14718 | set sys/security.h i_syssecrt | |
14719 | eval $inhdr | |
14720 | ||
104d25b7 JH |
14721 | : see if this is a sys/statvfs.h system |
14722 | set sys/statvfs.h i_sysstatvfs | |
14723 | eval $inhdr | |
14724 | ||
b7b35fc2 JH |
14725 | : see if this is a sys/uio.h system |
14726 | set sys/uio.h i_sysuio | |
14727 | eval $inhdr | |
14728 | ||
5f80c64f JH |
14729 | : see if this is a sys/un.h system |
14730 | set sys/un.h i_sysun | |
14731 | eval $inhdr | |
14732 | ||
d4935d7f JH |
14733 | |
14734 | : see if this is a sys/utsname.h system | |
14735 | set sys/utsname.h i_sysutsname | |
14736 | eval $inhdr | |
14737 | ||
5f80c64f JH |
14738 | : see if this is a syswait system |
14739 | set sys/wait.h i_syswait | |
14740 | eval $inhdr | |
14741 | ||
0545a864 JH |
14742 | : see if this is a ustat.h system |
14743 | set ustat.h i_ustat | |
14744 | eval $inhdr | |
14745 | ||
5f80c64f JH |
14746 | : see if this is an utime system |
14747 | set utime.h i_utime | |
14748 | eval $inhdr | |
14749 | ||
14750 | : see if this is a values.h system | |
14751 | set values.h i_values | |
14752 | eval $inhdr | |
14753 | ||
14754 | : see if this is a vfork system | |
14755 | case "$d_vfork" in | |
14756 | "$define") | |
14757 | set vfork.h i_vfork | |
14758 | eval $inhdr | |
14759 | ;; | |
14760 | *) | |
14761 | i_vfork="$undef" | |
14762 | ;; | |
14763 | esac | |
14764 | ||
14765 | : see if gdbm.h is available | |
14766 | set gdbm.h t_gdbm | |
14767 | eval $inhdr | |
14768 | case "$t_gdbm" in | |
14769 | $define) | |
14770 | : see if gdbm_open exists | |
14771 | set gdbm_open d_gdbm_open | |
14772 | eval $inlibc | |
14773 | case "$d_gdbm_open" in | |
14774 | $undef) | |
14775 | t_gdbm="$undef" | |
14776 | echo "We won't be including <gdbm.h>" | |
14777 | ;; | |
14778 | esac | |
14779 | ;; | |
14780 | esac | |
14781 | val="$t_gdbm" | |
14782 | set i_gdbm | |
14783 | eval $setvar | |
14784 | ||
14785 | echo " " | |
14786 | echo "Looking for extensions..." >&4 | |
5f80c64f JH |
14787 | : If we are using the old config.sh, known_extensions may contain |
14788 | : old or inaccurate or duplicate values. | |
14789 | known_extensions='' | |
14790 | nonxs_extensions='' | |
14791 | : We do not use find because it might not be available. | |
14792 | : We do not just use MANIFEST because the user may have dropped | |
14793 | : some additional extensions into the source tree and expect them | |
14794 | : to be built. | |
7e791ca9 NK |
14795 | |
14796 | : Function to recursively find available extensions, ignoring DynaLoader | |
14797 | : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness | |
14798 | find_extensions=' | |
14799 | for xxx in *; do | |
14800 | case "$xxx" in | |
14801 | DynaLoader|dynaload) ;; | |
14802 | *) | |
14803 | if $test -f $xxx/$xxx.xs; then | |
14804 | known_extensions="$known_extensions $1$xxx"; | |
14805 | elif $test -f $xxx/Makefile.PL; then | |
14806 | nonxs_extensions="$nonxs_extensions $1$xxx"; | |
14807 | else | |
14808 | if $test -d $xxx -a $# -lt 10; then | |
14809 | set $1$xxx/ $*; | |
14810 | cd $xxx; | |
14811 | eval $find_extensions; | |
14812 | cd ..; | |
14813 | shift; | |
9f50e519 | 14814 | fi; |
7e791ca9 NK |
14815 | fi |
14816 | ;; | |
9f50e519 | 14817 | esac; |
7e791ca9 NK |
14818 | done' |
14819 | tdir=`pwd` | |
14820 | cd $rsrc/ext | |
a3635516 | 14821 | set X |
efdb23e1 | 14822 | shift |
7e791ca9 | 14823 | eval $find_extensions |
5f80c64f JH |
14824 | set X $nonxs_extensions |
14825 | shift | |
14826 | nonxs_extensions="$*" | |
14827 | set X $known_extensions | |
14828 | shift | |
14829 | known_extensions="$*" | |
14830 | cd $tdir | |
14831 | ||
14832 | : Now see which are supported on this system. | |
14833 | avail_ext='' | |
14834 | for xxx in $known_extensions ; do | |
14835 | case "$xxx" in | |
14836 | DB_File|db_file) | |
14837 | case "$i_db" in | |
14838 | $define) avail_ext="$avail_ext $xxx" ;; | |
14839 | esac | |
14840 | ;; | |
14841 | GDBM_File|gdbm_fil) | |
14842 | case "$i_gdbm" in | |
14843 | $define) avail_ext="$avail_ext $xxx" ;; | |
14844 | esac | |
14845 | ;; | |
14846 | NDBM_File|ndbm_fil) | |
14847 | case "$i_ndbm" in | |
f7dd4e7f | 14848 | $define) |
10cc9d2a | 14849 | case "$osname-$use64bitint" in |
f7dd4e7f JH |
14850 | hpux-define) |
14851 | case "$libs" in | |
14852 | *-lndbm*) avail_ext="$avail_ext $xxx" ;; | |
14853 | esac | |
14854 | ;; | |
14855 | *) avail_ext="$avail_ext $xxx" ;; | |
14856 | esac | |
14857 | ;; | |
5f80c64f JH |
14858 | esac |
14859 | ;; | |
14860 | ODBM_File|odbm_fil) | |
14861 | case "${i_dbm}${i_rpcsvcdbm}" in | |
f7dd4e7f | 14862 | *"${define}"*) |
10cc9d2a | 14863 | case "$osname-$use64bitint" in |
f7dd4e7f JH |
14864 | hpux-define) |
14865 | case "$libs" in | |
14866 | *-ldbm*) avail_ext="$avail_ext $xxx" ;; | |
14867 | esac | |
14868 | ;; | |
14869 | *) avail_ext="$avail_ext $xxx" ;; | |
14870 | esac | |
14871 | ;; | |
5f80c64f JH |
14872 | esac |
14873 | ;; | |
14874 | POSIX|posix) | |
14875 | case "$useposix" in | |
14876 | true|define|y) avail_ext="$avail_ext $xxx" ;; | |
14877 | esac | |
14878 | ;; | |
14879 | Opcode|opcode) | |
14880 | case "$useopcode" in | |
14881 | true|define|y) avail_ext="$avail_ext $xxx" ;; | |
14882 | esac | |
14883 | ;; | |
14884 | Socket|socket) | |
14885 | case "$d_socket" in | |
14886 | true|$define|y) avail_ext="$avail_ext $xxx" ;; | |
14887 | esac | |
14888 | ;; | |
14889 | Thread|thread) | |
14890 | case "$usethreads" in | |
14891 | true|$define|y) avail_ext="$avail_ext $xxx" ;; | |
14892 | esac | |
14893 | ;; | |
14894 | IPC/SysV|ipc/sysv) | |
14895 | : XXX Do we need a useipcsysv variable here | |
14896 | case "${d_msg}${d_sem}${d_shm}" in | |
14897 | *"${define}"*) avail_ext="$avail_ext $xxx" ;; | |
14898 | esac | |
14899 | ;; | |
14900 | *) avail_ext="$avail_ext $xxx" | |
14901 | ;; | |
14902 | esac | |
14903 | done | |
14904 | ||
14905 | set X $avail_ext | |
14906 | shift | |
14907 | avail_ext="$*" | |
14908 | ||
14909 | : Now see which nonxs extensions are supported on this system. | |
14910 | : For now assume all are. | |
14911 | nonxs_ext='' | |
14912 | for xxx in $nonxs_extensions ; do | |
14913 | case "$xxx" in | |
14914 | *) nonxs_ext="$nonxs_ext $xxx" | |
14915 | ;; | |
14916 | esac | |
14917 | done | |
14918 | ||
14919 | set X $nonxs_ext | |
14920 | shift | |
14921 | nonxs_ext="$*" | |
14922 | ||
14923 | case $usedl in | |
14924 | $define) | |
14925 | $cat <<EOM | |
14926 | A number of extensions are supplied with $package. You may choose to | |
14927 | compile these extensions for dynamic loading (the default), compile | |
14928 | them into the $package executable (static loading), or not include | |
14929 | them at all. Answer "none" to include no extensions. | |
14930 | Note that DynaLoader is always built and need not be mentioned here. | |
14931 | ||
14932 | EOM | |
14933 | case "$dynamic_ext" in | |
14934 | '') dflt="$avail_ext" ;; | |
14935 | *) dflt="$dynamic_ext" | |
14936 | # Perhaps we are reusing an old out-of-date config.sh. | |
14937 | case "$hint" in | |
14938 | previous) | |
14939 | if test X"$dynamic_ext" != X"$avail_ext"; then | |
14940 | $cat <<EOM | |
14941 | NOTICE: Your previous config.sh list may be incorrect. | |
14942 | The extensions now available to you are | |
14943 | ${avail_ext} | |
14944 | but the default list from your previous config.sh is | |
14945 | ${dynamic_ext} | |
14946 | ||
14947 | EOM | |
14948 | fi | |
14949 | ;; | |
14950 | esac | |
14951 | ;; | |
14952 | esac | |
14953 | case "$dflt" in | |
14954 | '') dflt=none;; | |
14955 | esac | |
14956 | rp="What extensions do you wish to load dynamically?" | |
14957 | . ./myread | |
14958 | case "$ans" in | |
14959 | none) dynamic_ext=' ' ;; | |
14960 | *) dynamic_ext="$ans" ;; | |
14961 | esac | |
14962 | ||
14963 | case "$static_ext" in | |
14964 | '') | |
14965 | : Exclude those already listed in dynamic linking | |
14966 | dflt='' | |
14967 | for xxx in $avail_ext; do | |
14968 | case " $dynamic_ext " in | |
14969 | *" $xxx "*) ;; | |
14970 | *) dflt="$dflt $xxx" ;; | |
14971 | esac | |
14972 | done | |
14973 | set X $dflt | |
14974 | shift | |
14975 | dflt="$*" | |
14976 | ;; | |
14977 | *) dflt="$static_ext" | |
14978 | ;; | |
14979 | esac | |
14980 | ||
14981 | case "$dflt" in | |
14982 | '') dflt=none;; | |
14983 | esac | |
14984 | rp="What extensions do you wish to load statically?" | |
14985 | . ./myread | |
14986 | case "$ans" in | |
14987 | none) static_ext=' ' ;; | |
14988 | *) static_ext="$ans" ;; | |
14989 | esac | |
14990 | ;; | |
14991 | *) | |
14992 | $cat <<EOM | |
14993 | A number of extensions are supplied with $package. Answer "none" | |
14994 | to include no extensions. | |
14995 | Note that DynaLoader is always built and need not be mentioned here. | |
14996 | ||
14997 | EOM | |
14998 | case "$static_ext" in | |
14999 | '') dflt="$avail_ext" ;; | |
15000 | *) dflt="$static_ext" | |
15001 | # Perhaps we are reusing an old out-of-date config.sh. | |
15002 | case "$hint" in | |
15003 | previous) | |
15004 | if test X"$static_ext" != X"$avail_ext"; then | |
15005 | $cat <<EOM | |
15006 | NOTICE: Your previous config.sh list may be incorrect. | |
15007 | The extensions now available to you are | |
15008 | ${avail_ext} | |
15009 | but the default list from your previous config.sh is | |
15010 | ${static_ext} | |
15011 | ||
15012 | EOM | |
15013 | fi | |
15014 | ;; | |
15015 | esac | |
15016 | ;; | |
15017 | esac | |
15018 | : Exclude those that are not xs extensions | |
15019 | case "$dflt" in | |
15020 | '') dflt=none;; | |
15021 | esac | |
15022 | rp="What extensions do you wish to include?" | |
15023 | . ./myread | |
15024 | case "$ans" in | |
15025 | none) static_ext=' ' ;; | |
15026 | *) static_ext="$ans" ;; | |
15027 | esac | |
15028 | ;; | |
15029 | esac | |
15030 | ||
15031 | set X $dynamic_ext $static_ext $nonxs_ext | |
15032 | shift | |
15033 | extensions="$*" | |
15034 | ||
15035 | : Remove build directory name from cppstdin so it can be used from | |
15036 | : either the present location or the final installed location. | |
15037 | echo " " | |
15038 | : Get out of the UU directory to get correct path name. | |
15039 | cd .. | |
15040 | case "$cppstdin" in | |
15041 | `pwd`/cppstdin) | |
15042 | echo "Stripping down cppstdin path name" | |
15043 | cppstdin=cppstdin | |
15044 | ;; | |
15045 | esac | |
15046 | cd UU | |
15047 | ||
15048 | : end of configuration questions | |
15049 | echo " " | |
15050 | echo "End of configuration questions." | |
15051 | echo " " | |
15052 | ||
15053 | : back to where it started | |
15054 | if test -d ../UU; then | |
15055 | cd .. | |
15056 | fi | |
15057 | ||
15058 | : configuration may be patched via a 'config.over' file | |
15059 | if $test -f config.over; then | |
15060 | echo " " | |
15061 | dflt=y | |
15062 | rp='I see a config.over file. Do you wish to load it?' | |
15063 | . UU/myread | |
15064 | case "$ans" in | |
15065 | n*) echo "OK, I'll ignore it.";; | |
15066 | *) . ./config.over | |
15067 | echo "Configuration override changes have been loaded." | |
15068 | ;; | |
15069 | esac | |
15070 | fi | |
15071 | ||
15072 | : in case they want portability, strip down executable paths | |
15073 | case "$d_portable" in | |
15074 | "$define") | |
15075 | echo " " | |
15076 | echo "Stripping down executable paths..." >&4 | |
15077 | for file in $loclist $trylist; do | |
534ac15a JH |
15078 | eval temp=\$$file |
15079 | eval $file=`basename $temp` | |
5f80c64f JH |
15080 | done |
15081 | ;; | |
15082 | esac | |
15083 | ||
15084 | : create config.sh file | |
15085 | echo " " | |
15086 | echo "Creating config.sh..." >&4 | |
15087 | $spitshell <<EOT >config.sh | |
15088 | $startsh | |
15089 | # | |
15090 | # This file was produced by running the Configure script. It holds all the | |
15091 | # definitions figured out by Configure. Should you modify one of these values, | |
15092 | # do not forget to propagate your changes by running "Configure -der". You may | |
15093 | # instead choose to run each of the .SH files by yourself, or "Configure -S". | |
15094 | # | |
15095 | ||
15096 | # Package name : $package | |
15097 | # Source directory : $src | |
15098 | # Configuration time: $cf_time | |
15099 | # Configured by : $cf_by | |
15100 | # Target system : $myuname | |
15101 | ||
15102 | Author='$Author' | |
15103 | Date='$Date' | |
15104 | Header='$Header' | |
15105 | Id='$Id' | |
15106 | Locker='$Locker' | |
15107 | Log='$Log' | |
15108 | Mcc='$Mcc' | |
15109 | RCSfile='$RCSfile' | |
15110 | Revision='$Revision' | |
15111 | Source='$Source' | |
15112 | State='$State' | |
15113 | _a='$_a' | |
15114 | _exe='$_exe' | |
15115 | _o='$_o' | |
15116 | afs='$afs' | |
15117 | alignbytes='$alignbytes' | |
15118 | ansi2knr='$ansi2knr' | |
15119 | aphostname='$aphostname' | |
ff935051 JH |
15120 | api_revision='$api_revision' |
15121 | api_subversion='$api_subversion' | |
15122 | api_version='$api_version' | |
15123 | api_versionstring='$api_versionstring' | |
5f80c64f JH |
15124 | ar='$ar' |
15125 | archlib='$archlib' | |
15126 | archlibexp='$archlibexp' | |
15127 | archname64='$archname64' | |
15128 | archname='$archname' | |
15129 | archobjs='$archobjs' | |
15130 | awk='$awk' | |
15131 | baserev='$baserev' | |
15132 | bash='$bash' | |
15133 | bin='$bin' | |
d71b2b6b | 15134 | bincompat5005='$bincompat5005' |
5f80c64f JH |
15135 | binexp='$binexp' |
15136 | bison='$bison' | |
15137 | byacc='$byacc' | |
15138 | byteorder='$byteorder' | |
15139 | c='$c' | |
15140 | castflags='$castflags' | |
15141 | cat='$cat' | |
15142 | cc='$cc' | |
15143 | cccdlflags='$cccdlflags' | |
15144 | ccdlflags='$ccdlflags' | |
15145 | ccflags='$ccflags' | |
ff49bff8 | 15146 | ccsymbols='$ccsymbols' |
5f80c64f JH |
15147 | cf_by='$cf_by' |
15148 | cf_email='$cf_email' | |
15149 | cf_time='$cf_time' | |
8175356b | 15150 | charsize='$charsize' |
5f80c64f JH |
15151 | chgrp='$chgrp' |
15152 | chmod='$chmod' | |
15153 | chown='$chown' | |
15154 | clocktype='$clocktype' | |
15155 | comm='$comm' | |
15156 | compress='$compress' | |
15157 | contains='$contains' | |
15158 | cp='$cp' | |
15159 | cpio='$cpio' | |
15160 | cpp='$cpp' | |
15161 | cpp_stuff='$cpp_stuff' | |
ff49bff8 | 15162 | cppccsymbols='$cppccsymbols' |
5f80c64f JH |
15163 | cppflags='$cppflags' |
15164 | cpplast='$cpplast' | |
15165 | cppminus='$cppminus' | |
15166 | cpprun='$cpprun' | |
15167 | cppstdin='$cppstdin' | |
ff49bff8 | 15168 | cppsymbols='$cppsymbols' |
68c15b6f | 15169 | crosscompile='$crosscompile' |
5f80c64f JH |
15170 | cryptlib='$cryptlib' |
15171 | csh='$csh' | |
15172 | d_Gconvert='$d_Gconvert' | |
cf2093f6 JH |
15173 | d_PRIEldbl='$d_PRIEldbl' |
15174 | d_PRIFldbl='$d_PRIFldbl' | |
15175 | d_PRIGldbl='$d_PRIGldbl' | |
15176 | d_PRIX64='$d_PRIX64' | |
15177 | d_PRId64='$d_PRId64' | |
15178 | d_PRIeldbl='$d_PRIeldbl' | |
15179 | d_PRIfldbl='$d_PRIfldbl' | |
15180 | d_PRIgldbl='$d_PRIgldbl' | |
15181 | d_PRIi64='$d_PRIi64' | |
15182 | d_PRIo64='$d_PRIo64' | |
15183 | d_PRIu64='$d_PRIu64' | |
15184 | d_PRIx64='$d_PRIx64' | |
5f80c64f JH |
15185 | d_access='$d_access' |
15186 | d_accessx='$d_accessx' | |
15187 | d_alarm='$d_alarm' | |
15188 | d_archlib='$d_archlib' | |
cf2093f6 JH |
15189 | d_atolf='$d_atolf' |
15190 | d_atoll='$d_atoll' | |
5f80c64f JH |
15191 | d_attribut='$d_attribut' |
15192 | d_bcmp='$d_bcmp' | |
15193 | d_bcopy='$d_bcopy' | |
d71b2b6b | 15194 | d_bincompat5005='$d_bincompat5005' |
5f80c64f JH |
15195 | d_bsd='$d_bsd' |
15196 | d_bsdgetpgrp='$d_bsdgetpgrp' | |
15197 | d_bsdsetpgrp='$d_bsdsetpgrp' | |
15198 | d_bzero='$d_bzero' | |
15199 | d_casti32='$d_casti32' | |
15200 | d_castneg='$d_castneg' | |
15201 | d_charvspr='$d_charvspr' | |
15202 | d_chown='$d_chown' | |
15203 | d_chroot='$d_chroot' | |
15204 | d_chsize='$d_chsize' | |
15205 | d_closedir='$d_closedir' | |
15206 | d_const='$d_const' | |
15207 | d_crypt='$d_crypt' | |
15208 | d_csh='$d_csh' | |
15209 | d_cuserid='$d_cuserid' | |
15210 | d_dbl_dig='$d_dbl_dig' | |
5f80c64f | 15211 | d_difftime='$d_difftime' |
5f80c64f JH |
15212 | d_dirnamlen='$d_dirnamlen' |
15213 | d_dlerror='$d_dlerror' | |
15214 | d_dlopen='$d_dlopen' | |
15215 | d_dlsymun='$d_dlsymun' | |
15216 | d_dosuid='$d_dosuid' | |
15217 | d_drand48proto='$d_drand48proto' | |
15218 | d_dup2='$d_dup2' | |
15219 | d_eaccess='$d_eaccess' | |
15220 | d_endgrent='$d_endgrent' | |
15221 | d_endhent='$d_endhent' | |
15222 | d_endnent='$d_endnent' | |
15223 | d_endpent='$d_endpent' | |
15224 | d_endpwent='$d_endpwent' | |
15225 | d_endsent='$d_endsent' | |
f1066039 | 15226 | d_endspent='$d_endspent' |
5f80c64f JH |
15227 | d_eofnblk='$d_eofnblk' |
15228 | d_eunice='$d_eunice' | |
15229 | d_fchmod='$d_fchmod' | |
15230 | d_fchown='$d_fchown' | |
15231 | d_fcntl='$d_fcntl' | |
15232 | d_fd_macros='$d_fd_macros' | |
15233 | d_fd_set='$d_fd_set' | |
15234 | d_fds_bits='$d_fds_bits' | |
5f80c64f | 15235 | d_fgetpos='$d_fgetpos' |
5f80c64f | 15236 | d_flexfnam='$d_flexfnam' |
5f80c64f | 15237 | d_flock='$d_flock' |
5f80c64f JH |
15238 | d_fork='$d_fork' |
15239 | d_fpathconf='$d_fpathconf' | |
d9b3e12d | 15240 | d_fpos64_t='$d_fpos64_t' |
a3540c92 | 15241 | d_frexpl='$d_frexpl' |
0545a864 | 15242 | d_fs_data_s='$d_fs_data_s' |
5f80c64f | 15243 | d_fseeko='$d_fseeko' |
5f80c64f | 15244 | d_fsetpos='$d_fsetpos' |
104d25b7 JH |
15245 | d_fstatfs='$d_fstatfs' |
15246 | d_fstatvfs='$d_fstatvfs' | |
5f80c64f JH |
15247 | d_ftello='$d_ftello' |
15248 | d_ftime='$d_ftime' | |
49dabb45 | 15249 | d_getcwd='$d_getcwd' |
c890dc6c | 15250 | d_getfsstat='$d_getfsstat' |
5f80c64f JH |
15251 | d_getgrent='$d_getgrent' |
15252 | d_getgrps='$d_getgrps' | |
15253 | d_gethbyaddr='$d_gethbyaddr' | |
15254 | d_gethbyname='$d_gethbyname' | |
15255 | d_gethent='$d_gethent' | |
15256 | d_gethname='$d_gethname' | |
15257 | d_gethostprotos='$d_gethostprotos' | |
15258 | d_getlogin='$d_getlogin' | |
ad27e871 | 15259 | d_getmnt='$d_getmnt' |
ccc7f9b3 | 15260 | d_getmntent='$d_getmntent' |
5f80c64f JH |
15261 | d_getnbyaddr='$d_getnbyaddr' |
15262 | d_getnbyname='$d_getnbyname' | |
15263 | d_getnent='$d_getnent' | |
15264 | d_getnetprotos='$d_getnetprotos' | |
15265 | d_getpbyname='$d_getpbyname' | |
15266 | d_getpbynumber='$d_getpbynumber' | |
15267 | d_getpent='$d_getpent' | |
15268 | d_getpgid='$d_getpgid' | |
15269 | d_getpgrp2='$d_getpgrp2' | |
15270 | d_getpgrp='$d_getpgrp' | |
15271 | d_getppid='$d_getppid' | |
15272 | d_getprior='$d_getprior' | |
15273 | d_getprotoprotos='$d_getprotoprotos' | |
15274 | d_getpwent='$d_getpwent' | |
15275 | d_getsbyname='$d_getsbyname' | |
15276 | d_getsbyport='$d_getsbyport' | |
15277 | d_getsent='$d_getsent' | |
15278 | d_getservprotos='$d_getservprotos' | |
f1066039 JH |
15279 | d_getspent='$d_getspent' |
15280 | d_getspnam='$d_getspnam' | |
5f80c64f JH |
15281 | d_gettimeod='$d_gettimeod' |
15282 | d_gnulibc='$d_gnulibc' | |
15283 | d_grpasswd='$d_grpasswd' | |
ccc7f9b3 | 15284 | d_hasmntopt='$d_hasmntopt' |
5f80c64f | 15285 | d_htonl='$d_htonl' |
43999f95 | 15286 | d_iconv='$d_iconv' |
5f80c64f JH |
15287 | d_index='$d_index' |
15288 | d_inetaton='$d_inetaton' | |
13b3f787 | 15289 | d_int64_t='$d_int64_t' |
5f80c64f | 15290 | d_isascii='$d_isascii' |
a3540c92 JH |
15291 | d_isnan='$d_isnan' |
15292 | d_isnanl='$d_isnanl' | |
5f80c64f JH |
15293 | d_killpg='$d_killpg' |
15294 | d_lchown='$d_lchown' | |
2d4389e4 | 15295 | d_ldbl_dig='$d_ldbl_dig' |
5f80c64f JH |
15296 | d_link='$d_link' |
15297 | d_locconv='$d_locconv' | |
5f80c64f JH |
15298 | d_lockf='$d_lockf' |
15299 | d_longdbl='$d_longdbl' | |
15300 | d_longlong='$d_longlong' | |
49c10eea | 15301 | d_lseekproto='$d_lseekproto' |
5f80c64f | 15302 | d_lstat='$d_lstat' |
1e8c3fde | 15303 | d_madvise='$d_madvise' |
5f80c64f JH |
15304 | d_mblen='$d_mblen' |
15305 | d_mbstowcs='$d_mbstowcs' | |
15306 | d_mbtowc='$d_mbtowc' | |
0f27ced1 | 15307 | d_memchr='$d_memchr' |
5f80c64f JH |
15308 | d_memcmp='$d_memcmp' |
15309 | d_memcpy='$d_memcpy' | |
15310 | d_memmove='$d_memmove' | |
15311 | d_memset='$d_memset' | |
15312 | d_mkdir='$d_mkdir' | |
fe749a9f | 15313 | d_mkdtemp='$d_mkdtemp' |
5f80c64f | 15314 | d_mkfifo='$d_mkfifo' |
fe749a9f JH |
15315 | d_mkstemp='$d_mkstemp' |
15316 | d_mkstemps='$d_mkstemps' | |
5f80c64f | 15317 | d_mktime='$d_mktime' |
fe749a9f | 15318 | d_mmap='$d_mmap' |
a3540c92 | 15319 | d_modfl='$d_modfl' |
fe749a9f | 15320 | d_mprotect='$d_mprotect' |
5f80c64f | 15321 | d_msg='$d_msg' |
de4597cb JH |
15322 | d_msg_ctrunc='$d_msg_ctrunc' |
15323 | d_msg_dontroute='$d_msg_dontroute' | |
15324 | d_msg_oob='$d_msg_oob' | |
15325 | d_msg_peek='$d_msg_peek' | |
15326 | d_msg_proxy='$d_msg_proxy' | |
5f80c64f JH |
15327 | d_msgctl='$d_msgctl' |
15328 | d_msgget='$d_msgget' | |
15329 | d_msgrcv='$d_msgrcv' | |
15330 | d_msgsnd='$d_msgsnd' | |
fe749a9f JH |
15331 | d_msync='$d_msync' |
15332 | d_munmap='$d_munmap' | |
5f80c64f | 15333 | d_mymalloc='$d_mymalloc' |
5f80c64f | 15334 | d_nice='$d_nice' |
78691af5 | 15335 | d_nv_preserves_uv='$d_nv_preserves_uv' |
2000072c | 15336 | d_off64_t='$d_off64_t' |
ef4af2be | 15337 | d_old_pthread_create_joinable='$d_old_pthread_create_joinable' |
5f80c64f JH |
15338 | d_oldpthreads='$d_oldpthreads' |
15339 | d_oldsock='$d_oldsock' | |
15340 | d_open3='$d_open3' | |
5f80c64f JH |
15341 | d_pathconf='$d_pathconf' |
15342 | d_pause='$d_pause' | |
3b777bb4 | 15343 | d_perl_otherlibdirs='$d_perl_otherlibdirs' |
5f80c64f JH |
15344 | d_phostname='$d_phostname' |
15345 | d_pipe='$d_pipe' | |
15346 | d_poll='$d_poll' | |
15347 | d_portable='$d_portable' | |
15348 | d_pthread_yield='$d_pthread_yield' | |
5f80c64f JH |
15349 | d_pwage='$d_pwage' |
15350 | d_pwchange='$d_pwchange' | |
15351 | d_pwclass='$d_pwclass' | |
15352 | d_pwcomment='$d_pwcomment' | |
15353 | d_pwexpire='$d_pwexpire' | |
15354 | d_pwgecos='$d_pwgecos' | |
15355 | d_pwpasswd='$d_pwpasswd' | |
15356 | d_pwquota='$d_pwquota' | |
bbe6c963 | 15357 | d_qgcvt='$d_qgcvt' |
de1c2614 | 15358 | d_quad='$d_quad' |
5f80c64f JH |
15359 | d_readdir='$d_readdir' |
15360 | d_readlink='$d_readlink' | |
15361 | d_rename='$d_rename' | |
15362 | d_rewinddir='$d_rewinddir' | |
15363 | d_rmdir='$d_rmdir' | |
15364 | d_safebcpy='$d_safebcpy' | |
15365 | d_safemcpy='$d_safemcpy' | |
15366 | d_sanemcmp='$d_sanemcmp' | |
15367 | d_sched_yield='$d_sched_yield' | |
de4597cb | 15368 | d_scm_rights='$d_scm_rights' |
5f80c64f JH |
15369 | d_seekdir='$d_seekdir' |
15370 | d_select='$d_select' | |
15371 | d_sem='$d_sem' | |
15372 | d_semctl='$d_semctl' | |
15373 | d_semctl_semid_ds='$d_semctl_semid_ds' | |
15374 | d_semctl_semun='$d_semctl_semun' | |
15375 | d_semget='$d_semget' | |
15376 | d_semop='$d_semop' | |
15377 | d_setegid='$d_setegid' | |
15378 | d_seteuid='$d_seteuid' | |
15379 | d_setgrent='$d_setgrent' | |
15380 | d_setgrps='$d_setgrps' | |
15381 | d_sethent='$d_sethent' | |
15382 | d_setlinebuf='$d_setlinebuf' | |
15383 | d_setlocale='$d_setlocale' | |
15384 | d_setnent='$d_setnent' | |
15385 | d_setpent='$d_setpent' | |
15386 | d_setpgid='$d_setpgid' | |
15387 | d_setpgrp2='$d_setpgrp2' | |
15388 | d_setpgrp='$d_setpgrp' | |
15389 | d_setprior='$d_setprior' | |
15390 | d_setpwent='$d_setpwent' | |
15391 | d_setregid='$d_setregid' | |
15392 | d_setresgid='$d_setresgid' | |
15393 | d_setresuid='$d_setresuid' | |
15394 | d_setreuid='$d_setreuid' | |
15395 | d_setrgid='$d_setrgid' | |
15396 | d_setruid='$d_setruid' | |
15397 | d_setsent='$d_setsent' | |
15398 | d_setsid='$d_setsid' | |
f1066039 | 15399 | d_setspent='$d_setspent' |
5f80c64f JH |
15400 | d_setvbuf='$d_setvbuf' |
15401 | d_sfio='$d_sfio' | |
15402 | d_shm='$d_shm' | |
15403 | d_shmat='$d_shmat' | |
15404 | d_shmatprototype='$d_shmatprototype' | |
15405 | d_shmctl='$d_shmctl' | |
15406 | d_shmdt='$d_shmdt' | |
15407 | d_shmget='$d_shmget' | |
15408 | d_sigaction='$d_sigaction' | |
15409 | d_sigsetjmp='$d_sigsetjmp' | |
15410 | d_socket='$d_socket' | |
13b3f787 | 15411 | d_socklen_t='$d_socklen_t' |
5f80c64f | 15412 | d_sockpair='$d_sockpair' |
68d4903c | 15413 | d_sqrtl='$d_sqrtl' |
5f80c64f | 15414 | d_statblks='$d_statblks' |
0545a864 JH |
15415 | d_statfs_f_flags='$d_statfs_f_flags' |
15416 | d_statfs_s='$d_statfs_s' | |
104d25b7 | 15417 | d_statvfs='$d_statvfs' |
5f80c64f JH |
15418 | d_stdio_cnt_lval='$d_stdio_cnt_lval' |
15419 | d_stdio_ptr_lval='$d_stdio_ptr_lval' | |
ed39a0f2 | 15420 | d_stdio_stream_array='$d_stdio_stream_array' |
5f80c64f JH |
15421 | d_stdiobase='$d_stdiobase' |
15422 | d_stdstdio='$d_stdstdio' | |
5f80c64f JH |
15423 | d_strchr='$d_strchr' |
15424 | d_strcoll='$d_strcoll' | |
15425 | d_strctcpy='$d_strctcpy' | |
15426 | d_strerrm='$d_strerrm' | |
15427 | d_strerror='$d_strerror' | |
15428 | d_strtod='$d_strtod' | |
15429 | d_strtol='$d_strtol' | |
ff935051 | 15430 | d_strtold='$d_strtold' |
76d49b1c | 15431 | d_strtoll='$d_strtoll' |
5f80c64f | 15432 | d_strtoul='$d_strtoul' |
cf2093f6 | 15433 | d_strtoull='$d_strtoull' |
ff935051 | 15434 | d_strtouq='$d_strtouq' |
5f80c64f JH |
15435 | d_strxfrm='$d_strxfrm' |
15436 | d_suidsafe='$d_suidsafe' | |
15437 | d_symlink='$d_symlink' | |
15438 | d_syscall='$d_syscall' | |
15439 | d_sysconf='$d_sysconf' | |
15440 | d_sysernlst='$d_sysernlst' | |
15441 | d_syserrlst='$d_syserrlst' | |
15442 | d_system='$d_system' | |
15443 | d_tcgetpgrp='$d_tcgetpgrp' | |
15444 | d_tcsetpgrp='$d_tcsetpgrp' | |
5f80c64f | 15445 | d_telldir='$d_telldir' |
cb86ce0e | 15446 | d_telldirproto='$d_telldirproto' |
5f80c64f JH |
15447 | d_time='$d_time' |
15448 | d_times='$d_times' | |
5f80c64f JH |
15449 | d_truncate='$d_truncate' |
15450 | d_tzname='$d_tzname' | |
15451 | d_umask='$d_umask' | |
15452 | d_uname='$d_uname' | |
15453 | d_union_semun='$d_union_semun' | |
0545a864 | 15454 | d_ustat='$d_ustat' |
526fdc24 | 15455 | d_vendorarch='$d_vendorarch' |
717c4fcc | 15456 | d_vendorbin='$d_vendorbin' |
a3635516 | 15457 | d_vendorlib='$d_vendorlib' |
5f80c64f JH |
15458 | d_vfork='$d_vfork' |
15459 | d_void_closedir='$d_void_closedir' | |
15460 | d_voidsig='$d_voidsig' | |
15461 | d_voidtty='$d_voidtty' | |
15462 | d_volatile='$d_volatile' | |
15463 | d_vprintf='$d_vprintf' | |
15464 | d_wait4='$d_wait4' | |
15465 | d_waitpid='$d_waitpid' | |
15466 | d_wcstombs='$d_wcstombs' | |
15467 | d_wctomb='$d_wctomb' | |
15468 | d_xenix='$d_xenix' | |
15469 | date='$date' | |
15470 | db_hashtype='$db_hashtype' | |
15471 | db_prefixtype='$db_prefixtype' | |
15472 | defvoidused='$defvoidused' | |
15473 | direntrytype='$direntrytype' | |
15474 | dlext='$dlext' | |
15475 | dlsrc='$dlsrc' | |
15476 | doublesize='$doublesize' | |
15477 | drand01='$drand01' | |
15478 | dynamic_ext='$dynamic_ext' | |
15479 | eagain='$eagain' | |
15480 | ebcdic='$ebcdic' | |
15481 | echo='$echo' | |
15482 | egrep='$egrep' | |
15483 | emacs='$emacs' | |
15484 | eunicefix='$eunicefix' | |
15485 | exe_ext='$exe_ext' | |
15486 | expr='$expr' | |
15487 | extensions='$extensions' | |
66fe083f | 15488 | fflushNULL='$fflushNULL' |
767df6a1 | 15489 | fflushall='$fflushall' |
5f80c64f JH |
15490 | find='$find' |
15491 | firstmakefile='$firstmakefile' | |
15492 | flex='$flex' | |
8175356b | 15493 | fpossize='$fpossize' |
5f80c64f JH |
15494 | fpostype='$fpostype' |
15495 | freetype='$freetype' | |
ccc7f9b3 | 15496 | full_ar='$full_ar' |
5f80c64f JH |
15497 | full_csh='$full_csh' |
15498 | full_sed='$full_sed' | |
15499 | gccversion='$gccversion' | |
a22e52b9 | 15500 | gidformat='$gidformat' |
785fb66b JH |
15501 | gidsign='$gidsign' |
15502 | gidsize='$gidsize' | |
5f80c64f JH |
15503 | gidtype='$gidtype' |
15504 | glibpth='$glibpth' | |
15505 | grep='$grep' | |
15506 | groupcat='$groupcat' | |
15507 | groupstype='$groupstype' | |
15508 | gzip='$gzip' | |
15509 | h_fcntl='$h_fcntl' | |
15510 | h_sysfile='$h_sysfile' | |
15511 | hint='$hint' | |
15512 | hostcat='$hostcat' | |
15513 | huge='$huge' | |
8175356b JH |
15514 | i16size='$i16size' |
15515 | i16type='$i16type' | |
15516 | i32size='$i32size' | |
15517 | i32type='$i32type' | |
15518 | i64size='$i64size' | |
15519 | i64type='$i64type' | |
15520 | i8size='$i8size' | |
15521 | i8type='$i8type' | |
5f80c64f JH |
15522 | i_arpainet='$i_arpainet' |
15523 | i_bsdioctl='$i_bsdioctl' | |
15524 | i_db='$i_db' | |
15525 | i_dbm='$i_dbm' | |
15526 | i_dirent='$i_dirent' | |
15527 | i_dld='$i_dld' | |
15528 | i_dlfcn='$i_dlfcn' | |
15529 | i_fcntl='$i_fcntl' | |
15530 | i_float='$i_float' | |
15531 | i_gdbm='$i_gdbm' | |
15532 | i_grp='$i_grp' | |
43999f95 | 15533 | i_iconv='$i_iconv' |
792d8dab | 15534 | i_ieeefp='$i_ieeefp' |
5f80c64f JH |
15535 | i_inttypes='$i_inttypes' |
15536 | i_limits='$i_limits' | |
15537 | i_locale='$i_locale' | |
7f3d1cf1 | 15538 | i_machcthr='$i_machcthr' |
5f80c64f JH |
15539 | i_malloc='$i_malloc' |
15540 | i_math='$i_math' | |
15541 | i_memory='$i_memory' | |
e7fb4fcc | 15542 | i_mntent='$i_mntent' |
5f80c64f JH |
15543 | i_ndbm='$i_ndbm' |
15544 | i_netdb='$i_netdb' | |
15545 | i_neterrno='$i_neterrno' | |
9cc6feab | 15546 | i_netinettcp='$i_netinettcp' |
5f80c64f | 15547 | i_niin='$i_niin' |
5b34fd99 | 15548 | i_poll='$i_poll' |
c4747d3e | 15549 | i_pthread='$i_pthread' |
5f80c64f JH |
15550 | i_pwd='$i_pwd' |
15551 | i_rpcsvcdbm='$i_rpcsvcdbm' | |
15552 | i_sfio='$i_sfio' | |
15553 | i_sgtty='$i_sgtty' | |
f1066039 | 15554 | i_shadow='$i_shadow' |
86959918 | 15555 | i_socks='$i_socks' |
5f80c64f JH |
15556 | i_stdarg='$i_stdarg' |
15557 | i_stddef='$i_stddef' | |
15558 | i_stdlib='$i_stdlib' | |
15559 | i_string='$i_string' | |
923fc586 | 15560 | i_sunmath='$i_sunmath' |
5f80c64f JH |
15561 | i_sysaccess='$i_sysaccess' |
15562 | i_sysdir='$i_sysdir' | |
15563 | i_sysfile='$i_sysfile' | |
15564 | i_sysfilio='$i_sysfilio' | |
15565 | i_sysin='$i_sysin' | |
15566 | i_sysioctl='$i_sysioctl' | |
ca52efda | 15567 | i_syslog='$i_syslog' |
fe749a9f | 15568 | i_sysmman='$i_sysmman' |
bf0c440f | 15569 | i_sysmode='$i_sysmode' |
104d25b7 | 15570 | i_sysmount='$i_sysmount' |
5f80c64f JH |
15571 | i_sysndir='$i_sysndir' |
15572 | i_sysparam='$i_sysparam' | |
15573 | i_sysresrc='$i_sysresrc' | |
15574 | i_syssecrt='$i_syssecrt' | |
15575 | i_sysselct='$i_sysselct' | |
15576 | i_syssockio='$i_syssockio' | |
15577 | i_sysstat='$i_sysstat' | |
0545a864 | 15578 | i_sysstatfs='$i_sysstatfs' |
104d25b7 | 15579 | i_sysstatvfs='$i_sysstatvfs' |
5f80c64f JH |
15580 | i_systime='$i_systime' |
15581 | i_systimek='$i_systimek' | |
15582 | i_systimes='$i_systimes' | |
15583 | i_systypes='$i_systypes' | |
de4597cb | 15584 | i_sysuio='$i_sysuio' |
5f80c64f | 15585 | i_sysun='$i_sysun' |
d4935d7f | 15586 | i_sysutsname='$i_sysutsname' |
0545a864 | 15587 | i_sysvfs='$i_sysvfs' |
5f80c64f JH |
15588 | i_syswait='$i_syswait' |
15589 | i_termio='$i_termio' | |
15590 | i_termios='$i_termios' | |
15591 | i_time='$i_time' | |
15592 | i_unistd='$i_unistd' | |
0545a864 | 15593 | i_ustat='$i_ustat' |
5f80c64f JH |
15594 | i_utime='$i_utime' |
15595 | i_values='$i_values' | |
15596 | i_varargs='$i_varargs' | |
15597 | i_varhdr='$i_varhdr' | |
15598 | i_vfork='$i_vfork' | |
15599 | ignore_versioned_solibs='$ignore_versioned_solibs' | |
ff935051 | 15600 | inc_version_list='$inc_version_list' |
3a096bf3 | 15601 | inc_version_list_init='$inc_version_list_init' |
5f80c64f JH |
15602 | incpath='$incpath' |
15603 | inews='$inews' | |
15604 | installarchlib='$installarchlib' | |
15605 | installbin='$installbin' | |
15606 | installman1dir='$installman1dir' | |
15607 | installman3dir='$installman3dir' | |
dd4e71fd JH |
15608 | installprefix='$installprefix' |
15609 | installprefixexp='$installprefixexp' | |
5f80c64f JH |
15610 | installprivlib='$installprivlib' |
15611 | installscript='$installscript' | |
15612 | installsitearch='$installsitearch' | |
717c4fcc | 15613 | installsitebin='$installsitebin' |
5f80c64f | 15614 | installsitelib='$installsitelib' |
dd4e71fd | 15615 | installstyle='$installstyle' |
104d25b7 | 15616 | installusrbinperl='$installusrbinperl' |
526fdc24 | 15617 | installvendorarch='$installvendorarch' |
717c4fcc | 15618 | installvendorbin='$installvendorbin' |
a3635516 | 15619 | installvendorlib='$installvendorlib' |
5f80c64f | 15620 | intsize='$intsize' |
8175356b JH |
15621 | ivdformat='$ivdformat' |
15622 | ivsize='$ivsize' | |
15623 | ivtype='$ivtype' | |
5f80c64f JH |
15624 | known_extensions='$known_extensions' |
15625 | ksh='$ksh' | |
15626 | large='$large' | |
15627 | ld='$ld' | |
15628 | lddlflags='$lddlflags' | |
15629 | ldflags='$ldflags' | |
5cf1d1f1 | 15630 | ldlibpthname='$ldlibpthname' |
5f80c64f JH |
15631 | less='$less' |
15632 | lib_ext='$lib_ext' | |
15633 | libc='$libc' | |
15634 | libperl='$libperl' | |
15635 | libpth='$libpth' | |
15636 | libs='$libs' | |
43999f95 JH |
15637 | libsdirs='$libsdirs' |
15638 | libsfiles='$libsfiles' | |
15639 | libsfound='$libsfound' | |
13b3f787 | 15640 | libspath='$libspath' |
5f80c64f JH |
15641 | libswanted='$libswanted' |
15642 | line='$line' | |
15643 | lint='$lint' | |
15644 | lkflags='$lkflags' | |
15645 | ln='$ln' | |
15646 | lns='$lns' | |
15647 | locincpth='$locincpth' | |
15648 | loclibpth='$loclibpth' | |
15649 | longdblsize='$longdblsize' | |
15650 | longlongsize='$longlongsize' | |
15651 | longsize='$longsize' | |
15652 | lp='$lp' | |
15653 | lpr='$lpr' | |
15654 | ls='$ls' | |
15655 | lseeksize='$lseeksize' | |
15656 | lseektype='$lseektype' | |
15657 | mail='$mail' | |
15658 | mailx='$mailx' | |
15659 | make='$make' | |
15660 | make_set_make='$make_set_make' | |
15661 | mallocobj='$mallocobj' | |
15662 | mallocsrc='$mallocsrc' | |
15663 | malloctype='$malloctype' | |
15664 | man1dir='$man1dir' | |
15665 | man1direxp='$man1direxp' | |
15666 | man1ext='$man1ext' | |
15667 | man3dir='$man3dir' | |
15668 | man3direxp='$man3direxp' | |
15669 | man3ext='$man3ext' | |
15670 | medium='$medium' | |
5f80c64f JH |
15671 | mips_type='$mips_type' |
15672 | mkdir='$mkdir' | |
fe749a9f | 15673 | mmaptype='$mmaptype' |
5f80c64f JH |
15674 | models='$models' |
15675 | modetype='$modetype' | |
15676 | more='$more' | |
68c15b6f | 15677 | multiarch='$multiarch' |
5f80c64f JH |
15678 | mv='$mv' |
15679 | myarchname='$myarchname' | |
15680 | mydomain='$mydomain' | |
15681 | myhostname='$myhostname' | |
15682 | myuname='$myuname' | |
15683 | n='$n' | |
15684 | netdb_hlen_type='$netdb_hlen_type' | |
15685 | netdb_host_type='$netdb_host_type' | |
15686 | netdb_name_type='$netdb_name_type' | |
15687 | netdb_net_type='$netdb_net_type' | |
15688 | nm='$nm' | |
15689 | nm_opt='$nm_opt' | |
15690 | nm_so_opt='$nm_so_opt' | |
15691 | nonxs_ext='$nonxs_ext' | |
15692 | nroff='$nroff' | |
8175356b JH |
15693 | nvsize='$nvsize' |
15694 | nvtype='$nvtype' | |
5f80c64f JH |
15695 | o_nonblock='$o_nonblock' |
15696 | obj_ext='$obj_ext' | |
ef4af2be | 15697 | old_pthread_create_joinable='$old_pthread_create_joinable' |
5f80c64f JH |
15698 | optimize='$optimize' |
15699 | orderlib='$orderlib' | |
15700 | osname='$osname' | |
15701 | osvers='$osvers' | |
3b777bb4 | 15702 | otherlibdirs='$otherlibdirs' |
5f80c64f JH |
15703 | package='$package' |
15704 | pager='$pager' | |
15705 | passcat='$passcat' | |
15706 | patchlevel='$patchlevel' | |
15707 | path_sep='$path_sep' | |
49c10eea | 15708 | perl5='$perl5' |
5f80c64f JH |
15709 | perl='$perl' |
15710 | perladmin='$perladmin' | |
15711 | perlpath='$perlpath' | |
15712 | pg='$pg' | |
15713 | phostname='$phostname' | |
15714 | pidtype='$pidtype' | |
15715 | plibpth='$plibpth' | |
fe749a9f | 15716 | pm_apiversion='$pm_apiversion' |
5f80c64f JH |
15717 | pmake='$pmake' |
15718 | pr='$pr' | |
15719 | prefix='$prefix' | |
15720 | prefixexp='$prefixexp' | |
15721 | privlib='$privlib' | |
15722 | privlibexp='$privlibexp' | |
15723 | prototype='$prototype' | |
15724 | ptrsize='$ptrsize' | |
6b8eaf93 | 15725 | quadkind='$quadkind' |
d7d93a81 | 15726 | quadtype='$quadtype' |
5f80c64f JH |
15727 | randbits='$randbits' |
15728 | randfunc='$randfunc' | |
15729 | randseedtype='$randseedtype' | |
15730 | ranlib='$ranlib' | |
15731 | rd_nodata='$rd_nodata' | |
49c10eea | 15732 | revision='$revision' |
5f80c64f JH |
15733 | rm='$rm' |
15734 | rmail='$rmail' | |
15735 | runnm='$runnm' | |
cf2093f6 JH |
15736 | sPRIEldbl='$sPRIEldbl' |
15737 | sPRIFldbl='$sPRIFldbl' | |
15738 | sPRIGldbl='$sPRIGldbl' | |
15739 | sPRIX64='$sPRIX64' | |
15740 | sPRId64='$sPRId64' | |
15741 | sPRIeldbl='$sPRIeldbl' | |
15742 | sPRIfldbl='$sPRIfldbl' | |
15743 | sPRIgldbl='$sPRIgldbl' | |
15744 | sPRIi64='$sPRIi64' | |
15745 | sPRIo64='$sPRIo64' | |
15746 | sPRIu64='$sPRIu64' | |
15747 | sPRIx64='$sPRIx64' | |
5f80c64f JH |
15748 | sched_yield='$sched_yield' |
15749 | scriptdir='$scriptdir' | |
15750 | scriptdirexp='$scriptdirexp' | |
15751 | sed='$sed' | |
15752 | seedfunc='$seedfunc' | |
15753 | selectminbits='$selectminbits' | |
15754 | selecttype='$selecttype' | |
15755 | sendmail='$sendmail' | |
15756 | sh='$sh' | |
15757 | shar='$shar' | |
15758 | sharpbang='$sharpbang' | |
15759 | shmattype='$shmattype' | |
15760 | shortsize='$shortsize' | |
15761 | shrpenv='$shrpenv' | |
15762 | shsharp='$shsharp' | |
af4c28eb | 15763 | sig_count='$sig_count' |
5f80c64f JH |
15764 | sig_name='$sig_name' |
15765 | sig_name_init='$sig_name_init' | |
15766 | sig_num='$sig_num' | |
824a2ba3 | 15767 | sig_num_init='$sig_num_init' |
5f80c64f JH |
15768 | signal_t='$signal_t' |
15769 | sitearch='$sitearch' | |
15770 | sitearchexp='$sitearchexp' | |
717c4fcc JH |
15771 | sitebin='$sitebin' |
15772 | sitebinexp='$sitebinexp' | |
5f80c64f | 15773 | sitelib='$sitelib' |
526fdc24 | 15774 | sitelib_stem='$sitelib_stem' |
5f80c64f | 15775 | sitelibexp='$sitelibexp' |
dd4e71fd JH |
15776 | siteprefix='$siteprefix' |
15777 | siteprefixexp='$siteprefixexp' | |
8c99d73e | 15778 | sizesize='$sizesize' |
5f80c64f JH |
15779 | sizetype='$sizetype' |
15780 | sleep='$sleep' | |
15781 | smail='$smail' | |
15782 | small='$small' | |
15783 | so='$so' | |
15784 | sockethdr='$sockethdr' | |
15785 | socketlib='$socketlib' | |
c890dc6c | 15786 | socksizetype='$socksizetype' |
5f80c64f JH |
15787 | sort='$sort' |
15788 | spackage='$spackage' | |
15789 | spitshell='$spitshell' | |
15790 | split='$split' | |
15791 | src='$src' | |
15792 | ssizetype='$ssizetype' | |
15793 | startperl='$startperl' | |
15794 | startsh='$startsh' | |
15795 | static_ext='$static_ext' | |
15796 | stdchar='$stdchar' | |
15797 | stdio_base='$stdio_base' | |
15798 | stdio_bufsiz='$stdio_bufsiz' | |
15799 | stdio_cnt='$stdio_cnt' | |
15800 | stdio_filbuf='$stdio_filbuf' | |
15801 | stdio_ptr='$stdio_ptr' | |
767df6a1 | 15802 | stdio_stream_array='$stdio_stream_array' |
5f80c64f JH |
15803 | strings='$strings' |
15804 | submit='$submit' | |
15805 | subversion='$subversion' | |
15806 | sysman='$sysman' | |
15807 | tail='$tail' | |
15808 | tar='$tar' | |
15809 | tbl='$tbl' | |
15810 | tee='$tee' | |
15811 | test='$test' | |
15812 | timeincl='$timeincl' | |
15813 | timetype='$timetype' | |
15814 | touch='$touch' | |
15815 | tr='$tr' | |
15816 | trnl='$trnl' | |
15817 | troff='$troff' | |
8175356b JH |
15818 | u16size='$u16size' |
15819 | u16type='$u16type' | |
15820 | u32size='$u32size' | |
15821 | u32type='$u32type' | |
15822 | u64size='$u64size' | |
15823 | u64type='$u64type' | |
15824 | u8size='$u8size' | |
15825 | u8type='$u8type' | |
a22e52b9 | 15826 | uidformat='$uidformat' |
57def98f | 15827 | uidsign='$uidsign' |
785fb66b | 15828 | uidsize='$uidsize' |
5f80c64f JH |
15829 | uidtype='$uidtype' |
15830 | uname='$uname' | |
15831 | uniq='$uniq' | |
d7d93a81 | 15832 | uquadtype='$uquadtype' |
aaacdc8b | 15833 | use5005threads='$use5005threads' |
10cc9d2a JH |
15834 | use64bitall='$use64bitall' |
15835 | use64bitint='$use64bitint' | |
5f80c64f | 15836 | usedl='$usedl' |
aaacdc8b | 15837 | useithreads='$useithreads' |
249b38c6 | 15838 | uselargefiles='$uselargefiles' |
b0ce926a | 15839 | uselongdouble='$uselongdouble' |
09458382 | 15840 | usemorebits='$usemorebits' |
5f80c64f JH |
15841 | usemultiplicity='$usemultiplicity' |
15842 | usemymalloc='$usemymalloc' | |
15843 | usenm='$usenm' | |
15844 | useopcode='$useopcode' | |
15845 | useperlio='$useperlio' | |
15846 | useposix='$useposix' | |
15847 | usesfio='$usesfio' | |
15848 | useshrplib='$useshrplib' | |
29209bc5 | 15849 | usesocks='$usesocks' |
5f80c64f | 15850 | usethreads='$usethreads' |
a3635516 | 15851 | usevendorprefix='$usevendorprefix' |
5f80c64f JH |
15852 | usevfork='$usevfork' |
15853 | usrinc='$usrinc' | |
15854 | uuname='$uuname' | |
8175356b JH |
15855 | uvoformat='$uvoformat' |
15856 | uvsize='$uvsize' | |
15857 | uvtype='$uvtype' | |
15858 | uvuformat='$uvuformat' | |
15859 | uvxformat='$uvxformat' | |
526fdc24 MS |
15860 | vendorarch='$vendorarch' |
15861 | vendorarchexp='$vendorarchexp' | |
717c4fcc JH |
15862 | vendorbin='$vendorbin' |
15863 | vendorbinexp='$vendorbinexp' | |
a3635516 | 15864 | vendorlib='$vendorlib' |
526fdc24 | 15865 | vendorlib_stem='$vendorlib_stem' |
a3635516 JH |
15866 | vendorlibexp='$vendorlibexp' |
15867 | vendorprefix='$vendorprefix' | |
15868 | vendorprefixexp='$vendorprefixexp' | |
5f80c64f JH |
15869 | version='$version' |
15870 | vi='$vi' | |
15871 | voidflags='$voidflags' | |
15872 | xlibpth='$xlibpth' | |
fe749a9f | 15873 | xs_apiversion='$xs_apiversion' |
5f80c64f JH |
15874 | zcat='$zcat' |
15875 | zip='$zip' | |
15876 | EOT | |
15877 | ||
15878 | : Add in command line options if available | |
15879 | $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh | |
15880 | ||
15881 | : add special variables | |
15882 | $test -f $src/patchlevel.h && \ | |
d00b958f | 15883 | awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh |
2000072c | 15884 | echo "CONFIGDOTSH=true" >>config.sh |
5f80c64f JH |
15885 | |
15886 | : propagate old symbols | |
15887 | if $test -f UU/config.sh; then | |
15888 | <UU/config.sh sort | uniq >UU/oldconfig.sh | |
15889 | sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\ | |
15890 | sort | uniq -u >UU/oldsyms | |
15891 | set X `cat UU/oldsyms` | |
15892 | shift | |
15893 | case $# in | |
15894 | 0) ;; | |
15895 | *) | |
15896 | cat <<EOM | |
15897 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em... | |
15898 | EOM | |
15899 | echo "# Variables propagated from previous config.sh file." >>config.sh | |
15900 | for sym in `cat UU/oldsyms`; do | |
15901 | echo " Propagating $hint variable "'$'"$sym..." | |
15902 | eval 'tmp="$'"${sym}"'"' | |
15903 | echo "$tmp" | \ | |
15904 | sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh | |
15905 | done | |
15906 | ;; | |
15907 | esac | |
15908 | fi | |
15909 | ||
15910 | : Finish up by extracting the .SH files | |
15911 | case "$alldone" in | |
15912 | exit) | |
15913 | $rm -rf UU | |
15914 | echo "Done." | |
15915 | exit 0 | |
15916 | ;; | |
15917 | cont) | |
15918 | ;; | |
15919 | '') | |
15920 | dflt='' | |
15921 | nostick=true | |
15922 | $cat <<EOM | |
15923 | ||
15924 | If you'd like to make any changes to the config.sh file before I begin | |
15925 | to configure things, do it as a shell escape now (e.g. !vi config.sh). | |
15926 | ||
15927 | EOM | |
15928 | rp="Press return or use a shell escape to edit config.sh:" | |
15929 | . UU/myread | |
15930 | nostick='' | |
15931 | case "$ans" in | |
15932 | '') ;; | |
15933 | *) : in case they cannot read | |
15934 | sh 1>&4 -c "$ans";; | |
15935 | esac | |
15936 | ;; | |
15937 | esac | |
15938 | ||
15939 | : if this fails, just run all the .SH files by hand | |
15940 | . ./config.sh | |
15941 | ||
15942 | echo " " | |
15943 | exec 1>&4 | |
15944 | . ./UU/extract | |
15945 | ||
15946 | if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then | |
15947 | dflt=y | |
15948 | case "$silent" in | |
15949 | true) ;; | |
15950 | *) | |
15951 | $cat <<EOM | |
15952 | ||
15953 | Now you need to generate make dependencies by running "$make depend". | |
15954 | You might prefer to run it in background: "$make depend > makedepend.out &" | |
15955 | It can take a while, so you might not want to run it right now. | |
15956 | ||
15957 | EOM | |
15958 | ;; | |
15959 | esac | |
15960 | rp="Run $make depend now?" | |
15961 | . UU/myread | |
15962 | case "$ans" in | |
15963 | y*) | |
15964 | $make depend && echo "Now you must run a $make." | |
15965 | ;; | |
15966 | *) | |
15967 | echo "You must run '$make depend' then '$make'." | |
15968 | ;; | |
15969 | esac | |
15970 | elif test -f [Mm]akefile; then | |
15971 | echo " " | |
15972 | echo "Now you must run a $make." | |
15973 | else | |
15974 | echo "Done." | |
15975 | fi | |
15976 | ||
15977 | if $test -f Policy.sh; then | |
15978 | $cat <<EOM | |
15979 | ||
15980 | If you compile $package on a different machine or from a different object | |
15981 | directory, copy the Policy.sh file from this object directory to the | |
15982 | new one before you run Configure -- this will help you with most of | |
15983 | the policy defaults. | |
15984 | ||
15985 | EOM | |
15986 | fi | |
15987 | if $test -f config.msg; then | |
15988 | echo "Hmm. I also noted the following information while running:" | |
15989 | echo " " | |
15990 | $cat config.msg >&4 | |
15991 | $rm -f config.msg | |
15992 | fi | |
15993 | $rm -f kit*isdone ark*isdone | |
15994 | $rm -rf UU | |
15995 | ||
15996 | : End of Configure | |
15997 |