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 | |
17 | # comp.sources.misc so you may fetch it yourself from your nearest | |
18 | # archive site. Check with Archie if you don't know where that can be.) | |
19 | # | |
20 | ||
8e07c86e | 21 | # $Id: Head.U,v 3.0.1.8 1995/07/25 13:40:02 ram Exp $ |
2304df62 | 22 | # |
24fef2a7 | 23 | # Generated on Sat Feb 1 00:26:40 EST 1997 [metaconfig 3.0 PL60] |
2304df62 AD |
24 | |
25 | cat >/tmp/c1$$ <<EOF | |
26 | ARGGGHHHH!!!!! | |
27 | ||
28 | SCO csh still thinks true is false. Write to SCO today and tell them that next | |
29 | year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-) | |
30 | ||
31 | (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All | |
32 | we'd have to do is go in and swap the && and || tokens, wherever they are.) | |
33 | ||
34 | [End of diatribe. We now return you to your regularly scheduled programming...] | |
35 | EOF | |
36 | cat >/tmp/c2$$ <<EOF | |
37 | ||
38 | OOPS! You naughty creature! You didn't run Configure with sh! | |
39 | I will attempt to remedy the situation by running sh for you... | |
40 | EOF | |
41 | ||
42 | true || cat /tmp/c1$$ /tmp/c2$$ | |
43 | true || exec sh $0 $argv:q | |
44 | ||
45 | (exit $?0) || cat /tmp/c2$$ | |
46 | (exit $?0) || exec sh $0 $argv:q | |
47 | rm -f /tmp/c1$$ /tmp/c2$$ | |
48 | ||
a0d0e21e LW |
49 | : compute my invocation name |
50 | me=$0 | |
51 | case "$0" in | |
52 | */*) | |
53 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` | |
54 | test "$me" || me=$0 | |
55 | ;; | |
56 | esac | |
57 | ||
8e07c86e AD |
58 | : Proper PATH separator |
59 | p_=: | |
60 | : On OS/2 this directory should exist if this is not floppy only system :-] | |
4b40f7a3 | 61 | if test -d c:/. -a -n "$OS2_SHELL"; then |
8e07c86e AD |
62 | p_=\; |
63 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` | |
64 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` | |
65 | fi | |
a0d0e21e LW |
66 | |
67 | : Proper PATH setting | |
68 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' | |
16d20bd9 | 69 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
232e078e | 70 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
16d20bd9 | 71 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
232e078e AD |
72 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
73 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" | |
74 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" | |
75 | paths="$paths /sbin /usr/sbin /usr/libexec" | |
a0d0e21e LW |
76 | |
77 | for p in $paths | |
78 | do | |
8e07c86e AD |
79 | case "$p_$PATH$p_" in |
80 | *$p_$p$p_*) ;; | |
81 | *) test -d $p && PATH=$PATH$p_$p ;; | |
a0d0e21e LW |
82 | esac |
83 | done | |
84 | ||
8e07c86e | 85 | PATH=.$p_$PATH |
2304df62 AD |
86 | export PATH |
87 | ||
3c321fdc | 88 | : This should not matter in a script, but apparently it does sometimes |
89 | unset CDPATH | |
90 | ||
a0d0e21e | 91 | : Sanity checks |
2304df62 | 92 | if test ! -t 0; then |
a0d0e21e | 93 | echo "Say 'sh $me', not 'sh <$me'" |
2304df62 AD |
94 | exit 1 |
95 | fi | |
96 | ||
ff0cee69 | 97 | : Test and see if we are running under ksh, either blatantly or in disguise. |
98 | if (PATH=.; alias -x) >/dev/null 2>&1; then | |
99 | : running under ksh. Is this a good thing? | |
100 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname ; then | |
101 | if test X`/usr/bin/uname -v` = X4 ; then | |
102 | : on AIX 4, /bin/sh is really ksh, and it causes us problems. | |
103 | : Avoid it | |
2304df62 | 104 | cat <<'EOM' |
ff0cee69 | 105 | (Feeding myself to /usr/bin/bsh to avoid AIX 4's /bin/sh.) |
2304df62 | 106 | EOM |
ecfc5424 | 107 | unset ENV |
ff0cee69 | 108 | exec /usr/bin/bsh $0 "$@" |
2304df62 | 109 | fi |
ff0cee69 | 110 | else |
111 | if test ! -f /hp-ux ; then | |
2304df62 | 112 | : Warn them if they use ksh on other systems |
a0d0e21e LW |
113 | cat <<EOM |
114 | (I see you are using the Korn shell. Some ksh's blow up on $me, | |
8ff267be | 115 | especially on older exotic systems. If yours does, try the Bourne |
116 | shell instead.) | |
2304df62 | 117 | EOM |
ff0cee69 | 118 | fi |
119 | fi | |
120 | else | |
121 | : Not running under ksh. Maybe we should be? | |
122 | : On HP-UX, large Configure scripts may exercise a bug in /bin/sh | |
123 | if test -f /hp-ux -a -f /bin/ksh; then | |
124 | cat <<'EOM' | |
125 | (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.) | |
126 | EOM | |
127 | unset ENV | |
128 | exec /bin/ksh $0 "$@" | |
129 | fi | |
2304df62 AD |
130 | fi |
131 | ||
132 | : Configure runs within the UU subdirectory | |
133 | test -d UU || mkdir UU | |
8e07c86e | 134 | cd UU && rm -f ./* |
2304df62 | 135 | |
a0d0e21e | 136 | dynamic_ext='' |
2304df62 | 137 | extensions='' |
a0d0e21e LW |
138 | known_extensions='' |
139 | static_ext='' | |
8ff267be | 140 | useopcode='' |
a0d0e21e | 141 | useposix='' |
ecfc5424 | 142 | d_bsd='' |
40a7a20a | 143 | d_eunice='' |
2304df62 AD |
144 | d_xenix='' |
145 | eunicefix='' | |
146 | Mcc='' | |
147 | awk='' | |
148 | bash='' | |
149 | bison='' | |
150 | byacc='' | |
151 | cat='' | |
152 | chgrp='' | |
153 | chmod='' | |
154 | chown='' | |
ecfc5424 | 155 | comm='' |
2304df62 AD |
156 | compress='' |
157 | cp='' | |
158 | cpio='' | |
159 | cpp='' | |
160 | csh='' | |
161 | date='' | |
162 | echo='' | |
163 | egrep='' | |
164 | emacs='' | |
165 | expr='' | |
166 | find='' | |
167 | flex='' | |
168 | gcc='' | |
169 | grep='' | |
8ff267be | 170 | gzip='' |
2304df62 AD |
171 | inews='' |
172 | ksh='' | |
173 | less='' | |
174 | line='' | |
175 | lint='' | |
176 | ln='' | |
177 | lp='' | |
178 | lpr='' | |
179 | ls='' | |
180 | mail='' | |
181 | mailx='' | |
2304df62 AD |
182 | mkdir='' |
183 | more='' | |
184 | mv='' | |
185 | nroff='' | |
186 | perl='' | |
187 | pg='' | |
188 | pmake='' | |
189 | pr='' | |
190 | rm='' | |
191 | rmail='' | |
192 | sed='' | |
193 | sendmail='' | |
2304df62 AD |
194 | shar='' |
195 | sleep='' | |
196 | smail='' | |
197 | sort='' | |
198 | submit='' | |
199 | tail='' | |
200 | tar='' | |
201 | tbl='' | |
202 | test='' | |
203 | touch='' | |
204 | tr='' | |
205 | troff='' | |
206 | uname='' | |
207 | uniq='' | |
208 | uuname='' | |
209 | vi='' | |
210 | zcat='' | |
8ff267be | 211 | zip='' |
1aef975c | 212 | full_sed='' |
a0d0e21e | 213 | libswanted='' |
2304df62 AD |
214 | hint='' |
215 | myuname='' | |
85e6fe83 LW |
216 | osname='' |
217 | osvers='' | |
2304df62 AD |
218 | Author='' |
219 | Date='' | |
220 | Header='' | |
221 | Id='' | |
222 | Locker='' | |
223 | Log='' | |
224 | RCSfile='' | |
225 | Revision='' | |
226 | Source='' | |
227 | State='' | |
4633a7c4 LW |
228 | ar='' |
229 | archobjs='' | |
230 | exe_ext='' | |
231 | firstmakefile='' | |
232 | lib_ext='' | |
233 | obj_ext='' | |
234 | path_sep='' | |
2304df62 | 235 | afs='' |
a0d0e21e LW |
236 | alignbytes='' |
237 | archlib='' | |
238 | archlibexp='' | |
a0d0e21e LW |
239 | d_archlib='' |
240 | installarchlib='' | |
40000a8c AD |
241 | archname='' |
242 | myarchname='' | |
ecfc5424 | 243 | baserev='' |
2304df62 AD |
244 | bin='' |
245 | binexp='' | |
246 | installbin='' | |
5f05dabc | 247 | bincompat3='' |
248 | d_bincompat3='' | |
2304df62 AD |
249 | byteorder='' |
250 | cc='' | |
251 | gccversion='' | |
252 | ccflags='' | |
253 | cppflags='' | |
254 | ldflags='' | |
255 | lkflags='' | |
8e07c86e | 256 | locincpth='' |
2304df62 | 257 | optimize='' |
8e07c86e | 258 | cf_email='' |
2304df62 AD |
259 | cf_by='' |
260 | cf_time='' | |
261 | contains='' | |
a0d0e21e | 262 | cpp_stuff='' |
2304df62 AD |
263 | cpplast='' |
264 | cppminus='' | |
265 | cpprun='' | |
266 | cppstdin='' | |
267 | d_access='' | |
a0d0e21e | 268 | d_alarm='' |
ecfc5424 | 269 | d_attribut='' |
2304df62 AD |
270 | d_bcmp='' |
271 | d_bcopy='' | |
272 | d_bzero='' | |
273 | d_casti32='' | |
274 | castflags='' | |
275 | d_castneg='' | |
a0d0e21e LW |
276 | d_chown='' |
277 | d_chroot='' | |
2304df62 | 278 | d_chsize='' |
a0d0e21e LW |
279 | d_closedir='' |
280 | d_void_closedir='' | |
2304df62 AD |
281 | d_const='' |
282 | cryptlib='' | |
283 | d_crypt='' | |
284 | d_csh='' | |
1aef975c | 285 | full_csh='' |
a0d0e21e LW |
286 | d_cuserid='' |
287 | d_dbl_dig='' | |
288 | d_difftime='' | |
289 | d_dlerror='' | |
290 | d_dlopen='' | |
291 | d_dlsymun='' | |
2304df62 | 292 | d_dosuid='' |
a0d0e21e | 293 | d_suidsafe='' |
2304df62 AD |
294 | d_dup2='' |
295 | d_fchmod='' | |
296 | d_fchown='' | |
297 | d_fcntl='' | |
a0d0e21e LW |
298 | d_fd_macros='' |
299 | d_fd_set='' | |
300 | d_fds_bits='' | |
301 | d_fgetpos='' | |
2304df62 AD |
302 | d_flexfnam='' |
303 | d_flock='' | |
a0d0e21e LW |
304 | d_fork='' |
305 | d_fsetpos='' | |
5f05dabc | 306 | d_ftime='' |
307 | d_gettimeod='' | |
a0d0e21e | 308 | d_Gconvert='' |
2304df62 | 309 | d_getgrps='' |
5cd24f17 | 310 | d_setgrps='' |
2304df62 AD |
311 | d_gethent='' |
312 | aphostname='' | |
313 | d_gethname='' | |
314 | d_phostname='' | |
315 | d_uname='' | |
a0d0e21e | 316 | d_getlogin='' |
2afac517 | 317 | d_getpgid='' |
2304df62 | 318 | d_getpgrp2='' |
2afac517 | 319 | d_bsdgetpgrp='' |
2304df62 | 320 | d_getpgrp='' |
a0d0e21e | 321 | d_getppid='' |
2304df62 | 322 | d_getprior='' |
a4f3eea9 | 323 | d_gnulibc='' |
2304df62 | 324 | d_htonl='' |
7e1af8bc | 325 | d_inetaton='' |
2304df62 AD |
326 | d_isascii='' |
327 | d_killpg='' | |
328 | d_link='' | |
a0d0e21e LW |
329 | d_locconv='' |
330 | d_lockf='' | |
2304df62 | 331 | d_lstat='' |
a0d0e21e LW |
332 | d_mblen='' |
333 | d_mbstowcs='' | |
334 | d_mbtowc='' | |
2304df62 AD |
335 | d_memcmp='' |
336 | d_memcpy='' | |
337 | d_memmove='' | |
338 | d_memset='' | |
339 | d_mkdir='' | |
a0d0e21e LW |
340 | d_mkfifo='' |
341 | d_mktime='' | |
2304df62 AD |
342 | d_msg='' |
343 | d_msgctl='' | |
344 | d_msgget='' | |
345 | d_msgrcv='' | |
346 | d_msgsnd='' | |
a0d0e21e | 347 | d_nice='' |
2304df62 | 348 | d_open3='' |
a0d0e21e LW |
349 | d_fpathconf='' |
350 | d_pathconf='' | |
351 | d_pause='' | |
352 | d_pipe='' | |
8e07c86e | 353 | d_poll='' |
2304df62 AD |
354 | d_portable='' |
355 | d_readdir='' | |
85e6fe83 LW |
356 | d_rewinddir='' |
357 | d_seekdir='' | |
358 | d_telldir='' | |
a0d0e21e | 359 | d_readlink='' |
2304df62 AD |
360 | d_rename='' |
361 | d_rmdir='' | |
362 | d_safebcpy='' | |
363 | d_safemcpy='' | |
36477c24 | 364 | d_sanemcmp='' |
2304df62 AD |
365 | d_select='' |
366 | d_sem='' | |
367 | d_semctl='' | |
368 | d_semget='' | |
369 | d_semop='' | |
370 | d_setegid='' | |
371 | d_seteuid='' | |
a0d0e21e | 372 | d_setlinebuf='' |
2304df62 AD |
373 | d_setlocale='' |
374 | d_setpgid='' | |
375 | d_setpgrp2='' | |
376 | d_bsdpgrp='' | |
2afac517 | 377 | d_bsdsetpgrp='' |
2304df62 AD |
378 | d_setpgrp='' |
379 | d_setprior='' | |
380 | d_setregid='' | |
381 | d_setresgid='' | |
382 | d_setresuid='' | |
383 | d_setreuid='' | |
384 | d_setrgid='' | |
385 | d_setruid='' | |
386 | d_setsid='' | |
760ac839 | 387 | d_sfio='' |
8ff267be | 388 | usesfio='' |
2304df62 AD |
389 | d_shm='' |
390 | d_shmat='' | |
a0d0e21e LW |
391 | d_shmatprototype='' |
392 | shmattype='' | |
2304df62 AD |
393 | d_shmctl='' |
394 | d_shmdt='' | |
395 | d_shmget='' | |
2c7991dc | 396 | d_sigaction='' |
8ff267be | 397 | d_sigsetjmp='' |
2304df62 AD |
398 | d_oldsock='' |
399 | d_socket='' | |
400 | d_sockpair='' | |
401 | sockethdr='' | |
402 | socketlib='' | |
403 | d_statblks='' | |
c2960299 AD |
404 | d_stdio_cnt_lval='' |
405 | d_stdio_ptr_lval='' | |
16d20bd9 | 406 | d_stdiobase='' |
2304df62 | 407 | d_stdstdio='' |
16d20bd9 AD |
408 | stdio_base='' |
409 | stdio_bufsiz='' | |
410 | stdio_cnt='' | |
411 | stdio_ptr='' | |
2304df62 AD |
412 | d_index='' |
413 | d_strchr='' | |
a0d0e21e | 414 | d_strcoll='' |
2304df62 AD |
415 | d_strctcpy='' |
416 | d_strerrm='' | |
417 | d_strerror='' | |
418 | d_sysernlst='' | |
419 | d_syserrlst='' | |
a89d8a78 DH |
420 | d_strtod='' |
421 | d_strtol='' | |
422 | d_strtoul='' | |
a0d0e21e | 423 | d_strxfrm='' |
2304df62 AD |
424 | d_symlink='' |
425 | d_syscall='' | |
a0d0e21e | 426 | d_sysconf='' |
2304df62 | 427 | d_system='' |
a0d0e21e LW |
428 | d_tcgetpgrp='' |
429 | d_tcsetpgrp='' | |
85e6fe83 LW |
430 | d_time='' |
431 | timetype='' | |
2304df62 AD |
432 | clocktype='' |
433 | d_times='' | |
434 | d_truncate='' | |
a0d0e21e LW |
435 | d_tzname='' |
436 | d_umask='' | |
2304df62 | 437 | d_vfork='' |
a0d0e21e | 438 | usevfork='' |
2304df62 AD |
439 | d_voidsig='' |
440 | signal_t='' | |
441 | d_volatile='' | |
442 | d_charvspr='' | |
443 | d_vprintf='' | |
444 | d_wait4='' | |
445 | d_waitpid='' | |
a0d0e21e LW |
446 | d_wcstombs='' |
447 | d_wctomb='' | |
448 | dlext='' | |
85e6fe83 LW |
449 | cccdlflags='' |
450 | ccdlflags='' | |
2304df62 | 451 | dlsrc='' |
232e078e | 452 | ld='' |
85e6fe83 | 453 | lddlflags='' |
2304df62 | 454 | usedl='' |
a0d0e21e | 455 | fpostype='' |
2304df62 AD |
456 | gidtype='' |
457 | groupstype='' | |
458 | h_fcntl='' | |
459 | h_sysfile='' | |
ecfc5424 AD |
460 | db_hashtype='' |
461 | db_prefixtype='' | |
a0d0e21e | 462 | i_db='' |
2304df62 | 463 | i_dbm='' |
8e07c86e | 464 | i_rpcsvcdbm='' |
2304df62 | 465 | d_dirnamlen='' |
a0d0e21e | 466 | direntrytype='' |
2304df62 | 467 | i_dirent='' |
a0d0e21e | 468 | i_dld='' |
2304df62 AD |
469 | i_dlfcn='' |
470 | i_fcntl='' | |
a0d0e21e | 471 | i_float='' |
2304df62 AD |
472 | i_gdbm='' |
473 | i_grp='' | |
a0d0e21e | 474 | i_limits='' |
4633a7c4 | 475 | i_locale='' |
a0d0e21e LW |
476 | i_malloc='' |
477 | i_math='' | |
85e6fe83 | 478 | i_memory='' |
2304df62 | 479 | i_ndbm='' |
85e6fe83 | 480 | i_neterrno='' |
2304df62 AD |
481 | i_niin='' |
482 | i_sysin='' | |
483 | d_pwage='' | |
484 | d_pwchange='' | |
485 | d_pwclass='' | |
486 | d_pwcomment='' | |
487 | d_pwexpire='' | |
488 | d_pwquota='' | |
489 | i_pwd='' | |
760ac839 | 490 | i_sfio='' |
2304df62 | 491 | i_stddef='' |
a0d0e21e | 492 | i_stdlib='' |
2304df62 AD |
493 | i_string='' |
494 | strings='' | |
495 | i_sysdir='' | |
496 | i_sysfile='' | |
497 | d_voidtty='' | |
498 | i_bsdioctl='' | |
a0d0e21e | 499 | i_sysfilio='' |
2304df62 AD |
500 | i_sysioctl='' |
501 | i_syssockio='' | |
502 | i_sysndir='' | |
a0d0e21e | 503 | i_sysparam='' |
8ff267be | 504 | i_sysresrc='' |
2304df62 | 505 | i_sysselct='' |
1aef975c | 506 | i_sysstat='' |
a0d0e21e | 507 | i_systimes='' |
fed7345c | 508 | i_systypes='' |
25f94b33 | 509 | i_sysun='' |
8ff267be | 510 | i_syswait='' |
2304df62 AD |
511 | i_sgtty='' |
512 | i_termio='' | |
513 | i_termios='' | |
514 | i_systime='' | |
515 | i_systimek='' | |
516 | i_time='' | |
517 | timeincl='' | |
85e6fe83 | 518 | i_unistd='' |
2304df62 | 519 | i_utime='' |
760ac839 | 520 | i_values='' |
a0d0e21e | 521 | i_stdarg='' |
2304df62 AD |
522 | i_varargs='' |
523 | i_varhdr='' | |
524 | i_vfork='' | |
525 | intsize='' | |
24fef2a7 AD |
526 | longsize='' |
527 | shortsize='' | |
2304df62 | 528 | libc='' |
8ff267be | 529 | libperl='' |
2afac517 | 530 | shrpenv='' |
8ff267be | 531 | useshrplib='' |
a0d0e21e | 532 | glibpth='' |
2304df62 | 533 | libpth='' |
8e07c86e | 534 | loclibpth='' |
2304df62 AD |
535 | plibpth='' |
536 | xlibpth='' | |
537 | libs='' | |
85e6fe83 LW |
538 | lns='' |
539 | lseektype='' | |
8ff267be | 540 | make='' |
541 | make_set_make='' | |
85e6fe83 | 542 | d_mymalloc='' |
94b6baf5 | 543 | freetype='' |
2304df62 AD |
544 | mallocobj='' |
545 | mallocsrc='' | |
546 | malloctype='' | |
547 | usemymalloc='' | |
16d20bd9 AD |
548 | installman1dir='' |
549 | man1dir='' | |
550 | man1direxp='' | |
551 | man1ext='' | |
552 | installman3dir='' | |
553 | man3dir='' | |
554 | man3direxp='' | |
555 | man3ext='' | |
2304df62 AD |
556 | huge='' |
557 | large='' | |
558 | medium='' | |
559 | models='' | |
560 | small='' | |
561 | split='' | |
a0d0e21e | 562 | modetype='' |
2304df62 AD |
563 | mydomain='' |
564 | myhostname='' | |
565 | phostname='' | |
566 | c='' | |
567 | n='' | |
8e07c86e AD |
568 | d_eofnblk='' |
569 | eagain='' | |
570 | o_nonblock='' | |
571 | rd_nodata='' | |
2304df62 AD |
572 | groupcat='' |
573 | hostcat='' | |
574 | passcat='' | |
4633a7c4 LW |
575 | d_oldarchlib='' |
576 | oldarchlib='' | |
577 | oldarchlibexp='' | |
85e6fe83 LW |
578 | orderlib='' |
579 | ranlib='' | |
2304df62 AD |
580 | package='' |
581 | spackage='' | |
2c7991dc | 582 | pager='' |
ecfc5424 | 583 | patchlevel='' |
760ac839 | 584 | subversion='' |
8e07c86e | 585 | perladmin='' |
4633a7c4 | 586 | perlpath='' |
a0d0e21e | 587 | prefix='' |
1aef975c | 588 | prefixexp='' |
2304df62 AD |
589 | installprivlib='' |
590 | privlib='' | |
591 | privlibexp='' | |
592 | prototype='' | |
593 | randbits='' | |
594 | installscript='' | |
595 | scriptdir='' | |
596 | scriptdirexp='' | |
a0d0e21e | 597 | selecttype='' |
8ff267be | 598 | sh='' |
2304df62 | 599 | sig_name='' |
8e07c86e | 600 | sig_num='' |
4633a7c4 LW |
601 | installsitearch='' |
602 | sitearch='' | |
603 | sitearchexp='' | |
25f94b33 AD |
604 | installsitelib='' |
605 | sitelib='' | |
606 | sitelibexp='' | |
a0d0e21e LW |
607 | sizetype='' |
608 | so='' | |
2304df62 AD |
609 | sharpbang='' |
610 | shsharp='' | |
611 | spitshell='' | |
a0d0e21e | 612 | ssizetype='' |
4633a7c4 | 613 | startperl='' |
2304df62 AD |
614 | startsh='' |
615 | stdchar='' | |
616 | sysman='' | |
617 | uidtype='' | |
618 | nm_opt='' | |
40a7a20a | 619 | nm_so_opt='' |
2304df62 AD |
620 | runnm='' |
621 | usenm='' | |
8ff267be | 622 | useperlio='' |
2304df62 AD |
623 | incpath='' |
624 | mips='' | |
625 | mips_type='' | |
626 | usrinc='' | |
627 | defvoidused='' | |
628 | voidflags='' | |
2304df62 AD |
629 | CONFIG='' |
630 | ||
ecfc5424 AD |
631 | define='define' |
632 | undef='undef' | |
633 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' | |
634 | rmlist='' | |
635 | ||
636 | : We must find out about Eunice early | |
637 | eunicefix=':' | |
638 | if test -f /etc/unixtovms; then | |
639 | eunicefix=/etc/unixtovms | |
640 | fi | |
641 | if test -f /etc/unixtovms.exe; then | |
642 | eunicefix=/etc/unixtovms.exe | |
643 | fi | |
644 | ||
645 | : list of known cpp symbols, sorted alphabetically | |
646 | al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2" | |
647 | al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH" | |
648 | al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" | |
649 | al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" | |
650 | al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" | |
651 | al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" | |
652 | al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4" | |
653 | al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" | |
654 | al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" | |
655 | al="$al VMS Xenix286" | |
656 | al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI" | |
657 | al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET" | |
658 | al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" | |
659 | al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" | |
660 | al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" | |
661 | al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" | |
662 | al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" | |
663 | al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" | |
664 | al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" | |
665 | al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" | |
666 | al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" | |
667 | al="$al __SVR4_2__ __UMAXV__" | |
668 | al="$al ____386BSD____ __alpha __alpha__ __amiga" | |
669 | al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" | |
670 | al="$al __host_mips__" | |
671 | al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" | |
672 | al="$al __hp9000s500 __hp9000s700 __hp9000s800" | |
673 | al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" | |
674 | al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" | |
675 | al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" | |
676 | al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" | |
677 | al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" | |
678 | al="$al __mc88100 __mc88100__ __mips __mips__" | |
679 | al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" | |
680 | al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" | |
681 | al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" | |
682 | al="$al _host_mips _mips _unix" | |
683 | al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" | |
684 | al="$al apollo ardent att386 att3b" | |
685 | al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" | |
686 | al="$al cadmus clipper concurrent convex cray ctix" | |
687 | al="$al dmert encore gcos gcx gimpel gould" | |
688 | al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" | |
689 | al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" | |
690 | al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" | |
691 | al="$al i186 i286 i386 i486 i8086" | |
692 | al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" | |
693 | al="$al ksr1 linux luna luna88k m68k m88100 m88k" | |
694 | al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" | |
695 | al="$al mc68040 mc68060 mc68k mc68k32 mc700" | |
696 | al="$al mc88000 mc88100 merlin mert mips mvs n16" | |
697 | al="$al ncl_el ncl_mr" | |
698 | al="$al news1500 news1700 news1800 news1900 news3700" | |
699 | al="$al news700 news800 news900 ns16000 ns32000" | |
700 | al="$al ns32016 ns32332 ns32k nsc32000 os osf" | |
701 | al="$al parisc pc532 pdp11 plexus posix pyr" | |
702 | al="$al riscix riscos scs sequent sgi sinix sony sony_news" | |
703 | al="$al sonyrisc sparc sparclite spectrum stardent stratos" | |
704 | al="$al sun sun3 sun386 svr4 sysV68 sysV88" | |
705 | al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" | |
706 | al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" | |
707 | al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms" | |
708 | al="$al xenix z8000" | |
709 | ||
ecfc5424 AD |
710 | groupstype='' |
711 | i_whoami='' | |
8e07c86e AD |
712 | : default library list |
713 | libswanted='' | |
714 | : set useposix=false in your hint file to disable the POSIX extension. | |
715 | useposix=true | |
8ff267be | 716 | : set useopcode=false in your hint file to disable the Opcode extension. |
717 | useopcode=true | |
40a7a20a | 718 | : Define several unixisms. These can be used in hint files. |
25f94b33 AD |
719 | exe_ext='' |
720 | : Extra object files, if any, needed on this platform. | |
721 | archobjs='' | |
8e07c86e | 722 | : Possible local include directories to search. |
25f94b33 | 723 | : Set locincpth to "" in a hint file to defeat local include searches. |
8e07c86e AD |
724 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
725 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" | |
726 | : | |
727 | : no include file wanted by default | |
728 | inclwanted='' | |
729 | ||
ecfc5424 AD |
730 | : change the next line if compiling for Xenix/286 on Xenix/386 |
731 | xlibpth='/usr/lib/386 /lib/386' | |
732 | ||
8e07c86e AD |
733 | : Possible local library directories to search. |
734 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
735 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
736 | ||
ecfc5424 | 737 | : general looking path for locating libraries |
4b40f7a3 SV |
738 | glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large" |
739 | glibpth="$glibpth /lib /usr/lib $xlibpth" | |
740 | glibpth="$glibpth /lib/large /usr/lib/small /lib/small" | |
741 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" | |
ecfc5424 AD |
742 | |
743 | : Private path used by Configure to find libraries. Its value | |
744 | : is prepended to libpth. This variable takes care of special | |
745 | : machines, like the mips. Usually, it should be empty. | |
746 | plibpth='' | |
747 | ||
ecfc5424 AD |
748 | : full support for void wanted by default |
749 | defvoidused=15 | |
750 | ||
ecfc5424 | 751 | : List of libraries we want. |
760ac839 | 752 | libswanted='sfio net socket inet nsl nm ndbm gdbm dbm db malloc dl' |
ecfc5424 AD |
753 | libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" |
754 | libswanted="$libswanted ucb bsd BSD PW x" | |
1aef975c | 755 | : We probably want to search /usr/shlib before most other libraries. |
94b6baf5 | 756 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
ecfc5424 AD |
757 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
758 | glibpth="/usr/shlib $glibpth" | |
759 | : Do not use vfork unless overridden by a hint file. | |
760 | usevfork=false | |
761 | ||
8ff267be | 762 | : Find the basic shell for Bourne shell scripts |
763 | case "$sh" in | |
764 | '') | |
765 | : SYSTYPE is for some older MIPS systems. | |
766 | : I do not know if it is still needed. | |
767 | case "$SYSTYPE" in | |
768 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; | |
769 | *) xxx='/bin/sh';; | |
770 | esac | |
771 | if test -f "$xxx"; then | |
772 | sh="$xxx" | |
773 | else | |
774 | : Build up a list and do a single loop so we can 'break' out. | |
775 | pth=`echo $PATH | sed -e "s/$p_/ /g"` | |
776 | for xxx in sh bash ksh pdksh ash; do | |
777 | for p in $pth; do | |
778 | try="$try ${p}/${xxx}" | |
779 | done | |
780 | done | |
781 | for xxx in $try; do | |
782 | if test -f "$xxx"; then | |
783 | sh="$xxx"; | |
784 | echo "Your Bourne shell appears to be in $sh." | |
785 | break | |
786 | elif test -f "$xxx.exe"; then | |
787 | sh="$xxx"; | |
788 | echo "Hmm. Your Bourne shell appears to be in $sh." | |
789 | break | |
790 | fi | |
791 | done | |
792 | fi | |
793 | ;; | |
794 | esac | |
795 | ||
796 | case "$sh" in | |
797 | '') cat <<EOM >&2 | |
798 | $me: Fatal Error: I can't find a Bourne Shell anywhere. | |
799 | Usually it's in /bin/sh. How did you even get this far? | |
284c50cc | 800 | Please contact me (Chip Salzenberg) at chip@perl.com and |
8ff267be | 801 | we'll try to straigten this all out. |
802 | EOM | |
803 | exit 1 | |
804 | ;; | |
805 | esac | |
806 | ||
760ac839 | 807 | : see if sh knows # comments |
8ff267be | 808 | if `$sh -c '#' >/dev/null 2>&1`; then |
760ac839 LW |
809 | shsharp=true |
810 | spitshell=cat | |
811 | echo " " | |
760ac839 LW |
812 | xcat=/bin/cat |
813 | test -f $xcat || xcat=/usr/bin/cat | |
814 | echo "#!$xcat" >try | |
815 | $eunicefix try | |
816 | chmod +x try | |
817 | ./try > today | |
818 | if test -s today; then | |
760ac839 LW |
819 | sharpbang='#!' |
820 | else | |
821 | echo "#! $xcat" > try | |
822 | $eunicefix try | |
823 | chmod +x try | |
824 | ./try > today | |
825 | if test -s today; then | |
760ac839 LW |
826 | sharpbang='#! ' |
827 | else | |
8ff267be | 828 | echo "Okay, let's see if #! works on this system..." |
760ac839 LW |
829 | echo "It's just a comment." |
830 | sharpbang=': use ' | |
831 | fi | |
832 | fi | |
833 | else | |
8ff267be | 834 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
760ac839 LW |
835 | shsharp=false |
836 | cd .. | |
837 | echo "exec grep -v '^[ ]*#'" >spitshell | |
838 | chmod +x spitshell | |
839 | $eunicefix spitshell | |
840 | spitshell=`pwd`/spitshell | |
841 | cd UU | |
842 | echo "I presume that if # doesn't work, #! won't work either!" | |
843 | sharpbang=': use ' | |
844 | fi | |
845 | rm -f try today | |
846 | ||
847 | : figure out how to guarantee sh startup | |
8ff267be | 848 | case "$startsh" in |
849 | '') startsh=${sharpbang}${sh} ;; | |
850 | *) | |
760ac839 | 851 | esac |
760ac839 LW |
852 | cat >try <<EOSS |
853 | $startsh | |
854 | set abc | |
855 | test "$?abc" != 1 | |
856 | EOSS | |
857 | ||
858 | chmod +x try | |
859 | $eunicefix try | |
860 | if ./try; then | |
8ff267be | 861 | : echo "Yup, it does." |
760ac839 | 862 | else |
8ff267be | 863 | echo "Hmm. '$startsh' didn't work." |
864 | echo "You may have to fix up the shell scripts to make sure sh runs them." | |
760ac839 LW |
865 | fi |
866 | rm -f try | |
867 | ||
2304df62 | 868 | : script used to extract .SH files with variable substitutions |
760ac839 LW |
869 | cat >extract <<EOS |
870 | $startsh | |
871 | EOS | |
872 | cat >>extract <<'EOS' | |
2304df62 AD |
873 | CONFIG=true |
874 | echo "Doing variable substitutions on .SH files..." | |
875 | if test -f MANIFEST; then | |
5f05dabc | 876 | shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'` |
a0d0e21e LW |
877 | : Pick up possible extension manifests. |
878 | for dir in ext/* ; do | |
879 | if test -f $dir/MANIFEST; then | |
5f05dabc | 880 | xxx=`awk '{print $1}' < $dir/MANIFEST | |
a0d0e21e LW |
881 | sed -n "/\.SH$/ s@^@$dir/@p"` |
882 | shlist="$shlist $xxx" | |
883 | fi | |
884 | done | |
885 | set x $shlist | |
2304df62 AD |
886 | else |
887 | echo "(Looking for .SH files under the current directory.)" | |
5f05dabc | 888 | set x `find . -name "*.SH" -print` |
2304df62 AD |
889 | fi |
890 | shift | |
891 | case $# in | |
892 | 0) set x *.SH; shift;; | |
893 | esac | |
894 | if test ! -f $1; then | |
895 | shift | |
896 | fi | |
897 | for file in $*; do | |
898 | case "$file" in | |
899 | */*) | |
900 | dir=`expr X$file : 'X\(.*\)/'` | |
901 | file=`expr X$file : 'X.*/\(.*\)'` | |
902 | (cd $dir && . ./$file) | |
903 | ;; | |
904 | *) | |
905 | . ./$file | |
906 | ;; | |
907 | esac | |
908 | done | |
909 | if test -f config_h.SH; then | |
910 | if test ! -f config.h; then | |
911 | : oops, they left it out of MANIFEST, probably, so do it anyway. | |
912 | . ./config_h.SH | |
913 | fi | |
914 | fi | |
915 | EOS | |
916 | ||
917 | : produce awk script to parse command line options | |
918 | cat >options.awk <<'EOF' | |
919 | BEGIN { | |
16d20bd9 | 920 | optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification |
2304df62 AD |
921 | |
922 | len = length(optstr); | |
923 | for (i = 1; i <= len; i++) { | |
924 | c = substr(optstr, i, 1); | |
925 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; | |
926 | if (a == ":") { | |
927 | arg[c] = 1; | |
928 | i++; | |
929 | } | |
930 | opt[c] = 1; | |
931 | } | |
932 | } | |
933 | { | |
934 | expect = 0; | |
935 | str = $0; | |
936 | if (substr(str, 1, 1) != "-") { | |
937 | printf("'%s'\n", str); | |
938 | next; | |
939 | } | |
940 | len = length($0); | |
941 | for (i = 2; i <= len; i++) { | |
942 | c = substr(str, i, 1); | |
943 | if (!opt[c]) { | |
944 | printf("-%s\n", substr(str, i)); | |
945 | next; | |
946 | } | |
947 | printf("-%s\n", c); | |
948 | if (arg[c]) { | |
949 | if (i < len) | |
950 | printf("'%s'\n", substr(str, i + 1)); | |
951 | else | |
952 | expect = 1; | |
953 | next; | |
954 | } | |
955 | } | |
956 | } | |
957 | END { | |
958 | if (expect) | |
959 | print "?"; | |
960 | } | |
961 | EOF | |
962 | ||
963 | : process the command line options | |
4633a7c4 LW |
964 | set X `for arg in "$@"; do echo "X$arg"; done | |
965 | sed -e s/X// | awk -f options.awk` | |
2304df62 AD |
966 | eval "set $*" |
967 | shift | |
968 | rm -f options.awk | |
969 | ||
970 | : set up default values | |
971 | fastread='' | |
972 | reuseval=false | |
973 | config_sh='' | |
974 | alldone='' | |
975 | error='' | |
976 | silent='' | |
977 | extractsh='' | |
ecfc5424 | 978 | override='' |
16d20bd9 | 979 | knowitall='' |
28757baa | 980 | |
1aef975c | 981 | rm -f optdef.sh |
28757baa | 982 | cat >optdef.sh <<EOS |
983 | $startsh | |
984 | EOS | |
2304df62 AD |
985 | |
986 | : option parsing | |
987 | while test $# -gt 0; do | |
988 | case "$1" in | |
989 | -d) shift; fastread=yes;; | |
990 | -e) shift; alldone=cont;; | |
991 | -f) | |
992 | shift | |
993 | cd .. | |
994 | if test -r "$1"; then | |
995 | config_sh="$1" | |
996 | else | |
a0d0e21e | 997 | echo "$me: cannot read config file $1." >&2 |
2304df62 AD |
998 | error=true |
999 | fi | |
1000 | cd UU | |
1001 | shift;; | |
1002 | -h) shift; error=true;; | |
1003 | -r) shift; reuseval=true;; | |
1004 | -s) shift; silent=true;; | |
1005 | -E) shift; alldone=exit;; | |
16d20bd9 | 1006 | -K) shift; knowitall=true;; |
ecfc5424 | 1007 | -O) shift; override=true;; |
2304df62 | 1008 | -S) shift; extractsh=true;; |
a0d0e21e LW |
1009 | -D) |
1010 | shift | |
1011 | case "$1" in | |
1012 | *=) | |
1013 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 | |
1014 | echo "$me: ignoring -D $1" >&2 | |
1015 | ;; | |
ecfc5424 | 1016 | *=*) echo "$1" | \ |
1aef975c AD |
1017 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
1018 | *) echo "$1='define'" >> optdef.sh;; | |
a0d0e21e LW |
1019 | esac |
1020 | shift | |
1021 | ;; | |
1022 | -U) | |
1023 | shift | |
1024 | case "$1" in | |
1aef975c | 1025 | *=) echo "$1" >> optdef.sh;; |
a0d0e21e LW |
1026 | *=*) |
1027 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 | |
1028 | echo "$me: ignoring -U $1" >&2 | |
1029 | ;; | |
1aef975c | 1030 | *) echo "$1='undef'" >> optdef.sh;; |
a0d0e21e LW |
1031 | esac |
1032 | shift | |
1033 | ;; | |
2c7991dc | 1034 | -V) echo "$me generated by metaconfig 3.0 PL60." >&2 |
2304df62 AD |
1035 | exit 0;; |
1036 | --) break;; | |
a0d0e21e | 1037 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
2304df62 AD |
1038 | *) break;; |
1039 | esac | |
1040 | done | |
1041 | ||
1042 | case "$error" in | |
1043 | true) | |
1044 | cat >&2 <<EOM | |
2afac517 | 1045 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
a0d0e21e | 1046 | [-U symbol] [-U symbol=] |
2304df62 AD |
1047 | -d : use defaults for all answers. |
1048 | -e : go on without questioning past the production of config.sh. | |
1049 | -f : specify an alternate default configuration file. | |
1050 | -h : print this help message and exit (with an error status). | |
1051 | -r : reuse C symbols value if possible (skips costly nm extraction). | |
1052 | -s : silent mode, only echoes questions and essential information. | |
a0d0e21e LW |
1053 | -D : define symbol to have some value: |
1054 | -D symbol symbol gets the value 'define' | |
1055 | -D symbol=value symbol gets the value 'value' | |
2304df62 | 1056 | -E : stop at the end of questions, after having produced config.sh. |
16d20bd9 | 1057 | -K : do not use unless you know what you are doing. |
ecfc5424 | 1058 | -O : let -D and -U override definitions from loaded configuration file. |
2304df62 | 1059 | -S : perform variable substitutions on all .SH files (can mix with -f) |
a0d0e21e LW |
1060 | -U : undefine symbol: |
1061 | -U symbol symbol gets the value 'undef' | |
1062 | -U symbol= symbol gets completely empty | |
2304df62 AD |
1063 | -V : print version number and exit (with a zero status). |
1064 | EOM | |
1065 | exit 1 | |
1066 | ;; | |
1067 | esac | |
1068 | ||
1069 | exec 4>&1 | |
1070 | case "$silent" in | |
1071 | true) exec 1>/dev/null;; | |
1072 | esac | |
1073 | ||
ecfc5424 | 1074 | : run the defines and the undefines, if any, but leave the file out there... |
1aef975c AD |
1075 | touch optdef.sh |
1076 | . ./optdef.sh | |
a0d0e21e | 1077 | |
2304df62 AD |
1078 | case "$extractsh" in |
1079 | true) | |
1080 | case "$config_sh" in | |
1081 | '') config_sh='config.sh'; config='./config.sh';; | |
1082 | /*) config="$config_sh";; | |
1083 | *) config="./$config_sh";; | |
1084 | esac | |
1085 | echo " " | |
1086 | echo "Fetching answers from $config_sh..." | |
1087 | cd .. | |
1088 | . $config | |
1aef975c | 1089 | test "$override" && . ./optdef.sh |
2304df62 AD |
1090 | echo " " |
1091 | . ./UU/extract | |
1092 | rm -rf UU | |
1093 | echo "Done." | |
1094 | exit 0 | |
1095 | ;; | |
1096 | esac | |
1097 | ||
1098 | : set package name | |
85e6fe83 | 1099 | package=perl5 |
1aef975c AD |
1100 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
1101 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` | |
1102 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1103 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; | |
1104 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; | |
1105 | esac | |
2304df62 AD |
1106 | |
1107 | : Eunice requires " " instead of "", can you believe it | |
1108 | echo " " | |
1109 | : Here we go... | |
1110 | echo "Beginning of configuration questions for $package." | |
1111 | ||
1aef975c | 1112 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 |
2304df62 | 1113 | |
2304df62 AD |
1114 | : Some greps do not return status, grrr. |
1115 | echo "grimblepritz" >grimble | |
1116 | if grep blurfldyick grimble >/dev/null 2>&1 ; then | |
1117 | contains=contains | |
1118 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then | |
1119 | contains=grep | |
1120 | else | |
1121 | contains=contains | |
1122 | fi | |
1123 | rm -f grimble | |
1124 | : the following should work in any shell | |
1125 | case "$contains" in | |
1126 | contains*) | |
1127 | echo " " | |
1128 | echo "AGH! Grep doesn't return a status. Attempting remedial action." | |
1129 | cat >contains <<'EOSS' | |
1130 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp | |
1131 | EOSS | |
1132 | chmod +x contains | |
1133 | esac | |
1134 | ||
1135 | : first determine how to suppress newline on echo command | |
1136 | echo " " | |
1137 | echo "Checking echo to see how to suppress newlines..." | |
1138 | (echo "hi there\c" ; echo " ") >.echotmp | |
1139 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
1140 | echo "...using -n." | |
1141 | n='-n' | |
1142 | c='' | |
1143 | else | |
1144 | cat <<'EOM' | |
1145 | ...using \c | |
1146 | EOM | |
1147 | n='' | |
1148 | c='\c' | |
1149 | fi | |
1150 | echo $n "The star should be here-->$c" | |
1151 | echo '*' | |
1152 | rm -f .echotmp | |
1153 | ||
1154 | : Now test for existence of everything in MANIFEST | |
1155 | echo " " | |
1156 | if test -f ../MANIFEST; then | |
1157 | echo "First let's make sure your kit is complete. Checking..." >&4 | |
1158 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50 | |
1159 | rm -f missing | |
1160 | for filelist in x??; do | |
1161 | (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing) | |
1162 | done | |
1163 | if test -s missing; then | |
1164 | cat missing >&4 | |
1165 | cat >&4 <<'EOM' | |
1166 | ||
1167 | THIS PACKAGE SEEMS TO BE INCOMPLETE. | |
1168 | ||
1169 | You have the option of continuing the configuration process, despite the | |
1170 | distinct possibility that your kit is damaged, by typing 'y'es. If you | |
1171 | do, don't blame me if something goes wrong. I advise you to type 'n'o | |
284c50cc | 1172 | and contact the author (chip@perl.com). |
2304df62 AD |
1173 | |
1174 | EOM | |
1175 | echo $n "Continue? [n] $c" >&4 | |
1176 | read ans | |
1177 | case "$ans" in | |
1178 | y*) | |
1179 | echo "Continuing..." >&4 | |
1180 | rm -f missing | |
1181 | ;; | |
1182 | *) | |
1183 | echo "ABORTING..." >&4 | |
1184 | kill $$ | |
1185 | ;; | |
1186 | esac | |
1187 | else | |
1188 | echo "Looks good..." >&4 | |
1189 | fi | |
1190 | else | |
1191 | echo "There is no MANIFEST file. I hope your kit is complete !" | |
1192 | fi | |
1193 | rm -f missing x?? | |
1194 | ||
1195 | : compute the number of columns on the terminal for proper question formatting | |
1196 | case "$COLUMNS" in | |
1197 | '') COLUMNS='80';; | |
1198 | esac | |
1199 | ||
1200 | : set up the echo used in my read | |
1201 | myecho="case \"\$xxxm\" in | |
1202 | '') echo $n \"\$rp $c\" >&4;; | |
1203 | *) case \"\$rp\" in | |
1204 | '') echo $n \"[\$xxxm] $c\";; | |
1205 | *) | |
1206 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then | |
1207 | echo \"\$rp\" >&4 | |
1208 | echo $n \"[\$xxxm] $c\" >&4 | |
1209 | else | |
1210 | echo $n \"\$rp [\$xxxm] $c\" >&4 | |
1211 | fi | |
1212 | ;; | |
1213 | esac;; | |
1214 | esac" | |
1215 | ||
1216 | : now set up to do reads with possible shell escape and default assignment | |
1217 | cat <<EOSC >myread | |
28757baa | 1218 | $startsh |
2304df62 AD |
1219 | xxxm=\$dflt |
1220 | $myecho | |
1221 | ans='!' | |
1222 | case "\$fastread" in | |
1223 | yes) case "\$dflt" in | |
1224 | '') ;; | |
1225 | *) ans=''; | |
1226 | case "\$silent-\$rp" in | |
1227 | true-) ;; | |
1228 | *) echo " " >&4;; | |
1229 | esac;; | |
1230 | esac;; | |
1231 | *) case "\$silent" in | |
1232 | true) case "\$rp" in | |
1233 | '') ans='';; | |
1234 | esac;; | |
1235 | esac;; | |
1236 | esac | |
1237 | while expr "X\$ans" : "X!" >/dev/null; do | |
1238 | read answ | |
1239 | set x \$xxxm | |
1240 | shift | |
ff0cee69 | 1241 | aok=''; eval ans="\\"\$answ\\"" && aok=y |
2304df62 AD |
1242 | case "\$answ" in |
1243 | "\$ans") | |
1244 | case "\$ans" in | |
ecfc5424 AD |
1245 | \\&*) |
1246 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` | |
1247 | shift | |
1248 | case "\$1" in | |
1249 | -d) | |
1250 | fastread=yes | |
40a7a20a | 1251 | echo "(OK, I'll run with -d after this question.)" >&4 |
ecfc5424 AD |
1252 | ;; |
1253 | -*) | |
40a7a20a | 1254 | echo "*** Sorry, \$1 not supported yet." >&4 |
ecfc5424 AD |
1255 | ;; |
1256 | esac | |
1257 | $myecho | |
1258 | ans=! | |
1259 | ;; | |
2304df62 AD |
1260 | "!") |
1261 | sh 1>&4 | |
1262 | echo " " | |
1263 | $myecho | |
1264 | ;; | |
1265 | !*) | |
1266 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` | |
1267 | shift | |
1268 | sh 1>&4 -c "\$*" | |
1269 | echo " " | |
1270 | $myecho | |
1271 | ;; | |
1272 | esac;; | |
1273 | *) | |
1274 | case "\$aok" in | |
1275 | y) | |
1276 | echo "*** Substitution done -- please confirm." | |
1277 | xxxm="\$ans" | |
1278 | ans=\`echo $n "\$ans$c" | tr '\012' ' '\` | |
1279 | xxxm="\$ans" | |
1280 | ans=! | |
1281 | ;; | |
1282 | *) | |
1283 | echo "*** Error -- try again." | |
1284 | ans=! | |
1285 | ;; | |
1286 | esac | |
1287 | $myecho | |
1288 | ;; | |
1289 | esac | |
1290 | case "\$ans\$xxxm\$nostick" in | |
1291 | '') | |
1292 | ans=! | |
1293 | $myecho | |
1294 | ;; | |
1295 | esac | |
1296 | done | |
1297 | case "\$ans" in | |
1298 | '') ans="\$xxxm";; | |
1299 | esac | |
1300 | EOSC | |
1301 | ||
1302 | : create .config dir to save info across Configure sessions | |
1303 | test -d ../.config || mkdir ../.config | |
1304 | cat >../.config/README <<EOF | |
1305 | This directory created by Configure to save information that should | |
1306 | persist across sessions. | |
1307 | ||
1308 | You may safely delete it if you wish. | |
1309 | EOF | |
1310 | ||
1311 | : general instructions | |
1312 | needman=true | |
1313 | firsttime=true | |
760ac839 LW |
1314 | user=`(logname) 2>/dev/null` |
1315 | case "$user" in "") | |
1316 | user=`whoami 2>&1` ;; | |
1317 | esac | |
2304df62 AD |
1318 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
1319 | firsttime=false | |
1320 | echo " " | |
1321 | rp='Would you like to see the instructions?' | |
1322 | dflt=n | |
1323 | . ./myread | |
1324 | case "$ans" in | |
1325 | [yY]*) ;; | |
1326 | *) needman=false;; | |
1327 | esac | |
1328 | fi | |
1329 | if $needman; then | |
1330 | cat <<EOH | |
1331 | ||
1332 | This installation shell script will examine your system and ask you questions | |
a0d0e21e | 1333 | to determine how the perl5 package should be installed. If you get |
2304df62 AD |
1334 | stuck on a question, you may use a ! shell escape to start a subshell or |
1335 | execute a command. Many of the questions will have default answers in square | |
1336 | brackets; typing carriage return will give you the default. | |
1337 | ||
1338 | On some of the questions which ask for file or directory names you are allowed | |
1339 | to use the ~name construct to specify the login directory belonging to "name", | |
1340 | even if you don't have a shell which knows about that. Questions where this is | |
1341 | allowed will be marked "(~name ok)". | |
1342 | ||
1343 | EOH | |
1344 | rp='' | |
1345 | dflt='Type carriage return to continue' | |
1346 | . ./myread | |
1347 | cat <<'EOH' | |
1348 | ||
1349 | The prompter used in this script allows you to use shell variables and | |
1350 | backticks in your answers. You may use $1, $2, etc... to refer to the words | |
1351 | in the default answer, as if the default line was a set of arguments given to a | |
1352 | script shell. This means you may also use $* to repeat the whole default line, | |
1353 | so you do not have to re-type everything to add something to the default. | |
1354 | ||
1355 | Everytime there is a substitution, you will have to confirm. If there is an | |
1356 | error (e.g. an unmatched backtick), the default answer will remain unchanged | |
1357 | and you will be prompted again. | |
1358 | ||
1359 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all | |
1360 | the questions and use the computed defaults (or the previous answers if there | |
1361 | was already a config.sh file). Type 'Configure -h' for a list of options. | |
ecfc5424 AD |
1362 | You may also start interactively and then answer '& -d' at any prompt to turn |
1363 | on the non-interactive behaviour for the remaining of the execution. | |
2304df62 AD |
1364 | |
1365 | EOH | |
1366 | . ./myread | |
1367 | cat <<EOH | |
1368 | ||
1369 | Much effort has been expended to ensure that this shell script will run on any | |
1370 | Unix system. If despite that it blows up on yours, your best bet is to edit | |
40000a8c AD |
1371 | Configure and run it again. If you can't run Configure for some reason, |
1372 | you'll have to generate a config.sh file by hand. Whatever problems you | |
284c50cc | 1373 | have, let me (chip@perl.com) know how I blew it. |
2304df62 AD |
1374 | |
1375 | This installation script affects things in two ways: | |
1376 | ||
1377 | 1) it may do direct variable substitutions on some of the files included | |
1378 | in this kit. | |
1379 | 2) it builds a config.h file for inclusion in C programs. You may edit | |
1380 | any of these files as the need arises after running this script. | |
1381 | ||
1382 | If you make a mistake on a question, there is no easy way to back up to it | |
1383 | currently. The easiest thing to do is to edit config.sh and rerun all the SH | |
1384 | files. Configure will offer to let you do this before it runs the SH files. | |
1385 | ||
1386 | EOH | |
1387 | dflt='Type carriage return to continue' | |
1388 | . ./myread | |
1389 | case "$firsttime" in | |
1390 | true) echo $user >>../.config/instruct;; | |
1391 | esac | |
1392 | fi | |
1393 | ||
2304df62 AD |
1394 | : find out where common programs are |
1395 | echo " " | |
1396 | echo "Locating common programs..." >&4 | |
1397 | cat <<EOSC >loc | |
1398 | $startsh | |
1399 | case \$# in | |
1400 | 0) exit 1;; | |
1401 | esac | |
1402 | thing=\$1 | |
1403 | shift | |
1404 | dflt=\$1 | |
1405 | shift | |
1406 | for dir in \$*; do | |
1407 | case "\$thing" in | |
1408 | .) | |
1409 | if test -d \$dir/\$thing; then | |
1410 | echo \$dir | |
1411 | exit 0 | |
1412 | fi | |
1413 | ;; | |
1414 | *) | |
a0d0e21e | 1415 | for thisthing in \$dir/\$thing; do |
ecfc5424 | 1416 | : just loop through to pick last item |
a0d0e21e | 1417 | done |
25f94b33 | 1418 | if test -f \$thisthing; then |
a0d0e21e | 1419 | echo \$thisthing |
2304df62 AD |
1420 | exit 0 |
1421 | elif test -f \$dir/\$thing.exe; then | |
1422 | : on Eunice apparently | |
1423 | echo \$dir/\$thing | |
1424 | exit 0 | |
1425 | fi | |
1426 | ;; | |
1427 | esac | |
1428 | done | |
1429 | echo \$dflt | |
1430 | exit 1 | |
1431 | EOSC | |
1432 | chmod +x loc | |
1433 | $eunicefix loc | |
1434 | loclist=" | |
1435 | awk | |
1436 | cat | |
ecfc5424 | 1437 | comm |
2304df62 AD |
1438 | cp |
1439 | echo | |
1440 | expr | |
a0d0e21e | 1441 | find |
2304df62 | 1442 | grep |
a0d0e21e | 1443 | ls |
2304df62 | 1444 | mkdir |
2304df62 AD |
1445 | rm |
1446 | sed | |
1447 | sort | |
85e6fe83 | 1448 | touch |
2304df62 AD |
1449 | tr |
1450 | uniq | |
1451 | " | |
1452 | trylist=" | |
1453 | Mcc | |
2304df62 AD |
1454 | byacc |
1455 | cpp | |
1456 | csh | |
1457 | date | |
1458 | egrep | |
8ff267be | 1459 | gzip |
2c7991dc | 1460 | less |
2304df62 | 1461 | line |
8ff267be | 1462 | ln |
2c7991dc | 1463 | more |
2304df62 AD |
1464 | nroff |
1465 | perl | |
2c7991dc | 1466 | pg |
40a7a20a | 1467 | sendmail |
2304df62 AD |
1468 | test |
1469 | uname | |
8ff267be | 1470 | zip |
2304df62 | 1471 | " |
8e07c86e | 1472 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
1473 | pth="$pth /lib /usr/lib" |
1474 | for file in $loclist; do | |
1475 | xxx=`./loc $file $file $pth` | |
1476 | eval $file=$xxx | |
1477 | eval _$file=$xxx | |
1478 | case "$xxx" in | |
1479 | /*) | |
1480 | echo $file is in $xxx. | |
1481 | ;; | |
8e07c86e AD |
1482 | ?:[\\/]*) |
1483 | echo $file is in $xxx. | |
1484 | ;; | |
2304df62 | 1485 | *) |
25f94b33 AD |
1486 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
1487 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
4633a7c4 | 1488 | exit 1 |
2304df62 AD |
1489 | ;; |
1490 | esac | |
1491 | done | |
1492 | echo " " | |
1493 | echo "Don't worry if any of the following aren't found..." | |
1494 | say=offhand | |
1495 | for file in $trylist; do | |
1496 | xxx=`./loc $file $file $pth` | |
1497 | eval $file=$xxx | |
1498 | eval _$file=$xxx | |
1499 | case "$xxx" in | |
1500 | /*) | |
1501 | echo $file is in $xxx. | |
1502 | ;; | |
8e07c86e AD |
1503 | ?:[\\/]*) |
1504 | echo $file is in $xxx. | |
1505 | ;; | |
2304df62 AD |
1506 | *) |
1507 | echo "I don't see $file out there, $say." | |
1508 | say=either | |
1509 | ;; | |
1510 | esac | |
1511 | done | |
1512 | case "$egrep" in | |
1513 | egrep) | |
1514 | echo "Substituting grep for egrep." | |
1515 | egrep=$grep | |
1516 | ;; | |
1517 | esac | |
8ff267be | 1518 | case "$ln" in |
1519 | ln) | |
1520 | echo "Substituting cp for ln." | |
1521 | ln=$cp | |
1522 | ;; | |
1523 | esac | |
2304df62 AD |
1524 | case "$test" in |
1525 | test) | |
1526 | echo "Hopefully test is built into your sh." | |
1527 | ;; | |
1528 | *) | |
ecfc5424 | 1529 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
2304df62 AD |
1530 | echo "Using the test built into your sh." |
1531 | test=test | |
1532 | _test=test | |
1533 | fi | |
1534 | ;; | |
1535 | esac | |
1536 | case "$echo" in | |
1537 | echo) | |
1538 | echo "Hopefully echo is built into your sh." | |
1539 | ;; | |
1540 | '') ;; | |
1541 | *) | |
1542 | echo " " | |
1543 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
1544 | $echo $n "hi there$c" >foo1 | |
1545 | echo $n "hi there$c" >foo2 | |
1546 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
1547 | echo "They are compatible. In fact, they may be identical." | |
1548 | else | |
1549 | case "$n" in | |
1550 | '-n') n='' c='\c';; | |
1551 | *) n='-n' c='';; | |
1552 | esac | |
1553 | cat <<FOO | |
1554 | They are not compatible! You are probably running ksh on a non-USG system. | |
1555 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
1556 | have echo built in and we may have to run some Bourne shell scripts. That | |
1557 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
1558 | ||
1559 | FOO | |
1560 | $echo $n "The star should be here-->$c" | |
1561 | $echo "*" | |
1562 | fi | |
1563 | $rm -f foo1 foo2 | |
1564 | ;; | |
1565 | esac | |
1566 | ||
a0d0e21e LW |
1567 | : determine whether symbolic links are supported |
1568 | echo " " | |
1569 | $touch blurfl | |
1570 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
1571 | echo "Symbolic links are supported." >&4 | |
1572 | lns="$ln -s" | |
1573 | else | |
1574 | echo "Symbolic links are NOT supported." >&4 | |
1575 | lns="$ln" | |
1576 | fi | |
1577 | $rm -f blurfl sym | |
1578 | ||
ecfc5424 AD |
1579 | : see whether [:lower:] and [:upper:] are supported character classes |
1580 | echo " " | |
1581 | up='[A-Z]' | |
1582 | low='[a-z]' | |
1583 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1584 | ABYZ) | |
1585 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
1586 | up='[:upper:]' | |
1587 | low='[:lower:]' | |
1588 | ;; | |
1589 | *) | |
1590 | echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 | |
1591 | ;; | |
1592 | esac | |
1593 | : set up the translation script tr, must be called with ./tr of course | |
1594 | cat >tr <<EOSC | |
1595 | $startsh | |
1596 | case "\$1\$2" in | |
1597 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
1598 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
1599 | esac | |
1600 | exec $tr "\$@" | |
1601 | EOSC | |
1602 | chmod +x tr | |
1603 | $eunicefix tr | |
1604 | ||
2304df62 AD |
1605 | : Try to determine whether config.sh was made on this system |
1606 | case "$config_sh" in | |
1607 | '') | |
1608 | myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` | |
a0d0e21e | 1609 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
ecfc5424 | 1610 | ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` |
1aef975c | 1611 | newmyuname="$myuname" |
2304df62 | 1612 | dflt=n |
16d20bd9 AD |
1613 | case "$knowitall" in |
1614 | '') | |
1615 | if test -f ../config.sh; then | |
1616 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
1617 | eval "`grep myuname= ../config.sh`" | |
1618 | fi | |
1619 | if test "X$myuname" = "X$newmyuname"; then | |
1620 | dflt=y | |
1621 | fi | |
2304df62 | 1622 | fi |
16d20bd9 AD |
1623 | ;; |
1624 | *) dflt=y;; | |
1625 | esac | |
2304df62 AD |
1626 | |
1627 | : Get old answers from old config file if Configure was run on the | |
1628 | : same system, otherwise use the hints. | |
1629 | hint=default | |
1630 | cd .. | |
1631 | if test -f config.sh; then | |
16d20bd9 AD |
1632 | echo " " |
1633 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
1634 | . UU/myread |
1635 | case "$ans" in | |
1636 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; | |
1637 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
ecfc5424 AD |
1638 | tmp_n="$n" |
1639 | tmp_c="$c" | |
85cad39c | 1640 | tmp_sh="$sh" |
2304df62 AD |
1641 | . ./config.sh |
1642 | cp config.sh UU | |
ecfc5424 AD |
1643 | n="$tmp_n" |
1644 | c="$tmp_c" | |
85cad39c | 1645 | : Older versions did not always set $sh. Catch re-use of such |
1646 | : an old config.sh. | |
1647 | case "$sh" in | |
1648 | '') sh="$tmp_sh" ;; | |
1649 | esac | |
2304df62 AD |
1650 | hint=previous |
1651 | ;; | |
1652 | esac | |
1653 | fi | |
1654 | if test ! -f config.sh; then | |
1655 | $cat <<EOM | |
1656 | ||
1657 | First time through, eh? I have some defaults handy for the following systems: | |
1658 | ||
1659 | EOM | |
1660 | cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4 | |
1661 | dflt='' | |
1662 | : Half the following guesses are probably wrong... If you have better | |
284c50cc | 1663 | : tests or hints, please send them to chip@perl.com |
2304df62 | 1664 | : The metaconfig authors would also appreciate a copy... |
a0d0e21e | 1665 | $test -f /irix && osname=irix |
85e6fe83 LW |
1666 | $test -f /xenix && osname=sco_xenix |
1667 | $test -f /dynix && osname=dynix | |
1668 | $test -f /dnix && osname=dnix | |
5f05dabc | 1669 | $test -f /lynx.os && osname=lynxos |
1670 | $test -f /unicos && osname=unicos && osvers=`$uname -r` | |
7a4c00b4 | 1671 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
85e6fe83 | 1672 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
1673 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
1674 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
1675 | $test -d /usr/apollo/bin && osname=apollo |
1676 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 1677 | $test -d /usr/include/minix && osname=minix |
4633a7c4 LW |
1678 | if $test -d /MachTen; then |
1679 | osname=machten | |
1680 | if $test -x /sbin/version; then | |
1681 | osvers=`/sbin/version | $awk '{print $2}' | | |
1682 | $sed -e 's/[A-Za-z]$//'` | |
1683 | elif $test -x /usr/etc/version; then | |
1684 | osvers=`/usr/etc/version | $awk '{print $2}' | | |
1685 | $sed -e 's/[A-Za-z]$//'` | |
1686 | else | |
1687 | osvers="$2.$3" | |
1688 | fi | |
1689 | fi | |
2304df62 AD |
1690 | if $test -f $uname; then |
1691 | set X $myuname | |
1692 | shift | |
1693 | ||
2304df62 | 1694 | case "$5" in |
85e6fe83 | 1695 | fps*) osname=fps ;; |
2304df62 AD |
1696 | mips*) |
1697 | case "$4" in | |
85e6fe83 LW |
1698 | umips) osname=umips ;; |
1699 | *) osname=mips ;; | |
2304df62 | 1700 | esac;; |
85e6fe83 LW |
1701 | [23]100) osname=mips ;; |
1702 | next*) osname=next ;; | |
1703 | news*) osname=news ;; | |
ecfc5424 AD |
1704 | i386*) |
1705 | if $test -f /etc/kconfig; then | |
1706 | osname=isc | |
a0d0e21e LW |
1707 | if test "$lns" = "ln -s"; then |
1708 | osvers=4 | |
1709 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
1710 | osvers=3 | |
2304df62 | 1711 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 1712 | osvers=2 |
ecfc5424 AD |
1713 | fi |
1714 | fi | |
1715 | ;; | |
2304df62 AD |
1716 | esac |
1717 | ||
1718 | case "$1" in | |
a0d0e21e LW |
1719 | aix) osname=aix |
1720 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
1721 | case "$tmp" in | |
1aef975c | 1722 | 'not found') osvers="$4"."$3" ;; |
a0d0e21e LW |
1723 | '<3240'|'<>3240') osvers=3.2.0 ;; |
1724 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
1725 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 1726 | *) osvers=$tmp;; |
a0d0e21e LW |
1727 | esac |
1728 | ;; | |
23f87696 SZ |
1729 | *dc.osx) osname=dcosx |
1730 | osvers="$3" | |
1731 | ;; | |
a0d0e21e LW |
1732 | dnix) osname=dnix |
1733 | osvers="$3" | |
1734 | ;; | |
1735 | domainos) osname=apollo | |
1736 | osvers="$3" | |
1737 | ;; | |
1738 | dgux) osname=dgux | |
1739 | osvers="$3" | |
1740 | ;; | |
760ac839 LW |
1741 | dynixptx*) osname=dynixptx |
1742 | osvers="$3" | |
1743 | ;; | |
a0d0e21e LW |
1744 | freebsd) osname=freebsd |
1745 | osvers="$3" ;; | |
1746 | genix) osname=genix ;; | |
1747 | hp*) osname=hpux | |
1748 | case "$3" in | |
1749 | *.08.*) osvers=9 ;; | |
1750 | *.09.*) osvers=9 ;; | |
1751 | *.10.*) osvers=10 ;; | |
ecfc5424 | 1752 | *) osvers="$3" ;; |
a0d0e21e LW |
1753 | esac |
1754 | ;; | |
a78b0d02 | 1755 | irix*) osname=irix |
a0d0e21e LW |
1756 | case "$3" in |
1757 | 4*) osvers=4 ;; | |
1758 | 5*) osvers=5 ;; | |
ecfc5424 | 1759 | *) osvers="$3" ;; |
a0d0e21e LW |
1760 | esac |
1761 | ;; | |
1762 | linux) osname=linux | |
1763 | case "$3" in | |
1764 | 1*) osvers=1 ;; | |
1765 | *) osvers="$3" ;; | |
1766 | esac | |
1767 | ;; | |
1768 | netbsd*) osname=netbsd | |
ecfc5424 AD |
1769 | osvers="$3" |
1770 | ;; | |
a0d0e21e LW |
1771 | bsd386) osname=bsd386 |
1772 | osvers=`$uname -r` | |
1773 | ;; | |
1774 | next*) osname=next ;; | |
1775 | solaris) osname=solaris | |
1776 | case "$3" in | |
1777 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 1778 | *) osvers="$3" ;; |
a0d0e21e LW |
1779 | esac |
1780 | ;; | |
85e6fe83 LW |
1781 | sunos) osname=sunos |
1782 | case "$3" in | |
85e6fe83 LW |
1783 | 5*) osname=solaris |
1784 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 1785 | *) osvers="$3" ;; |
2304df62 AD |
1786 | esac |
1787 | ;; | |
a0d0e21e | 1788 | titanos) osname=titanos |
85e6fe83 | 1789 | case "$3" in |
a0d0e21e LW |
1790 | 1*) osvers=1 ;; |
1791 | 2*) osvers=2 ;; | |
1792 | 3*) osvers=3 ;; | |
1793 | 4*) osvers=4 ;; | |
ecfc5424 | 1794 | *) osvers="$3" ;; |
2304df62 AD |
1795 | esac |
1796 | ;; | |
85e6fe83 | 1797 | ultrix) osname=ultrix |
ecfc5424 | 1798 | osvers="$3" |
2304df62 | 1799 | ;; |
28757baa | 1800 | osf1|mls+) case "$5" in |
fed7345c AD |
1801 | alpha) |
1802 | osname=dec_osf | |
1803 | osvers=`echo "$3" | sed 's/^[vt]//'` | |
ecfc5424 AD |
1804 | ;; |
1805 | hp*) osname=hp_osf1 ;; | |
1806 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
1807 | esac |
1808 | ;; | |
a0d0e21e LW |
1809 | uts) osname=uts |
1810 | osvers="$3" | |
1811 | ;; | |
ff68c719 | 1812 | qnx) osname=qnx |
1813 | osvers="$4" | |
1814 | ;; | |
85e6fe83 | 1815 | $2) case "$osname" in |
2304df62 | 1816 | *isc*) ;; |
a0d0e21e | 1817 | *freebsd*) ;; |
5f05dabc | 1818 | svr*) |
a0d0e21e LW |
1819 | : svr4.x or possibly later |
1820 | case "svr$3" in | |
1821 | ${osname}*) | |
1822 | osname=svr$3 | |
1823 | osvers=$4 | |
1824 | ;; | |
1825 | esac | |
1826 | case "$osname" in | |
1827 | svr4.0) | |
1828 | : Check for ESIX | |
1829 | if test -f /stand/boot ; then | |
1830 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
1831 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
1832 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
1833 | if test -n "$isesix"; then | |
a0d0e21e LW |
1834 | osname=esix4 |
1835 | fi | |
1836 | fi | |
1837 | fi | |
1838 | ;; | |
1839 | esac | |
1840 | ;; | |
2304df62 | 1841 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
1842 | osname=sco |
1843 | set `echo $3 | $sed 's/\./ /g'` $4 | |
2304df62 | 1844 | if $test -f sco_$1_$2_$3.sh; then |
85e6fe83 | 1845 | osvers=$1.$2.$3 |
2304df62 | 1846 | elif $test -f sco_$1_$2.sh; then |
85e6fe83 | 1847 | osvers=$1.$2 |
2304df62 | 1848 | elif $test -f sco_$1.sh; then |
85e6fe83 | 1849 | osvers=$1 |
2304df62 | 1850 | fi |
a0d0e21e LW |
1851 | else |
1852 | case "$osname" in | |
1853 | '') : Still unknown. Probably a generic Sys V. | |
1854 | osname="sysv" | |
1855 | osvers="$3" | |
1856 | ;; | |
1857 | esac | |
2304df62 AD |
1858 | fi |
1859 | ;; | |
1860 | esac | |
1861 | ;; | |
a0d0e21e LW |
1862 | *) case "$osname" in |
1863 | '') : Still unknown. Probably a generic BSD. | |
1864 | osname="$1" | |
1865 | osvers="$3" | |
1866 | ;; | |
1867 | esac | |
1868 | ;; | |
2304df62 AD |
1869 | esac |
1870 | else | |
1871 | if test -f /vmunix -a -f news_os.sh; then | |
ecfc5424 | 1872 | (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1 |
2304df62 | 1873 | if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then |
85e6fe83 | 1874 | osname=news_os |
2304df62 AD |
1875 | fi |
1876 | $rm -f ../UU/kernel.what | |
8e07c86e AD |
1877 | elif test -d c:/.; then |
1878 | set X $myuname | |
1879 | osname=os2 | |
1880 | osvers="$5" | |
2304df62 AD |
1881 | fi |
1882 | fi | |
85e6fe83 | 1883 | |
a0d0e21e LW |
1884 | : Now look for a hint file osname_osvers, unless one has been |
1885 | : specified already. | |
1886 | case "$hintfile" in | |
1887 | ''|' ') | |
ecfc5424 | 1888 | file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` |
a0d0e21e | 1889 | : Also try without trailing minor version numbers. |
ecfc5424 AD |
1890 | xfile=`echo $file | $sed -e 's@_[^_]*$@@'` |
1891 | xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` | |
1892 | xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` | |
1893 | xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` | |
a0d0e21e LW |
1894 | case "$file" in |
1895 | '') dflt=none ;; | |
1896 | *) case "$osvers" in | |
1897 | '') dflt=$file | |
1898 | ;; | |
1899 | *) if $test -f $file.sh ; then | |
1900 | dflt=$file | |
1901 | elif $test -f $xfile.sh ; then | |
1902 | dflt=$xfile | |
1903 | elif $test -f $xxfile.sh ; then | |
1904 | dflt=$xxfile | |
1905 | elif $test -f $xxxfile.sh ; then | |
1906 | dflt=$xxxfile | |
1907 | elif $test -f $xxxxfile.sh ; then | |
1908 | dflt=$xxxxfile | |
1909 | elif $test -f "${osname}.sh" ; then | |
1910 | dflt="${osname}" | |
1911 | else | |
1912 | dflt=none | |
1913 | fi | |
1914 | ;; | |
1915 | esac | |
85e6fe83 LW |
1916 | ;; |
1917 | esac | |
1918 | ;; | |
a0d0e21e | 1919 | *) |
ecfc5424 | 1920 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 1921 | ;; |
2304df62 | 1922 | esac |
1aef975c | 1923 | |
2304df62 AD |
1924 | $cat <<EOM |
1925 | ||
1926 | You may give one or more space-separated answers, or "none" if appropriate. | |
1927 | If your OS version has no hints, DO NOT give a wrong version -- say "none". | |
1928 | ||
1929 | EOM | |
1930 | rp="Which of these apply, if any?" | |
1931 | . ../UU/myread | |
85e6fe83 LW |
1932 | tans=$ans |
1933 | for file in $tans; do | |
2304df62 AD |
1934 | if $test -f $file.sh; then |
1935 | . ./$file.sh | |
1936 | $cat $file.sh >> ../UU/config.sh | |
85e6fe83 | 1937 | elif $test X$tans = X -o X$tans = Xnone ; then |
2304df62 AD |
1938 | : nothing |
1939 | else | |
85e6fe83 LW |
1940 | : Give one chance to correct a possible typo. |
1941 | echo "$file.sh does not exist" | |
1942 | dflt=$file | |
1943 | rp="hint to use instead?" | |
1944 | . ../UU/myread | |
1945 | for file in $ans; do | |
1946 | if $test -f "$file.sh"; then | |
1947 | . ./$file.sh | |
1948 | $cat $file.sh >> ../UU/config.sh | |
1949 | elif $test X$ans = X -o X$ans = Xnone ; then | |
1950 | : nothing | |
1951 | else | |
1952 | echo "$file.sh does not exist -- ignored." | |
1953 | fi | |
1954 | done | |
2304df62 AD |
1955 | fi |
1956 | done | |
85e6fe83 | 1957 | |
2304df62 | 1958 | hint=recommended |
85e6fe83 LW |
1959 | : Remember our hint file for later. |
1960 | if $test -f "$file.sh" ; then | |
a0d0e21e | 1961 | hintfile="$file" |
85e6fe83 | 1962 | else |
a0d0e21e | 1963 | hintfile='' |
85e6fe83 LW |
1964 | fi |
1965 | ||
2304df62 AD |
1966 | cd .. |
1967 | fi | |
1968 | cd UU | |
1969 | ;; | |
1970 | *) | |
1971 | echo " " | |
1972 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
1973 | tmp_n="$n" |
1974 | tmp_c="$c" | |
2304df62 AD |
1975 | cd .. |
1976 | cp $config_sh config.sh 2>/dev/null | |
a78b0d02 | 1977 | chmod +w config.sh |
2304df62 AD |
1978 | . ./config.sh |
1979 | cd UU | |
1980 | cp ../config.sh . | |
ecfc5424 AD |
1981 | n="$tmp_n" |
1982 | c="$tmp_c" | |
2304df62 AD |
1983 | hint=previous |
1984 | ;; | |
1985 | esac | |
1aef975c AD |
1986 | test "$override" && . ./optdef.sh |
1987 | myuname="$newmyuname" | |
2304df62 AD |
1988 | |
1989 | : Restore computed paths | |
1990 | for file in $loclist $trylist; do | |
1991 | eval $file="\$_$file" | |
1992 | done | |
1993 | ||
85e6fe83 | 1994 | cat << EOM |
a0d0e21e | 1995 | |
85e6fe83 | 1996 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
1997 | The default value is probably right if the name rings a bell. Otherwise, |
1998 | since spelling matters for me, either accept the default or answer "none" | |
1999 | to leave it blank. | |
a0d0e21e | 2000 | |
85e6fe83 | 2001 | EOM |
85e6fe83 | 2002 | case "$osname" in |
a0d0e21e | 2003 | ''|' ') |
85e6fe83 | 2004 | case "$hintfile" in |
a0d0e21e | 2005 | ''|' '|none) dflt=none ;; |
ecfc5424 | 2006 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
2007 | esac |
2008 | ;; | |
2009 | *) dflt="$osname" ;; | |
2010 | esac | |
2011 | rp="Operating system name?" | |
2012 | . ./myread | |
2013 | case "$ans" in | |
ecfc5424 AD |
2014 | none) osname='' ;; |
2015 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 2016 | esac |
8ff267be | 2017 | echo " " |
2018 | case "$osvers" in | |
2019 | ''|' ') | |
2020 | case "$hintfile" in | |
2021 | ''|' '|none) dflt=none ;; | |
2022 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` | |
2023 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` | |
2024 | case "$dflt" in | |
2025 | ''|' ') dflt=none ;; | |
2026 | esac | |
2027 | ;; | |
2028 | esac | |
2029 | ;; | |
2030 | *) dflt="$osvers" ;; | |
2031 | esac | |
2032 | rp="Operating system version?" | |
2033 | . ./myread | |
2034 | case "$ans" in | |
2035 | none) osvers='' ;; | |
2036 | *) osvers="$ans" ;; | |
2037 | esac | |
2038 | ||
760ac839 LW |
2039 | |
2040 | ||
2304df62 AD |
2041 | : who configured the system |
2042 | cf_time=`$date 2>&1` | |
8ff267be | 2043 | cf_by=`(logname) 2>/dev/null` |
2044 | case "$cf_by" in "") | |
2045 | cf_by=`(whoami) 2>/dev/null` | |
2046 | case "$cf_by" in "") | |
2047 | cf_by=unknown ;; | |
2048 | esac ;; | |
2049 | esac | |
2304df62 | 2050 | |
4633a7c4 | 2051 | : determine the architecture name |
2304df62 | 2052 | echo " " |
4633a7c4 LW |
2053 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
2054 | tarch=`arch`"-$osname" | |
2055 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
2056 | if uname -m > tmparch 2>&1 ; then | |
7e1af8bc | 2057 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ |
5f05dabc | 2058 | -e 's/$/'"-$osname/" tmparch` |
4633a7c4 LW |
2059 | else |
2060 | tarch="$osname" | |
2061 | fi | |
2062 | $rm -f tmparch | |
2063 | else | |
2064 | tarch="$osname" | |
2065 | fi | |
2066 | case "$myarchname" in | |
2067 | ''|"$tarch") ;; | |
2068 | *) | |
2069 | echo "(Your architecture name used to be $myarchname.)" | |
2070 | archname='' | |
2304df62 AD |
2071 | ;; |
2072 | esac | |
4633a7c4 LW |
2073 | case "$archname" in |
2074 | '') dflt="$tarch";; | |
2075 | *) dflt="$archname";; | |
2076 | esac | |
2077 | rp='What is your architecture name' | |
2078 | . ./myread | |
2079 | archname="$ans" | |
2080 | myarchname="$tarch" | |
2081 | ||
2082 | : is AFS running? | |
2083 | echo " " | |
2afac517 | 2084 | case "$afs" in |
2085 | $define|true) afs=true ;; | |
2086 | $undef|false) afs=false ;; | |
2087 | *) if test -d /afs; then | |
2088 | afs=true | |
2089 | else | |
2090 | afs=false | |
2091 | fi | |
2092 | ;; | |
2093 | esac | |
2094 | if $afs; then | |
4633a7c4 | 2095 | echo "AFS may be running... I'll be extra cautious then..." >&4 |
2304df62 | 2096 | else |
4633a7c4 | 2097 | echo "AFS does not seem to be running..." >&4 |
2304df62 AD |
2098 | fi |
2099 | ||
4633a7c4 LW |
2100 | : decide how portable to be. Allow command line overrides. |
2101 | case "$d_portable" in | |
2102 | "$undef") ;; | |
2103 | *) d_portable="$define" ;; | |
2304df62 | 2104 | esac |
2304df62 | 2105 | |
4633a7c4 LW |
2106 | : set up shell script to do ~ expansion |
2107 | cat >filexp <<EOSS | |
2108 | $startsh | |
2109 | : expand filename | |
2110 | case "\$1" in | |
2111 | ~/*|~) | |
2112 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
2304df62 | 2113 | ;; |
4633a7c4 LW |
2114 | ~*) |
2115 | if $test -f /bin/csh; then | |
2116 | /bin/csh -f -c "glob \$1" | |
2117 | failed=\$? | |
2118 | echo "" | |
2119 | exit \$failed | |
2120 | else | |
2121 | name=\`$expr x\$1 : '..\([^/]*\)'\` | |
2122 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
2123 | if $test ! -d "\$dir"; then | |
2124 | me=\`basename \$0\` | |
2125 | echo "\$me: can't locate home directory for: \$name" >&2 | |
2126 | exit 1 | |
2127 | fi | |
2128 | case "\$1" in | |
2129 | */*) | |
2130 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
2131 | ;; | |
2132 | *) | |
2133 | echo \$dir | |
2134 | ;; | |
2304df62 | 2135 | esac |
4633a7c4 | 2136 | fi |
2304df62 AD |
2137 | ;; |
2138 | *) | |
4633a7c4 | 2139 | echo \$1 |
2304df62 AD |
2140 | ;; |
2141 | esac | |
4633a7c4 LW |
2142 | EOSS |
2143 | chmod +x filexp | |
2144 | $eunicefix filexp | |
2304df62 AD |
2145 | |
2146 | : now set up to get a file name | |
28757baa | 2147 | cat <<EOS >getfile |
2148 | $startsh | |
2149 | EOS | |
2150 | cat <<'EOSC' >>getfile | |
2304df62 AD |
2151 | tilde='' |
2152 | fullpath='' | |
2153 | already='' | |
2154 | skip='' | |
2155 | none_ok='' | |
2156 | exp_file='' | |
a0d0e21e | 2157 | nopath_ok='' |
2304df62 AD |
2158 | orig_rp="$rp" |
2159 | orig_dflt="$dflt" | |
2160 | ||
2161 | case "$fn" in | |
ecfc5424 AD |
2162 | *\(*) |
2163 | expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok | |
2164 | fn=`echo $fn | sed 's/(.*)//'` | |
2165 | ;; | |
2166 | esac | |
2167 | ||
2168 | case "$fn" in | |
a0d0e21e LW |
2169 | *:*) |
2170 | loc_file=`expr $fn : '.*:\(.*\)'` | |
2171 | fn=`expr $fn : '\(.*\):.*'` | |
2172 | ;; | |
2173 | esac | |
2174 | ||
2175 | case "$fn" in | |
2304df62 AD |
2176 | *~*) tilde=true;; |
2177 | esac | |
2178 | case "$fn" in | |
2179 | */*) fullpath=true;; | |
2180 | esac | |
2181 | case "$fn" in | |
2182 | *+*) skip=true;; | |
2183 | esac | |
2184 | case "$fn" in | |
2185 | *n*) none_ok=true;; | |
2186 | esac | |
2187 | case "$fn" in | |
2188 | *e*) exp_file=true;; | |
2189 | esac | |
a0d0e21e LW |
2190 | case "$fn" in |
2191 | *p*) nopath_ok=true;; | |
2192 | esac | |
2304df62 AD |
2193 | |
2194 | case "$fn" in | |
2195 | *f*) type='File';; | |
2196 | *d*) type='Directory';; | |
a0d0e21e | 2197 | *l*) type='Locate';; |
2304df62 AD |
2198 | esac |
2199 | ||
2200 | what="$type" | |
2201 | case "$what" in | |
2202 | Locate) what='File';; | |
2203 | esac | |
2204 | ||
2205 | case "$exp_file" in | |
2206 | '') | |
2207 | case "$d_portable" in | |
2208 | "$define") ;; | |
2209 | *) exp_file=true;; | |
2210 | esac | |
2211 | ;; | |
2212 | esac | |
2213 | ||
2214 | cd .. | |
2215 | while test "$type"; do | |
2216 | redo='' | |
2217 | rp="$orig_rp" | |
2218 | dflt="$orig_dflt" | |
2219 | case "$tilde" in | |
2220 | true) rp="$rp (~name ok)";; | |
2221 | esac | |
2222 | . UU/myread | |
ecfc5424 AD |
2223 | if test -f UU/getfile.ok && \ |
2224 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
2225 | then | |
2226 | value="$ans" | |
2227 | ansexp="$ans" | |
2228 | break | |
2229 | fi | |
2304df62 AD |
2230 | case "$ans" in |
2231 | none) | |
2232 | value='' | |
2233 | ansexp='' | |
2234 | case "$none_ok" in | |
2235 | true) type='';; | |
2236 | esac | |
2237 | ;; | |
2238 | *) | |
2239 | case "$tilde" in | |
2240 | '') value="$ans" | |
2241 | ansexp="$ans";; | |
2242 | *) | |
2243 | value=`UU/filexp $ans` | |
2244 | case $? in | |
2245 | 0) | |
2246 | if test "$ans" != "$value"; then | |
ecfc5424 | 2247 | echo "(That expands to $value on this system.)" |
2304df62 AD |
2248 | fi |
2249 | ;; | |
2250 | *) value="$ans";; | |
2251 | esac | |
2252 | ansexp="$value" | |
2253 | case "$exp_file" in | |
2254 | '') value="$ans";; | |
2255 | esac | |
2256 | ;; | |
2257 | esac | |
2258 | case "$fullpath" in | |
2259 | true) | |
2260 | case "$ansexp" in | |
2261 | /*) value="$ansexp" ;; | |
2262 | *) | |
2263 | redo=true | |
2264 | case "$already" in | |
2265 | true) | |
2266 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
2267 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
2268 | ;; | |
2269 | *) | |
2270 | echo "Please give a full path name, starting with slash." >&4 | |
2271 | case "$tilde" in | |
2272 | true) | |
2273 | echo "Note that using ~name is ok provided it expands well." >&4 | |
2274 | already=true | |
2275 | ;; | |
2276 | esac | |
2277 | esac | |
2278 | ;; | |
2279 | esac | |
2280 | ;; | |
2281 | esac | |
2282 | case "$redo" in | |
2283 | '') | |
2284 | case "$type" in | |
2285 | File) | |
2286 | if test -f "$ansexp"; then | |
2287 | type='' | |
2288 | elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 | |
2289 | then | |
2290 | echo "($value is not a plain file, but that's ok.)" | |
2291 | type='' | |
2292 | fi | |
2293 | ;; | |
2294 | Directory) | |
2295 | if test -d "$ansexp"; then | |
2296 | type='' | |
2297 | fi | |
2298 | ;; | |
2299 | Locate) | |
40000a8c | 2300 | if test -d "$ansexp"; then |
a0d0e21e LW |
2301 | echo "(Looking for $loc_file in directory $value.)" |
2302 | value="$value/$loc_file" | |
40000a8c | 2303 | ansexp="$ansexp/$loc_file" |
2304df62 | 2304 | fi |
40000a8c | 2305 | if test -f "$ansexp"; then |
2304df62 AD |
2306 | type='' |
2307 | fi | |
a0d0e21e LW |
2308 | case "$nopath_ok" in |
2309 | true) case "$value" in | |
2310 | */*) ;; | |
2311 | *) echo "Assuming $value will be in people's path." | |
2312 | type='' | |
2313 | ;; | |
2314 | esac | |
2315 | ;; | |
2316 | esac | |
2304df62 AD |
2317 | ;; |
2318 | esac | |
2319 | ||
2320 | case "$skip" in | |
2321 | true) type=''; | |
2322 | esac | |
2323 | ||
2324 | case "$type" in | |
2325 | '') ;; | |
2326 | *) | |
2327 | if test "$fastread" = yes; then | |
2328 | dflt=y | |
2329 | else | |
2330 | dflt=n | |
2331 | fi | |
2332 | rp="$what $value doesn't exist. Use that name anyway?" | |
2333 | . UU/myread | |
2334 | dflt='' | |
2335 | case "$ans" in | |
2336 | y*) type='';; | |
2337 | *) echo " ";; | |
2338 | esac | |
2339 | ;; | |
2340 | esac | |
2341 | ;; | |
2342 | esac | |
2343 | ;; | |
2344 | esac | |
2345 | done | |
2346 | cd UU | |
2347 | ans="$value" | |
2348 | rp="$orig_rp" | |
2349 | dflt="$orig_dflt" | |
ecfc5424 | 2350 | rm -f getfile.ok |
2304df62 AD |
2351 | EOSC |
2352 | ||
4633a7c4 LW |
2353 | : determine root of directory hierarchy where package will be installed. |
2354 | case "$prefix" in | |
2355 | '') | |
2356 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
8e07c86e | 2357 | ;; |
4633a7c4 LW |
2358 | *) |
2359 | dflt="$prefix" | |
8e07c86e AD |
2360 | ;; |
2361 | esac | |
4633a7c4 | 2362 | $cat <<EOM |
2304df62 | 2363 | |
4633a7c4 LW |
2364 | By default, $package will be installed in $dflt/bin, manual |
2365 | pages under $dflt/man, etc..., i.e. with $dflt as prefix for | |
2366 | all installation directories. Typically set to /usr/local, but you | |
2367 | may choose /usr if you wish to install $package among your system | |
2368 | binaries. If you wish to have binaries under /bin but manual pages | |
2369 | under /usr/local/man, that's ok: you will be prompted separately | |
2370 | for each of the installation directories, the prefix being only used | |
2371 | to set the defaults. | |
8e07c86e AD |
2372 | |
2373 | EOM | |
2374 | fn=d~ | |
2375 | rp='Installation prefix to use?' | |
2376 | . ./getfile | |
2377 | oldprefix='' | |
2378 | case "$prefix" in | |
a0d0e21e | 2379 | '') ;; |
8e07c86e AD |
2380 | *) |
2381 | case "$ans" in | |
2382 | "$prefix") ;; | |
2383 | *) oldprefix="$prefix";; | |
2384 | esac | |
2385 | ;; | |
a0d0e21e | 2386 | esac |
8e07c86e AD |
2387 | prefix="$ans" |
2388 | prefixexp="$ansexp" | |
a0d0e21e | 2389 | |
8e07c86e AD |
2390 | : set the prefixit variable, to compute a suitable default value |
2391 | prefixit='case "$3" in | |
2392 | ""|none) | |
2393 | case "$oldprefix" in | |
2394 | "") eval "$1=\"\$$2\"";; | |
2395 | *) | |
2396 | case "$3" in | |
2397 | "") eval "$1=";; | |
2398 | none) | |
2399 | eval "tp=\"\$$2\""; | |
2400 | case "$tp" in | |
2401 | ""|" ") eval "$1=\"\$$2\"";; | |
2402 | *) eval "$1=";; | |
2403 | esac;; | |
2404 | esac;; | |
2405 | esac;; | |
2406 | *) | |
2407 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; | |
2408 | case "$tp" in | |
2409 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; | |
2410 | /*-$oldprefix/*|\~*-$oldprefix/*) | |
2411 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; | |
2412 | *) eval "$1=\"\$$2\"";; | |
2413 | esac;; | |
2414 | esac' | |
a0d0e21e | 2415 | |
4633a7c4 LW |
2416 | : determine where private library files go |
2417 | : Usual default is /usr/local/lib/perl5. Also allow things like | |
2418 | : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant. | |
2419 | case "$prefix" in | |
2420 | *perl*) set dflt privlib lib ;; | |
2421 | *) set dflt privlib lib/$package ;; | |
2422 | esac | |
8e07c86e | 2423 | eval $prefixit |
4633a7c4 LW |
2424 | $cat <<EOM |
2425 | ||
2426 | There are some auxiliary files for $package that need to be put into a | |
2427 | private library directory that is accessible by everyone. | |
2428 | ||
2429 | EOM | |
2430 | fn=d~+ | |
2431 | rp='Pathname where the private library files will reside?' | |
8e07c86e | 2432 | . ./getfile |
4633a7c4 LW |
2433 | if $test "X$privlibexp" != "X$ansexp"; then |
2434 | installprivlib='' | |
8e07c86e | 2435 | fi |
4633a7c4 LW |
2436 | privlib="$ans" |
2437 | privlibexp="$ansexp" | |
8e07c86e AD |
2438 | if $afs; then |
2439 | $cat <<EOM | |
2304df62 | 2440 | |
8e07c86e | 2441 | Since you are running AFS, I need to distinguish the directory in which |
4633a7c4 | 2442 | private files reside from the directory in which they are installed (and from |
8e07c86e | 2443 | which they are presumably copied to the former directory by occult means). |
a0d0e21e | 2444 | |
8e07c86e | 2445 | EOM |
4633a7c4 LW |
2446 | case "$installprivlib" in |
2447 | '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2448 | *) dflt="$installprivlib";; | |
8e07c86e AD |
2449 | esac |
2450 | fn=de~ | |
4633a7c4 | 2451 | rp='Where will private files be installed?' |
8e07c86e | 2452 | . ./getfile |
4633a7c4 | 2453 | installprivlib="$ans" |
8e07c86e | 2454 | else |
4633a7c4 LW |
2455 | installprivlib="$privlibexp" |
2456 | fi | |
2457 | ||
2458 | : set the base revision | |
774d564b | 2459 | baserev=5.0 |
4633a7c4 LW |
2460 | |
2461 | : get the patchlevel | |
2462 | echo " " | |
2463 | echo "Getting the current patchlevel..." >&4 | |
2464 | if $test -r ../patchlevel.h;then | |
760ac839 LW |
2465 | patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h` |
2466 | subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h` | |
4633a7c4 LW |
2467 | else |
2468 | patchlevel=0 | |
f55a7265 | 2469 | subversion=0 |
8e07c86e | 2470 | fi |
5f05dabc | 2471 | $echo $n "(You have $package" $c |
2472 | case "$package" in | |
2473 | "*$baserev") ;; | |
2474 | *) $echo $n " $baserev" $c ;; | |
2475 | esac | |
2476 | $echo $n " patchlevel $patchlevel" $c | |
36477c24 | 2477 | test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c |
2478 | echo ".)" | |
2304df62 | 2479 | |
8e07c86e AD |
2480 | : set the prefixup variable, to restore leading tilda escape |
2481 | prefixup='case "$prefixexp" in | |
2482 | "$prefix") ;; | |
2483 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; | |
2484 | esac' | |
2485 | ||
4633a7c4 LW |
2486 | : determine where public architecture dependent libraries go |
2487 | set archlib archlib | |
8e07c86e | 2488 | eval $prefixit |
4633a7c4 | 2489 | case "$archlib" in |
8e07c86e | 2490 | '') |
774d564b | 2491 | case "$privlib" in |
2492 | '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` | |
2493 | set dflt | |
2494 | eval $prefixup | |
8e07c86e | 2495 | ;; |
774d564b | 2496 | *) if test 0 -eq "$subversion"; then |
2497 | version=`LC_ALL=C; export LC_ALL; \ | |
2498 | echo $baserev $patchlevel | \ | |
2499 | $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'` | |
2500 | else | |
2501 | version=`LC_ALL=C; export LC_ALL; \ | |
2502 | echo $baserev $patchlevel $subversion | \ | |
2503 | $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'` | |
2504 | fi | |
aa7e9289 | 2505 | dflt="$privlib/$archname/$version" |
774d564b | 2506 | ;; |
2507 | esac | |
2508 | ;; | |
2509 | *) | |
2510 | dflt="$archlib" | |
2511 | ;; | |
8e07c86e | 2512 | esac |
4633a7c4 LW |
2513 | cat <<EOM |
2514 | ||
2515 | $spackage contains architecture-dependent library files. If you are | |
2516 | sharing libraries in a heterogeneous environment, you might store | |
2517 | these files in a separate location. Otherwise, you can just include | |
2518 | them with the rest of the public library files. | |
2519 | ||
8e07c86e | 2520 | EOM |
4633a7c4 LW |
2521 | fn=d+~ |
2522 | rp='Where do you want to put the public architecture-dependent libraries?' | |
8e07c86e | 2523 | . ./getfile |
4633a7c4 LW |
2524 | archlib="$ans" |
2525 | archlibexp="$ansexp" | |
2526 | ||
8e07c86e AD |
2527 | if $afs; then |
2528 | $cat <<EOM | |
2529 | ||
2530 | Since you are running AFS, I need to distinguish the directory in which | |
4633a7c4 | 2531 | private files reside from the directory in which they are installed (and from |
8e07c86e AD |
2532 | which they are presumably copied to the former directory by occult means). |
2533 | ||
2534 | EOM | |
4633a7c4 LW |
2535 | case "$installarchlib" in |
2536 | '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2537 | *) dflt="$installarchlib";; | |
8e07c86e AD |
2538 | esac |
2539 | fn=de~ | |
4633a7c4 | 2540 | rp='Where will architecture-dependent library files be installed?' |
8e07c86e | 2541 | . ./getfile |
4633a7c4 | 2542 | installarchlib="$ans" |
8e07c86e | 2543 | else |
4633a7c4 LW |
2544 | installarchlib="$archlibexp" |
2545 | fi | |
2546 | if $test X"$archlib" = X"$privlib"; then | |
2547 | d_archlib="$undef" | |
2548 | else | |
2549 | d_archlib="$define" | |
8e07c86e AD |
2550 | fi |
2551 | ||
40a7a20a | 2552 | : set up the script used to warn in case of inconsistency |
28757baa | 2553 | cat <<EOS >whoa |
2554 | $startsh | |
2555 | EOS | |
2556 | cat <<'EOSC' >>whoa | |
40a7a20a | 2557 | dflt=y |
2558 | echo " " | |
2559 | echo "*** WHOA THERE!!! ***" >&4 | |
2560 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
2561 | rp=" Keep the $hint value?" | |
2562 | . ./myread | |
2563 | case "$ans" in | |
2564 | y) td=$was; tu=$was;; | |
2565 | esac | |
2566 | EOSC | |
2567 | ||
2568 | : function used to set $1 to $val | |
2569 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
2570 | case "$val$was" in | |
2571 | $define$undef) . ./whoa; eval "$var=\$td";; | |
2572 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
2573 | *) eval "$var=$val";; | |
2574 | esac' | |
2575 | ||
5f05dabc | 2576 | $cat <<EOM |
2577 | ||
2578 | Perl 5.004 can be compiled for binary compatibility with 5.003. | |
2579 | If you decide to do so, you will be able to continue using any | |
2580 | extensions that were compiled for Perl 5.003. However, binary | |
2581 | compatibility forces Perl to expose some of its internal symbols | |
2582 | in the same way that 5.003 did. So you may have symbol conflicts | |
2583 | if you embed a binary-compatible Perl in other programs. | |
2584 | ||
2585 | EOM | |
2586 | case "$d_bincompat3" in | |
2587 | "$undef") dflt=n ;; | |
2588 | *) dflt=y ;; | |
2589 | esac | |
2590 | rp='Binary compatibility with Perl 5.003?' | |
2591 | . ./myread | |
2592 | case "$ans" in | |
2593 | y*) val="$define" ;; | |
2594 | *) val="$undef" ;; | |
2595 | esac | |
2596 | set d_bincompat3 | |
2597 | eval $setvar | |
2598 | case "$d_bincompat3" in | |
2599 | "$define") bincompat3=y ;; | |
2600 | *) bincompat3=n ;; | |
2601 | esac | |
2602 | ||
40a7a20a | 2603 | : make some quick guesses about what we are up against |
2604 | echo " " | |
2605 | $echo $n "Hmm... $c" | |
2606 | echo exit 1 >bsd | |
2607 | echo exit 1 >usg | |
2608 | echo exit 1 >v7 | |
2609 | echo exit 1 >osf1 | |
2610 | echo exit 1 >eunice | |
2611 | echo exit 1 >xenix | |
2612 | echo exit 1 >venix | |
8ff267be | 2613 | echo exit 1 >os2 |
40a7a20a | 2614 | d_bsd="$undef" |
2615 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null | |
2616 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
2617 | then | |
2618 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
2619 | echo exit 0 >osf1 | |
2620 | elif test `echo abc | tr a-z A-Z` = Abc ; then | |
2621 | xxx=`./loc addbib blurfl $pth` | |
2622 | if $test -f $xxx; then | |
2623 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
2624 | echo exit 0 >bsd | |
2625 | echo exit 0 >usg | |
2626 | else | |
2627 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2628 | echo "Looks kind of like an extended USG system, but we'll see..." | |
2629 | else | |
2630 | echo "Looks kind of like a USG system, but we'll see..." | |
2631 | fi | |
2632 | echo exit 0 >usg | |
2633 | fi | |
2634 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2635 | echo "Looks kind of like a BSD system, but we'll see..." | |
2636 | d_bsd="$define" | |
2637 | echo exit 0 >bsd | |
2638 | else | |
2639 | echo "Looks kind of like a Version 7 system, but we'll see..." | |
2640 | echo exit 0 >v7 | |
2641 | fi | |
2642 | case "$eunicefix" in | |
2643 | *unixtovms*) | |
2644 | $cat <<'EOI' | |
2645 | There is, however, a strange, musty smell in the air that reminds me of | |
2646 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
2647 | EOI | |
2648 | echo exit 0 >eunice | |
2649 | d_eunice="$define" | |
2650 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
2651 | ;; | |
2652 | *) | |
2653 | echo " " | |
2654 | echo "Congratulations. You aren't running Eunice." | |
2655 | d_eunice="$undef" | |
2656 | ;; | |
2657 | esac | |
8ff267be | 2658 | : Detect OS2. The p_ variable is set above in the Head.U unit. |
2659 | case "$p_" in | |
2660 | :) ;; | |
2661 | *) | |
2662 | $cat <<'EOI' | |
2663 | I have the feeling something is not exactly right, however...don't tell me... | |
2664 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! | |
2665 | EOI | |
2666 | echo exit 0 >os2 | |
2667 | ;; | |
2668 | esac | |
40a7a20a | 2669 | if test -f /xenix; then |
2670 | echo "Actually, this looks more like a XENIX system..." | |
2671 | echo exit 0 >xenix | |
2672 | d_xenix="$define" | |
2673 | else | |
2674 | echo " " | |
2675 | echo "It's not Xenix..." | |
2676 | d_xenix="$undef" | |
2677 | fi | |
2678 | chmod +x xenix | |
2679 | $eunicefix xenix | |
2680 | if test -f /venix; then | |
2681 | echo "Actually, this looks more like a VENIX system..." | |
2682 | echo exit 0 >venix | |
2683 | else | |
2684 | echo " " | |
2685 | if ./xenix; then | |
2686 | : null | |
2687 | else | |
2688 | echo "Nor is it Venix..." | |
2689 | fi | |
2690 | fi | |
8ff267be | 2691 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 |
2692 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 | |
40a7a20a | 2693 | $rm -f foo |
2694 | ||
2695 | : see if setuid scripts can be secure | |
2696 | $cat <<EOM | |
2697 | ||
2698 | Some kernels have a bug that prevents setuid #! scripts from being | |
2699 | secure. Some sites have disabled setuid #! scripts because of this. | |
2700 | ||
2701 | First let's decide if your kernel supports secure setuid #! scripts. | |
2702 | (If setuid #! scripts would be secure but have been disabled anyway, | |
2703 | don't say that they are secure if asked.) | |
2704 | ||
2705 | EOM | |
2706 | ||
2707 | val="$undef" | |
2708 | if $test -d /dev/fd; then | |
2709 | echo "#!$ls" >reflect | |
2710 | chmod +x,u+s reflect | |
2711 | ./reflect >flect 2>&1 | |
2712 | if $contains "/dev/fd" flect >/dev/null; then | |
2713 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 | |
2714 | val="$define" | |
2715 | else | |
2716 | $cat <<EOM | |
2717 | If you are not sure if they are secure, I can check but I'll need a | |
2718 | username and password different from the one you are using right now. | |
2719 | If you don't have such a username or don't want me to test, simply | |
2720 | enter 'none'. | |
2721 | ||
2722 | EOM | |
2723 | rp='Other username to test security of setuid scripts with?' | |
2724 | dflt='none' | |
2725 | . ./myread | |
2726 | case "$ans" in | |
2727 | n|none) | |
2728 | case "$d_suidsafe" in | |
2729 | '') echo "I'll assume setuid scripts are *not* secure." >&4 | |
2730 | dflt=n;; | |
2731 | "$undef") | |
2732 | echo "Well, the $hint value is *not* secure." >&4 | |
2733 | dflt=n;; | |
2734 | *) echo "Well, the $hint value *is* secure." >&4 | |
2735 | dflt=y;; | |
2736 | esac | |
2737 | ;; | |
2738 | *) | |
2739 | $rm -f reflect flect | |
2740 | echo "#!$ls" >reflect | |
2741 | chmod +x,u+s reflect | |
2742 | echo >flect | |
2743 | chmod a+w flect | |
2744 | echo '"su" will (probably) prompt you for '"$ans's password." | |
2745 | su $ans -c './reflect >flect' | |
2746 | if $contains "/dev/fd" flect >/dev/null; then | |
2747 | echo "Okay, it looks like setuid scripts are secure." >&4 | |
2748 | dflt=y | |
2749 | else | |
2750 | echo "I don't think setuid scripts are secure." >&4 | |
2751 | dflt=n | |
2752 | fi | |
2753 | ;; | |
2754 | esac | |
2755 | rp='Does your kernel have *secure* setuid scripts?' | |
2756 | . ./myread | |
2757 | case "$ans" in | |
2758 | [yY]*) val="$define";; | |
2759 | *) val="$undef";; | |
2760 | esac | |
2761 | fi | |
2762 | else | |
2763 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 | |
760ac839 | 2764 | echo "(That's for file descriptors, not floppy disks.)" |
40a7a20a | 2765 | val="$undef" |
2766 | fi | |
2767 | set d_suidsafe | |
2768 | eval $setvar | |
2769 | ||
2770 | $rm -f reflect flect | |
2771 | ||
2772 | : now see if they want to do setuid emulation | |
2773 | echo " " | |
2774 | val="$undef" | |
2775 | case "$d_suidsafe" in | |
2776 | "$define") | |
2777 | val="$undef" | |
2778 | echo "No need to emulate SUID scripts since they are secure here." >& 4 | |
2779 | ;; | |
2780 | *) | |
2781 | $cat <<EOM | |
2782 | Some systems have disabled setuid scripts, especially systems where | |
2783 | setuid scripts cannot be secure. On systems where setuid scripts have | |
2784 | been disabled, the setuid/setgid bits on scripts are currently | |
2785 | useless. It is possible for $package to detect those bits and emulate | |
2786 | setuid/setgid in a secure fashion. This emulation will only work if | |
2787 | setuid scripts have been disabled in your kernel. | |
2788 | ||
2789 | EOM | |
2790 | case "$d_dosuid" in | |
2791 | "$define") dflt=y ;; | |
2792 | *) dflt=n ;; | |
2793 | esac | |
2794 | rp="Do you want to do setuid/setgid emulation?" | |
2795 | . ./myread | |
2796 | case "$ans" in | |
2797 | [yY]*) val="$define";; | |
2798 | *) val="$undef";; | |
2799 | esac | |
2800 | ;; | |
2801 | esac | |
2802 | set d_dosuid | |
2803 | eval $setvar | |
2804 | ||
37120919 AD |
2805 | : determine where site specific libraries go. |
2806 | set sitelib sitelib | |
2807 | eval $prefixit | |
2808 | case "$sitelib" in | |
2809 | '') dflt="$privlib/site_perl" ;; | |
2810 | *) dflt="$sitelib" ;; | |
2811 | esac | |
2812 | $cat <<EOM | |
2813 | ||
2814 | The installation process will also create a directory for | |
2815 | site-specific extensions and modules. Some users find it convenient | |
2816 | to place all local files in this directory rather than in the main | |
2817 | distribution directory. | |
2818 | ||
2819 | EOM | |
2820 | fn=d~+ | |
2821 | rp='Pathname for the site-specific library files?' | |
2822 | . ./getfile | |
2823 | if $test "X$sitelibexp" != "X$ansexp"; then | |
2824 | installsitelib='' | |
2825 | fi | |
2826 | sitelib="$ans" | |
2827 | sitelibexp="$ansexp" | |
2828 | if $afs; then | |
2829 | $cat <<EOM | |
2830 | ||
2831 | Since you are running AFS, I need to distinguish the directory in which | |
2832 | private files reside from the directory in which they are installed (and from | |
2833 | which they are presumably copied to the former directory by occult means). | |
2834 | ||
2835 | EOM | |
2836 | case "$installsitelib" in | |
2837 | '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;; | |
2838 | *) dflt="$installsitelib";; | |
2839 | esac | |
2840 | fn=de~ | |
2841 | rp='Where will private files be installed?' | |
2842 | . ./getfile | |
2843 | installsitelib="$ans" | |
2844 | else | |
2845 | installsitelib="$sitelibexp" | |
2846 | fi | |
4633a7c4 | 2847 | |
37120919 AD |
2848 | : determine where site specific architecture-dependent libraries go. |
2849 | xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'` | |
2850 | : xxx is usuually lib/site_perl/archname. | |
2851 | set sitearch sitearch none | |
8e07c86e | 2852 | eval $prefixit |
37120919 AD |
2853 | case "$sitearch" in |
2854 | '') dflt="$sitelib/$archname" ;; | |
2855 | *) dflt="$sitearch" ;; | |
2856 | esac | |
8e07c86e AD |
2857 | $cat <<EOM |
2858 | ||
4633a7c4 LW |
2859 | The installation process will also create a directory for |
2860 | architecture-dependent site-specific extensions and modules. | |
8e07c86e AD |
2861 | |
2862 | EOM | |
4633a7c4 LW |
2863 | fn=nd~+ |
2864 | rp='Pathname for the site-specific architecture-dependent library files?' | |
8e07c86e | 2865 | . ./getfile |
4633a7c4 LW |
2866 | if $test "X$sitearchexp" != "X$ansexp"; then |
2867 | installsitearch='' | |
8e07c86e | 2868 | fi |
4633a7c4 LW |
2869 | sitearch="$ans" |
2870 | sitearchexp="$ansexp" | |
8e07c86e AD |
2871 | if $afs; then |
2872 | $cat <<EOM | |
2873 | ||
2874 | Since you are running AFS, I need to distinguish the directory in which | |
2875 | private files reside from the directory in which they are installed (and from | |
2876 | which they are presumably copied to the former directory by occult means). | |
2877 | ||
2878 | EOM | |
4633a7c4 LW |
2879 | case "$installsitearch" in |
2880 | '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;; | |
2881 | *) dflt="$installsitearch";; | |
8e07c86e AD |
2882 | esac |
2883 | fn=de~ | |
2884 | rp='Where will private files be installed?' | |
2885 | . ./getfile | |
4633a7c4 | 2886 | installsitearch="$ans" |
8e07c86e | 2887 | else |
4633a7c4 | 2888 | installsitearch="$sitearchexp" |
8e07c86e AD |
2889 | fi |
2890 | ||
4633a7c4 LW |
2891 | : determine where old public architecture dependent libraries might be |
2892 | case "$oldarchlib" in | |
2893 | '') case "$privlib" in | |
2894 | '') ;; | |
2895 | *) dflt="$privlib/$archname" | |
8e07c86e | 2896 | ;; |
8e07c86e AD |
2897 | esac |
2898 | ;; | |
4633a7c4 LW |
2899 | *) dflt="$oldarchlib" |
2900 | ;; | |
8e07c86e | 2901 | esac |
4633a7c4 LW |
2902 | if $test ! -d "$dflt/auto"; then |
2903 | dflt=none | |
2904 | fi | |
8e07c86e AD |
2905 | cat <<EOM |
2906 | ||
760ac839 | 2907 | In 5.001, Perl stored architecture-dependent library files in a directory |
4633a7c4 LW |
2908 | with a name such as $privlib/$archname, |
2909 | and this directory contained files from the standard extensions and | |
2910 | files from any additional extensions you might have added. Starting | |
2911 | with version 5.002, all the architecture-dependent standard extensions | |
760ac839 LW |
2912 | will go into a version-specific directory such as |
2913 | $archlib, | |
4633a7c4 LW |
2914 | while locally-added extensions will go into |
2915 | $sitearch. | |
2916 | ||
2917 | If you wish Perl to continue to search the old architecture-dependent | |
2918 | library for your local extensions, give the path to that directory. | |
2919 | If you do not wish to use your old architecture-dependent library | |
2920 | files, answer 'none'. | |
8e07c86e AD |
2921 | |
2922 | EOM | |
4633a7c4 LW |
2923 | fn=dn~ |
2924 | rp='Directory for your old 5.001 architecture-dependent libraries?' | |
8e07c86e | 2925 | . ./getfile |
4633a7c4 LW |
2926 | oldarchlib="$ans" |
2927 | oldarchlibexp="$ansexp" | |
2928 | case "$oldarchlib" in | |
2929 | ''|' ') val="$undef" ;; | |
2930 | *) val="$define" ;; | |
2931 | esac | |
2932 | set d_oldarchlib | |
2933 | eval $setvar | |
8e07c86e | 2934 | |
4633a7c4 LW |
2935 | : determine where public executables go |
2936 | echo " " | |
2937 | set dflt bin bin | |
2938 | eval $prefixit | |
2939 | fn=d~ | |
2940 | rp='Pathname where the public executables will reside?' | |
2941 | . ./getfile | |
2942 | if $test "X$ansexp" != "X$binexp"; then | |
2943 | installbin='' | |
2944 | fi | |
2945 | bin="$ans" | |
2946 | binexp="$ansexp" | |
8e07c86e AD |
2947 | if $afs; then |
2948 | $cat <<EOM | |
2949 | ||
2950 | Since you are running AFS, I need to distinguish the directory in which | |
4633a7c4 | 2951 | executables reside from the directory in which they are installed (and from |
8e07c86e AD |
2952 | which they are presumably copied to the former directory by occult means). |
2953 | ||
2954 | EOM | |
4633a7c4 LW |
2955 | case "$installbin" in |
2956 | '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;; | |
2957 | *) dflt="$installbin";; | |
8e07c86e AD |
2958 | esac |
2959 | fn=de~ | |
4633a7c4 | 2960 | rp='Where will public executables be installed?' |
8e07c86e | 2961 | . ./getfile |
4633a7c4 | 2962 | installbin="$ans" |
8e07c86e | 2963 | else |
4633a7c4 | 2964 | installbin="$binexp" |
8e07c86e AD |
2965 | fi |
2966 | ||
2c7991dc | 2967 | : determine where manual pages are on this system |
2968 | echo " " | |
2969 | case "$sysman" in | |
2970 | '') | |
2971 | syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' | |
2972 | syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" | |
2973 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" | |
2974 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
2975 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" | |
2976 | sysman=`./loc . /usr/man/man1 $syspath` | |
2977 | ;; | |
2978 | esac | |
2979 | if $test -d "$sysman"; then | |
2980 | echo "System manual is in $sysman." >&4 | |
2981 | else | |
2982 | echo "Could not find manual pages in source form." >&4 | |
2983 | fi | |
2984 | ||
2afac517 | 2985 | : see what memory models we can support |
2986 | case "$models" in | |
2987 | '') | |
2988 | $cat >pdp11.c <<'EOP' | |
2989 | main() { | |
2990 | #ifdef pdp11 | |
2991 | exit(0); | |
2992 | #else | |
2993 | exit(1); | |
2994 | #endif | |
2995 | } | |
2996 | EOP | |
2997 | cc -o pdp11 pdp11.c >/dev/null 2>&1 | |
2998 | if ./pdp11 2>/dev/null; then | |
2999 | dflt='unsplit split' | |
3000 | else | |
3001 | tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` | |
3002 | case "$tans" in | |
3003 | X) dflt='none';; | |
3004 | *) if $test -d /lib/small || $test -d /usr/lib/small; then | |
3005 | dflt='small' | |
3006 | else | |
3007 | dflt='' | |
3008 | fi | |
3009 | if $test -d /lib/medium || $test -d /usr/lib/medium; then | |
3010 | dflt="$dflt medium" | |
3011 | fi | |
3012 | if $test -d /lib/large || $test -d /usr/lib/large; then | |
3013 | dflt="$dflt large" | |
3014 | fi | |
3015 | if $test -d /lib/huge || $test -d /usr/lib/huge; then | |
3016 | dflt="$dflt huge" | |
3017 | fi | |
3018 | esac | |
3019 | fi;; | |
3020 | *) dflt="$models";; | |
3021 | esac | |
8e07c86e | 3022 | $cat <<EOM |
2afac517 | 3023 | |
3024 | Some systems have different model sizes. On most systems they are called | |
3025 | small, medium, large, and huge. On the PDP11 they are called unsplit and | |
3026 | split. If your system doesn't support different memory models, say "none". | |
3027 | If you wish to force everything to one memory model, say "none" here and | |
3028 | put the appropriate flags later when it asks you for other cc and ld flags. | |
3029 | Venix systems may wish to put "none" and let the compiler figure things out. | |
3030 | (In the following question multiple model names should be space separated.) | |
8e07c86e | 3031 | |
8e07c86e | 3032 | EOM |
2afac517 | 3033 | rp="Which memory models are supported?" |
3034 | . ./myread | |
3035 | models="$ans" | |
3036 | ||
3037 | case "$models" in | |
3038 | none) | |
3039 | small='' | |
3040 | medium='' | |
3041 | large='' | |
3042 | huge='' | |
3043 | unsplit='' | |
3044 | split='' | |
2c7991dc | 3045 | ;; |
2afac517 | 3046 | *split) |
3047 | case "$split" in | |
3048 | '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \ | |
3049 | $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then | |
3050 | dflt='-i' | |
3051 | else | |
3052 | dflt='none' | |
3053 | fi;; | |
3054 | *) dflt="$split";; | |
3055 | esac | |
3056 | rp="What flag indicates separate I and D space?" | |
3057 | . ./myread | |
3058 | tans="$ans" | |
3059 | case "$tans" in | |
3060 | none) tans='';; | |
3061 | esac | |
3062 | split="$tans" | |
3063 | unsplit='';; | |
3064 | *large*|*small*|*medium*|*huge*) | |
3065 | case "$models" in | |
3066 | *large*) | |
3067 | case "$large" in | |
3068 | '') dflt='-Ml';; | |
3069 | *) dflt="$large";; | |
3070 | esac | |
3071 | rp="What flag indicates large model?" | |
3072 | . ./myread | |
3073 | tans="$ans" | |
3074 | case "$tans" in | |
3075 | none) tans=''; | |
3076 | esac | |
3077 | large="$tans";; | |
3078 | *) large='';; | |
3079 | esac | |
3080 | case "$models" in | |
3081 | *huge*) case "$huge" in | |
3082 | '') dflt='-Mh';; | |
3083 | *) dflt="$huge";; | |
3084 | esac | |
3085 | rp="What flag indicates huge model?" | |
3086 | . ./myread | |
3087 | tans="$ans" | |
3088 | case "$tans" in | |
3089 | none) tans=''; | |
3090 | esac | |
3091 | huge="$tans";; | |
3092 | *) huge="$large";; | |
3093 | esac | |
3094 | case "$models" in | |
3095 | *medium*) case "$medium" in | |
3096 | '') dflt='-Mm';; | |
3097 | *) dflt="$medium";; | |
3098 | esac | |
3099 | rp="What flag indicates medium model?" | |
3100 | . ./myread | |
3101 | tans="$ans" | |
3102 | case "$tans" in | |
3103 | none) tans=''; | |
3104 | esac | |
3105 | medium="$tans";; | |
3106 | *) medium="$large";; | |
3107 | esac | |
3108 | case "$models" in | |
3109 | *small*) case "$small" in | |
3110 | '') dflt='none';; | |
3111 | *) dflt="$small";; | |
3112 | esac | |
3113 | rp="What flag indicates small model?" | |
3114 | . ./myread | |
3115 | tans="$ans" | |
3116 | case "$tans" in | |
3117 | none) tans=''; | |
3118 | esac | |
3119 | small="$tans";; | |
3120 | *) small='';; | |
25f94b33 | 3121 | esac |
8e07c86e | 3122 | ;; |
2afac517 | 3123 | *) |
3124 | echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 | |
8e07c86e AD |
3125 | ;; |
3126 | esac | |
8e07c86e | 3127 | |
2afac517 | 3128 | : see if we need a special compiler |
3129 | echo " " | |
3130 | if ./usg; then | |
3131 | case "$cc" in | |
3132 | '') case "$Mcc" in | |
3133 | /*) dflt='Mcc';; | |
3134 | *) case "$large" in | |
3135 | -M*) dflt='cc';; | |
3136 | *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then | |
3137 | if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then | |
3138 | dflt='cc' | |
3139 | else | |
3140 | dflt='cc -M' | |
3141 | fi | |
3142 | else | |
3143 | dflt='cc' | |
3144 | fi;; | |
3145 | esac;; | |
3146 | esac;; | |
3147 | *) dflt="$cc";; | |
3148 | esac | |
3149 | $cat <<'EOM' | |
3150 | On some systems the default C compiler will not resolve multiple global | |
3151 | references that happen to have the same name. On some such systems the "Mcc" | |
3152 | command may be used to force these to be resolved. On other systems a "cc -M" | |
3153 | command is required. (Note that the -M flag on other systems indicates a | |
3154 | memory model to use!) If you have the Gnu C compiler, you might wish to use | |
3155 | that instead. | |
8e07c86e AD |
3156 | |
3157 | EOM | |
2afac517 | 3158 | rp="What command will force resolution on this system?" |
3159 | . ./myread | |
3160 | cc="$ans" | |
8e07c86e | 3161 | else |
2afac517 | 3162 | case "$cc" in |
3163 | '') dflt=cc;; | |
3164 | *) dflt="$cc";; | |
3165 | esac | |
3166 | rp="Use which C compiler?" | |
3167 | . ./myread | |
3168 | cc="$ans" | |
8e07c86e | 3169 | fi |
2afac517 | 3170 | echo " " |
3171 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
3172 | $cat >gccvers.c <<EOM | |
3173 | #include <stdio.h> | |
3174 | int main() { | |
3175 | #ifdef __GNUC__ | |
3176 | #ifdef __VERSION__ | |
3177 | printf("%s\n", __VERSION__); | |
3178 | #else | |
3179 | printf("%s\n", "1"); | |
3180 | #endif | |
3181 | #endif | |
3182 | exit(0); | |
3183 | } | |
3184 | EOM | |
3185 | if $cc -o gccvers gccvers.c >/dev/null 2>&1; then | |
3186 | gccversion=`./gccvers` | |
3187 | case "$gccversion" in | |
3188 | '') echo "You are not using GNU cc." ;; | |
3189 | *) echo "You are using GNU cc $gccversion." ;; | |
3190 | esac | |
3191 | else | |
3192 | echo " " | |
3193 | echo "*** WHOA THERE!!! ***" >&4 | |
3194 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
3195 | case "$knowitall" in | |
3196 | '') | |
3197 | echo " You'd better start hunting for one and let me know about it." >&4 | |
3198 | exit 1 | |
2c7991dc | 3199 | ;; |
8e07c86e | 3200 | esac |
2afac517 | 3201 | fi |
3202 | $rm -f gccvers* | |
3203 | case "$gccversion" in | |
3204 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
8e07c86e AD |
3205 | esac |
3206 | ||
2afac517 | 3207 | : What should the include directory be ? |
8e07c86e | 3208 | echo " " |
2afac517 | 3209 | $echo $n "Hmm... $c" |
3210 | dflt='/usr/include' | |
3211 | incpath='' | |
3212 | mips_type='' | |
3213 | if $test -f /bin/mips && /bin/mips; then | |
3214 | echo "Looks like a MIPS system..." | |
3215 | $cat >usr.c <<'EOCP' | |
3216 | #ifdef SYSTYPE_BSD43 | |
3217 | /bsd43 | |
3218 | #endif | |
3219 | EOCP | |
3220 | if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then | |
3221 | dflt='/bsd43/usr/include' | |
3222 | incpath='/bsd43' | |
3223 | mips_type='BSD 4.3' | |
8e07c86e | 3224 | else |
2afac517 | 3225 | mips_type='System V' |
8e07c86e | 3226 | fi |
2afac517 | 3227 | $rm -f usr.c usr.out |
3228 | echo "and you're compiling with the $mips_type compiler and libraries." | |
3229 | xxx_prompt=y | |
3230 | echo "exit 0" >mips | |
8e07c86e | 3231 | else |
2afac517 | 3232 | echo "Doesn't look like a MIPS system." |
3233 | xxx_prompt=n | |
3234 | echo "exit 1" >mips | |
3235 | fi | |
3236 | chmod +x mips | |
3237 | $eunicefix mips | |
3238 | echo " " | |
3239 | case "$usrinc" in | |
3240 | '') ;; | |
3241 | *) dflt="$usrinc";; | |
3242 | esac | |
3243 | case "$xxx_prompt" in | |
3244 | y) fn=d/ | |
3245 | rp='Where are the include files you want to use?' | |
3246 | . ./getfile | |
3247 | usrinc="$ans" | |
3248 | ;; | |
3249 | *) usrinc="$dflt" | |
3250 | ;; | |
3251 | esac | |
8e07c86e | 3252 | |
2afac517 | 3253 | : Set private lib path |
3254 | case "$plibpth" in | |
3255 | '') if ./mips; then | |
3256 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
3257 | fi;; | |
3258 | esac | |
3259 | case "$libpth" in | |
3260 | ' ') dlist='';; | |
3261 | '') dlist="$loclibpth $plibpth $glibpth";; | |
3262 | *) dlist="$libpth";; | |
3263 | esac | |
8e07c86e | 3264 | |
2afac517 | 3265 | : Now check and see which directories actually exist, avoiding duplicates |
3266 | libpth='' | |
3267 | for xxx in $dlist | |
3268 | do | |
3269 | if $test -d $xxx; then | |
3270 | case " $libpth " in | |
3271 | *" $xxx "*) ;; | |
3272 | *) libpth="$libpth $xxx";; | |
3273 | esac | |
3274 | fi | |
3275 | done | |
3276 | $cat <<'EOM' | |
8e07c86e | 3277 | |
2afac517 | 3278 | Some systems have incompatible or broken versions of libraries. Among |
3279 | the directories listed in the question below, please remove any you | |
3280 | know not to be holding relevant libraries, and add any that are needed. | |
3281 | Say "none" for none. | |
8e07c86e | 3282 | |
8e07c86e | 3283 | EOM |
2afac517 | 3284 | case "$libpth" in |
3285 | '') dflt='none';; | |
3286 | *) | |
3287 | set X $libpth | |
3288 | shift | |
3289 | dflt=${1+"$@"} | |
4633a7c4 | 3290 | ;; |
8e07c86e | 3291 | esac |
2afac517 | 3292 | rp="Directories to use for library searches?" |
3293 | . ./myread | |
3294 | case "$ans" in | |
3295 | none) libpth=' ';; | |
3296 | *) libpth="$ans";; | |
3297 | esac | |
8e07c86e | 3298 | |
5f05dabc | 3299 | : Define several unixisms. Hints files or command line options |
3300 | : can be used to override them. | |
3301 | case "$ar" in | |
3302 | '') ar='ar';; | |
3303 | esac | |
3304 | case "$lib_ext" in | |
3305 | '') lib_ext='.a';; | |
3306 | esac | |
3307 | case "$obj_ext" in | |
3308 | '') obj_ext='.o';; | |
3309 | esac | |
3310 | case "$path_sep" in | |
3311 | '') path_sep=':';; | |
3312 | esac | |
3313 | : Which makefile gets called first. This is used by make depend. | |
3314 | case "$firstmakefile" in | |
3315 | '') firstmakefile='makefile';; | |
3316 | esac | |
3317 | ||
2afac517 | 3318 | : compute shared library extension |
3319 | case "$so" in | |
3320 | '') | |
3321 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
3322 | dflt='sl' | |
3323 | else | |
3324 | dflt='so' | |
3325 | fi | |
3326 | ;; | |
3327 | *) dflt="$so";; | |
8e07c86e | 3328 | esac |
2afac517 | 3329 | $cat <<EOM |
8e07c86e | 3330 | |
2afac517 | 3331 | On some systems, shared libraries may be available. Answer 'none' if |
3332 | you want to suppress searching of shared libraries for the remaining | |
3333 | of this configuration. | |
8e07c86e AD |
3334 | |
3335 | EOM | |
2afac517 | 3336 | rp='What is the file extension used for shared libraries?' |
3337 | . ./myread | |
3338 | so="$ans" | |
8e07c86e | 3339 | |
2afac517 | 3340 | : Looking for optional libraries |
3341 | echo " " | |
3342 | echo "Checking for optional libraries..." >&4 | |
3343 | case "$libs" in | |
3344 | ' '|'') dflt='';; | |
3345 | *) dflt="$libs";; | |
8e07c86e | 3346 | esac |
2afac517 | 3347 | case "$libswanted" in |
3348 | '') libswanted='c_s';; | |
3349 | esac | |
3350 | for thislib in $libswanted; do | |
3351 | ||
3352 | if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then | |
3353 | echo "Found -l$thislib (shared)." | |
3354 | case " $dflt " in | |
3355 | *"-l$thislib "*);; | |
3356 | *) dflt="$dflt -l$thislib";; | |
4633a7c4 | 3357 | esac |
2afac517 | 3358 | elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then |
3359 | echo "Found -l$thislib (shared)." | |
3360 | case " $dflt " in | |
3361 | *"-l$thislib "*);; | |
3362 | *) dflt="$dflt -l$thislib";; | |
3363 | esac | |
5f05dabc | 3364 | elif xxx=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$xxx"; then |
2afac517 | 3365 | echo "Found -l$thislib." |
3366 | case " $dflt " in | |
3367 | *"-l$thislib "*);; | |
3368 | *) dflt="$dflt -l$thislib";; | |
3369 | esac | |
5f05dabc | 3370 | elif xxx=`./loc $thislib$lib_ext X $libpth`; $test -f "$xxx"; then |
2afac517 | 3371 | echo "Found -l$thislib." |
3372 | case " $dflt " in | |
3373 | *"-l$thislib "*);; | |
3374 | *) dflt="$dflt -l$thislib";; | |
3375 | esac | |
5f05dabc | 3376 | elif xxx=`./loc lib${thislib}_s$lib_ext X $libpth`; $test -f "$xxx"; then |
2afac517 | 3377 | echo "Found -l${thislib}_s." |
3378 | case " $dflt " in | |
3379 | *"-l$thislib "*);; | |
3380 | *) dflt="$dflt -l${thislib}_s";; | |
3381 | esac | |
5f05dabc | 3382 | elif xxx=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$xxx"; then |
2afac517 | 3383 | echo "Found -l$thislib." |
3384 | case " $dflt " in | |
3385 | *"-l$thislib "*);; | |
3386 | *) dflt="$dflt -l$thislib";; | |
3387 | esac | |
3388 | else | |
3389 | echo "No -l$thislib." | |
3390 | fi | |
3391 | done | |
3392 | set X $dflt | |
3393 | shift | |
3394 | dflt="$*" | |
3395 | case "$libs" in | |
3396 | '') dflt="$dflt";; | |
3397 | *) dflt="$libs";; | |
3398 | esac | |
3399 | case "$dflt" in | |
3400 | ' '|'') dflt='none';; | |
8e07c86e | 3401 | esac |
2afac517 | 3402 | |
4633a7c4 LW |
3403 | $cat <<EOM |
3404 | ||
2afac517 | 3405 | Some versions of Unix support shared libraries, which make executables smaller |
3406 | but make load time slightly longer. | |
8e07c86e | 3407 | |
2afac517 | 3408 | On some systems, mostly System V Release 3's, the shared library is included |
3409 | by putting the option "-lc_s" as the last thing on the cc command line when | |
3410 | linking. Other systems use shared libraries by default. There may be other | |
3411 | libraries needed to compile $package on your machine as well. If your system | |
3412 | needs the "-lc_s" option, include it here. Include any other special libraries | |
3413 | here as well. Say "none" for none. | |
4633a7c4 | 3414 | EOM |
2afac517 | 3415 | |
3416 | echo " " | |
3417 | rp="Any additional libraries?" | |
8e07c86e | 3418 | . ./myread |
2afac517 | 3419 | case "$ans" in |
3420 | none) libs=' ';; | |
3421 | *) libs="$ans";; | |
3422 | esac | |
8e07c86e | 3423 | |
4633a7c4 | 3424 | : see how we invoke the C preprocessor |
2304df62 | 3425 | echo " " |
4633a7c4 LW |
3426 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 |
3427 | cat <<'EOT' >testcpp.c | |
3428 | #define ABC abc | |
3429 | #define XYZ xyz | |
3430 | ABC.XYZ | |
3431 | EOT | |
3432 | cd .. | |
3433 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
3434 | chmod 755 cppstdin | |
3435 | wrapper=`pwd`/cppstdin | |
3436 | ok='false' | |
3437 | cd UU | |
3438 | ||
3439 | if $test "X$cppstdin" != "X" && \ | |
3440 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
3441 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3442 | then | |
3443 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
3444 | case "$cpprun" in | |
3445 | '') echo "But let's see if we can live without a wrapper..." ;; | |
3446 | *) | |
3447 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
3448 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3449 | then | |
3450 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" | |
3451 | ok='true' | |
a0d0e21e | 3452 | else |
4633a7c4 | 3453 | echo "(However, $cpprun $cpplast does not work, let's see...)" |
2304df62 | 3454 | fi |
2304df62 | 3455 | ;; |
2304df62 | 3456 | esac |
4633a7c4 LW |
3457 | else |
3458 | case "$cppstdin" in | |
3459 | '') ;; | |
3460 | *) | |
3461 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
3462 | ;; | |
3463 | esac | |
3464 | fi | |
3465 | ||
3466 | if $ok; then | |
3467 | : nothing | |
3468 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
3469 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
3470 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3471 | echo "Yup, it does." | |
3472 | x_cpp="$cc -E" | |
3473 | x_minus=''; | |
3474 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
3475 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
3476 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3477 | echo "Yup, it does." | |
3478 | x_cpp="$cc -E" | |
3479 | x_minus='-'; | |
3480 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
3481 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
3482 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3483 | echo "Yipee, that works!" | |
3484 | x_cpp="$cc -P" | |
3485 | x_minus=''; | |
3486 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
3487 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
3488 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3489 | echo "At long last!" | |
3490 | x_cpp="$cc -P" | |
3491 | x_minus='-'; | |
3492 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
3493 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
3494 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3495 | echo "It works!" | |
3496 | x_cpp="$cpp" | |
3497 | x_minus=''; | |
3498 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
3499 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
3500 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3501 | echo "Hooray, it works! I was beginning to wonder." | |
3502 | x_cpp="$cpp" | |
3503 | x_minus='-'; | |
3504 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
3505 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3506 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3507 | x_cpp="$wrapper" | |
3508 | x_minus='' | |
3509 | echo "Eureka!" | |
3510 | else | |
3511 | dflt='' | |
3512 | rp="No dice. I can't find a C preprocessor. Name one:" | |
3513 | . ./myread | |
3514 | x_cpp="$ans" | |
3515 | x_minus='' | |
3516 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
3517 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3518 | echo "OK, that will do." >&4 | |
3519 | else | |
3520 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
3521 | exit 1 | |
3522 | fi | |
3523 | fi | |
3524 | ||
3525 | case "$ok" in | |
3526 | false) | |
3527 | cppstdin="$x_cpp" | |
3528 | cppminus="$x_minus" | |
3529 | cpprun="$x_cpp" | |
3530 | cpplast="$x_minus" | |
3531 | set X $x_cpp | |
3532 | shift | |
3533 | case "$1" in | |
3534 | "$cpp") | |
3535 | echo "Perhaps can we force $cc -E using a wrapper..." | |
3536 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3537 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3538 | then | |
3539 | echo "Yup, we can." | |
3540 | cppstdin="$wrapper" | |
3541 | cppminus=''; | |
3542 | else | |
3543 | echo "Nope, we'll have to live without it..." | |
3544 | fi | |
3545 | ;; | |
3546 | esac | |
3547 | case "$cpprun" in | |
3548 | "$wrapper") | |
3549 | cpprun='' | |
3550 | cpplast='' | |
3551 | ;; | |
3552 | esac | |
3553 | ;; | |
3554 | esac | |
3555 | ||
3556 | case "$cppstdin" in | |
3557 | "$wrapper") ;; | |
3558 | *) $rm -f $wrapper;; | |
3559 | esac | |
3560 | $rm -f testcpp.c testcpp.out | |
3561 | ||
2afac517 | 3562 | : determine optimize, if desired, or use for debug flag also |
3563 | case "$optimize" in | |
2ae324a7 | 3564 | ' '|$undef) dflt='none';; |
2afac517 | 3565 | '') dflt='-O';; |
3566 | *) dflt="$optimize";; | |
4633a7c4 | 3567 | esac |
2afac517 | 3568 | $cat <<EOH |
4633a7c4 | 3569 | |
760ac839 | 3570 | Some C compilers have problems with their optimizers. By default, $package |
4633a7c4 LW |
3571 | compiles with the -O flag to use the optimizer. Alternately, you might want |
3572 | to use the symbolic debugger, which uses the -g flag (on traditional Unix | |
3573 | systems). Either flag can be specified here. To use neither flag, specify | |
3574 | the word "none". | |
3575 | ||
3576 | EOH | |
3577 | rp="What optimizer/debugger flag should be used?" | |
3578 | . ./myread | |
3579 | optimize="$ans" | |
3580 | case "$optimize" in | |
3581 | 'none') optimize=" ";; | |
3582 | esac | |
3583 | ||
3584 | dflt='' | |
25f94b33 AD |
3585 | : We will not override a previous value, but we might want to |
3586 | : augment a hint file | |
3587 | case "$hint" in | |
3588 | none|recommended) | |
4633a7c4 LW |
3589 | case "$gccversion" in |
3590 | 1*) dflt='-fpcc-struct-return' ;; | |
3591 | esac | |
3592 | case "$optimize" in | |
3593 | *-g*) dflt="$dflt -DDEBUGGING";; | |
3594 | esac | |
3595 | case "$gccversion" in | |
3596 | 2*) if test -d /etc/conf/kconfig.d && | |
3597 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
3598 | then | |
3599 | dflt="$dflt -posix" | |
3600 | fi | |
3601 | ;; | |
3602 | esac | |
3603 | ;; | |
3604 | esac | |
3605 | ||
a4f3eea9 | 3606 | case "$mips_type" in |
3607 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
3608 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
3609 | esac | |
3610 | for thisincl in $inclwanted; do | |
3611 | if $test -d $thisincl; then | |
3612 | if $test x$thisincl != x$usrinc; then | |
3613 | case "$dflt" in | |
3614 | *$thisincl*);; | |
3615 | *) dflt="$dflt -I$thisincl";; | |
3616 | esac | |
3617 | fi | |
3618 | fi | |
3619 | done | |
3620 | ||
3621 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then | |
3622 | xxx=true; | |
3623 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
3624 | xxx=true; | |
3625 | else | |
3626 | xxx=false; | |
3627 | fi; | |
3628 | if $xxx; then | |
3629 | case "$dflt" in | |
3630 | *$2*);; | |
3631 | *) dflt="$dflt -D$2";; | |
3632 | esac; | |
3633 | fi' | |
3634 | ||
3635 | if ./osf1; then | |
3636 | set signal.h __LANGUAGE_C__; eval $inctest | |
3637 | else | |
3638 | set signal.h LANGUAGE_C; eval $inctest | |
3639 | fi | |
a4f3eea9 | 3640 | |
3641 | case "$hint" in | |
3642 | none|recommended) dflt="$ccflags $dflt" ;; | |
3643 | *) dflt="$ccflags";; | |
3644 | esac | |
3645 | ||
3646 | case "$dflt" in | |
3647 | ''|' ') dflt=none;; | |
3648 | esac | |
3649 | $cat <<EOH | |
3650 | ||
3651 | Your C compiler may want other flags. For this question you should include | |
3652 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
3653 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
3654 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
3655 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE, | |
3656 | -DHIDEMYMALLOC or -DCRIPPLED_CC. | |
3657 | ||
3658 | To use no flags, specify the word "none". | |
3659 | ||
3660 | EOH | |
3661 | set X $dflt | |
3662 | shift | |
3663 | dflt=${1+"$@"} | |
3664 | rp="Any additional cc flags?" | |
3665 | . ./myread | |
3666 | case "$ans" in | |
3667 | none) ccflags='';; | |
3668 | *) ccflags="$ans";; | |
3669 | esac | |
3670 | ||
3671 | : the following weeds options from ccflags that are of no interest to cpp | |
3672 | cppflags="$ccflags" | |
3673 | case "$gccversion" in | |
3674 | 1*) cppflags="$cppflags -D__GNUC__" | |
3675 | esac | |
3676 | case "$mips_type" in | |
3677 | '');; | |
3678 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
3679 | esac | |
3680 | case "$cppflags" in | |
3681 | '');; | |
3682 | *) | |
3683 | echo " " | |
3684 | echo "Let me guess what the preprocessor flags are..." >&4 | |
3685 | set X $cppflags | |
3686 | shift | |
3687 | cppflags='' | |
3688 | $cat >cpp.c <<'EOM' | |
3689 | #define BLURFL foo | |
3690 | ||
3691 | BLURFL xx LFRULB | |
3692 | EOM | |
3693 | previous='' | |
3694 | for flag in $* | |
3695 | do | |
3696 | case "$flag" in | |
3697 | -*) ftry="$flag";; | |
3698 | *) ftry="$previous $flag";; | |
3699 | esac | |
3700 | if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \ | |
3701 | >cpp1.out 2>/dev/null && \ | |
3702 | $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \ | |
3703 | >cpp2.out 2>/dev/null && \ | |
3704 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
3705 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
3706 | then | |
3707 | cppflags="$cppflags $ftry" | |
3708 | previous='' | |
3709 | else | |
3710 | previous="$flag" | |
3711 | fi | |
3712 | done | |
3713 | set X $cppflags | |
3714 | shift | |
3715 | cppflags=${1+"$@"} | |
3716 | case "$cppflags" in | |
3717 | *-*) echo "They appear to be: $cppflags";; | |
3718 | esac | |
3719 | $rm -f cpp.c cpp?.out | |
3720 | ;; | |
3721 | esac | |
3722 | ||
3723 | : flags used in final linking phase | |
3724 | ||
3725 | case "$ldflags" in | |
3726 | '') if ./venix; then | |
3727 | dflt='-i -z' | |
3728 | else | |
3729 | dflt='' | |
3730 | fi | |
3731 | case "$ccflags" in | |
3732 | *-posix*) dflt="$dflt -posix" ;; | |
3733 | esac | |
3734 | ;; | |
3735 | *) dflt="$ldflags";; | |
3736 | esac | |
3737 | ||
3738 | : Try to guess additional flags to pick up local libraries. | |
3739 | for thislibdir in $libpth; do | |
3740 | case " $loclibpth " in | |
3741 | *" $thislibdir "*) | |
3742 | case "$dflt " in | |
3743 | *"-L$thislibdir "*) ;; | |
3744 | *) dflt="$dflt -L$thislibdir" ;; | |
3745 | esac | |
3746 | ;; | |
3747 | esac | |
3748 | done | |
3749 | ||
3750 | case "$dflt" in | |
3751 | '') dflt='none' ;; | |
3752 | esac | |
3753 | ||
3754 | $cat <<EOH | |
3755 | ||
3756 | Your C linker may need flags. For this question you should | |
3757 | include -L/whatever and any other flags used by the C linker, but you | |
3758 | should NOT include libraries like -lwhatever. | |
3759 | ||
3760 | Make sure you include the appropriate -L/path flags if your C linker | |
3761 | does not normally search all of the directories you specified above, | |
3762 | namely | |
3763 | $libpth | |
3764 | To use no flags, specify the word "none". | |
3765 | ||
3766 | EOH | |
3767 | ||
3768 | rp="Any additional ld flags (NOT including libraries)?" | |
3769 | . ./myread | |
3770 | case "$ans" in | |
3771 | none) ldflags='';; | |
3772 | *) ldflags="$ans";; | |
3773 | esac | |
3774 | rmlist="$rmlist pdp11" | |
3775 | ||
3776 | : coherency check | |
3777 | echo " " | |
1e422769 | 3778 | echo "Checking your choice of C compiler, libs, and flags for coherency..." >&4 |
3779 | set X $cc $optimize $ccflags $ldflags -o try try.c $libs | |
a4f3eea9 | 3780 | shift |
3781 | $cat >try.msg <<EOM | |
3782 | I've tried to compile and run a simple program with: | |
3783 | ||
3784 | $* | |
3785 | ./try | |
3786 | ||
3787 | and I got the following output: | |
3788 | ||
3789 | EOM | |
3790 | $cat > try.c <<'EOF' | |
3791 | #include <stdio.h> | |
3792 | main() { exit(0); } | |
3793 | EOF | |
3794 | dflt=y | |
1e422769 | 3795 | if sh -c "$cc $optimize $ccflags -o try try.c $ldflags $libs" >>try.msg 2>&1; then |
a4f3eea9 | 3796 | if sh -c './try' >>try.msg 2>&1; then |
3797 | dflt=n | |
3798 | else | |
3799 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
3800 | rp="You have a problem. Shall I abort Configure" | |
3801 | dflt=y | |
3802 | fi | |
3803 | else | |
3804 | echo "I can't compile the test program." >>try.msg | |
3805 | rp="You have a BIG problem. Shall I abort Configure" | |
3806 | dflt=y | |
3807 | fi | |
3808 | case "$dflt" in | |
3809 | y) | |
3810 | $cat try.msg | |
3811 | case "$knowitall" in | |
3812 | '') | |
3813 | echo "(The supplied flags might be incorrect with this C compiler.)" | |
3814 | ;; | |
3815 | *) dflt=n;; | |
3816 | esac | |
3817 | echo " " | |
3818 | . ./myread | |
3819 | case "$ans" in | |
3820 | n*|N*) ;; | |
3821 | *) echo "Ok. Stopping Configure." >&4 | |
3822 | exit 1 | |
3823 | ;; | |
3824 | esac | |
3825 | ;; | |
3826 | n) echo "OK, that should do.";; | |
3827 | esac | |
3828 | $rm -f try try.* core | |
3829 | ||
3830 | echo " " | |
3831 | echo "Checking for GNU C Library..." >&4 | |
3832 | cat >gnulibc.c <<EOM | |
3833 | int | |
3834 | main() | |
3835 | { | |
3836 | return __libc_main(); | |
3837 | } | |
3838 | EOM | |
3839 | if $cc $ccflags $ldflags -o gnulibc gnulibc.c $libs >/dev/null 2>&1 && \ | |
3840 | ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then | |
3841 | val="$define" | |
3842 | echo "You are using the GNU C Library" | |
4633a7c4 | 3843 | else |
a4f3eea9 | 3844 | val="$undef" |
3845 | echo "You are not using the GNU C Library" | |
4633a7c4 | 3846 | fi |
a4f3eea9 | 3847 | $rm -f gnulibc* |
3848 | set d_gnulibc | |
3849 | eval $setvar | |
25f94b33 | 3850 | |
a4f3eea9 | 3851 | : see if nm is to be used to determine whether a symbol is defined or not |
3852 | case "$usenm" in | |
3853 | '') | |
3854 | case "$d_gnulibc" in | |
3855 | $define) | |
3856 | dflt=n | |
3857 | ;; | |
3858 | *) | |
3859 | dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` | |
3860 | if $test $dflt -gt 20; then | |
3861 | dflt=y | |
3862 | else | |
3863 | dflt=n | |
3864 | fi | |
3865 | ;; | |
3866 | esac | |
3867 | ;; | |
3868 | *) | |
3869 | case "$usenm" in | |
3870 | true) dflt=y;; | |
3871 | *) dflt=n;; | |
3872 | esac | |
3873 | ;; | |
25f94b33 | 3874 | esac |
a4f3eea9 | 3875 | $cat <<EOM |
4633a7c4 | 3876 | |
a4f3eea9 | 3877 | I can use 'nm' to extract the symbols from your C libraries. This is a time |
3878 | consuming task which may generate huge output on the disk (up to 3 megabytes) | |
3879 | but that should make the symbols extraction faster. The alternative is to skip | |
3880 | the 'nm' extraction part and to compile a small test program instead to | |
3881 | determine whether each symbol is present. If you have a fast C compiler and/or | |
3882 | if your 'nm' output cannot be parsed, this may be the best solution. | |
3883 | You shouldn't let me use 'nm' if you have the GNU C Library. | |
4633a7c4 | 3884 | |
a4f3eea9 | 3885 | EOM |
3886 | rp='Shall I use nm to extract C symbols from the libraries?' | |
4633a7c4 LW |
3887 | . ./myread |
3888 | case "$ans" in | |
a4f3eea9 | 3889 | n|N) usenm=false;; |
3890 | *) usenm=true;; | |
4633a7c4 LW |
3891 | esac |
3892 | ||
a4f3eea9 | 3893 | runnm=$usenm |
3894 | case "$reuseval" in | |
3895 | true) runnm=false;; | |
4633a7c4 | 3896 | esac |
a4f3eea9 | 3897 | |
3898 | : nm options which may be necessary | |
3899 | case "$nm_opt" in | |
3900 | '') if $test -f /mach_boot; then | |
1e422769 | 3901 | nm_opt='' # Mach |
a4f3eea9 | 3902 | elif $test -d /usr/ccs/lib; then |
1e422769 | 3903 | nm_opt='-p' # Solaris (and SunOS?) |
a4f3eea9 | 3904 | elif $test -f /dgux; then |
1e422769 | 3905 | nm_opt='-p' # DG-UX |
2ae324a7 | 3906 | elif $test -f /lib64/rld; then |
1e422769 | 3907 | nm_opt='-p' # 64-bit Irix |
a4f3eea9 | 3908 | else |
3909 | nm_opt='' | |
3910 | fi;; | |
4633a7c4 | 3911 | esac |
4633a7c4 | 3912 | |
a4f3eea9 | 3913 | : nm options which may be necessary for shared libraries but illegal |
3914 | : for archive libraries. Thank you, Linux. | |
3915 | case "$nm_so_opt" in | |
3916 | '') case "$myuname" in | |
3917 | *linux*) | |
3918 | if nm --help | $grep 'dynamic' > /dev/null 2>&1; then | |
3919 | nm_so_opt='--dynamic' | |
4633a7c4 | 3920 | fi |
a4f3eea9 | 3921 | ;; |
4633a7c4 | 3922 | esac |
4633a7c4 LW |
3923 | ;; |
3924 | esac | |
3925 | ||
a4f3eea9 | 3926 | case "$runnm" in |
3927 | true) | |
3928 | : get list of predefined functions in a handy place | |
3929 | echo " " | |
3930 | case "$libc" in | |
3931 | '') libc=unknown | |
3932 | case "$libs" in | |
5f05dabc | 3933 | *-lc_s*) libc=`./loc libc_s$lib_ext $libc $libpth` |
a4f3eea9 | 3934 | esac |
3935 | ;; | |
3936 | esac | |
3937 | libnames=''; | |
3938 | case "$libs" in | |
3939 | '') ;; | |
3940 | *) for thislib in $libs; do | |
3941 | case "$thislib" in | |
3942 | -lc|-lc_s) | |
3943 | : Handle C library specially below. | |
3944 | ;; | |
3945 | -l*) | |
3946 | thislib=`echo $thislib | $sed -e 's/^-l//'` | |
3947 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then | |
3948 | : | |
3949 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then | |
3950 | : | |
5f05dabc | 3951 | elif try=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$try"; then |
a4f3eea9 | 3952 | : |
d97d40b5 IZ |
3953 | elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then |
3954 | : | |
a4f3eea9 | 3955 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then |
3956 | : | |
3957 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then | |
3958 | : | |
5f05dabc | 3959 | elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then |
a4f3eea9 | 3960 | : |
3961 | else | |
3962 | try='' | |
3963 | fi | |
3964 | libnames="$libnames $try" | |
3965 | ;; | |
3966 | *) libnames="$libnames $thislib" ;; | |
3967 | esac | |
3968 | done | |
3969 | ;; | |
3970 | esac | |
3971 | xxx=normal | |
3972 | case "$libc" in | |
3973 | unknown) | |
3974 | set /lib/libc.$so | |
3975 | for xxx in $libpth; do | |
3976 | $test -r $1 || set $xxx/libc.$so | |
3977 | : The messy sed command sorts on library version numbers. | |
3978 | $test -r $1 || \ | |
3979 | set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ | |
3980 | tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e ' | |
3981 | h | |
3982 | s/[0-9][0-9]*/0000&/g | |
3983 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g | |
3984 | G | |
3985 | s/\n/ /' | \ | |
3986 | sort | $sed -e 's/^.* //'` | |
3987 | eval set \$$# | |
3988 | done | |
3989 | $test -r $1 || set /usr/ccs/lib/libc.$so | |
5f05dabc | 3990 | $test -r $1 || set /lib/libsys_s$lib_ext |
a4f3eea9 | 3991 | ;; |
3992 | *) | |
3993 | set blurfl | |
3994 | ;; | |
3995 | esac | |
3996 | if $test -r "$1"; then | |
3997 | echo "Your (shared) C library seems to be in $1." | |
3998 | libc="$1" | |
3999 | elif $test -r /lib/libc && $test -r /lib/clib; then | |
4000 | echo "Your C library seems to be in both /lib/clib and /lib/libc." | |
4001 | xxx=apollo | |
4002 | libc='/lib/clib /lib/libc' | |
4003 | if $test -r /lib/syslib; then | |
4004 | echo "(Your math library is in /lib/syslib.)" | |
4005 | libc="$libc /lib/syslib" | |
4006 | fi | |
4007 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
4008 | echo "Your C library seems to be in $libc, as you said before." | |
5f05dabc | 4009 | elif $test -r $incpath/usr/lib/libc$lib_ext; then |
4010 | libc=$incpath/usr/lib/libc$lib_ext; | |
a4f3eea9 | 4011 | echo "Your C library seems to be in $libc. That's fine." |
5f05dabc | 4012 | elif $test -r /lib/libc$lib_ext; then |
4013 | libc=/lib/libc$lib_ext; | |
a4f3eea9 | 4014 | echo "Your C library seems to be in $libc. You're normal." |
4015 | else | |
5f05dabc | 4016 | if tans=`./loc libc$lib_ext blurfl/dyick $libpth`; $test -r "$tans"; then |
a4f3eea9 | 4017 | : |
4018 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then | |
4019 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` | |
4020 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then | |
4021 | : | |
5f05dabc | 4022 | elif tans=`./loc Slibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then |
a4f3eea9 | 4023 | : |
5f05dabc | 4024 | elif tans=`./loc Mlibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then |
a4f3eea9 | 4025 | : |
4633a7c4 | 4026 | else |
5f05dabc | 4027 | tans=`./loc Llibc$lib_ext blurfl/dyick $xlibpth` |
4633a7c4 | 4028 | fi |
a4f3eea9 | 4029 | if $test -r "$tans"; then |
4030 | echo "Your C library seems to be in $tans, of all places." | |
4031 | libc=$tans | |
4032 | else | |
4033 | libc='blurfl' | |
4034 | fi | |
4035 | fi | |
4036 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
4037 | dflt="$libc" | |
4038 | cat <<EOM | |
4633a7c4 | 4039 | |
a4f3eea9 | 4040 | If the guess above is wrong (which it might be if you're using a strange |
4041 | compiler, or your machine supports multiple models), you can override it here. | |
4633a7c4 | 4042 | |
a4f3eea9 | 4043 | EOM |
4044 | else | |
4045 | dflt='' | |
4046 | echo $libpth | tr ' ' '\012' | sort | uniq > libpath | |
4047 | cat >&4 <<EOM | |
4048 | I can't seem to find your C library. I've looked in the following places: | |
4633a7c4 | 4049 | |
a4f3eea9 | 4050 | EOM |
4051 | $sed 's/^/ /' libpath | |
4052 | cat <<EOM | |
4633a7c4 | 4053 | |
a4f3eea9 | 4054 | None of these seems to contain your C library. I need to get its name... |
4633a7c4 | 4055 | |
a4f3eea9 | 4056 | EOM |
4057 | fi | |
4058 | fn=f | |
4059 | rp='Where is your C library?' | |
4060 | . ./getfile | |
4061 | libc="$ans" | |
4633a7c4 | 4062 | |
4633a7c4 | 4063 | echo " " |
a4f3eea9 | 4064 | echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames |
4065 | set X `cat libnames` | |
4633a7c4 | 4066 | shift |
a4f3eea9 | 4067 | xxx=files |
4068 | case $# in 1) xxx=file; esac | |
4069 | echo "Extracting names from the following $xxx for later perusal:" >&4 | |
4070 | echo " " | |
4071 | $sed 's/^/ /' libnames >&4 | |
4072 | echo " " | |
4073 | $echo $n "This may take a while...$c" >&4 | |
4633a7c4 | 4074 | |
a4f3eea9 | 4075 | : Linux may need the special Dynamic option to nm for shared libraries. |
4076 | : In general, this is stored in the nm_so_opt variable. | |
4077 | : Unfortunately, that option may be fatal on non-shared libraries. | |
4078 | for nm_libs_ext in $*; do | |
4079 | case $nm_libs_ext in | |
4080 | *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;; | |
4081 | *) nm $nm_opt $nm_libs_ext 2>/dev/null ;; | |
4082 | esac | |
4083 | done > libc.tmp | |
4633a7c4 | 4084 | |
a4f3eea9 | 4085 | $echo $n ".$c" |
4086 | $grep fprintf libc.tmp > libc.ptf | |
4087 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' | |
4088 | xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4' | |
4089 | xxx='[ADTSIW]' | |
4090 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\ | |
4091 | eval $xscan;\ | |
4092 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4093 | eval $xrun | |
4094 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ | |
4095 | eval $xscan;\ | |
4096 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4097 | eval $xrun | |
4098 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ | |
4099 | eval $xscan;\ | |
4100 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4101 | eval $xrun | |
4102 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ | |
4103 | eval $xscan;\ | |
4104 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4105 | eval $xrun | |
4106 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ | |
4107 | eval $xscan;\ | |
4108 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4109 | eval $xrun | |
4110 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ | |
4111 | eval $xscan;\ | |
4112 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4113 | eval $xrun | |
4114 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ | |
4115 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ | |
4116 | eval $xscan;\ | |
4117 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4118 | eval $xrun | |
4119 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ | |
4120 | eval $xscan;\ | |
4121 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4122 | eval $xrun | |
4123 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ | |
4124 | eval $xscan;\ | |
4125 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4126 | eval $xrun | |
1e422769 | 4127 | elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ |
4128 | eval $xscan;\ | |
4129 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4130 | eval $xrun | |
a4f3eea9 | 4131 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
4132 | eval $xscan;\ | |
4133 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4134 | eval $xrun | |
4135 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ | |
4136 | eval $xscan;\ | |
4137 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4138 | eval $xrun | |
44a8e56a | 4139 | elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ |
4140 | eval $xscan;\ | |
4141 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4142 | eval $xrun | |
a4f3eea9 | 4143 | else |
4144 | nm -p $* 2>/dev/null >libc.tmp | |
4145 | $grep fprintf libc.tmp > libc.ptf | |
4146 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ | |
4147 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 | |
4148 | then | |
4149 | nm_opt='-p' | |
4150 | eval $xrun | |
4633a7c4 | 4151 | else |
a4f3eea9 | 4152 | echo " " |
4153 | echo "nm didn't seem to work right. Trying ar instead..." >&4 | |
4154 | com='' | |
4155 | if ar t $libc > libc.tmp; then | |
4156 | for thisname in $libnames; do | |
4157 | ar t $thisname >>libc.tmp | |
4158 | done | |
4159 | $sed -e 's/\.o$//' < libc.tmp > libc.list | |
4160 | echo "Ok." >&4 | |
4161 | else | |
4162 | echo "ar didn't seem to work right." >&4 | |
4163 | echo "Maybe this is a Cray...trying bld instead..." >&4 | |
4164 | if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list | |
4165 | then | |
4166 | for thisname in $libnames; do | |
4167 | bld t $libnames | \ | |
4168 | $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list | |
4169 | ar t $thisname >>libc.tmp | |
4170 | done | |
4171 | echo "Ok." >&4 | |
4172 | else | |
4173 | echo "That didn't work either. Giving up." >&4 | |
4174 | exit 1 | |
4175 | fi | |
4176 | fi | |
4633a7c4 | 4177 | fi |
4633a7c4 | 4178 | fi |
a4f3eea9 | 4179 | nm_extract="$com" |
4180 | if $test -f /lib/syscalls.exp; then | |
4633a7c4 | 4181 | echo " " |
a4f3eea9 | 4182 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 |
4183 | $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list | |
4184 | fi | |
4185 | ;; | |
4186 | esac | |
4187 | $rm -f libnames libpath | |
4188 | ||
2afac517 | 4189 | : determine filename position in cpp output |
4633a7c4 | 4190 | echo " " |
2afac517 | 4191 | echo "Computing filename position in cpp output for #include directives..." >&4 |
4192 | echo '#include <stdio.h>' > foo.c | |
4193 | $cat >fieldn <<EOF | |
4194 | $startsh | |
4195 | $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \ | |
4196 | $grep '^[ ]*#.*stdio\.h' | \ | |
4197 | while read cline; do | |
4198 | pos=1 | |
4199 | set \$cline | |
4200 | while $test \$# -gt 0; do | |
4201 | if $test -r \`echo \$1 | $tr -d '"'\`; then | |
4202 | echo "\$pos" | |
4203 | exit 0 | |
4204 | fi | |
4205 | shift | |
4206 | pos=\`expr \$pos + 1\` | |
4207 | done | |
4633a7c4 | 4208 | done |
2afac517 | 4209 | EOF |
4210 | chmod +x fieldn | |
4211 | fieldn=`./fieldn` | |
4212 | $rm -f foo.c fieldn | |
4213 | case $fieldn in | |
4214 | '') pos='???';; | |
4215 | 1) pos=first;; | |
4216 | 2) pos=second;; | |
4217 | 3) pos=third;; | |
4218 | *) pos="${fieldn}th";; | |
4633a7c4 | 4219 | esac |
2afac517 | 4220 | echo "Your cpp writes the filename in the $pos field of the line." |
4633a7c4 | 4221 | |
2afac517 | 4222 | : locate header file |
4223 | $cat >findhdr <<EOF | |
4224 | $startsh | |
4225 | wanted=\$1 | |
4226 | name='' | |
4227 | if test -f $usrinc/\$wanted; then | |
4228 | echo "$usrinc/\$wanted" | |
4229 | exit 0 | |
4230 | fi | |
4231 | awkprg='{ print \$$fieldn }' | |
4232 | echo "#include <\$wanted>" > foo\$\$.c | |
4233 | $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ | |
4234 | $grep "^[ ]*#.*\$wanted" | \ | |
4235 | while read cline; do | |
4236 | name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` | |
4237 | case "\$name" in | |
4238 | */\$wanted) echo "\$name"; exit 0;; | |
4239 | *) name='';; | |
4240 | esac; | |
4241 | done; | |
4242 | $rm -f foo\$\$.c; | |
4243 | case "\$name" in | |
4244 | '') exit 1;; | |
4633a7c4 | 4245 | esac |
2afac517 | 4246 | EOF |
4247 | chmod +x findhdr | |
4633a7c4 | 4248 | |
2afac517 | 4249 | : define an alternate in-header-list? function |
4250 | inhdr='echo " "; td=$define; tu=$undef; yyy=$@; | |
4251 | cont=true; xxf="echo \"<\$1> found.\" >&4"; | |
4252 | case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; | |
4253 | *) xxnf="echo \"<\$1> NOT found, ...\" >&4";; | |
4254 | esac; | |
4255 | case $# in 4) instead=instead;; *) instead="at last";; esac; | |
4256 | while $test "$cont"; do | |
4257 | xxx=`./findhdr $1` | |
4258 | var=$2; eval "was=\$$2"; | |
4259 | if $test "$xxx" && $test -r "$xxx"; | |
4260 | then eval $xxf; | |
4261 | eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; | |
4262 | cont=""; | |
4263 | else eval $xxnf; | |
4264 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; | |
4265 | set $yyy; shift; shift; yyy=$@; | |
4266 | case $# in 0) cont="";; | |
4267 | 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; | |
4268 | xxnf="echo \"and I did not find <\$1> either.\" >&4";; | |
4269 | *) xxf="echo \"but I found <\$1\> instead.\" >&4"; | |
4270 | xxnf="echo \"there is no <\$1>, ...\" >&4";; | |
4271 | esac; | |
4272 | done; | |
4273 | while $test "$yyy"; | |
4274 | do set $yyy; var=$2; eval "was=\$$2"; | |
4275 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; | |
4276 | set $yyy; shift; shift; yyy=$@; | |
4277 | done' | |
4633a7c4 | 4278 | |
2afac517 | 4279 | : see if dld is available |
4280 | set dld.h i_dld | |
4281 | eval $inhdr | |
4633a7c4 | 4282 | |
2afac517 | 4283 | : is a C symbol defined? |
4284 | csym='tlook=$1; | |
4285 | case "$3" in | |
4286 | -v) tf=libc.tmp; tc=""; tdc="";; | |
4287 | -a) tf=libc.tmp; tc="[0]"; tdc="[]";; | |
4288 | *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; | |
4289 | esac; | |
4290 | tx=yes; | |
4291 | case "$reuseval-$4" in | |
4292 | true-) ;; | |
4293 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; | |
4294 | esac; | |
4295 | case "$tx" in | |
4296 | yes) | |
4297 | case "$runnm" in | |
4298 | true) | |
4299 | if $contains $tlook $tf >/dev/null 2>&1; | |
4300 | then tval=true; | |
4301 | else tval=false; | |
4302 | fi;; | |
4303 | *) | |
4304 | echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; | |
4305 | if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; | |
4306 | then tval=true; | |
4307 | else tval=false; | |
4308 | fi; | |
4309 | $rm -f t t.c;; | |
4310 | esac;; | |
4311 | *) | |
4312 | case "$tval" in | |
4313 | $define) tval=true;; | |
4314 | *) tval=false;; | |
4315 | esac;; | |
4316 | esac; | |
4317 | eval "$2=$tval"' | |
4633a7c4 | 4318 | |
2afac517 | 4319 | : define an is-in-libc? function |
4320 | inlibc='echo " "; td=$define; tu=$undef; | |
4321 | sym=$1; var=$2; eval "was=\$$2"; | |
4322 | tx=yes; | |
4323 | case "$reuseval$was" in | |
4324 | true) ;; | |
4325 | true*) tx=no;; | |
4326 | esac; | |
4327 | case "$tx" in | |
4328 | yes) | |
4329 | set $sym tres -f; | |
4330 | eval $csym; | |
4331 | case "$tres" in | |
4332 | true) | |
4333 | echo "$sym() found." >&4; | |
4334 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; | |
4335 | *) | |
4336 | echo "$sym() NOT found." >&4; | |
4337 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; | |
4338 | esac;; | |
4339 | *) | |
4340 | case "$was" in | |
4341 | $define) echo "$sym() found." >&4;; | |
4342 | *) echo "$sym() NOT found." >&4;; | |
4343 | esac;; | |
4344 | esac' | |
4633a7c4 | 4345 | |
2afac517 | 4346 | : see if dlopen exists |
4347 | xxx_runnm="$runnm" | |
4348 | runnm=false | |
4349 | set dlopen d_dlopen | |
4350 | eval $inlibc | |
4351 | runnm="$xxx_runnm" | |
40a7a20a | 4352 | |
2afac517 | 4353 | : determine which dynamic loading, if any, to compile in |
4633a7c4 | 4354 | echo " " |
2afac517 | 4355 | dldir="ext/DynaLoader" |
4356 | case "$usedl" in | |
4357 | $define|y|true) | |
4358 | dflt='y' | |
4359 | usedl="$define" | |
4360 | ;; | |
4361 | $undef|n|false) | |
4362 | dflt='n' | |
4363 | usedl="$undef" | |
4364 | ;; | |
4365 | *) | |
4366 | dflt='n' | |
4367 | case "$d_dlopen" in | |
4368 | $define) dflt='y' ;; | |
4369 | esac | |
4370 | case "$i_dld" in | |
4371 | $define) dflt='y' ;; | |
4633a7c4 | 4372 | esac |
2afac517 | 4373 | : Does a dl_xxx.xs file exist for this operating system |
4374 | $test -f ../$dldir/dl_${osname}.xs && dflt='y' | |
4633a7c4 LW |
4375 | ;; |
4376 | esac | |
2afac517 | 4377 | rp="Do you wish to use dynamic loading?" |
4378 | . ./myread | |
4379 | usedl="$ans" | |
4380 | case "$ans" in | |
4381 | y*) usedl="$define" | |
4382 | case "$dlsrc" in | |
4383 | '') | |
4384 | if $test -f ../$dldir/dl_${osname}.xs ; then | |
4385 | dflt="$dldir/dl_${osname}.xs" | |
4386 | elif $test "$d_dlopen" = "$define" ; then | |
4387 | dflt="$dldir/dl_dlopen.xs" | |
4388 | elif $test "$i_dld" = "$define" ; then | |
4389 | dflt="$dldir/dl_dld.xs" | |
4633a7c4 | 4390 | else |
2afac517 | 4391 | dflt='' |
4633a7c4 | 4392 | fi |
4633a7c4 | 4393 | ;; |
2afac517 | 4394 | *) dflt="$dldir/$dlsrc" |
4395 | ;; | |
4633a7c4 | 4396 | esac |
2afac517 | 4397 | echo "The following dynamic loading files are available:" |
4398 | : Can not go over to $dldir because getfile has path hard-coded in. | |
4399 | cd ..; ls -C $dldir/dl*.xs; cd UU | |
4400 | rp="Source file to use for dynamic loading" | |
4401 | fn="fne" | |
4402 | . ./getfile | |
4403 | usedl="$define" | |
4404 | : emulate basename | |
4405 | dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'` | |
2304df62 | 4406 | |
2afac517 | 4407 | $cat << EOM |
2304df62 | 4408 | |
2afac517 | 4409 | Some systems may require passing special flags to $cc -c to |
4410 | compile modules that will be used to create a shared library. | |
4411 | To use no flags, say "none". | |
2304df62 AD |
4412 | |
4413 | EOM | |
2afac517 | 4414 | case "$cccdlflags" in |
4415 | '') case "$gccversion" in | |
4416 | '') case "$osname" in | |
4417 | hpux) dflt='+z' ;; | |
4418 | next) dflt='none' ;; | |
8cc95fdb | 4419 | svr4*|esix*) dflt='-Kpic' ;; |
4420 | irix*) dflt='-KPIC' ;; | |
4421 | solaris) case "$ccflags" in | |
4422 | *-DDEBUGGING*) dflt='-KPIC' ;; | |
4423 | *) dflt='-Kpic' ;; | |
4424 | esac ;; | |
2afac517 | 4425 | sunos) dflt='-pic' ;; |
4426 | *) dflt='none' ;; | |
4427 | esac ;; | |
81d89818 HF |
4428 | *) case "$osname/$ccflags" in |
4429 | solaris/*-DDEBUGGING*) dflt='-fPIC' ;; | |
4430 | *) dflt='-fpic' ;; | |
4431 | esac ;; | |
2afac517 | 4432 | esac ;; |
4433 | *) dflt="$cccdlflags" ;; | |
4434 | esac | |
4435 | rp="Any special flags to pass to $cc -c to compile shared library modules?" | |
4436 | . ./myread | |
4437 | case "$ans" in | |
4438 | none) cccdlflags=' ' ;; | |
4439 | *) cccdlflags="$ans" ;; | |
4440 | esac | |
2304df62 | 4441 | |
2afac517 | 4442 | cat << EOM |
ecfc5424 | 4443 | |
2afac517 | 4444 | Some systems use ld to create libraries that can be dynamically loaded, |
4445 | while other systems (such as those using ELF) use $cc. | |
a0f45b59 | 4446 | |
2afac517 | 4447 | EOM |
4448 | case "$ld" in | |
4449 | '') $cat >try.c <<'EOM' | |
4450 | /* Test for whether ELF binaries are produced */ | |
4451 | #include <fcntl.h> | |
4452 | #include <stdlib.h> | |
4453 | main() { | |
4454 | char b[4]; | |
4455 | int i = open("a.out",O_RDONLY); | |
4456 | if(i == -1) | |
4457 | exit(1); /* fail */ | |
4458 | if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') | |
4459 | exit(0); /* succeed (yes, it's ELF) */ | |
2304df62 | 4460 | else |
2afac517 | 4461 | exit(1); /* fail */ |
4462 | } | |
4463 | EOM | |
4464 | if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then | |
4465 | cat <<EOM | |
4466 | You appear to have ELF support. I'll use $cc to build dynamic libraries. | |
4467 | EOM | |
4468 | dflt="$cc" | |
2304df62 | 4469 | else |
2afac517 | 4470 | echo "I'll use ld to build dynamic libraries." |
4471 | dflt='ld' | |
2304df62 | 4472 | fi |
2afac517 | 4473 | rm -f try.c a.out |
4474 | ;; | |
4475 | *) dflt="$ld" | |
4476 | ;; | |
4477 | esac | |
4478 | ||
4479 | rp="What command should be used to create dynamic libraries?" | |
4480 | . ./myread | |
4481 | ld="$ans" | |
4482 | ||
4483 | cat << EOM | |
4484 | ||
4485 | Some systems may require passing special flags to $ld to create a | |
4486 | library that can be dynamically loaded. If your ld flags include | |
4487 | -L/other/path options to locate libraries outside your loader's normal | |
4488 | search path, you may need to specify those -L options here as well. To | |
4489 | use no flags, say "none". | |
4490 | ||
4491 | EOM | |
4492 | case "$lddlflags" in | |
4493 | '') case "$osname" in | |
4494 | hpux) dflt='-b' ;; | |
4495 | linux|irix*) dflt='-shared' ;; | |
4496 | next) dflt='none' ;; | |
4497 | solaris) dflt='-G' ;; | |
4498 | sunos) dflt='-assert nodefinitions' ;; | |
4499 | svr4*|esix*) dflt="-G $ldflags" ;; | |
4500 | *) dflt='none' ;; | |
4501 | esac | |
4502 | ;; | |
4503 | *) dflt="$lddlflags" ;; | |
4504 | esac | |
4505 | ||
4506 | : Try to guess additional flags to pick up local libraries. | |
4507 | for thisflag in $ldflags; do | |
4508 | case "$thisflag" in | |
4509 | -L*) | |
4510 | case " $dflt " in | |
4511 | *" $thisflag "*) ;; | |
4512 | *) dflt="$dflt $thisflag" ;; | |
4513 | esac | |
4514 | ;; | |
4515 | esac | |
4516 | done | |
4517 | ||
4518 | case "$dflt" in | |
4519 | '') dflt='none' ;; | |
4520 | esac | |
4521 | ||
4522 | rp="Any special flags to pass to $ld to create a dynamically loaded library?" | |
4523 | . ./myread | |
4524 | case "$ans" in | |
4525 | none) lddlflags=' ' ;; | |
4526 | *) lddlflags="$ans" ;; | |
4527 | esac | |
4528 | ||
4529 | cat <<EOM | |
4530 | ||
4531 | Some systems may require passing special flags to $cc to indicate that | |
4532 | the resulting executable will use dynamic linking. To use no flags, | |
4533 | say "none". | |
4534 | ||
4535 | EOM | |
4536 | case "$ccdlflags" in | |
4537 | '') case "$osname" in | |
4538 | hpux) dflt='-Wl,-E' ;; | |
4539 | linux) dflt='-rdynamic' ;; | |
4540 | next) dflt='none' ;; | |
4541 | sunos) dflt='none' ;; | |
4542 | *) dflt='none' ;; | |
4543 | esac ;; | |
4544 | *) dflt="$ccdlflags" ;; | |
4545 | esac | |
4546 | rp="Any special flags to pass to $cc to use dynamic loading?" | |
4547 | . ./myread | |
4548 | case "$ans" in | |
4549 | none) ccdlflags=' ' ;; | |
4550 | *) ccdlflags="$ans" ;; | |
4551 | esac | |
4552 | ;; | |
4553 | *) usedl="$undef" | |
4554 | ld='ld' | |
4555 | dlsrc='dl_none.xs' | |
4556 | lddlflags='' | |
4557 | ccdlflags='' | |
4558 | ;; | |
4559 | esac | |
4560 | ||
4561 | also='' | |
4562 | case "$usedl" in | |
4563 | $undef) | |
4564 | # No dynamic loading being used, so don't bother even to prompt. | |
4565 | useshrplib='false' | |
4566 | ;; | |
4567 | *) case "$useshrplib" in | |
4568 | '') case "$osname" in | |
2ae324a7 | 4569 | svr4*|dgux|dynixptx|esix|powerux) |
2afac517 | 4570 | dflt='yes' |
4571 | also='Building a shared libperl is required for dynamic loading to work on your system.' | |
4572 | ;; | |
4573 | next*) | |
4574 | case "$osvers" in | |
4575 | 4*) dflt='yes' | |
4576 | also='Building a shared libperl is needed for MAB support.' | |
4577 | ;; | |
4578 | *) dflt='no' | |
4579 | ;; | |
4580 | esac | |
4581 | ;; | |
4582 | sunos) | |
4583 | dflt='no' | |
4584 | also='Building a shared libperl will definitely not work on SunOS 4.' | |
4585 | ;; | |
4586 | *) dflt='no' | |
4587 | ;; | |
4588 | esac | |
4589 | ;; | |
4590 | $define|true|[Yy]*) | |
4591 | dflt='yes' | |
4592 | ;; | |
4593 | *) dflt='no' | |
4594 | ;; | |
4595 | esac | |
4596 | $cat << EOM | |
4597 | ||
4598 | The perl executable is normally obtained by linking perlmain.c with | |
4599 | libperl${lib_ext}, any static extensions (usually just DynaLoader), and | |
4600 | any other libraries needed on this system (such as -lm, etc.). Since | |
4601 | your system supports dynamic loading, it is probably possible to build | |
4602 | a shared libperl.$so. If you will have more than one executable linked | |
4603 | to libperl.$so, this will significantly reduce the size of each | |
4604 | executable, but it may have a noticeable affect on performance. The | |
4605 | default is probably sensible for your system. | |
4606 | $also | |
4607 | ||
4608 | EOM | |
4609 | rp="Build a shared libperl.$so (y/n)" | |
4610 | . ./myread | |
4611 | case "$ans" in | |
4612 | true|$define|[Yy]*) | |
4613 | useshrplib='true' | |
4614 | # Why does next4 have to be so different? | |
4615 | case "${osname}${osvers}" in | |
4616 | next4*) xxx='DYLD_LIBRARY_PATH' ;; | |
4617 | *) xxx='LD_LIBRARY_PATH' ;; | |
4618 | esac | |
4619 | $cat <<EOM >&4 | |
4620 | ||
4621 | To build perl, you must add the current working directory to your | |
4622 | $xxx environtment variable before running make. You can do | |
4623 | this with | |
4624 | $xxx=\`pwd\`; export $xxx | |
4625 | for Bourne-style shells, or | |
4626 | setenv $xxx \`pwd\` | |
4627 | for Csh-style shells. You *MUST* do this before running make. | |
4628 | ||
4629 | EOM | |
4630 | ;; | |
4631 | *) useshrplib='false' ;; | |
4632 | esac | |
4633 | ;; | |
4634 | esac | |
4635 | ||
4636 | case "$useshrplib" in | |
4637 | true) | |
4638 | case "$libperl" in | |
4639 | '') | |
4640 | # Figure out a good name for libperl.so. Since it gets stored in | |
4641 | # a version-specific architecture-dependent library, the version | |
4642 | # number isn't really that important, except for making cc/ld happy. | |
4643 | # | |
4644 | # A name such as libperl.so.3.1 | |
4645 | majmin="libperl.$so.$patchlevel.$subversion" | |
4646 | # A name such as libperl.so.301 | |
4647 | majonly=`echo $patchlevel $subversion | | |
4648 | $awk '{printf "%d%02d", $1, $2}'` | |
4649 | majonly=libperl.$so.$majonly | |
4650 | # I'd prefer to keep the os-specific stuff here to a minimum, and | |
4651 | # rely on figuring it out from the naming of libc. | |
4652 | case "${osname}${osvers}" in | |
4653 | next4*) | |
4654 | dflt=libperl.5.$so | |
4655 | # XXX How handle the --version stuff for MAB? | |
4656 | ;; | |
4657 | linux*) # ld won't link with a bare -lperl otherwise. | |
4658 | dflt=libperl.$so | |
4659 | ;; | |
4660 | *) # Try to guess based on whether libc has major.minor. | |
4661 | case "$libc" in | |
4662 | *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; | |
4663 | *libc.$so.[0-9]*) dflt=$majonly ;; | |
4664 | *) dflt=libperl.$so ;; | |
4665 | esac | |
4666 | ;; | |
4667 | esac | |
4668 | ;; | |
4669 | *) dflt=$libperl | |
4670 | ;; | |
4671 | esac | |
4672 | cat << EOM | |
4673 | ||
4674 | I need to select a good name for the shared libperl. If your system uses | |
4675 | library names with major and minor numbers, then you might want something | |
4676 | like $majmin. Alternatively, if your system uses a single version | |
4677 | number for shared libraries, then you might want to use $majonly. | |
4678 | Or, your system might be quite happy with a simple libperl.$so. | |
4679 | ||
4680 | Since the shared libperl will get installed into a version-specific | |
4681 | architecture-dependent directory, the version number of the shared perl | |
4682 | library probably isn't important, so the default should be o.k. | |
4683 | ||
4684 | EOM | |
4685 | rp='What name do you want to give to the shared libperl?' | |
4686 | . ./myread | |
4687 | libperl=$ans | |
4688 | echo "Ok, I'll use $libperl" | |
4689 | ;; | |
4690 | *) | |
4691 | libperl="libperl${lib_ext}" | |
4692 | ;; | |
4693 | esac | |
4694 | ||
4695 | # Detect old use of shrpdir via undocumented Configure -Dshrpdir | |
4696 | case "$shrpdir" in | |
4697 | '') ;; | |
4698 | *) $cat >&4 <<EOM | |
4699 | WARNING: Use of the shrpdir variable for the installation location of | |
4700 | the shared $libperl is not supported. It was never documented and | |
284c50cc MDLR |
4701 | will not work in this version. Let me (chip@perl.com) know of any |
4702 | problems this may cause. | |
2afac517 | 4703 | |
4704 | EOM | |
4705 | case "$shrpdir" in | |
4706 | "$archlibexp/CORE") | |
4707 | $cat >&4 <<EOM | |
4708 | But your current setting of $shrpdir is | |
4709 | the default anyway, so it's harmless. | |
4710 | EOM | |
4711 | ;; | |
4712 | *) | |
4713 | $cat >&4 <<EOM | |
4714 | Further, your current attempted setting of $shrpdir | |
4715 | conflicts with the value of $archlibexp/CORE | |
4716 | that installperl will use. | |
4717 | EOM | |
4718 | ;; | |
4719 | esac | |
4720 | ;; | |
4721 | esac | |
4722 | ||
4723 | # How will the perl executable find the installed shared $libperl? | |
4724 | # Add $xxx to ccdlflags. | |
4725 | # If we can't figure out a command-line option, use $shrpenv to | |
4726 | # set env LD_RUN_PATH. The main perl makefile uses this. | |
4727 | shrpdir=$archlibexp/CORE | |
4728 | xxx='' | |
4729 | tmp_shrpenv='' | |
4730 | if "$useshrplib"; then | |
4731 | case "$osname" in | |
3c321fdc | 4732 | aix) |
4733 | # We'll set it in Makefile.SH... | |
4734 | ;; | |
2afac517 | 4735 | solaris|netbsd) |
4736 | xxx="-R $shrpdir" | |
4737 | ;; | |
28757baa | 4738 | freebsd) |
44a8e56a | 4739 | xxx="-Wl,-R$shrpdir" |
28757baa | 4740 | ;; |
b971f6e4 | 4741 | linux|irix*|dec_osf) |
2afac517 | 4742 | xxx="-Wl,-rpath,$shrpdir" |
4743 | ;; | |
4744 | *) | |
4745 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" | |
4746 | ;; | |
4747 | esac | |
4748 | case "$xxx" in | |
4749 | '') ;; | |
b971f6e4 | 4750 | *) |
4751 | # Only add $xxx if it isn't already in ccdlflags. | |
4752 | case " $ccdlflags " in | |
4753 | *" $xxx "*) ;; | |
4754 | *) ccdlflags="$ccdlflags $xxx" | |
4755 | cat <<EOM >&4 | |
2afac517 | 4756 | |
4757 | Adding $xxx to the flags | |
4758 | passed to $ld so that the perl executable will find the | |
4759 | installed shared $libperl. | |
4760 | ||
4761 | EOM | |
b971f6e4 | 4762 | ;; |
4763 | esac | |
2afac517 | 4764 | ;; |
4765 | esac | |
4766 | fi | |
4767 | # Respect a hint or command-line value. | |
4768 | case "$shrpenv" in | |
4769 | '') shrpenv="$tmp_shrpenv" ;; | |
4770 | esac | |
4771 | ||
4772 | : determine where manual pages go | |
4773 | set man1dir man1dir none | |
4774 | eval $prefixit | |
4775 | $cat <<EOM | |
4776 | ||
4777 | $spackage has manual pages available in source form. | |
4778 | EOM | |
4779 | case "$nroff" in | |
4780 | nroff) | |
4781 | echo "However, you don't have nroff, so they're probably useless to you." | |
4782 | case "$man1dir" in | |
4783 | '') man1dir="none";; | |
4784 | esac;; | |
4785 | esac | |
4786 | echo "If you don't want the manual sources installed, answer 'none'." | |
4787 | case "$man1dir" in | |
4788 | ' ') dflt=none | |
4789 | ;; | |
4790 | '') | |
4791 | lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1" | |
4792 | lookpath="$lookpath $prefixexp/man/p_man/man1" | |
4793 | lookpath="$lookpath $prefixexp/man/u_man/man1" | |
4794 | lookpath="$lookpath $prefixexp/man/man.1" | |
4795 | : If prefix contains 'perl' then we want to keep the man pages | |
4796 | : under the prefix directory. Otherwise, look in a variety of | |
4797 | : other possible places. This is debatable, but probably a | |
4798 | : good compromise. Well, apparently not. | |
4799 | : Experience has shown people expect man1dir to be under prefix, | |
4800 | : so we now always put it there. Users who want other behavior | |
4801 | : can answer interactively or use a command line option. | |
4802 | : Does user have System V-style man paths. | |
4803 | case "$sysman" in | |
4804 | */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;; | |
4805 | *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;; | |
4806 | esac | |
4807 | set dflt | |
4808 | eval $prefixup | |
4809 | ;; | |
4810 | *) dflt="$man1dir" | |
4811 | ;; | |
4812 | esac | |
4813 | echo " " | |
4814 | fn=dn+~ | |
4815 | rp="Where do the main $spackage manual pages (source) go?" | |
4816 | . ./getfile | |
4817 | if $test "X$man1direxp" != "X$ansexp"; then | |
4818 | installman1dir='' | |
4819 | fi | |
4820 | man1dir="$ans" | |
4821 | man1direxp="$ansexp" | |
4822 | case "$man1dir" in | |
4823 | '') man1dir=' ' | |
4824 | installman1dir='';; | |
4825 | esac | |
4826 | if $afs; then | |
4827 | $cat <<EOM | |
4828 | ||
4829 | Since you are running AFS, I need to distinguish the directory in which | |
4830 | manual pages reside from the directory in which they are installed (and from | |
4831 | which they are presumably copied to the former directory by occult means). | |
4832 | ||
4833 | EOM | |
4834 | case "$installman1dir" in | |
4835 | '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;; | |
4836 | *) dflt="$installman1dir";; | |
4837 | esac | |
4838 | fn=de~ | |
4839 | rp='Where will man pages be installed?' | |
4840 | . ./getfile | |
4841 | installman1dir="$ans" | |
4842 | else | |
4843 | installman1dir="$man1direxp" | |
4844 | fi | |
4845 | ||
4846 | : What suffix to use on installed man pages | |
4847 | ||
4848 | case "$man1dir" in | |
4849 | ' ') | |
4850 | man1ext='0' | |
4851 | ;; | |
4852 | *) | |
4853 | rp="What suffix should be used for the main $spackage man pages?" | |
4854 | case "$man1ext" in | |
4855 | '') case "$man1dir" in | |
4856 | *1) dflt=1 ;; | |
4857 | *1p) dflt=1p ;; | |
4858 | *1pm) dflt=1pm ;; | |
4859 | *l) dflt=l;; | |
4860 | *n) dflt=n;; | |
4861 | *o) dflt=o;; | |
4862 | *p) dflt=p;; | |
4863 | *C) dflt=C;; | |
4864 | *L) dflt=L;; | |
4865 | *L1) dflt=L1;; | |
4866 | *) dflt=1;; | |
4867 | esac | |
4868 | ;; | |
4869 | *) dflt="$man1ext";; | |
4870 | esac | |
4871 | . ./myread | |
4872 | man1ext="$ans" | |
4873 | ;; | |
4874 | esac | |
4875 | ||
4876 | : see if we can have long filenames | |
4877 | echo " " | |
4878 | rmlist="$rmlist /tmp/cf$$" | |
4879 | $test -d /tmp/cf$$ || mkdir /tmp/cf$$ | |
4880 | first=123456789abcdef | |
4881 | second=/tmp/cf$$/$first | |
4882 | $rm -f $first $second | |
4883 | if (echo hi >$first) 2>/dev/null; then | |
4884 | if $test -f 123456789abcde; then | |
4885 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
4886 | val="$undef" | |
4887 | else | |
4888 | if (echo hi >$second) 2>/dev/null; then | |
4889 | if $test -f /tmp/cf$$/123456789abcde; then | |
4890 | $cat <<'EOM' | |
4891 | That's peculiar... You can have filenames longer than 14 characters, but only | |
4892 | on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems | |
4893 | I shall consider your system cannot support long filenames at all. | |
4894 | EOM | |
4895 | val="$undef" | |
4896 | else | |
4897 | echo 'You can have filenames longer than 14 characters.' >&4 | |
4898 | val="$define" | |
4899 | fi | |
4900 | else | |
4901 | $cat <<'EOM' | |
4902 | How confusing! Some of your filesystems are sane enough to allow filenames | |
4903 | longer than 14 characters but some others like /tmp can't even think about them. | |
4904 | So, for now on, I shall assume your kernel does not allow them at all. | |
4905 | EOM | |
4906 | val="$undef" | |
4907 | fi | |
4908 | fi | |
4909 | else | |
4910 | $cat <<'EOM' | |
4911 | You can't have filenames longer than 14 chars. You can't even think about them! | |
4912 | EOM | |
4913 | val="$undef" | |
4914 | fi | |
4915 | set d_flexfnam | |
4916 | eval $setvar | |
4917 | $rm -rf /tmp/cf$$ 123456789abcde* | |
4918 | ||
4919 | : determine where library module manual pages go | |
4920 | set man3dir man3dir none | |
4921 | eval $prefixit | |
4922 | $cat <<EOM | |
4923 | ||
4924 | $spackage has manual pages for many of the library modules. | |
4925 | EOM | |
4926 | ||
4927 | case "$nroff" in | |
4928 | nroff) | |
4929 | $cat <<'EOM' | |
4930 | However, you don't have nroff, so they're probably useless to you. | |
4931 | You can use the supplied perldoc script instead. | |
4932 | EOM | |
4933 | case "$man3dir" in | |
4934 | '') man3dir="none";; | |
4935 | esac;; | |
4936 | esac | |
4937 | ||
4938 | case "$d_flexfnam" in | |
4939 | undef) | |
4940 | $cat <<'EOM' | |
4941 | However, your system can't handle the long file names like File::Basename.3. | |
4942 | You can use the supplied perldoc script instead. | |
4943 | EOM | |
4944 | case "$man3dir" in | |
4945 | '') man3dir="none";; | |
4946 | esac;; | |
4947 | esac | |
4948 | ||
4949 | echo "If you don't want the manual sources installed, answer 'none'." | |
4950 | : We dont use /usr/local/man/man3 because some man programs will | |
4951 | : only show the /usr/local/man/man3 contents, and not the system ones, | |
4952 | : thus man less will show the perl module less.pm, but not the system | |
4953 | : less command. We might also conflict with TCL man pages. | |
4954 | : However, something like /opt/perl/man/man3 is fine. | |
4955 | case "$man3dir" in | |
4956 | '') case "$prefix" in | |
4957 | *perl*) dflt=`echo $man1dir | | |
4958 | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;; | |
4959 | *) dflt="$privlib/man/man3" ;; | |
4960 | esac | |
4961 | ;; | |
4962 | ' ') dflt=none;; | |
4963 | *) dflt="$man3dir" ;; | |
4964 | esac | |
4965 | echo " " | |
4966 | ||
4967 | fn=dn+~ | |
4968 | rp="Where do the $spackage library man pages (source) go?" | |
4969 | . ./getfile | |
4970 | if test "X$man3direxp" != "X$ansexp"; then | |
4971 | installman3dir='' | |
4972 | fi | |
4973 | ||
4974 | man3dir="$ans" | |
4975 | man3direxp="$ansexp" | |
4976 | case "$man3dir" in | |
4977 | '') man3dir=' ' | |
4978 | installman3dir='';; | |
4979 | esac | |
4980 | if $afs; then | |
4981 | $cat <<EOM | |
4982 | ||
4983 | Since you are running AFS, I need to distinguish the directory in which | |
4984 | manual pages reside from the directory in which they are installed (and from | |
4985 | which they are presumably copied to the former directory by occult means). | |
4986 | ||
4987 | EOM | |
4988 | case "$installman3dir" in | |
4989 | '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;; | |
4990 | *) dflt="$installman3dir";; | |
4991 | esac | |
4992 | fn=de~ | |
4993 | rp='Where will man pages be installed?' | |
4994 | . ./getfile | |
4995 | installman3dir="$ans" | |
4996 | else | |
4997 | installman3dir="$man3direxp" | |
4998 | fi | |
4999 | ||
5000 | : What suffix to use on installed man pages | |
5001 | ||
5002 | case "$man3dir" in | |
5003 | ' ') | |
5004 | man3ext='0' | |
5005 | ;; | |
5006 | *) | |
5007 | rp="What suffix should be used for the $spackage library man pages?" | |
5008 | case "$man3ext" in | |
5009 | '') case "$man3dir" in | |
5010 | *3) dflt=3 ;; | |
5011 | *3p) dflt=3p ;; | |
5012 | *3pm) dflt=3pm ;; | |
5013 | *l) dflt=l;; | |
5014 | *n) dflt=n;; | |
5015 | *o) dflt=o;; | |
5016 | *p) dflt=p;; | |
5017 | *C) dflt=C;; | |
5018 | *L) dflt=L;; | |
5019 | *L3) dflt=L3;; | |
5020 | *) dflt=3;; | |
5021 | esac | |
5022 | ;; | |
5023 | *) dflt="$man3ext";; | |
5024 | esac | |
5025 | . ./myread | |
5026 | man3ext="$ans" | |
5027 | ;; | |
5028 | esac | |
5029 | ||
5030 | : see if we have to deal with yellow pages, now NIS. | |
5031 | if $test -d /usr/etc/yp || $test -d /etc/yp; then | |
5032 | if $test -f /usr/etc/nibindd; then | |
5033 | echo " " | |
5034 | echo "I'm fairly confident you're on a NeXT." | |
5035 | echo " " | |
5036 | rp='Do you get the hosts file via NetInfo?' | |
5037 | dflt=y | |
5038 | case "$hostcat" in | |
5039 | nidump*) ;; | |
5040 | '') ;; | |
5041 | *) dflt=n;; | |
5042 | esac | |
5043 | . ./myread | |
5044 | case "$ans" in | |
5045 | y*) hostcat='nidump hosts .';; | |
5046 | *) case "$hostcat" in | |
5047 | nidump*) hostcat='';; | |
5048 | esac | |
5049 | ;; | |
5050 | esac | |
5051 | fi | |
5052 | case "$hostcat" in | |
5053 | nidump*) ;; | |
5054 | *) | |
5055 | case "$hostcat" in | |
5056 | *ypcat*) dflt=y;; | |
5057 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
5058 | dflt=y | |
5059 | else | |
5060 | dflt=n | |
5061 | fi;; | |
5062 | *) dflt=n;; | |
5063 | esac | |
5064 | echo " " | |
5065 | rp='Are you getting the hosts file via yellow pages?' | |
5066 | . ./myread | |
5067 | case "$ans" in | |
5068 | y*) hostcat='ypcat hosts';; | |
5069 | *) hostcat='cat /etc/hosts';; | |
5070 | esac | |
5071 | ;; | |
5072 | esac | |
5073 | fi | |
5074 | ||
5075 | : now get the host name | |
5076 | echo " " | |
5077 | echo "Figuring out host name..." >&4 | |
5078 | case "$myhostname" in | |
5079 | '') cont=true | |
5080 | echo 'Maybe "hostname" will work...' | |
5081 | if tans=`sh -c hostname 2>&1` ; then | |
5082 | myhostname=$tans | |
5083 | phostname=hostname | |
5084 | cont='' | |
5085 | fi | |
5086 | ;; | |
5087 | *) cont='';; | |
5088 | esac | |
5089 | if $test "$cont"; then | |
5090 | if ./xenix; then | |
5091 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' | |
5092 | if tans=`cat /etc/systemid 2>&1` ; then | |
5093 | myhostname=$tans | |
5094 | phostname='cat /etc/systemid' | |
5095 | echo "Whadyaknow. Xenix always was a bit strange..." | |
5096 | cont='' | |
5097 | fi | |
5098 | elif $test -r /etc/systemid; then | |
5099 | echo "(What is a non-Xenix system doing with /etc/systemid?)" | |
5100 | fi | |
5101 | fi | |
5102 | if $test "$cont"; then | |
5103 | echo 'No, maybe "uuname -l" will work...' | |
5104 | if tans=`sh -c 'uuname -l' 2>&1` ; then | |
5105 | myhostname=$tans | |
5106 | phostname='uuname -l' | |
5107 | else | |
5108 | echo 'Strange. Maybe "uname -n" will work...' | |
5109 | if tans=`sh -c 'uname -n' 2>&1` ; then | |
5110 | myhostname=$tans | |
5111 | phostname='uname -n' | |
5112 | else | |
5113 | echo 'Oh well, maybe I can mine it out of whoami.h...' | |
5114 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then | |
5115 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` | |
5116 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" | |
5117 | else | |
5118 | case "$myhostname" in | |
5119 | '') echo "Does this machine have an identity crisis or something?" | |
5120 | phostname='';; | |
5121 | *) | |
5122 | echo "Well, you said $myhostname before..." | |
5123 | phostname='echo $myhostname';; | |
5124 | esac | |
5125 | fi | |
5126 | fi | |
5127 | fi | |
5128 | fi | |
5129 | : you do not want to know about this | |
5130 | set $myhostname | |
5131 | myhostname=$1 | |
5132 | ||
5133 | : verify guess | |
5134 | if $test "$myhostname" ; then | |
5135 | dflt=y | |
5136 | rp='Your host name appears to be "'$myhostname'".'" Right?" | |
5137 | . ./myread | |
5138 | case "$ans" in | |
5139 | y*) ;; | |
5140 | *) myhostname='';; | |
5141 | esac | |
5142 | fi | |
5143 | ||
5144 | : bad guess or no guess | |
5145 | while $test "X$myhostname" = X ; do | |
5146 | dflt='' | |
5147 | rp="Please type the (one word) name of your host:" | |
5148 | . ./myread | |
5149 | myhostname="$ans" | |
5150 | done | |
5151 | ||
5152 | : translate upper to lower if necessary | |
5153 | case "$myhostname" in | |
5154 | *[A-Z]*) | |
5155 | echo "(Normalizing case in your host name)" | |
5156 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` | |
5157 | ;; | |
5158 | esac | |
5159 | ||
5160 | case "$myhostname" in | |
5161 | *.*) | |
5162 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` | |
5163 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` | |
5164 | echo "(Trimming domain name from host name--host name is now $myhostname)" | |
5165 | ;; | |
5166 | *) case "$mydomain" in | |
5167 | '') | |
5168 | { | |
5169 | : If we use NIS, try ypmatch. | |
5170 | : Is there some reason why this was not done before? | |
5171 | test "X$hostcat" = "Xypcat hosts" && | |
5172 | ypmatch "$myhostname" hosts 2>/dev/null |\ | |
5173 | $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ | |
5174 | $test -s hosts | |
5175 | } || { | |
5176 | : Extract only the relevant hosts, reducing file size, | |
5177 | : remove comments, insert trailing space for later use. | |
5178 | $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / | |
5179 | /[ ]$myhostname[ . ]/p" > hosts | |
5180 | } | |
5181 | tmp_re="[ . ]" | |
5182 | $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } | |
5183 | END { print sum }" hosts` = x1 || tmp_re="[ ]" | |
5184 | dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ | |
5185 | hosts | $sort | $uniq | \ | |
5186 | $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` | |
5187 | case `$echo X$dflt` in | |
5188 | X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" | |
5189 | dflt=. | |
5190 | ;; | |
5191 | X.) echo "(You do not have fully-qualified names in /etc/hosts)" | |
5192 | ;; | |
5193 | esac | |
5194 | case "$dflt" in | |
5195 | .) | |
5196 | tans=`./loc resolv.conf X /etc /usr/etc` | |
5197 | if $test -f "$tans"; then | |
5198 | echo "(Attempting domain name extraction from $tans)" | |
5199 | : Why was there an Egrep here, when Sed works? | |
5200 | : Look for either a search or a domain directive. | |
a6006777 | 5201 | dflt=.`$sed -n -e 's/ / /g' \ |
28757baa | 5202 | -e 's/^search *\([^ ]*\).*/\1/p' $tans \ |
a6006777 | 5203 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
2afac517 | 5204 | case "$dflt" in |
a6006777 | 5205 | .) dflt=.`$sed -n -e 's/ / /g' \ |
28757baa | 5206 | -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ |
a6006777 | 5207 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
774d564b | 5208 | ;; |
2afac517 | 5209 | esac |
5210 | fi | |
5211 | ;; | |
5212 | esac | |
5213 | case "$dflt" in | |
5214 | .) echo "(No help from resolv.conf either -- attempting clever guess)" | |
5215 | dflt=.`sh -c domainname 2>/dev/null` | |
5216 | case "$dflt" in | |
5217 | '') dflt='.';; | |
5218 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; | |
5219 | esac | |
5220 | ;; | |
5221 | esac | |
5222 | case "$dflt" in | |
5223 | .) echo "(Lost all hope -- silly guess then)" | |
5224 | dflt='.uucp' | |
5225 | ;; | |
5226 | esac | |
5227 | $rm -f hosts | |
5228 | ;; | |
5229 | *) dflt="$mydomain";; | |
5230 | esac;; | |
5231 | esac | |
5232 | echo " " | |
5233 | rp="What is your domain name?" | |
5234 | . ./myread | |
5235 | tans="$ans" | |
5236 | case "$ans" in | |
5237 | '') ;; | |
5238 | .*) ;; | |
5239 | *) tans=".$tans";; | |
5240 | esac | |
5241 | mydomain="$tans" | |
5242 | ||
5243 | : translate upper to lower if necessary | |
5244 | case "$mydomain" in | |
5245 | *[A-Z]*) | |
5246 | echo "(Normalizing case in your domain name)" | |
5247 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` | |
5248 | ;; | |
5249 | esac | |
5250 | ||
5251 | : a little sanity check here | |
5252 | case "$phostname" in | |
5253 | '') ;; | |
5254 | *) | |
5255 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in | |
5256 | $myhostname$mydomain|$myhostname) ;; | |
5257 | *) | |
5258 | case "$phostname" in | |
5259 | sed*) | |
5260 | echo "(That doesn't agree with your whoami.h file, by the way.)" | |
5261 | ;; | |
5262 | *) | |
5263 | echo "(That doesn't agree with your $phostname command, by the way.)" | |
5264 | ;; | |
5265 | esac | |
5266 | ;; | |
5267 | esac | |
5268 | ;; | |
5269 | esac | |
5270 | ||
5271 | $cat <<EOM | |
5272 | ||
5273 | I need to get your e-mail address in Internet format if possible, i.e. | |
5274 | something like user@host.domain. Please answer accurately since I have | |
5275 | no easy means to double check it. The default value provided below | |
5276 | is most probably close to the reality but may not be valid from outside | |
5277 | your organization... | |
5278 | ||
5279 | EOM | |
5280 | cont=x | |
5281 | while test "$cont"; do | |
5282 | case "$cf_email" in | |
5283 | '') dflt="$cf_by@$myhostname$mydomain";; | |
5284 | *) dflt="$cf_email";; | |
5285 | esac | |
5286 | rp='What is your e-mail address?' | |
5287 | . ./myread | |
5288 | cf_email="$ans" | |
5289 | case "$cf_email" in | |
5290 | *@*.*) cont='' ;; | |
5291 | *) | |
5292 | rp='Address does not look like an Internet one. Use it anyway?' | |
5293 | case "$fastread" in | |
5294 | yes) dflt=y ;; | |
5295 | *) dflt=n ;; | |
5296 | esac | |
5297 | . ./myread | |
5298 | case "$ans" in | |
5299 | y*) cont='' ;; | |
5300 | *) echo " " ;; | |
5301 | esac | |
5302 | ;; | |
5303 | esac | |
5304 | done | |
5305 | ||
5306 | $cat <<EOM | |
5307 | ||
5308 | If you or somebody else will be maintaining perl at your site, please | |
5309 | fill in the correct e-mail address here so that they may be contacted | |
5310 | if necessary. Currently, the "perlbug" program included with perl | |
5311 | will send mail to this address in addition to perlbug@perl.com. You may | |
5312 | enter "none" for no administrator. | |
5313 | ||
5314 | EOM | |
5315 | case "$perladmin" in | |
5316 | '') dflt="$cf_email";; | |
5317 | *) dflt="$perladmin";; | |
5318 | esac | |
5319 | rp='Perl administrator e-mail address' | |
5320 | . ./myread | |
5321 | perladmin="$ans" | |
5322 | ||
5f05dabc | 5323 | : figure out how to guarantee perl startup |
5324 | case "$startperl" in | |
5325 | '') | |
5326 | case "$sharpbang" in | |
5327 | *!) | |
5328 | $cat <<EOH | |
5329 | ||
5330 | I can use the #! construct to start perl on your system. This will | |
5331 | make startup of perl scripts faster, but may cause problems if you | |
5332 | want to share those scripts and perl is not in a standard place | |
5333 | ($binexp/perl) on all your platforms. The alternative is to force | |
5334 | a shell by starting the script with a single ':' character. | |
5335 | ||
5336 | EOH | |
5337 | dflt="$binexp/perl" | |
5338 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' | |
5339 | . ./myread | |
5340 | case "$ans" in | |
68dc0745 | 5341 | none) startperl=": # use perl";; |
5342 | *) startperl="#!$ans" | |
5343 | if $test 33 -lt `echo "$ans" | wc -c`; then | |
5344 | $cat >&4 <<EOM | |
5345 | ||
5346 | WARNING: Some systems limit the #! command to 32 characters. | |
5347 | If you experience difficulty running Perl scripts with #!, try | |
5348 | installing Perl in a directory with a shorter pathname. | |
5349 | ||
5350 | EOM | |
5351 | fi ;; | |
5f05dabc | 5352 | esac |
5353 | ;; | |
5354 | *) startperl=": # use perl" | |
5355 | ;; | |
5356 | esac | |
5357 | ;; | |
5358 | esac | |
5359 | echo "I'll use $startperl to start perl scripts." | |
5360 | ||
5361 | : figure best path for perl in scripts | |
5362 | case "$perlpath" in | |
5363 | '') | |
5364 | perlpath="$binexp/perl" | |
5365 | case "$startperl" in | |
5366 | *!*) ;; | |
5367 | *) | |
5368 | $cat <<EOH | |
5369 | ||
5370 | I will use the "eval 'exec'" idiom to start Perl on your system. | |
5371 | I can use the full path of your Perl binary for this purpose, but | |
5372 | doing so may cause problems if you want to share those scripts and | |
5373 | Perl is not always in a standard place ($binexp/perl). | |
5374 | ||
5375 | EOH | |
5376 | dflt="$binexp/perl" | |
5377 | rp="What path shall I use in \"eval 'exec'\"?" | |
5378 | . ./myread | |
5379 | perlpath="$ans" | |
5380 | ;; | |
5381 | esac | |
5382 | ;; | |
5383 | esac | |
5384 | case "$startperl" in | |
5385 | *!*) ;; | |
5386 | *) echo "I'll use $perlpath in \"eval 'exec'\"" ;; | |
5387 | esac | |
5388 | ||
2afac517 | 5389 | : determine where public executable scripts go |
5390 | set scriptdir scriptdir | |
5391 | eval $prefixit | |
5392 | case "$scriptdir" in | |
5393 | '') | |
5394 | dflt="$bin" | |
5395 | : guess some guesses | |
5396 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
5397 | $test -d /usr/share/bin && dflt=/usr/share/bin | |
5398 | $test -d /usr/local/script && dflt=/usr/local/script | |
5399 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
5400 | set dflt | |
5401 | eval $prefixup | |
5402 | ;; | |
5403 | *) dflt="$scriptdir" | |
5404 | ;; | |
5405 | esac | |
5406 | $cat <<EOM | |
5407 | ||
5408 | Some installations have a separate directory just for executable scripts so | |
5409 | that they can mount it across multiple architectures but keep the scripts in | |
5410 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
5411 | Or you might just lump your scripts in with all your other executables. | |
5412 | ||
5413 | EOM | |
5414 | fn=d~ | |
5415 | rp='Where do you keep publicly executable scripts?' | |
5416 | . ./getfile | |
5417 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
5418 | installscript='' | |
5419 | fi | |
5420 | scriptdir="$ans" | |
5421 | scriptdirexp="$ansexp" | |
5422 | if $afs; then | |
5423 | $cat <<EOM | |
5424 | ||
5425 | Since you are running AFS, I need to distinguish the directory in which | |
5426 | scripts reside from the directory in which they are installed (and from | |
5427 | which they are presumably copied to the former directory by occult means). | |
5428 | ||
5429 | EOM | |
5430 | case "$installscript" in | |
5431 | '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;; | |
5432 | *) dflt="$installscript";; | |
5433 | esac | |
5434 | fn=de~ | |
5435 | rp='Where will public scripts be installed?' | |
5436 | . ./getfile | |
5437 | installscript="$ans" | |
5438 | else | |
5439 | installscript="$scriptdirexp" | |
2304df62 | 5440 | fi |
2afac517 | 5441 | |
2afac517 | 5442 | cat <<EOM |
5443 | ||
5444 | Previous version of $package used the standard IO mechanisms as defined in | |
5445 | <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO | |
5446 | mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still | |
5447 | the default and is the only supported mechanism. This abstraction | |
5448 | layer can use AT&T's sfio (if you already have sfio installed) or | |
5449 | fall back on standard IO. This PerlIO abstraction layer is | |
5450 | experimental and may cause problems with some extension modules. | |
5451 | ||
5452 | If this doesn't make any sense to you, just accept the default 'n'. | |
5453 | EOM | |
5454 | case "$useperlio" in | |
5455 | $define|true|[yY]*) dflt='y';; | |
5456 | *) dflt='n';; | |
5457 | esac | |
5458 | rp='Use the experimental PerlIO abstraction layer?' | |
5459 | . ./myread | |
5460 | case "$ans" in | |
5461 | y|Y) | |
5462 | val="$define" | |
5463 | ;; | |
5464 | *) | |
5465 | echo "Ok, doing things the stdio way" | |
5466 | val="$undef" | |
5467 | ;; | |
5468 | esac | |
5469 | set useperlio | |
5470 | eval $setvar | |
2304df62 | 5471 | |
8e07c86e AD |
5472 | : Check how to convert floats to strings. |
5473 | echo " " | |
5474 | echo "Checking for an efficient way to convert floats to strings." | |
5475 | $cat >try.c <<'EOP' | |
5476 | #ifdef TRY_gconvert | |
5477 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) | |
8ff267be | 5478 | char *myname = "gconvert"; |
8e07c86e AD |
5479 | #endif |
5480 | #ifdef TRY_gcvt | |
5481 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) | |
8ff267be | 5482 | char *myname = "gcvt"; |
8e07c86e AD |
5483 | #endif |
5484 | #ifdef TRY_sprintf | |
5485 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) | |
8ff267be | 5486 | char *myname = "sprintf"; |
8e07c86e | 5487 | #endif |
8ff267be | 5488 | |
5489 | #include <stdio.h> | |
5490 | ||
5491 | int | |
5492 | checkit(expect, got) | |
5493 | char *expect; | |
5494 | char *got; | |
5495 | { | |
5496 | if (strcmp(expect, got)) { | |
5497 | printf("%s oddity: Expected %s, got %s\n", | |
5498 | myname, expect, got); | |
5499 | exit(1); | |
5500 | } | |
5501 | } | |
5502 | ||
5503 | int | |
5504 | main() | |
5505 | { | |
ecfc5424 | 5506 | char buf[64]; |
8ff267be | 5507 | buf[63] = '\0'; |
5508 | ||
5509 | /* This must be 1st test on (which?) platform */ | |
5510 | /* Alan Burlison <AlanBurlsin@unn.unisys.com> */ | |
5511 | Gconvert(0.1, 8, 0, buf); | |
5512 | checkit("0.1", buf); | |
5513 | ||
8e07c86e | 5514 | Gconvert(1.0, 8, 0, buf); |
8ff267be | 5515 | checkit("1", buf); |
5516 | ||
8e07c86e | 5517 | Gconvert(0.0, 8, 0, buf); |
8ff267be | 5518 | checkit("0", buf); |
5519 | ||
8e07c86e | 5520 | Gconvert(-1.0, 8, 0, buf); |
8ff267be | 5521 | checkit("-1", buf); |
5522 | ||
5523 | /* Some Linux gcvt's give 1.e+5 here. */ | |
5524 | Gconvert(100000.0, 8, 0, buf); | |
5525 | checkit("100000", buf); | |
5526 | ||
5527 | /* Some Linux gcvt's give -1.e+5 here. */ | |
5528 | Gconvert(-100000.0, 8, 0, buf); | |
5529 | checkit("-100000", buf); | |
5530 | ||
ecfc5424 | 5531 | exit(0); |
a0d0e21e LW |
5532 | } |
5533 | EOP | |
8e07c86e AD |
5534 | case "$d_Gconvert" in |
5535 | gconvert*) xxx_list='gconvert gcvt sprintf' ;; | |
5536 | gcvt*) xxx_list='gcvt gconvert sprintf' ;; | |
5537 | sprintf*) xxx_list='sprintf gconvert gcvt' ;; | |
5538 | *) xxx_list='gconvert gcvt sprintf' ;; | |
5539 | esac | |
5540 | ||
5541 | for xxx_convert in $xxx_list; do | |
5542 | echo "Trying $xxx_convert" | |
5543 | $rm -f try try.o | |
5544 | if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \ | |
5545 | try.c $libs > /dev/null 2>&1 ; then | |
5546 | echo "$xxx_convert" found. >&4 | |
5547 | if ./try; then | |
8e07c86e AD |
5548 | echo "I'll use $xxx_convert to convert floats into a string." >&4 |
5549 | break; | |
2304df62 | 5550 | else |
8ff267be | 5551 | echo "...But $xxx_convert didn't work as I expected." |
2304df62 | 5552 | fi |
8e07c86e AD |
5553 | else |
5554 | echo "$xxx_convert NOT found." >&4 | |
5555 | fi | |
5556 | done | |
5557 | ||
5558 | case "$xxx_convert" in | |
5559 | gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; | |
5560 | gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; | |
5561 | *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; | |
2304df62 AD |
5562 | esac |
5563 | ||
a0d0e21e LW |
5564 | : Initialize h_fcntl |
5565 | h_fcntl=false | |
5566 | ||
5567 | : Initialize h_sysfile | |
5568 | h_sysfile=false | |
2304df62 | 5569 | |
2304df62 AD |
5570 | : access call always available on UNIX |
5571 | set access d_access | |
5572 | eval $inlibc | |
5573 | ||
5574 | : locate the flags for 'access()' | |
5575 | case "$d_access" in | |
5576 | "$define") | |
5577 | echo " " | |
5578 | $cat >access.c <<'EOCP' | |
5579 | #include <sys/types.h> | |
5580 | #ifdef I_FCNTL | |
5581 | #include <fcntl.h> | |
5582 | #endif | |
5583 | #ifdef I_SYS_FILE | |
5584 | #include <sys/file.h> | |
5585 | #endif | |
5586 | #ifdef I_UNISTD | |
5587 | #include <unistd.h> | |
5588 | #endif | |
5589 | main() { | |
5590 | exit(R_OK); | |
5591 | } | |
8e07c86e AD |
5592 | EOCP |
5593 | : check sys/file.h first, no particular reason here | |
5594 | if $test `./findhdr sys/file.h` && \ | |
5595 | $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then | |
5596 | h_sysfile=true; | |
5597 | echo "<sys/file.h> defines the *_OK access constants." >&4 | |
5598 | elif $test `./findhdr fcntl.h` && \ | |
5599 | $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then | |
5600 | h_fcntl=true; | |
5601 | echo "<fcntl.h> defines the *_OK access constants." >&4 | |
5602 | elif $test `./findhdr unistd.h` && \ | |
5603 | $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then | |
5604 | echo "<unistd.h> defines the *_OK access constants." >&4 | |
5605 | else | |
5606 | echo "I can't find the four *_OK access constants--I'll use mine." >&4 | |
5607 | fi | |
5608 | ;; | |
5609 | esac | |
5610 | $rm -f access* | |
a0d0e21e | 5611 | |
8e07c86e AD |
5612 | : see if alarm exists |
5613 | set alarm d_alarm | |
5614 | eval $inlibc | |
2304df62 | 5615 | |
ecfc5424 | 5616 | : Look for GNU-cc style attribute checking |
2304df62 | 5617 | echo " " |
a0d0e21e LW |
5618 | echo "Checking whether your compiler can handle __attribute__ ..." >&4 |
5619 | $cat >attrib.c <<'EOCP' | |
1aef975c | 5620 | #include <stdio.h> |
ecfc5424 | 5621 | void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn)); |
a0d0e21e LW |
5622 | EOCP |
5623 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then | |
5624 | if $contains 'warning' attrib.out >/dev/null 2>&1; then | |
ecfc5424 | 5625 | echo "Your C compiler doesn't fully support __attribute__." |
a0d0e21e LW |
5626 | val="$undef" |
5627 | else | |
ecfc5424 | 5628 | echo "Your C compiler supports __attribute__." |
a0d0e21e LW |
5629 | val="$define" |
5630 | fi | |
5631 | else | |
ecfc5424 | 5632 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
a0d0e21e LW |
5633 | val="$undef" |
5634 | fi | |
ecfc5424 | 5635 | set d_attribut |
a0d0e21e LW |
5636 | eval $setvar |
5637 | $rm -f attrib* | |
5638 | ||
5639 | : see if bcmp exists | |
5640 | set bcmp d_bcmp | |
5641 | eval $inlibc | |
5642 | ||
5643 | : see if bcopy exists | |
5644 | set bcopy d_bcopy | |
5645 | eval $inlibc | |
5646 | ||
2afac517 | 5647 | : see if this is a unistd.h system |
5648 | set unistd.h i_unistd | |
5649 | eval $inhdr | |
5650 | ||
5651 | : see if getpgrp exists | |
5652 | set getpgrp d_getpgrp | |
5653 | eval $inlibc | |
5654 | ||
5655 | echo "Checking to see which flavor of getpgrp is in use . . . " | |
5656 | case "$d_getpgrp" in | |
5657 | "$define") | |
5658 | echo " " | |
5659 | $cat >set.c <<EOP | |
5660 | #$i_unistd I_UNISTD | |
5661 | #include <sys/types.h> | |
5662 | #ifdef I_UNISTD | |
5663 | # include <unistd.h> | |
5664 | #endif | |
5665 | main() | |
5666 | { | |
5667 | if (getuid() == 0) { | |
5668 | printf("(I see you are running Configure as super-user...)\n"); | |
5669 | setuid(1); | |
5670 | } | |
5671 | #ifdef TRY_BSD_PGRP | |
5672 | if (getpgrp(1) == 0) | |
5673 | exit(0); | |
5674 | #else | |
5675 | if (getpgrp() > 0) | |
5676 | exit(0); | |
5677 | #endif | |
5678 | exit(1); | |
5679 | } | |
5680 | EOP | |
5681 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
5682 | echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 | |
5683 | val="$define" | |
5684 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
5685 | echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 | |
5686 | val="$undef" | |
5687 | else | |
5688 | echo "I can't seem to compile and run the test program." | |
5689 | if ./usg; then | |
5690 | xxx="a USG one, i.e. you use getpgrp()." | |
5691 | else | |
5692 | # SVR4 systems can appear rather BSD-ish. | |
5693 | case "$i_unistd" in | |
5694 | $undef) | |
5695 | xxx="a BSD one, i.e. you use getpgrp(pid)." | |
5696 | val="$define" | |
5697 | ;; | |
5698 | $define) | |
5699 | xxx="probably a USG one, i.e. you use getpgrp()." | |
5700 | val="$undef" | |
5701 | ;; | |
5702 | esac | |
5703 | fi | |
5704 | echo "Assuming your getpgrp is $xxx" >&4 | |
5705 | fi | |
5706 | ;; | |
5707 | *) val="$undef";; | |
5708 | esac | |
5709 | set d_bsdgetpgrp | |
5710 | eval $setvar | |
5711 | $rm -f set set.c | |
5712 | ||
a0d0e21e LW |
5713 | : see if setpgrp exists |
5714 | set setpgrp d_setpgrp | |
5715 | eval $inlibc | |
5716 | ||
2afac517 | 5717 | echo "Checking to see which flavor of setpgrp is in use . . . " |
a0d0e21e LW |
5718 | case "$d_setpgrp" in |
5719 | "$define") | |
5720 | echo " " | |
5721 | $cat >set.c <<EOP | |
2afac517 | 5722 | #$i_unistd I_UNISTD |
5723 | #include <sys/types.h> | |
5724 | #ifdef I_UNISTD | |
5725 | # include <unistd.h> | |
5726 | #endif | |
a0d0e21e LW |
5727 | main() |
5728 | { | |
5729 | if (getuid() == 0) { | |
5730 | printf("(I see you are running Configure as super-user...)\n"); | |
5731 | setuid(1); | |
5732 | } | |
2afac517 | 5733 | #ifdef TRY_BSD_PGRP |
a0d0e21e | 5734 | if (-1 == setpgrp(1, 1)) |
2afac517 | 5735 | exit(0); |
5736 | #else | |
5737 | if (setpgrp() != -1) | |
5738 | exit(0); | |
5739 | #endif | |
5740 | exit(1); | |
a0d0e21e LW |
5741 | } |
5742 | EOP | |
2afac517 | 5743 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
5744 | echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 | |
5745 | val="$define" | |
5746 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
5747 | echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 | |
5748 | val="$undef" | |
a0d0e21e | 5749 | else |
2afac517 | 5750 | echo "I can't seem to compile and run the test program." |
ecfc5424 | 5751 | if ./usg; then |
2afac517 | 5752 | xxx="a USG one, i.e. you use setpgrp()." |
a0d0e21e | 5753 | else |
2afac517 | 5754 | # SVR4 systems can appear rather BSD-ish. |
5755 | case "$i_unistd" in | |
5756 | $undef) | |
5757 | xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." | |
5758 | val="$define" | |
5759 | ;; | |
5760 | $define) | |
5761 | xxx="probably a USG one, i.e. you use setpgrp()." | |
5762 | val="$undef" | |
5763 | ;; | |
5764 | esac | |
a0d0e21e | 5765 | fi |
2afac517 | 5766 | echo "Assuming your setpgrp is $xxx" >&4 |
a0d0e21e LW |
5767 | fi |
5768 | ;; | |
5769 | *) val="$undef";; | |
5770 | esac | |
2afac517 | 5771 | set d_bsdsetpgrp |
a0d0e21e | 5772 | eval $setvar |
2afac517 | 5773 | d_bsdpgrp=$d_bsdsetpgrp |
a0d0e21e | 5774 | $rm -f set set.c |
a0d0e21e LW |
5775 | : see if bzero exists |
5776 | set bzero d_bzero | |
5777 | eval $inlibc | |
5778 | ||
24fef2a7 | 5779 | : check for lengths of integral types |
a0d0e21e LW |
5780 | echo " " |
5781 | case "$intsize" in | |
5782 | '') | |
5783 | echo "Checking to see how big your integers are..." >&4 | |
24fef2a7 | 5784 | $cat >intsize.c <<'EOCP' |
a0d0e21e LW |
5785 | #include <stdio.h> |
5786 | main() | |
5787 | { | |
24fef2a7 AD |
5788 | printf("intsize=%d;\n", sizeof(int)); |
5789 | printf("longsize=%d;\n", sizeof(long)); | |
5790 | printf("shortsize=%d;\n", sizeof(short)); | |
5791 | fflush(stdout); | |
8e07c86e | 5792 | exit(0); |
a0d0e21e LW |
5793 | } |
5794 | EOCP | |
24fef2a7 AD |
5795 | # If $libs contains -lsfio, and sfio is mis-configured, then it |
5796 | # sometimes (apparently) runs and exits with a 0 status, but with no | |
5797 | # output!. Thus we check with test -s whether we actually got any | |
5798 | # output. I think it has to do with sfio's use of _exit vs. exit, | |
5799 | # but I don't know for sure. --Andy Dougherty 1/27/97. | |
5800 | if $cc $optimize $ccflags $ldflags -o intsize intsize.c $libs >/dev/null 2>&1 && | |
5801 | ./intsize > intsize.out 2>/dev/null && test -s intsize.out ; then | |
5802 | eval `$cat intsize.out` | |
8e07c86e | 5803 | echo "Your integers are $intsize bytes long." |
24fef2a7 AD |
5804 | echo "Your long integers are $longsize bytes long." |
5805 | echo "Your short integers are $shortsize bytes long." | |
a0d0e21e | 5806 | else |
24fef2a7 AD |
5807 | $cat >&4 <<EOM |
5808 | ||
5809 | Help! I can't compile and run the intsize test program: please enlighten me! | |
5810 | (This is probably a misconfiguration in your system or libraries, and | |
5811 | you really ought to fix it. Still, I'll try anyway.) | |
5812 | ||
5813 | EOM | |
5814 | dflt=4 | |
8e07c86e AD |
5815 | rp="What is the size of an integer (in bytes)?" |
5816 | . ./myread | |
5817 | intsize="$ans" | |
24fef2a7 AD |
5818 | dflt=$intsize |
5819 | rp="What is the size of a long integer (in bytes)?" | |
5820 | . ./myread | |
5821 | longsize="$ans" | |
5822 | dflt=2 | |
5823 | rp="What is the size of a short integer (in bytes)?" | |
5824 | . ./myread | |
5825 | shortsize="$ans" | |
a0d0e21e LW |
5826 | fi |
5827 | ;; | |
a0d0e21e | 5828 | esac |
24fef2a7 | 5829 | $rm -f intsize intsize.[co] intsize.out |
a0d0e21e | 5830 | |
ecfc5424 | 5831 | : see if signal is declared as pointer to function returning int or void |
a0d0e21e | 5832 | echo " " |
ecfc5424 AD |
5833 | xxx=`./findhdr signal.h` |
5834 | $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null | |
5835 | if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
5836 | echo "You have int (*signal())() instead of void." >&4 | |
5837 | val="$undef" | |
5838 | elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
5839 | echo "You have void (*signal())() instead of int." >&4 | |
5840 | val="$define" | |
5841 | elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then | |
5842 | echo "You have int (*signal())() instead of void." >&4 | |
5843 | val="$undef" | |
a0d0e21e | 5844 | else |
ecfc5424 AD |
5845 | case "$d_voidsig" in |
5846 | '') | |
5847 | echo "I can't determine whether signal handler returns void or int..." >&4 | |
5848 | dflt=void | |
5849 | rp="What type does your signal handler return?" | |
5850 | . ./myread | |
5851 | case "$ans" in | |
5852 | v*) val="$define";; | |
5853 | *) val="$undef";; | |
5854 | esac;; | |
5855 | "$define") | |
5856 | echo "As you already told me, signal handler returns void." >&4;; | |
5857 | *) | |
5858 | echo "As you already told me, signal handler returns int." >&4;; | |
5859 | esac | |
5860 | fi | |
5861 | set d_voidsig | |
5862 | eval $setvar | |
5863 | case "$d_voidsig" in | |
5864 | "$define") signal_t="void";; | |
5865 | *) signal_t="int";; | |
5866 | esac | |
5867 | $rm -f $$.tmp | |
5868 | ||
5869 | : check for ability to cast large floats to 32-bit ints. | |
5870 | echo " " | |
5871 | echo 'Checking whether your C compiler can cast large floats to int32.' >&4 | |
5872 | if $test "$intsize" -eq 4; then | |
5873 | xxx=int | |
5874 | else | |
5875 | xxx=long | |
5876 | fi | |
5877 | $cat >try.c <<EOCP | |
5878 | #include <sys/types.h> | |
5879 | #include <signal.h> | |
5880 | $signal_t blech() { exit(3); } | |
5881 | main() | |
2304df62 | 5882 | { |
a0d0e21e | 5883 | $xxx i32; |
2304df62 AD |
5884 | double f; |
5885 | int result = 0; | |
5886 | signal(SIGFPE, blech); | |
5887 | ||
5888 | f = (double) 0x7fffffff; | |
5889 | f = 10 * f; | |
a0d0e21e | 5890 | i32 = ($xxx) f; |
2304df62 | 5891 | |
a0d0e21e | 5892 | if (i32 != ($xxx) f) |
2304df62 AD |
5893 | result |= 1; |
5894 | exit(result); | |
5895 | } | |
5896 | EOCP | |
5897 | if $cc -o try $ccflags try.c >/dev/null 2>&1; then | |
5898 | ./try | |
5899 | yyy=$? | |
5900 | else | |
a0d0e21e | 5901 | echo "(I can't seem to compile the test program--assuming it can't)" |
2304df62 AD |
5902 | yyy=1 |
5903 | fi | |
5904 | case "$yyy" in | |
5905 | 0) val="$define" | |
5906 | echo "Yup, it can." | |
5907 | ;; | |
5908 | *) val="$undef" | |
5909 | echo "Nope, it can't." | |
5910 | ;; | |
5911 | esac | |
5912 | set d_casti32 | |
5913 | eval $setvar | |
85e6fe83 | 5914 | $rm -f try try.* |
a0d0e21e | 5915 | |
2304df62 AD |
5916 | : check for ability to cast negative floats to unsigned |
5917 | echo " " | |
5918 | echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 | |
ecfc5424 AD |
5919 | $cat >try.c <<EOCP |
5920 | #include <sys/types.h> | |
2304df62 | 5921 | #include <signal.h> |
232e078e AD |
5922 | $signal_t blech() { exit(7); } |
5923 | $signal_t blech_in_list() { exit(4); } | |
5924 | unsigned long dummy_long(p) unsigned long p; { return p; } | |
5925 | unsigned int dummy_int(p) unsigned int p; { return p; } | |
5926 | unsigned short dummy_short(p) unsigned short p; { return p; } | |
2304df62 AD |
5927 | main() |
5928 | { | |
232e078e | 5929 | double f = -123.; |
2304df62 AD |
5930 | unsigned long along; |
5931 | unsigned int aint; | |
5932 | unsigned short ashort; | |
5933 | int result = 0; | |
5934 | ||
5935 | signal(SIGFPE, blech); | |
5936 | along = (unsigned long)f; | |
5937 | aint = (unsigned int)f; | |
5938 | ashort = (unsigned short)f; | |
5939 | if (along != (unsigned long)-123) | |
5940 | result |= 1; | |
5941 | if (aint != (unsigned int)-123) | |
5942 | result |= 1; | |
5943 | if (ashort != (unsigned short)-123) | |
5944 | result |= 1; | |
5945 | f = (double)0x40000000; | |
5946 | f = f + f; | |
5947 | along = 0; | |
5948 | along = (unsigned long)f; | |
5949 | if (along != 0x80000000) | |
5950 | result |= 2; | |
5951 | f -= 1.; | |
5952 | along = 0; | |
5953 | along = (unsigned long)f; | |
5954 | if (along != 0x7fffffff) | |
5955 | result |= 1; | |
5956 | f += 2.; | |
5957 | along = 0; | |
5958 | along = (unsigned long)f; | |
5959 | if (along != 0x80000001) | |
5960 | result |= 2; | |
232e078e AD |
5961 | if (result) |
5962 | exit(result); | |
5963 | signal(SIGFPE, blech_in_list); | |
5964 | f = 123.; | |
5965 | along = dummy_long((unsigned long)f); | |
5966 | aint = dummy_int((unsigned int)f); | |
5967 | ashort = dummy_short((unsigned short)f); | |
5968 | if (along != (unsigned long)123) | |
5969 | result |= 4; | |
5970 | if (aint != (unsigned int)123) | |
5971 | result |= 4; | |
5972 | if (ashort != (unsigned short)123) | |
5973 | result |= 4; | |
2304df62 AD |
5974 | exit(result); |
5975 | ||
5976 | } | |
5977 | EOCP | |
5978 | if $cc -o try $ccflags try.c >/dev/null 2>&1; then | |
5979 | ./try | |
5980 | castflags=$? | |
5981 | else | |
ecfc5424 | 5982 | echo "(I can't seem to compile the test program--assuming it can't)" |
232e078e | 5983 | castflags=7 |
2304df62 AD |
5984 | fi |
5985 | case "$castflags" in | |
5986 | 0) val="$define" | |
5987 | echo "Yup, it can." | |
5988 | ;; | |
5989 | *) val="$undef" | |
5990 | echo "Nope, it can't." | |
5991 | ;; | |
5992 | esac | |
5993 | set d_castneg | |
5994 | eval $setvar | |
5995 | $rm -f try.* | |
5996 | ||
2304df62 AD |
5997 | : see if vprintf exists |
5998 | echo " " | |
5999 | if set vprintf val -f d_vprintf; eval $csym; $val; then | |
6000 | echo 'vprintf() found.' >&4 | |
6001 | val="$define" | |
6002 | $cat >vprintf.c <<'EOF' | |
6003 | #include <varargs.h> | |
6004 | ||
6005 | main() { xxx("foo"); } | |
6006 | ||
6007 | xxx(va_alist) | |
6008 | va_dcl | |
6009 | { | |
6010 | va_list args; | |
6011 | char buf[10]; | |
6012 | ||
6013 | va_start(args); | |
6014 | exit((unsigned long)vsprintf(buf,"%s",args) > 10L); | |
6015 | } | |
6016 | EOF | |
6017 | if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then | |
6018 | echo "Your vsprintf() returns (int)." >&4 | |
6019 | val2="$undef" | |
6020 | else | |
6021 | echo "Your vsprintf() returns (char*)." >&4 | |
6022 | val2="$define" | |
6023 | fi | |
6024 | else | |
6025 | echo 'vprintf() NOT found.' >&4 | |
6026 | val="$undef" | |
6027 | val2="$undef" | |
6028 | fi | |
6029 | set d_vprintf | |
6030 | eval $setvar | |
6031 | val=$val2 | |
6032 | set d_charvspr | |
6033 | eval $setvar | |
6034 | ||
a0d0e21e LW |
6035 | : see if chown exists |
6036 | set chown d_chown | |
6037 | eval $inlibc | |
6038 | ||
6039 | : see if chroot exists | |
6040 | set chroot d_chroot | |
6041 | eval $inlibc | |
6042 | ||
2304df62 AD |
6043 | : see if chsize exists |
6044 | set chsize d_chsize | |
6045 | eval $inlibc | |
6046 | ||
6047 | : check for const keyword | |
6048 | echo " " | |
6049 | echo 'Checking to see if your C compiler knows about "const"...' >&4 | |
6050 | $cat >const.c <<'EOCP' | |
6051 | typedef struct spug { int drokk; } spug; | |
6052 | main() | |
6053 | { | |
6054 | const char *foo; | |
6055 | const spug y; | |
6056 | } | |
6057 | EOCP | |
6058 | if $cc -c $ccflags const.c >/dev/null 2>&1 ; then | |
6059 | val="$define" | |
6060 | echo "Yup, it does." | |
6061 | else | |
6062 | val="$undef" | |
6063 | echo "Nope, it doesn't." | |
6064 | fi | |
6065 | set d_const | |
6066 | eval $setvar | |
6067 | ||
6068 | : see if crypt exists | |
6069 | echo " " | |
6070 | if set crypt val -f d_crypt; eval $csym; $val; then | |
6071 | echo 'crypt() found.' >&4 | |
6072 | val="$define" | |
6073 | cryptlib='' | |
6074 | else | |
5f05dabc | 6075 | cryptlib=`./loc Slibcrypt$lib_ext "" $xlibpth` |
2304df62 | 6076 | if $test -z "$cryptlib"; then |
5f05dabc | 6077 | cryptlib=`./loc Mlibcrypt$lib_ext "" $xlibpth` |
2304df62 AD |
6078 | else |
6079 | cryptlib=-lcrypt | |
6080 | fi | |
6081 | if $test -z "$cryptlib"; then | |
5f05dabc | 6082 | cryptlib=`./loc Llibcrypt$lib_ext "" $xlibpth` |
2304df62 AD |
6083 | else |
6084 | cryptlib=-lcrypt | |
6085 | fi | |
6086 | if $test -z "$cryptlib"; then | |
5f05dabc | 6087 | cryptlib=`./loc libcrypt$lib_ext "" $libpth` |
2304df62 AD |
6088 | else |
6089 | cryptlib=-lcrypt | |
6090 | fi | |
6091 | if $test -z "$cryptlib"; then | |
6092 | echo 'crypt() NOT found.' >&4 | |
6093 | val="$undef" | |
6094 | else | |
6095 | val="$define" | |
6096 | fi | |
6097 | fi | |
6098 | set d_crypt | |
6099 | eval $setvar | |
6100 | ||
6101 | : get csh whereabouts | |
6102 | case "$csh" in | |
ba7b5225 | 6103 | 'csh') val="$undef" ;; |
ba7b5225 | 6104 | *) val="$define" ;; |
2304df62 AD |
6105 | esac |
6106 | set d_csh | |
6107 | eval $setvar | |
46fc3d4c | 6108 | : Respect a hint or command line value for full_csh. |
6109 | case "$full_csh" in | |
6110 | '') full_csh=$csh ;; | |
6111 | esac | |
2304df62 | 6112 | |
a0d0e21e LW |
6113 | : see if cuserid exists |
6114 | set cuserid d_cuserid | |
2304df62 AD |
6115 | eval $inlibc |
6116 | ||
a0d0e21e LW |
6117 | : see if this is a limits.h system |
6118 | set limits.h i_limits | |
85e6fe83 LW |
6119 | eval $inhdr |
6120 | ||
a0d0e21e LW |
6121 | : see if this is a float.h system |
6122 | set float.h i_float | |
6123 | eval $inhdr | |
6124 | ||
6125 | : See if number of significant digits in a double precision number is known | |
6126 | echo " " | |
6127 | $cat >dbl_dig.c <<EOM | |
6128 | #$i_limits I_LIMITS | |
6129 | #$i_float I_FLOAT | |
6130 | #ifdef I_LIMITS | |
6131 | #include <limits.h> | |
85e6fe83 | 6132 | #endif |
a0d0e21e LW |
6133 | #ifdef I_FLOAT |
6134 | #include <float.h> | |
6135 | #endif | |
6136 | #ifdef DBL_DIG | |
6137 | printf("Contains DBL_DIG"); | |
85e6fe83 | 6138 | #endif |
85e6fe83 | 6139 | EOM |
a0d0e21e LW |
6140 | $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null |
6141 | if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then | |
6142 | echo "DBL_DIG found." >&4 | |
6143 | val="$define" | |
2304df62 | 6144 | else |
a0d0e21e LW |
6145 | echo "DBL_DIG NOT found." >&4 |
6146 | val="$undef" | |
2304df62 | 6147 | fi |
a0d0e21e LW |
6148 | $rm -f dbl_dig.? |
6149 | set d_dbl_dig | |
2304df62 | 6150 | eval $setvar |
2304df62 | 6151 | |
a0d0e21e LW |
6152 | : see if difftime exists |
6153 | set difftime d_difftime | |
2304df62 AD |
6154 | eval $inlibc |
6155 | ||
a0d0e21e LW |
6156 | : see if this is a dirent system |
6157 | echo " " | |
6158 | if xinc=`./findhdr dirent.h`; $test "$xinc"; then | |
6159 | val="$define" | |
6160 | echo "<dirent.h> found." >&4 | |
6161 | else | |
6162 | val="$undef" | |
6163 | if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then | |
6164 | echo "<sys/dir.h> found." >&4 | |
6165 | echo " " | |
6166 | else | |
6167 | xinc=`./findhdr sys/ndir.h` | |
6168 | fi | |
6169 | echo "<dirent.h> NOT found." >&4 | |
6170 | fi | |
6171 | set i_dirent | |
6172 | eval $setvar | |
6173 | ||
6174 | : Look for type of directory structure. | |
6175 | echo " " | |
6176 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
6177 | ||
6178 | case "$direntrytype" in | |
6179 | ''|' ') | |
6180 | case "$i_dirent" in | |
6181 | $define) guess1='struct dirent' ;; | |
6182 | *) guess1='struct direct' ;; | |
2afac517 | 6183 | esac |
6184 | ;; | |
6185 | *) guess1="$direntrytype" | |
6186 | ;; | |
8e07c86e AD |
6187 | esac |
6188 | ||
2afac517 | 6189 | case "$guess1" in |
6190 | 'struct dirent') guess2='struct direct' ;; | |
6191 | *) guess2='struct dirent' ;; | |
6192 | esac | |
6193 | ||
6194 | if $contains "$guess1" try.c >/dev/null 2>&1; then | |
6195 | direntrytype="$guess1" | |
6196 | echo "Your directory entries are $direntrytype." >&4 | |
6197 | elif $contains "$guess2" try.c >/dev/null 2>&1; then | |
6198 | direntrytype="$guess2" | |
6199 | echo "Your directory entries seem to be $direntrytype." >&4 | |
6200 | else | |
6201 | echo "I don't recognize your system's directory entries." >&4 | |
6202 | rp="What type is used for directory entries on this system?" | |
6203 | dflt="$guess1" | |
6204 | . ./myread | |
6205 | direntrytype="$ans" | |
6206 | fi | |
6207 | $rm -f try.c | |
a0d0e21e | 6208 | |
a0d0e21e | 6209 | |
2afac517 | 6210 | : see if the directory entry stores field length |
6211 | echo " " | |
6212 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
6213 | if $contains 'd_namlen' try.c >/dev/null 2>&1; then | |
6214 | echo "Good, your directory entry keeps length information in d_namlen." >&4 | |
6215 | val="$define" | |
6216 | else | |
6217 | echo "Your directory entry does not know about the d_namlen field." >&4 | |
6218 | val="$undef" | |
6219 | fi | |
6220 | set d_dirnamlen | |
6221 | eval $setvar | |
6222 | $rm -f try.c | |
a0d0e21e | 6223 | |
2afac517 | 6224 | : see if dlerror exists |
6225 | xxx_runnm="$runnm" | |
6226 | runnm=false | |
6227 | set dlerror d_dlerror | |
6228 | eval $inlibc | |
6229 | runnm="$xxx_runnm" | |
a0d0e21e LW |
6230 | |
6231 | : see if dlfcn is available | |
6232 | set dlfcn.h i_dlfcn | |
6233 | eval $inhdr | |
6234 | ||
6235 | case "$usedl" in | |
6236 | $define|y|true) | |
6237 | $cat << EOM | |
6238 | ||
6239 | On a few systems, the dynamically loaded modules that perl generates and uses | |
6240 | will need a different extension then shared libs. The default will probably | |
6241 | be appropriate. | |
6242 | ||
6243 | EOM | |
6244 | case "$dlext" in | |
6245 | '') dflt="$so" ;; | |
6246 | *) dflt="$dlext" ;; | |
6247 | esac | |
6248 | rp='What is the extension of dynamically loaded modules' | |
6249 | . ./myread | |
6250 | dlext="$ans" | |
6251 | ;; | |
6252 | *) | |
6253 | dlext="none" | |
6254 | ;; | |
6255 | esac | |
6256 | ||
6257 | : Check if dlsym need a leading underscore | |
6258 | echo " " | |
6259 | val="$undef" | |
6260 | ||
6261 | case "$dlsrc" in | |
6262 | dl_dlopen.xs) | |
6263 | echo "Checking whether your dlsym() needs a leading underscore ..." >&4 | |
6264 | $cat >dyna.c <<'EOM' | |
6265 | fred () { } | |
6266 | EOM | |
6267 | ||
6268 | $cat >fred.c<<EOM | |
6269 | ||
6270 | #include <stdio.h> | |
6271 | #$i_dlfcn I_DLFCN | |
6272 | #ifdef I_DLFCN | |
6273 | #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */ | |
6274 | #else | |
6275 | #include <sys/types.h> | |
6276 | #include <nlist.h> | |
6277 | #include <link.h> | |
6278 | #endif | |
6279 | ||
6280 | extern int fred() ; | |
6281 | ||
6282 | main() | |
6283 | { | |
6284 | void * handle ; | |
6285 | void * symbol ; | |
6286 | #ifndef RTLD_LAZY | |
6287 | int mode = 1 ; | |
6288 | #else | |
6289 | int mode = RTLD_LAZY ; | |
6290 | #endif | |
6291 | handle = dlopen("./dyna.$dlext", mode) ; | |
6292 | if (handle == NULL) { | |
5f05dabc | 6293 | printf ("1\n") ; |
6294 | fflush (stdout) ; | |
6295 | exit(0); | |
a0d0e21e LW |
6296 | } |
6297 | symbol = dlsym(handle, "fred") ; | |
6298 | if (symbol == NULL) { | |
5f05dabc | 6299 | /* try putting a leading underscore */ |
6300 | symbol = dlsym(handle, "_fred") ; | |
6301 | if (symbol == NULL) { | |
6302 | printf ("2\n") ; | |
6303 | fflush (stdout) ; | |
6304 | exit(0); | |
6305 | } | |
6306 | printf ("3\n") ; | |
a0d0e21e LW |
6307 | } |
6308 | else | |
5f05dabc | 6309 | printf ("4\n") ; |
36477c24 | 6310 | fflush (stdout) ; |
6311 | exit(0); | |
a0d0e21e LW |
6312 | } |
6313 | EOM | |
760ac839 | 6314 | : Call the object file tmp-dyna.o in case dlext=o. |
a0d0e21e | 6315 | if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && |
8ff267be | 6316 | mv dyna${obj_ext} tmp-dyna${obj_ext} > /dev/null 2>&1 && |
6317 | $ld $lddlflags -o dyna.$dlext tmp-dyna${obj_ext} > /dev/null 2>&1 && | |
a0d0e21e LW |
6318 | $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then |
6319 | xxx=`./fred` | |
6320 | case $xxx in | |
6321 | 1) echo "Test program failed using dlopen." >&4 | |
6322 | echo "Perhaps you should not use dynamic loading." >&4;; | |
6323 | 2) echo "Test program failed using dlsym." >&4 | |
6324 | echo "Perhaps you should not use dynamic loading." >&4;; | |
6325 | 3) echo "dlsym needs a leading underscore" >&4 | |
6326 | val="$define" ;; | |
6327 | 4) echo "dlsym doesn't need a leading underscore." >&4;; | |
6328 | esac | |
6329 | else | |
6330 | echo "I can't compile and run the test program." >&4 | |
6331 | fi | |
6332 | ;; | |
6333 | esac | |
6334 | ||
a78b0d02 | 6335 | $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.? |
a0d0e21e LW |
6336 | |
6337 | set d_dlsymun | |
6338 | eval $setvar | |
6339 | ||
a0d0e21e LW |
6340 | : see if dup2 exists |
6341 | set dup2 d_dup2 | |
6342 | eval $inlibc | |
6343 | ||
8e07c86e AD |
6344 | : Locate the flags for 'open()' |
6345 | echo " " | |
6346 | $cat >open3.c <<'EOCP' | |
6347 | #include <sys/types.h> | |
6348 | #ifdef I_FCNTL | |
6349 | #include <fcntl.h> | |
6350 | #endif | |
6351 | #ifdef I_SYS_FILE | |
6352 | #include <sys/file.h> | |
6353 | #endif | |
6354 | main() { | |
6355 | if(O_RDONLY); | |
6356 | #ifdef O_TRUNC | |
6357 | exit(0); | |
6358 | #else | |
6359 | exit(1); | |
6360 | #endif | |
6361 | } | |
6362 | EOCP | |
6363 | : check sys/file.h first to get FREAD on Sun | |
6364 | if $test `./findhdr sys/file.h` && \ | |
6365 | $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then | |
6366 | h_sysfile=true; | |
6367 | echo "<sys/file.h> defines the O_* constants..." >&4 | |
6368 | if ./open3; then | |
6369 | echo "and you have the 3 argument form of open()." >&4 | |
6370 | val="$define" | |
6371 | else | |
6372 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
6373 | val="$undef" | |
6374 | fi | |
6375 | elif $test `./findhdr fcntl.h` && \ | |
6376 | $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then | |
6377 | h_fcntl=true; | |
6378 | echo "<fcntl.h> defines the O_* constants..." >&4 | |
6379 | if ./open3; then | |
6380 | echo "and you have the 3 argument form of open()." >&4 | |
6381 | val="$define" | |
6382 | else | |
6383 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
6384 | val="$undef" | |
6385 | fi | |
6386 | else | |
6387 | val="$undef" | |
6388 | echo "I can't find the O_* constant definitions! You got problems." >&4 | |
6389 | fi | |
6390 | set d_open3 | |
6391 | eval $setvar | |
6392 | $rm -f open3* | |
6393 | ||
6394 | : check for non-blocking I/O stuff | |
6395 | case "$h_sysfile" in | |
6396 | true) echo "#include <sys/file.h>" > head.c;; | |
6397 | *) | |
6398 | case "$h_fcntl" in | |
6399 | true) echo "#include <fcntl.h>" > head.c;; | |
6400 | *) echo "#include <sys/fcntl.h>" > head.c;; | |
6401 | esac | |
6402 | ;; | |
6403 | esac | |
6404 | echo " " | |
6405 | echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 | |
6406 | case "$o_nonblock" in | |
6407 | '') | |
6408 | $cat head.c > try.c | |
6409 | $cat >>try.c <<'EOCP' | |
6410 | main() { | |
6411 | #ifdef O_NONBLOCK | |
6412 | printf("O_NONBLOCK\n"); | |
6413 | exit(0); | |
6414 | #endif | |
6415 | #ifdef O_NDELAY | |
6416 | printf("O_NDELAY\n"); | |
6417 | exit(0); | |
6418 | #endif | |
6419 | #ifdef FNDELAY | |
6420 | printf("FNDELAY\n"); | |
6421 | exit(0); | |
6422 | #endif | |
6423 | exit(0); | |
6424 | } | |
6425 | EOCP | |
6426 | if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then | |
6427 | o_nonblock=`./try` | |
6428 | case "$o_nonblock" in | |
6429 | '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; | |
6430 | *) echo "Seems like we can use $o_nonblock.";; | |
6431 | esac | |
6432 | else | |
6433 | echo "(I can't compile the test program; pray O_NONBLOCK is right!)" | |
6434 | fi | |
6435 | ;; | |
6436 | *) echo "Using $hint value $o_nonblock.";; | |
6437 | esac | |
6438 | $rm -f try try.* .out core | |
6439 | ||
6440 | echo " " | |
6441 | echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 | |
6442 | case "$eagain" in | |
6443 | '') | |
6444 | $cat head.c > try.c | |
6445 | $cat >>try.c <<EOCP | |
6446 | #include <errno.h> | |
6447 | #include <sys/types.h> | |
6448 | #include <signal.h> | |
4633a7c4 | 6449 | #define MY_O_NONBLOCK $o_nonblock |
8e07c86e AD |
6450 | extern int errno; |
6451 | $signal_t blech(x) int x; { exit(3); } | |
4633a7c4 LW |
6452 | EOCP |
6453 | $cat >> try.c <<'EOCP' | |
8e07c86e AD |
6454 | main() |
6455 | { | |
6456 | int pd[2]; | |
6457 | int pu[2]; | |
6458 | char buf[1]; | |
6459 | char string[100]; | |
6460 | ||
6461 | pipe(pd); /* Down: child -> parent */ | |
6462 | pipe(pu); /* Up: parent -> child */ | |
6463 | if (0 != fork()) { | |
6464 | int ret; | |
6465 | close(pd[1]); /* Parent reads from pd[0] */ | |
6466 | close(pu[0]); /* Parent writes (blocking) to pu[1] */ | |
4633a7c4 | 6467 | if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) |
8e07c86e AD |
6468 | exit(1); |
6469 | signal(SIGALRM, blech); | |
6470 | alarm(5); | |
6471 | if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ | |
6472 | exit(2); | |
6473 | sprintf(string, "%d\n", ret); | |
6474 | write(2, string, strlen(string)); | |
6475 | alarm(0); | |
6476 | #ifdef EAGAIN | |
6477 | if (errno == EAGAIN) { | |
6478 | printf("EAGAIN\n"); | |
6479 | goto ok; | |
6480 | } | |
6481 | #endif | |
6482 | #ifdef EWOULDBLOCK | |
6483 | if (errno == EWOULDBLOCK) | |
6484 | printf("EWOULDBLOCK\n"); | |
6485 | #endif | |
6486 | ok: | |
6487 | write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ | |
6488 | sleep(2); /* Give it time to close our pipe */ | |
6489 | alarm(5); | |
6490 | ret = read(pd[0], buf, 1); /* Should read EOF */ | |
6491 | alarm(0); | |
6492 | sprintf(string, "%d\n", ret); | |
6493 | write(3, string, strlen(string)); | |
6494 | exit(0); | |
6495 | } | |
6496 | ||
6497 | close(pd[0]); /* We write to pd[1] */ | |
6498 | close(pu[1]); /* We read from pu[0] */ | |
6499 | read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ | |
6500 | close(pd[1]); /* Pipe pd is now fully closed! */ | |
6501 | exit(0); /* Bye bye, thank you for playing! */ | |
6502 | } | |
6503 | EOCP | |
25f94b33 | 6504 | if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then |
774d564b | 6505 | echo "$startsh" >mtry |
40a7a20a | 6506 | echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry |
8e07c86e AD |
6507 | chmod +x mtry |
6508 | ./mtry >/dev/null 2>&1 | |
6509 | case $? in | |
6510 | 0) eagain=`$cat try.out`;; | |
6511 | 1) echo "Could not perform non-blocking setting!";; | |
6512 | 2) echo "I did a successful read() for something that was not there!";; | |
6513 | 3) echo "Hmm... non-blocking I/O does not seem to be working!";; | |
6514 | *) echo "Something terribly wrong happened during testing.";; | |
6515 | esac | |
6516 | rd_nodata=`$cat try.ret` | |
6517 | echo "A read() system call with no data present returns $rd_nodata." | |
6518 | case "$rd_nodata" in | |
6519 | 0|-1) ;; | |
6520 | *) | |
6521 | echo "(That's peculiar, fixing that to be -1.)" | |
6522 | rd_nodata=-1 | |
6523 | ;; | |
6524 | esac | |
6525 | case "$eagain" in | |
6526 | '') | |
6527 | echo "Forcing errno EAGAIN on read() with no data available." | |
6528 | eagain=EAGAIN | |
6529 | ;; | |
6530 | *) | |
6531 | echo "Your read() sets errno to $eagain when no data is available." | |
6532 | ;; | |
6533 | esac | |
6534 | status=`$cat try.err` | |
6535 | case "$status" in | |
6536 | 0) echo "And it correctly returns 0 to signal EOF.";; | |
6537 | -1) echo "But it also returns -1 to signal EOF, so be careful!";; | |
6538 | *) echo "However, your read() returns '$status' on EOF??";; | |
6539 | esac | |
6540 | val="$define" | |
28757baa | 6541 | if test "$status" = "$rd_nodata"; then |
8e07c86e AD |
6542 | echo "WARNING: you can't distinguish between EOF and no data!" |
6543 | val="$undef" | |
6544 | fi | |
6545 | else | |
6546 | echo "I can't compile the test program--assuming errno EAGAIN will do." | |
6547 | eagain=EAGAIN | |
6548 | fi | |
6549 | set d_eofnblk | |
6550 | eval $setvar | |
6551 | ;; | |
6552 | *) | |
6553 | echo "Using $hint value $eagain." | |
6554 | echo "Your read() returns $rd_nodata when no data is present." | |
6555 | case "$d_eofnblk" in | |
6556 | "$define") echo "And you can see EOF because read() returns 0.";; | |
6557 | "$undef") echo "But you can't see EOF status from read() returned value.";; | |
6558 | *) | |
6559 | echo "(Assuming you can't see EOF status from read anyway.)" | |
6560 | d_eofnblk=$undef | |
6561 | ;; | |
6562 | esac | |
6563 | ;; | |
6564 | esac | |
6565 | $rm -f try try.* .out core head.c mtry | |
6566 | ||
a0d0e21e LW |
6567 | : see if fchmod exists |
6568 | set fchmod d_fchmod | |
6569 | eval $inlibc | |
6570 | ||
6571 | : see if fchown exists | |
6572 | set fchown d_fchown | |
6573 | eval $inlibc | |
6574 | ||
6575 | : see if this is an fcntl system | |
6576 | set fcntl d_fcntl | |
6577 | eval $inlibc | |
6578 | ||
6579 | : see if fgetpos exists | |
6580 | set fgetpos d_fgetpos | |
6581 | eval $inlibc | |
6582 | ||
a0d0e21e LW |
6583 | : see if flock exists |
6584 | set flock d_flock | |
6585 | eval $inlibc | |
6586 | ||
a0d0e21e LW |
6587 | : see if fork exists |
6588 | set fork d_fork | |
6589 | eval $inlibc | |
6590 | ||
6591 | : see if pathconf exists | |
6592 | set pathconf d_pathconf | |
6593 | eval $inlibc | |
6594 | ||
6595 | : see if fpathconf exists | |
6596 | set fpathconf d_fpathconf | |
6597 | eval $inlibc | |
6598 | ||
6599 | : see if fsetpos exists | |
6600 | set fsetpos d_fsetpos | |
6601 | eval $inlibc | |
6602 | ||
6603 | : see if gethostent exists | |
6604 | set gethostent d_gethent | |
6605 | eval $inlibc | |
6606 | ||
6607 | : see if getlogin exists | |
6608 | set getlogin d_getlogin | |
6609 | eval $inlibc | |
6610 | ||
2afac517 | 6611 | : see if getpgid exists |
6612 | set getpgid d_getpgid | |
a0d0e21e LW |
6613 | eval $inlibc |
6614 | ||
6615 | : see if getpgrp2 exists | |
6616 | set getpgrp2 d_getpgrp2 | |
6617 | eval $inlibc | |
6618 | ||
6619 | : see if getppid exists | |
6620 | set getppid d_getppid | |
6621 | eval $inlibc | |
6622 | ||
6623 | : see if getpriority exists | |
6624 | set getpriority d_getprior | |
6625 | eval $inlibc | |
6626 | ||
5f05dabc | 6627 | : see if gettimeofday or ftime exists |
6628 | set gettimeofday d_gettimeod | |
6629 | eval $inlibc | |
6630 | case "$d_gettimeod" in | |
6631 | "$undef") | |
6632 | set ftime d_ftime | |
6633 | eval $inlibc | |
6634 | ;; | |
6635 | *) | |
6636 | val="$undef"; set d_ftime; eval $setvar | |
6637 | ;; | |
6638 | esac | |
6639 | case "$d_gettimeod$d_ftime" in | |
6640 | "$undef$undef") | |
6641 | echo " " | |
6642 | echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 | |
6643 | ;; | |
6644 | esac | |
6645 | ||
a0d0e21e LW |
6646 | : see if this is a netinet/in.h or sys/in.h system |
6647 | set netinet/in.h i_niin sys/in.h i_sysin | |
6648 | eval $inhdr | |
6649 | ||
6650 | : see if htonl --and friends-- exists | |
6651 | val='' | |
6652 | set htonl val | |
6653 | eval $inlibc | |
6654 | ||
6655 | : Maybe they are macros. | |
6656 | case "$val" in | |
6657 | $undef) | |
6658 | $cat >htonl.c <<EOM | |
6659 | #include <stdio.h> | |
6660 | #include <sys/types.h> | |
6661 | #$i_niin I_NETINET_IN | |
6662 | #$i_sysin I_SYS_IN | |
6663 | #ifdef I_NETINET_IN | |
6664 | #include <netinet/in.h> | |
6665 | #endif | |
6666 | #ifdef I_SYS_IN | |
6667 | #include <sys/in.h> | |
6668 | #endif | |
6669 | #ifdef htonl | |
6670 | printf("Defined as a macro."); | |
6671 | #endif | |
6672 | EOM | |
6673 | $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null | |
6674 | if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then | |
6675 | val="$define" | |
6676 | echo "But it seems to be defined as a macro." >&4 | |
6677 | fi | |
6678 | $rm -f htonl.? | |
6679 | ;; | |
6680 | esac | |
6681 | set d_htonl | |
6682 | eval $setvar | |
6683 | ||
6684 | : see which of string.h or strings.h is needed | |
6685 | echo " " | |
6686 | strings=`./findhdr string.h` | |
6687 | if $test "$strings" && $test -r "$strings"; then | |
6688 | echo "Using <string.h> instead of <strings.h>." >&4 | |
6689 | val="$define" | |
6690 | else | |
6691 | val="$undef" | |
6692 | strings=`./findhdr strings.h` | |
6693 | if $test "$strings" && $test -r "$strings"; then | |
6694 | echo "Using <strings.h> instead of <string.h>." >&4 | |
6695 | else | |
6696 | echo "No string header found -- You'll surely have problems." >&4 | |
6697 | fi | |
6698 | fi | |
6699 | set i_string | |
6700 | eval $setvar | |
6701 | case "$i_string" in | |
6702 | "$undef") strings=`./findhdr strings.h`;; | |
6703 | *) strings=`./findhdr string.h`;; | |
6704 | esac | |
6705 | ||
6706 | : index or strchr | |
6707 | echo " " | |
6708 | if set index val -f; eval $csym; $val; then | |
6709 | if set strchr val -f d_strchr; eval $csym; $val; then | |
6710 | if $contains strchr "$strings" >/dev/null 2>&1 ; then | |
6711 | val="$define" | |
6712 | vali="$undef" | |
6713 | echo "strchr() found." >&4 | |
6714 | else | |
6715 | val="$undef" | |
6716 | vali="$define" | |
6717 | echo "index() found." >&4 | |
6718 | fi | |
6719 | else | |
6720 | val="$undef" | |
6721 | vali="$define" | |
6722 | echo "index() found." >&4 | |
6723 | fi | |
6724 | else | |
6725 | if set strchr val -f d_strchr; eval $csym; $val; then | |
6726 | val="$define" | |
6727 | vali="$undef" | |
6728 | echo "strchr() found." >&4 | |
6729 | else | |
6730 | echo "No index() or strchr() found!" >&4 | |
6731 | val="$undef" | |
6732 | vali="$undef" | |
6733 | fi | |
6734 | fi | |
6735 | set d_strchr; eval $setvar | |
6736 | val="$vali" | |
6737 | set d_index; eval $setvar | |
6738 | ||
7e1af8bc | 6739 | : check whether inet_aton exists |
6740 | set inet_aton d_inetaton | |
6741 | eval $inlibc | |
6742 | ||
a0d0e21e LW |
6743 | : Look for isascii |
6744 | echo " " | |
6745 | $cat >isascii.c <<'EOCP' | |
6746 | #include <stdio.h> | |
6747 | #include <ctype.h> | |
6748 | main() { | |
6749 | int c = 'A'; | |
6750 | if (isascii(c)) | |
6751 | exit(0); | |
6752 | else | |
6753 | exit(1); | |
6754 | } | |
6755 | EOCP | |
6756 | if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then | |
6757 | echo "isascii() found." >&4 | |
6758 | val="$define" | |
6759 | else | |
6760 | echo "isascii() NOT found." >&4 | |
6761 | val="$undef" | |
6762 | fi | |
6763 | set d_isascii | |
6764 | eval $setvar | |
6765 | $rm -f isascii* | |
6766 | ||
6767 | : see if killpg exists | |
6768 | set killpg d_killpg | |
6769 | eval $inlibc | |
6770 | ||
6771 | : see if link exists | |
6772 | set link d_link | |
6773 | eval $inlibc | |
6774 | ||
a0d0e21e LW |
6775 | : see if localeconv exists |
6776 | set localeconv d_locconv | |
6777 | eval $inlibc | |
6778 | ||
6779 | : see if lockf exists | |
6780 | set lockf d_lockf | |
6781 | eval $inlibc | |
6782 | ||
6783 | : see if lstat exists | |
6784 | set lstat d_lstat | |
6785 | eval $inlibc | |
6786 | ||
6787 | : see if mblen exists | |
6788 | set mblen d_mblen | |
6789 | eval $inlibc | |
6790 | ||
6791 | : see if mbstowcs exists | |
6792 | set mbstowcs d_mbstowcs | |
6793 | eval $inlibc | |
6794 | ||
6795 | : see if mbtowc exists | |
6796 | set mbtowc d_mbtowc | |
6797 | eval $inlibc | |
6798 | ||
6799 | : see if memcmp exists | |
6800 | set memcmp d_memcmp | |
6801 | eval $inlibc | |
6802 | ||
6803 | : see if memcpy exists | |
6804 | set memcpy d_memcpy | |
6805 | eval $inlibc | |
6806 | ||
6807 | : see if memmove exists | |
6808 | set memmove d_memmove | |
2304df62 AD |
6809 | eval $inlibc |
6810 | ||
6811 | : see if memset exists | |
6812 | set memset d_memset | |
6813 | eval $inlibc | |
6814 | ||
6815 | : see if mkdir exists | |
6816 | set mkdir d_mkdir | |
6817 | eval $inlibc | |
6818 | ||
a0d0e21e LW |
6819 | : see if mkfifo exists |
6820 | set mkfifo d_mkfifo | |
6821 | eval $inlibc | |
6822 | ||
6823 | : see if mktime exists | |
6824 | set mktime d_mktime | |
6825 | eval $inlibc | |
6826 | ||
2304df62 AD |
6827 | : see if msgctl exists |
6828 | set msgctl d_msgctl | |
6829 | eval $inlibc | |
6830 | ||
6831 | : see if msgget exists | |
6832 | set msgget d_msgget | |
6833 | eval $inlibc | |
6834 | ||
6835 | : see if msgsnd exists | |
6836 | set msgsnd d_msgsnd | |
6837 | eval $inlibc | |
6838 | ||
6839 | : see if msgrcv exists | |
6840 | set msgrcv d_msgrcv | |
6841 | eval $inlibc | |
6842 | ||
6843 | : see how much of the 'msg*(2)' library is present. | |
6844 | h_msg=true | |
6845 | echo " " | |
6846 | case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in | |
6847 | *"$undef"*) h_msg=false;; | |
6848 | esac | |
6849 | : we could also check for sys/ipc.h ... | |
6850 | if $h_msg && $test `./findhdr sys/msg.h`; then | |
6851 | echo "You have the full msg*(2) library." >&4 | |
6852 | val="$define" | |
6853 | else | |
6854 | echo "You don't have the full msg*(2) library." >&4 | |
6855 | val="$undef" | |
6856 | fi | |
6857 | set d_msg | |
6858 | eval $setvar | |
6859 | ||
a0d0e21e LW |
6860 | : see if this is a malloc.h system |
6861 | set malloc.h i_malloc | |
6862 | eval $inhdr | |
6863 | ||
94b6baf5 AD |
6864 | : see if stdlib is available |
6865 | set stdlib.h i_stdlib | |
6866 | eval $inhdr | |
6867 | ||
85e6fe83 | 6868 | : determine which malloc to compile in |
85e6fe83 LW |
6869 | echo " " |
6870 | case "$usemymalloc" in | |
a0d0e21e LW |
6871 | ''|y*|true) dflt='y' ;; |
6872 | n*|false) dflt='n' ;; | |
6873 | *) dflt="$usemymalloc" ;; | |
85e6fe83 LW |
6874 | esac |
6875 | rp="Do you wish to attempt to use the malloc that comes with $package?" | |
6876 | . ./myread | |
6877 | usemymalloc="$ans" | |
6878 | case "$ans" in | |
a0d0e21e LW |
6879 | y*|true) |
6880 | usemymalloc='y' | |
6881 | mallocsrc='malloc.c' | |
6882 | mallocobj='malloc.o' | |
6883 | d_mymalloc="$define" | |
6884 | case "$libs" in | |
6885 | *-lmalloc*) | |
6886 | : Remove malloc from list of libraries to use | |
6887 | echo "Removing unneeded -lmalloc from library list" >&4 | |
6888 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` | |
6889 | shift | |
6890 | libs="$*" | |
6891 | echo "libs = $libs" >&4 | |
6892 | ;; | |
6893 | esac | |
6894 | ;; | |
6895 | *) | |
6896 | usemymalloc='n' | |
6897 | mallocsrc='' | |
6898 | mallocobj='' | |
6899 | d_mymalloc="$undef" | |
6900 | ;; | |
85e6fe83 LW |
6901 | esac |
6902 | ||
94b6baf5 | 6903 | : compute the return types of malloc and free |
85e6fe83 | 6904 | echo " " |
94b6baf5 | 6905 | $cat >malloc.c <<END |
a0d0e21e | 6906 | #$i_malloc I_MALLOC |
94b6baf5 | 6907 | #$i_stdlib I_STDLIB |
a0d0e21e LW |
6908 | #include <stdio.h> |
6909 | #include <sys/types.h> | |
6910 | #ifdef I_MALLOC | |
85e6fe83 | 6911 | #include <malloc.h> |
a0d0e21e | 6912 | #endif |
94b6baf5 AD |
6913 | #ifdef I_STDLIB |
6914 | #include <stdlib.h> | |
6915 | #endif | |
6916 | #ifdef TRY_MALLOC | |
85e6fe83 | 6917 | void *malloc(); |
94b6baf5 AD |
6918 | #endif |
6919 | #ifdef TRY_FREE | |
6920 | void free(); | |
6921 | #endif | |
85e6fe83 | 6922 | END |
94b6baf5 AD |
6923 | case "$malloctype" in |
6924 | '') | |
6925 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then | |
85e6fe83 LW |
6926 | malloctype='void *' |
6927 | else | |
6928 | malloctype='char *' | |
6929 | fi | |
85e6fe83 LW |
6930 | ;; |
6931 | esac | |
6932 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 | |
6933 | ||
94b6baf5 AD |
6934 | case "$freetype" in |
6935 | '') | |
6936 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then | |
6937 | freetype='void' | |
6938 | else | |
6939 | freetype='int' | |
6940 | fi | |
6941 | ;; | |
8e07c86e AD |
6942 | esac |
6943 | echo "Your system uses $freetype free(), it would seem." >&4 | |
6944 | $rm -f malloc.[co] | |
6945 | : see if nice exists | |
6946 | set nice d_nice | |
6947 | eval $inlibc | |
2304df62 | 6948 | |
a0d0e21e LW |
6949 | : see if pause exists |
6950 | set pause d_pause | |
6951 | eval $inlibc | |
6952 | ||
6953 | : see if pipe exists | |
6954 | set pipe d_pipe | |
6955 | eval $inlibc | |
6956 | ||
8e07c86e AD |
6957 | : see if poll exists |
6958 | set poll d_poll | |
6959 | eval $inlibc | |
6960 | ||
4aa0a1f7 AD |
6961 | : see if this is a pwd.h system |
6962 | set pwd.h i_pwd | |
6963 | eval $inhdr | |
6964 | ||
6965 | case "$i_pwd" in | |
6966 | $define) | |
6967 | xxx=`./findhdr pwd.h` | |
85e6fe83 | 6968 | $cppstdin $cppflags $cppminus < $xxx >$$.h |
4aa0a1f7 | 6969 | |
2304df62 | 6970 | if $contains 'pw_quota' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 6971 | val="$define" |
2304df62 | 6972 | else |
4aa0a1f7 | 6973 | val="$undef" |
2304df62 | 6974 | fi |
4aa0a1f7 AD |
6975 | set d_pwquota |
6976 | eval $setvar | |
6977 | ||
2304df62 | 6978 | if $contains 'pw_age' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 6979 | val="$define" |
2304df62 | 6980 | else |
4aa0a1f7 | 6981 | val="$undef" |
2304df62 | 6982 | fi |
4aa0a1f7 AD |
6983 | set d_pwage |
6984 | eval $setvar | |
6985 | ||
2304df62 | 6986 | if $contains 'pw_change' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 6987 | val="$define" |
2304df62 | 6988 | else |
4aa0a1f7 | 6989 | val="$undef" |
2304df62 | 6990 | fi |
4aa0a1f7 AD |
6991 | set d_pwchange |
6992 | eval $setvar | |
6993 | ||
2304df62 | 6994 | if $contains 'pw_class' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 6995 | val="$define" |
2304df62 | 6996 | else |
4aa0a1f7 | 6997 | val="$undef" |
2304df62 | 6998 | fi |
4aa0a1f7 AD |
6999 | set d_pwclass |
7000 | eval $setvar | |
7001 | ||
2304df62 | 7002 | if $contains 'pw_expire' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7003 | val="$define" |
2304df62 | 7004 | else |
4aa0a1f7 | 7005 | val="$undef" |
2304df62 | 7006 | fi |
4aa0a1f7 AD |
7007 | set d_pwexpire |
7008 | eval $setvar | |
7009 | ||
2304df62 | 7010 | if $contains 'pw_comment' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7011 | val="$define" |
2304df62 | 7012 | else |
4aa0a1f7 | 7013 | val="$undef" |
2304df62 | 7014 | fi |
4aa0a1f7 AD |
7015 | set d_pwcomment |
7016 | eval $setvar | |
7017 | ||
2304df62 | 7018 | $rm -f $$.h |
4aa0a1f7 AD |
7019 | ;; |
7020 | *) | |
7021 | val="$undef"; | |
7022 | set d_pwquota; eval $setvar | |
7023 | set d_pwage; eval $setvar | |
7024 | set d_pwchange; eval $setvar | |
7025 | set d_pwclass; eval $setvar | |
7026 | set d_pwexpire; eval $setvar | |
7027 | set d_pwcomment; eval $setvar | |
7028 | ;; | |
7029 | esac | |
2304df62 | 7030 | |
85e6fe83 | 7031 | : see if readdir and friends exist |
2304df62 AD |
7032 | set readdir d_readdir |
7033 | eval $inlibc | |
85e6fe83 LW |
7034 | set seekdir d_seekdir |
7035 | eval $inlibc | |
7036 | set telldir d_telldir | |
7037 | eval $inlibc | |
7038 | set rewinddir d_rewinddir | |
7039 | eval $inlibc | |
2304df62 | 7040 | |
a0d0e21e LW |
7041 | : see if readlink exists |
7042 | set readlink d_readlink | |
7043 | eval $inlibc | |
7044 | ||
2304df62 AD |
7045 | : see if rename exists |
7046 | set rename d_rename | |
7047 | eval $inlibc | |
7048 | ||
7049 | : see if rmdir exists | |
7050 | set rmdir d_rmdir | |
7051 | eval $inlibc | |
7052 | ||
8ff267be | 7053 | : see if memory.h is available. |
7054 | val='' | |
7055 | set memory.h val | |
7056 | eval $inhdr | |
7057 | ||
7058 | : See if it conflicts with string.h | |
7059 | case "$val" in | |
7060 | $define) | |
7061 | case "$strings" in | |
7062 | '') ;; | |
7063 | *) | |
7064 | $cppstdin $cppflags $cppminus < $strings > mem.h | |
7065 | if $contains 'memcpy' mem.h >/dev/null 2>&1; then | |
7066 | echo " " | |
7067 | echo "We won't be including <memory.h>." | |
7068 | val="$undef" | |
7069 | fi | |
7070 | $rm -f mem.h | |
7071 | ;; | |
7072 | esac | |
7073 | esac | |
7074 | set i_memory | |
7075 | eval $setvar | |
7076 | ||
2304df62 AD |
7077 | : can bcopy handle overlapping blocks? |
7078 | val="$undef" | |
7079 | case "$d_bcopy" in | |
7080 | "$define") | |
7081 | echo " " | |
7082 | echo "Checking to see if your bcopy() can do overlapping copies..." >&4 | |
8ff267be | 7083 | $cat >foo.c <<EOCP |
7084 | #$i_memory I_MEMORY | |
7085 | #$i_stdlib I_STDLIB | |
7086 | #$i_string I_STRING | |
7087 | #$i_unistd I_UNISTD | |
7088 | EOCP | |
7089 | $cat >>foo.c <<'EOCP' | |
7090 | #include <stdio.h> | |
7091 | ||
7092 | #ifdef I_MEMORY | |
7093 | # include <memory.h> | |
7094 | #endif | |
7095 | #ifdef I_STDLIB | |
7096 | # include <stdlib.h> | |
7097 | #endif | |
7098 | #ifdef I_STRING | |
7099 | # include <string.h> | |
7100 | #else | |
7101 | # include <strings.h> | |
7102 | #endif | |
7103 | #ifdef I_UNISTD | |
7104 | # include <unistd.h> /* Needed for NetBSD */ | |
7105 | #endif | |
2304df62 AD |
7106 | main() |
7107 | { | |
85e6fe83 LW |
7108 | char buf[128], abc[128]; |
7109 | char *b; | |
7110 | int len; | |
7111 | int off; | |
7112 | int align; | |
a0d0e21e | 7113 | |
8ff267be | 7114 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
7115 | try to store the string in read-only memory. */ | |
85e6fe83 | 7116 | bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36); |
2304df62 AD |
7117 | |
7118 | for (align = 7; align >= 0; align--) { | |
7119 | for (len = 36; len; len--) { | |
7120 | b = buf+align; | |
85e6fe83 | 7121 | bcopy(abc, b, len); |
2304df62 AD |
7122 | for (off = 1; off <= len; off++) { |
7123 | bcopy(b, b+off, len); | |
7124 | bcopy(b+off, b, len); | |
85e6fe83 | 7125 | if (bcmp(b, abc, len)) |
2304df62 AD |
7126 | exit(1); |
7127 | } | |
7128 | } | |
7129 | } | |
7130 | exit(0); | |
7131 | } | |
7132 | EOCP | |
774d564b | 7133 | if $cc $optimize $ccflags $ldflags foo.c \ |
7134 | -o safebcpy $libs >/dev/null 2>&1; then | |
2304df62 AD |
7135 | if ./safebcpy 2>/dev/null; then |
7136 | echo "Yes, it can." | |
7137 | val="$define" | |
7138 | else | |
7139 | echo "It can't, sorry." | |
8ff267be | 7140 | case "$d_memmove" in |
7141 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7142 | esac | |
2304df62 AD |
7143 | fi |
7144 | else | |
7145 | echo "(I can't compile the test program, so we'll assume not...)" | |
8ff267be | 7146 | case "$d_memmove" in |
7147 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7148 | esac | |
2304df62 AD |
7149 | fi |
7150 | ;; | |
7151 | esac | |
7152 | $rm -f foo.* safebcpy core | |
7153 | set d_safebcpy | |
7154 | eval $setvar | |
7155 | ||
7156 | : can memcpy handle overlapping blocks? | |
7157 | val="$undef" | |
7158 | case "$d_memcpy" in | |
7159 | "$define") | |
7160 | echo " " | |
7161 | echo "Checking to see if your memcpy() can do overlapping copies..." >&4 | |
8ff267be | 7162 | $cat >foo.c <<EOCP |
7163 | #$i_memory I_MEMORY | |
7164 | #$i_stdlib I_STDLIB | |
7165 | #$i_string I_STRING | |
7166 | #$i_unistd I_UNISTD | |
7167 | EOCP | |
7168 | $cat >>foo.c <<'EOCP' | |
7169 | #include <stdio.h> | |
7170 | ||
7171 | #ifdef I_MEMORY | |
7172 | # include <memory.h> | |
7173 | #endif | |
7174 | #ifdef I_STDLIB | |
7175 | # include <stdlib.h> | |
7176 | #endif | |
7177 | #ifdef I_STRING | |
7178 | # include <string.h> | |
7179 | #else | |
7180 | # include <strings.h> | |
7181 | #endif | |
7182 | #ifdef I_UNISTD | |
7183 | # include <unistd.h> /* Needed for NetBSD */ | |
7184 | #endif | |
2304df62 AD |
7185 | main() |
7186 | { | |
85e6fe83 LW |
7187 | char buf[128], abc[128]; |
7188 | char *b; | |
7189 | int len; | |
7190 | int off; | |
7191 | int align; | |
7192 | ||
8ff267be | 7193 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
7194 | try to store the string in read-only memory. */ | |
85e6fe83 | 7195 | memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36); |
2304df62 AD |
7196 | |
7197 | for (align = 7; align >= 0; align--) { | |
7198 | for (len = 36; len; len--) { | |
7199 | b = buf+align; | |
232e078e | 7200 | memcpy(b, abc, len); |
2304df62 | 7201 | for (off = 1; off <= len; off++) { |
2304df62 | 7202 | memcpy(b+off, b, len); |
232e078e | 7203 | memcpy(b, b+off, len); |
85e6fe83 | 7204 | if (memcmp(b, abc, len)) |
2304df62 AD |
7205 | exit(1); |
7206 | } | |
7207 | } | |
7208 | } | |
7209 | exit(0); | |
7210 | } | |
7211 | EOCP | |
774d564b | 7212 | if $cc $optimize $ccflags $ldflags foo.c \ |
7213 | -o safemcpy $libs >/dev/null 2>&1; then | |
2304df62 AD |
7214 | if ./safemcpy 2>/dev/null; then |
7215 | echo "Yes, it can." | |
7216 | val="$define" | |
7217 | else | |
7218 | echo "It can't, sorry." | |
8ff267be | 7219 | case "$d_memmove" in |
7220 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7221 | esac | |
2304df62 AD |
7222 | fi |
7223 | else | |
7224 | echo "(I can't compile the test program, so we'll assume not...)" | |
8ff267be | 7225 | case "$d_memmove" in |
7226 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7227 | esac | |
2304df62 AD |
7228 | fi |
7229 | ;; | |
7230 | esac | |
7231 | $rm -f foo.* safemcpy core | |
7232 | set d_safemcpy | |
7233 | eval $setvar | |
7234 | ||
36477c24 | 7235 | : can memcmp be trusted to compare relative magnitude? |
7236 | val="$undef" | |
7237 | case "$d_memcmp" in | |
7238 | "$define") | |
7239 | echo " " | |
5f05dabc | 7240 | echo "Checking to see if your memcmp() can compare relative magnitude..." >&4 |
36477c24 | 7241 | $cat >foo.c <<EOCP |
7242 | #$i_memory I_MEMORY | |
7243 | #$i_stdlib I_STDLIB | |
7244 | #$i_string I_STRING | |
7245 | #$i_unistd I_UNISTD | |
7246 | EOCP | |
7247 | $cat >>foo.c <<'EOCP' | |
7248 | #include <stdio.h> | |
7249 | ||
7250 | #ifdef I_MEMORY | |
7251 | # include <memory.h> | |
7252 | #endif | |
7253 | #ifdef I_STDLIB | |
7254 | # include <stdlib.h> | |
7255 | #endif | |
7256 | #ifdef I_STRING | |
7257 | # include <string.h> | |
7258 | #else | |
7259 | # include <strings.h> | |
7260 | #endif | |
7261 | #ifdef I_UNISTD | |
7262 | # include <unistd.h> /* Needed for NetBSD */ | |
7263 | #endif | |
7264 | main() | |
7265 | { | |
7266 | char a = -1; | |
7267 | char b = 0; | |
7268 | if ((a < b) && memcmp(&a, &b, 1) < 0) | |
7269 | exit(1); | |
7270 | exit(0); | |
7271 | } | |
7272 | EOCP | |
774d564b | 7273 | if $cc $optimize $ccflags $ldflags foo.c \ |
7274 | -o sanemcmp $libs >/dev/null 2>&1; then | |
36477c24 | 7275 | if ./sanemcmp 2>/dev/null; then |
7276 | echo "Yes, it can." | |
7277 | val="$define" | |
7278 | else | |
7279 | echo "No, it can't (it uses signed chars)." | |
7280 | fi | |
7281 | else | |
7282 | echo "(I can't compile the test program, so we'll assume not...)" | |
7283 | fi | |
7284 | ;; | |
7285 | esac | |
7286 | $rm -f foo.* sanemcmp core | |
7287 | set d_sanemcmp | |
7288 | eval $setvar | |
7289 | ||
2304df62 AD |
7290 | : see if select exists |
7291 | set select d_select | |
7292 | eval $inlibc | |
7293 | ||
7294 | : see if semctl exists | |
7295 | set semctl d_semctl | |
7296 | eval $inlibc | |
7297 | ||
7298 | : see if semget exists | |
7299 | set semget d_semget | |
7300 | eval $inlibc | |
7301 | ||
7302 | : see if semop exists | |
7303 | set semop d_semop | |
7304 | eval $inlibc | |
7305 | ||
7306 | : see how much of the 'sem*(2)' library is present. | |
7307 | h_sem=true | |
7308 | echo " " | |
7309 | case "$d_semctl$d_semget$d_semop" in | |
7310 | *"$undef"*) h_sem=false;; | |
7311 | esac | |
7312 | : we could also check for sys/ipc.h ... | |
7313 | if $h_sem && $test `./findhdr sys/sem.h`; then | |
7314 | echo "You have the full sem*(2) library." >&4 | |
7315 | val="$define" | |
7316 | else | |
7317 | echo "You don't have the full sem*(2) library." >&4 | |
7318 | val="$undef" | |
7319 | fi | |
7320 | set d_sem | |
7321 | eval $setvar | |
7322 | ||
7323 | : see if setegid exists | |
7324 | set setegid d_setegid | |
7325 | eval $inlibc | |
7326 | ||
7327 | : see if seteuid exists | |
7328 | set seteuid d_seteuid | |
7329 | eval $inlibc | |
7330 | ||
a0d0e21e LW |
7331 | : see if setlinebuf exists |
7332 | set setlinebuf d_setlinebuf | |
7333 | eval $inlibc | |
7334 | ||
2304df62 AD |
7335 | : see if setlocale exists |
7336 | set setlocale d_setlocale | |
7337 | eval $inlibc | |
a0d0e21e | 7338 | |
2304df62 AD |
7339 | : see if setpgid exists |
7340 | set setpgid d_setpgid | |
7341 | eval $inlibc | |
7342 | ||
2304df62 AD |
7343 | : see if setpgrp2 exists |
7344 | set setpgrp2 d_setpgrp2 | |
7345 | eval $inlibc | |
7346 | ||
7347 | : see if setpriority exists | |
7348 | set setpriority d_setprior | |
7349 | eval $inlibc | |
7350 | ||
7351 | : see if setregid exists | |
7352 | set setregid d_setregid | |
7353 | eval $inlibc | |
7354 | set setresgid d_setresgid | |
7355 | eval $inlibc | |
7356 | ||
7357 | : see if setreuid exists | |
7358 | set setreuid d_setreuid | |
7359 | eval $inlibc | |
7360 | set setresuid d_setresuid | |
7361 | eval $inlibc | |
7362 | ||
7363 | : see if setrgid exists | |
7364 | set setrgid d_setrgid | |
7365 | eval $inlibc | |
7366 | ||
7367 | : see if setruid exists | |
7368 | set setruid d_setruid | |
7369 | eval $inlibc | |
7370 | ||
7371 | : see if setsid exists | |
7372 | set setsid d_setsid | |
7373 | eval $inlibc | |
7374 | ||
760ac839 LW |
7375 | : see if sfio.h is available |
7376 | set sfio.h i_sfio | |
7377 | eval $inhdr | |
7378 | ||
7379 | ||
8ff267be | 7380 | : see if sfio library is available |
760ac839 LW |
7381 | case "$i_sfio" in |
7382 | $define) | |
7383 | val='' | |
7384 | set sfreserve val | |
7385 | eval $inlibc | |
7386 | ;; | |
7387 | *) | |
7388 | val="$undef" | |
7389 | ;; | |
7390 | esac | |
8ff267be | 7391 | : Ok, but do we want to use it. |
760ac839 LW |
7392 | case "$val" in |
7393 | $define) | |
7394 | case "$usesfio" in | |
8ff267be | 7395 | true|$define|[yY]*) dflt='y';; |
760ac839 LW |
7396 | *) dflt='n';; |
7397 | esac | |
8ff267be | 7398 | echo "$package can use the sfio library, but it is experimental." |
760ac839 LW |
7399 | rp="You seem to have sfio available, do you want to try using it?" |
7400 | . ./myread | |
7401 | case "$ans" in | |
8ff267be | 7402 | y|Y) ;; |
7403 | *) echo "Ok, avoiding sfio this time. I'll use stdio instead." | |
760ac839 | 7404 | val="$undef" |
ff0cee69 | 7405 | : Remove sfio from list of libraries to use |
7406 | set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` | |
7407 | shift | |
7408 | libs="$*" | |
7409 | echo "libs = $libs" >&4 | |
760ac839 LW |
7410 | ;; |
7411 | esac | |
7412 | ;; | |
8ff267be | 7413 | *) case "$usesfio" in |
7414 | true|$define|[yY]*) | |
7415 | echo "Sorry, cannot find sfio on this machine" >&4 | |
7416 | echo "Ignoring your setting of usesfio=$usesfio" >&4 | |
760ac839 LW |
7417 | ;; |
7418 | esac | |
7419 | ;; | |
7420 | esac | |
8ff267be | 7421 | set d_sfio |
7422 | eval $setvar | |
760ac839 LW |
7423 | case "$d_sfio" in |
7424 | $define) usesfio='true';; | |
7425 | *) usesfio='false';; | |
7426 | esac | |
7427 | ||
2304df62 AD |
7428 | : see if shmctl exists |
7429 | set shmctl d_shmctl | |
7430 | eval $inlibc | |
7431 | ||
7432 | : see if shmget exists | |
7433 | set shmget d_shmget | |
7434 | eval $inlibc | |
7435 | ||
a0d0e21e LW |
7436 | : see if shmat exists |
7437 | set shmat d_shmat | |
7438 | eval $inlibc | |
7439 | : see what shmat returns | |
7440 | case "$d_shmat" in | |
7441 | "$define") | |
7442 | $cat >shmat.c <<'END' | |
7443 | #include <sys/shm.h> | |
7444 | void *shmat(); | |
7445 | END | |
7446 | if $cc $ccflags -c shmat.c >/dev/null 2>&1; then | |
7447 | shmattype='void *' | |
7448 | else | |
7449 | shmattype='char *' | |
7450 | fi | |
7451 | echo "and it returns ($shmattype)." >&4 | |
7452 | : see if a prototype for shmat is available | |
e50aee73 AD |
7453 | xxx=`./findhdr sys/shm.h` |
7454 | $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null | |
a0d0e21e LW |
7455 | if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then |
7456 | val="$define" | |
7457 | else | |
7458 | val="$undef" | |
7459 | fi | |
7460 | $rm -f shmat.[co] | |
7461 | ;; | |
7462 | *) | |
7463 | val="$undef" | |
7464 | ;; | |
7465 | esac | |
7466 | set d_shmatprototype | |
7467 | eval $setvar | |
7468 | ||
7469 | : see if shmdt exists | |
7470 | set shmdt d_shmdt | |
7471 | eval $inlibc | |
7472 | ||
7473 | : see how much of the 'shm*(2)' library is present. | |
7474 | h_shm=true | |
7475 | echo " " | |
7476 | case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in | |
7477 | *"$undef"*) h_shm=false;; | |
7478 | esac | |
7479 | : we could also check for sys/ipc.h ... | |
7480 | if $h_shm && $test `./findhdr sys/shm.h`; then | |
7481 | echo "You have the full shm*(2) library." >&4 | |
7482 | val="$define" | |
7483 | else | |
7484 | echo "You don't have the full shm*(2) library." >&4 | |
7485 | val="$undef" | |
7486 | fi | |
7487 | set d_shm | |
7488 | eval $setvar | |
7489 | ||
2c7991dc | 7490 | echo " " |
8ff267be | 7491 | : see if we have sigaction |
7492 | if set sigaction val -f d_sigaction; eval $csym; $val; then | |
7493 | echo 'sigaction() found.' >&4 | |
7494 | val="$define" | |
2c7991dc | 7495 | else |
8ff267be | 7496 | echo 'sigaction NOT found.' >&4 |
7497 | val="$undef" | |
2c7991dc | 7498 | fi |
7499 | ||
8ff267be | 7500 | $cat > set.c <<'EOP' |
7501 | /* Solaris 2.5_x86 with SunWorks Pro C 3.0.1 doesn't have a complete | |
7502 | sigaction structure if compiled with cc -Xc. This compile test | |
7503 | will fail then. <doughera@lafcol.lafayette.edu> | |
7504 | */ | |
7505 | #include <stdio.h> | |
7506 | #include <sys/types.h> | |
7507 | #include <signal.h> | |
7508 | main() | |
7509 | { | |
7510 | struct sigaction act, oact; | |
7511 | } | |
7512 | EOP | |
7513 | ||
7514 | if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then | |
7515 | : | |
7516 | else | |
7517 | echo "But you don't seem to have a useable struct sigaction." >&4 | |
7518 | val="$undef" | |
7519 | fi | |
7520 | set d_sigaction; eval $setvar | |
7521 | $rm -f set set.o set.c | |
2c7991dc | 7522 | |
a5f75d66 AD |
7523 | : see if sigsetjmp exists |
7524 | echo " " | |
7525 | case "$d_sigsetjmp" in | |
7526 | '') | |
760ac839 | 7527 | $cat >set.c <<'EOP' |
a5f75d66 AD |
7528 | #include <setjmp.h> |
7529 | sigjmp_buf env; | |
7530 | int set = 1; | |
7531 | main() | |
7532 | { | |
7533 | if (sigsetjmp(env,1)) | |
7534 | exit(set); | |
7535 | set = 0; | |
7536 | siglongjmp(env, 1); | |
7537 | exit(1); | |
7538 | } | |
7539 | EOP | |
760ac839 | 7540 | if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then |
a5f75d66 AD |
7541 | if ./set >/dev/null 2>&1; then |
7542 | echo "POSIX sigsetjmp found." >&4 | |
7543 | val="$define" | |
7544 | else | |
760ac839 | 7545 | $cat >&4 <<EOM |
a5f75d66 | 7546 | Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!! |
760ac839 | 7547 | I'll ignore them. |
a5f75d66 AD |
7548 | EOM |
7549 | val="$undef" | |
7550 | fi | |
7551 | else | |
760ac839 | 7552 | echo "sigsetjmp not found." >&4 |
a5f75d66 AD |
7553 | val="$undef" |
7554 | fi | |
7555 | ;; | |
7556 | *) val="$d_sigsetjmp" | |
7557 | case "$d_sigsetjmp" in | |
7558 | $define) echo "POSIX sigsetjmp found." >&4;; | |
760ac839 | 7559 | $undef) echo "sigsetjmp not found." >&4;; |
a5f75d66 AD |
7560 | esac |
7561 | ;; | |
7562 | esac | |
7563 | set d_sigsetjmp | |
7564 | eval $setvar | |
7565 | $rm -f set.c set | |
7566 | ||
a0d0e21e LW |
7567 | socketlib='' |
7568 | sockethdr='' | |
7569 | : see whether socket exists | |
7570 | echo " " | |
7571 | $echo $n "Hmm... $c" >&4 | |
7572 | if set socket val -f d_socket; eval $csym; $val; then | |
7573 | echo "Looks like you have Berkeley networking support." >&4 | |
7574 | d_socket="$define" | |
7575 | if set setsockopt val -f; eval $csym; $val; then | |
7576 | d_oldsock="$undef" | |
7577 | else | |
7578 | echo "...but it uses the old 4.1c interface, rather than 4.2" >&4 | |
7579 | d_oldsock="$define" | |
7580 | fi | |
7581 | else | |
7582 | if $contains socklib libc.list >/dev/null 2>&1; then | |
7583 | echo "Looks like you have Berkeley networking support." >&4 | |
7584 | d_socket="$define" | |
7585 | : we will have to assume that it supports the 4.2 BSD interface | |
7586 | d_oldsock="$undef" | |
7587 | else | |
5f05dabc | 7588 | echo "You don't have Berkeley networking in libc$lib_ext..." >&4 |
7589 | if test -f /usr/lib/libnet$lib_ext; then | |
7590 | ( (nm $nm_opt /usr/lib/libnet$lib_ext | eval $nm_extract) || \ | |
7591 | ar t /usr/lib/libnet$lib_ext) 2>/dev/null >> libc.list | |
a0d0e21e LW |
7592 | if $contains socket libc.list >/dev/null 2>&1; then |
7593 | echo "...but the Wollongong group seems to have hacked it in." >&4 | |
7594 | socketlib="-lnet" | |
7595 | sockethdr="-I/usr/netinclude" | |
7596 | d_socket="$define" | |
7597 | if $contains setsockopt libc.list >/dev/null 2>&1; then | |
7598 | d_oldsock="$undef" | |
7599 | else | |
7600 | echo "...using the old 4.1c interface, rather than 4.2" >&4 | |
7601 | d_oldsock="$define" | |
7602 | fi | |
7603 | else | |
5f05dabc | 7604 | echo "or even in libnet$lib_ext, which is peculiar." >&4 |
a0d0e21e LW |
7605 | d_socket="$undef" |
7606 | d_oldsock="$undef" | |
7607 | fi | |
7608 | else | |
7609 | echo "or anywhere else I see." >&4 | |
7610 | d_socket="$undef" | |
7611 | d_oldsock="$undef" | |
7612 | fi | |
7613 | fi | |
7614 | fi | |
7615 | ||
7616 | : see if socketpair exists | |
7617 | set socketpair d_sockpair | |
2304df62 AD |
7618 | eval $inlibc |
7619 | ||
2304df62 AD |
7620 | : see if stat knows about block sizes |
7621 | echo " " | |
7622 | xxx=`./findhdr sys/stat.h` | |
7623 | if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then | |
7624 | if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then | |
7625 | echo "Your stat() knows about block sizes." >&4 | |
7626 | val="$define" | |
7627 | else | |
7628 | echo "Your stat() doesn't know about block sizes." >&4 | |
7629 | val="$undef" | |
7630 | fi | |
7631 | else | |
7632 | echo "Your stat() doesn't know about block sizes." >&4 | |
7633 | val="$undef" | |
7634 | fi | |
7635 | set d_statblks | |
7636 | eval $setvar | |
7637 | ||
16d20bd9 AD |
7638 | : see if _ptr and _cnt from stdio act std |
7639 | echo " " | |
7640 | if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then | |
7641 | echo "(Looks like you have stdio.h from Linux.)" | |
7642 | case "$stdio_ptr" in | |
c2960299 AD |
7643 | '') stdio_ptr='((fp)->_IO_read_ptr)' |
7644 | ptr_lval=$define | |
7645 | ;; | |
8e07c86e | 7646 | *) ptr_lval=$d_stdio_ptr_lval;; |
16d20bd9 AD |
7647 | esac |
7648 | case "$stdio_cnt" in | |
c2960299 AD |
7649 | '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' |
7650 | cnt_lval=$undef | |
7651 | ;; | |
8e07c86e | 7652 | *) cnt_lval=$d_stdio_cnt_lval;; |
16d20bd9 AD |
7653 | esac |
7654 | case "$stdio_base" in | |
7655 | '') stdio_base='((fp)->_IO_read_base)';; | |
7656 | esac | |
7657 | case "$stdio_bufsiz" in | |
c2960299 | 7658 | '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; |
16d20bd9 AD |
7659 | esac |
7660 | else | |
7661 | case "$stdio_ptr" in | |
c2960299 AD |
7662 | '') stdio_ptr='((fp)->_ptr)' |
7663 | ptr_lval=$define | |
7664 | ;; | |
8e07c86e | 7665 | *) ptr_lval=$d_stdio_ptr_lval;; |
16d20bd9 AD |
7666 | esac |
7667 | case "$stdio_cnt" in | |
c2960299 AD |
7668 | '') stdio_cnt='((fp)->_cnt)' |
7669 | cnt_lval=$define | |
7670 | ;; | |
8e07c86e | 7671 | *) cnt_lval=$d_stdio_cnt_lval;; |
16d20bd9 AD |
7672 | esac |
7673 | case "$stdio_base" in | |
7674 | '') stdio_base='((fp)->_base)';; | |
7675 | esac | |
7676 | case "$stdio_bufsiz" in | |
7677 | '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; | |
7678 | esac | |
7679 | fi | |
7680 | : test whether _ptr and _cnt really work | |
7681 | echo "Checking how std your stdio is..." >&4 | |
7682 | $cat >try.c <<EOP | |
7683 | #include <stdio.h> | |
7684 | #define FILE_ptr(fp) $stdio_ptr | |
7685 | #define FILE_cnt(fp) $stdio_cnt | |
8ff267be | 7686 | main() { |
16d20bd9 AD |
7687 | FILE *fp = fopen("try.c", "r"); |
7688 | char c = getc(fp); | |
7689 | if ( | |
7690 | 18 <= FILE_cnt(fp) && | |
7691 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 | |
7692 | ) | |
7693 | exit(0); | |
7694 | exit(1); | |
7695 | } | |
7696 | EOP | |
7697 | val="$undef" | |
7698 | if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then | |
7699 | if ./try; then | |
7700 | echo "Your stdio acts pretty std." | |
7701 | val="$define" | |
7702 | else | |
7703 | echo "Your stdio isn't very std." | |
7704 | fi | |
7705 | else | |
7706 | echo "Your stdio doesn't appear very std." | |
7707 | fi | |
7708 | $rm -f try.c try | |
7709 | set d_stdstdio | |
7710 | eval $setvar | |
7711 | ||
8e07c86e | 7712 | : Can _ptr be used as an lvalue? |
e50aee73 AD |
7713 | case "$d_stdstdio$ptr_lval" in |
7714 | $define$define) val=$define ;; | |
c2960299 AD |
7715 | *) val=$undef ;; |
7716 | esac | |
7717 | set d_stdio_ptr_lval | |
7718 | eval $setvar | |
7719 | ||
8e07c86e | 7720 | : Can _cnt be used as an lvalue? |
e50aee73 AD |
7721 | case "$d_stdstdio$cnt_lval" in |
7722 | $define$define) val=$define ;; | |
c2960299 AD |
7723 | *) val=$undef ;; |
7724 | esac | |
7725 | set d_stdio_cnt_lval | |
7726 | eval $setvar | |
7727 | ||
8ff267be | 7728 | |
16d20bd9 AD |
7729 | : see if _base is also standard |
7730 | val="$undef" | |
7731 | case "$d_stdstdio" in | |
7732 | $define) | |
7733 | $cat >try.c <<EOP | |
7734 | #include <stdio.h> | |
7735 | #define FILE_base(fp) $stdio_base | |
7736 | #define FILE_bufsiz(fp) $stdio_bufsiz | |
8ff267be | 7737 | main() { |
16d20bd9 AD |
7738 | FILE *fp = fopen("try.c", "r"); |
7739 | char c = getc(fp); | |
7740 | if ( | |
7741 | 19 <= FILE_bufsiz(fp) && | |
7742 | strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0 | |
7743 | ) | |
7744 | exit(0); | |
7745 | exit(1); | |
7746 | } | |
7747 | EOP | |
7748 | if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then | |
7749 | if ./try; then | |
8ff267be | 7750 | echo "And its _base field acts std." |
16d20bd9 AD |
7751 | val="$define" |
7752 | else | |
7753 | echo "But its _base field isn't std." | |
7754 | fi | |
7755 | else | |
7756 | echo "However, it seems to be lacking the _base field." | |
7757 | fi | |
7758 | $rm -f try.c try | |
7759 | ;; | |
7760 | esac | |
7761 | set d_stdiobase | |
7762 | eval $setvar | |
7763 | ||
a0d0e21e LW |
7764 | : see if strcoll exists |
7765 | set strcoll d_strcoll | |
7766 | eval $inlibc | |
2304df62 AD |
7767 | |
7768 | : check for structure copying | |
7769 | echo " " | |
7770 | echo "Checking to see if your C compiler can copy structs..." >&4 | |
7771 | $cat >try.c <<'EOCP' | |
7772 | main() | |
7773 | { | |
7774 | struct blurfl { | |
7775 | int dyick; | |
7776 | } foo, bar; | |
7777 | ||
7778 | foo = bar; | |
7779 | } | |
7780 | EOCP | |
7781 | if $cc -c try.c >/dev/null 2>&1 ; then | |
7782 | val="$define" | |
7783 | echo "Yup, it can." | |
7784 | else | |
7785 | val="$undef" | |
7786 | echo "Nope, it can't." | |
7787 | fi | |
7788 | set d_strctcpy | |
7789 | eval $setvar | |
7790 | $rm -f try.* | |
7791 | ||
7792 | : see if strerror and/or sys_errlist[] exist | |
7793 | echo " " | |
7794 | if set strerror val -f d_strerror; eval $csym; $val; then | |
7795 | echo 'strerror() found.' >&4 | |
7796 | d_strerror="$define" | |
a0d0e21e | 7797 | d_strerrm='strerror(e)' |
2304df62 AD |
7798 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
7799 | echo "(You also have sys_errlist[], so we could roll our own strerror.)" | |
7800 | d_syserrlst="$define" | |
7801 | else | |
7802 | echo "(Since you don't have sys_errlist[], sterror() is welcome.)" | |
7803 | d_syserrlst="$undef" | |
7804 | fi | |
7805 | elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \ | |
7806 | $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then | |
7807 | echo 'strerror() found in string header.' >&4 | |
7808 | d_strerror="$define" | |
a0d0e21e | 7809 | d_strerrm='strerror(e)' |
2304df62 AD |
7810 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
7811 | echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)" | |
7812 | d_syserrlst="$define" | |
7813 | else | |
7814 | echo "(You don't appear to have any sys_errlist[], how can this be?)" | |
7815 | d_syserrlst="$undef" | |
7816 | fi | |
7817 | elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
7818 | echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4 | |
7819 | d_strerror="$undef" | |
7820 | d_syserrlst="$define" | |
a0d0e21e | 7821 | d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])' |
2304df62 AD |
7822 | else |
7823 | echo 'strerror() and sys_errlist[] NOT found.' >&4 | |
7824 | d_strerror="$undef" | |
7825 | d_syserrlst="$undef" | |
a0d0e21e | 7826 | d_strerrm='"unknown"' |
2304df62 AD |
7827 | fi |
7828 | ||
a89d8a78 DH |
7829 | : see if strtod exists |
7830 | set strtod d_strtod | |
7831 | eval $inlibc | |
7832 | ||
7833 | : see if strtol exists | |
7834 | set strtol d_strtol | |
7835 | eval $inlibc | |
7836 | ||
7837 | : see if strtoul exists | |
7838 | set strtoul d_strtoul | |
7839 | eval $inlibc | |
7840 | ||
a0d0e21e LW |
7841 | : see if strxfrm exists |
7842 | set strxfrm d_strxfrm | |
7843 | eval $inlibc | |
7844 | ||
2304df62 AD |
7845 | : see if symlink exists |
7846 | set symlink d_symlink | |
7847 | eval $inlibc | |
7848 | ||
7849 | : see if syscall exists | |
7850 | set syscall d_syscall | |
7851 | eval $inlibc | |
7852 | ||
a0d0e21e LW |
7853 | : see if sysconf exists |
7854 | set sysconf d_sysconf | |
7855 | eval $inlibc | |
7856 | ||
2304df62 AD |
7857 | : see if system exists |
7858 | set system d_system | |
7859 | eval $inlibc | |
7860 | ||
a0d0e21e LW |
7861 | : see if tcgetpgrp exists |
7862 | set tcgetpgrp d_tcgetpgrp | |
7863 | eval $inlibc | |
7864 | ||
2c7991dc | 7865 | : see if tcsetpgrp exists |
7866 | set tcsetpgrp d_tcsetpgrp | |
7867 | eval $inlibc | |
4633a7c4 | 7868 | |
2c7991dc | 7869 | : define an is-a-typedef? function |
7870 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
7871 | case "$inclist" in | |
7872 | "") inclist="sys/types.h";; | |
7873 | esac; | |
7874 | eval "varval=\$$var"; | |
7875 | case "$varval" in | |
7876 | "") | |
7877 | $rm -f temp.c; | |
7878 | for inc in $inclist; do | |
7879 | echo "#include <$inc>" >>temp.c; | |
7880 | done; | |
7881 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
7882 | if $contains $type temp.E >/dev/null 2>&1; then | |
7883 | eval "$var=\$type"; | |
7884 | else | |
7885 | eval "$var=\$def"; | |
7886 | fi; | |
7887 | $rm -f temp.?;; | |
7888 | *) eval "$var=\$varval";; | |
7889 | esac' | |
4633a7c4 | 7890 | |
2c7991dc | 7891 | : see if this is a sys/times.h system |
7892 | set sys/times.h i_systimes | |
7893 | eval $inhdr | |
4633a7c4 | 7894 | |
2c7991dc | 7895 | : see if times exists |
4633a7c4 | 7896 | echo " " |
2c7991dc | 7897 | if set times val -f d_times; eval $csym; $val; then |
7898 | echo 'times() found.' >&4 | |
7899 | d_times="$define" | |
7900 | inc='' | |
7901 | case "$i_systimes" in | |
7902 | "$define") inc='sys/times.h';; | |
7903 | esac | |
7904 | set clock_t clocktype long stdio.h sys/types.h $inc | |
7905 | eval $typedef | |
7906 | dflt="$clocktype" | |
7907 | echo " " | |
7908 | rp="What type is returned by times() on this system?" | |
7909 | . ./myread | |
7910 | clocktype="$ans" | |
7911 | else | |
7912 | echo 'times() NOT found, hope that will do.' >&4 | |
7913 | d_times="$undef" | |
7914 | clocktype='int' | |
7915 | fi | |
2304df62 | 7916 | |
2c7991dc | 7917 | : see if truncate exists |
7918 | set truncate d_truncate | |
7919 | eval $inlibc | |
2304df62 | 7920 | |
2c7991dc | 7921 | : see if tzname[] exists |
7922 | echo " " | |
7923 | if set tzname val -a d_tzname; eval $csym; $val; then | |
7924 | val="$define" | |
7925 | echo 'tzname[] found.' >&4 | |
7926 | else | |
7927 | val="$undef" | |
7928 | echo 'tzname[] NOT found.' >&4 | |
7929 | fi | |
7930 | set d_tzname | |
7931 | eval $setvar | |
7932 | ||
7933 | : see if umask exists | |
7934 | set umask d_umask | |
7935 | eval $inlibc | |
85e6fe83 | 7936 | |
4633a7c4 | 7937 | : see how we will look up host name |
a0d0e21e | 7938 | echo " " |
4633a7c4 LW |
7939 | if false; then |
7940 | : dummy stub to allow use of elif | |
7941 | elif set uname val -f d_uname; eval $csym; $val; then | |
7942 | if ./xenix; then | |
7943 | $cat <<'EOM' | |
7944 | uname() was found, but you're running xenix, and older versions of xenix | |
7945 | have a broken uname(). If you don't really know whether your xenix is old | |
7946 | enough to have a broken system call, use the default answer. | |
7947 | ||
85e6fe83 | 7948 | EOM |
4633a7c4 LW |
7949 | dflt=y |
7950 | case "$d_uname" in | |
7951 | "$define") dflt=n;; | |
7952 | esac | |
7953 | rp='Is your uname() broken?' | |
7954 | . ./myread | |
7955 | case "$ans" in | |
7956 | n*) d_uname="$define"; call=uname;; | |
7957 | esac | |
7958 | else | |
7959 | echo 'uname() found.' >&4 | |
7960 | d_uname="$define" | |
7961 | call=uname | |
7962 | fi | |
a0d0e21e | 7963 | fi |
4633a7c4 LW |
7964 | case "$d_gethname" in |
7965 | '') d_gethname="$undef";; | |
7966 | esac | |
7967 | case "$d_uname" in | |
7968 | '') d_uname="$undef";; | |
7969 | esac | |
7970 | case "$d_phostname" in | |
7971 | '') d_phostname="$undef";; | |
7972 | esac | |
ecfc5424 | 7973 | |
4633a7c4 LW |
7974 | : backward compatibility for d_hvfork |
7975 | if test X$d_hvfork != X; then | |
7976 | d_vfork="$d_hvfork" | |
7977 | d_hvfork='' | |
7978 | fi | |
7979 | : see if there is a vfork | |
7980 | val='' | |
7981 | set vfork val | |
7982 | eval $inlibc | |
ecfc5424 | 7983 | |
4633a7c4 LW |
7984 | : Ok, but do we want to use it. vfork is reportedly unreliable in |
7985 | : perl on Solaris 2.x, and probably elsewhere. | |
7986 | case "$val" in | |
7987 | $define) | |
16d20bd9 | 7988 | echo " " |
4633a7c4 LW |
7989 | case "$usevfork" in |
7990 | false) dflt='n';; | |
7991 | *) dflt='y';; | |
7992 | esac | |
7993 | rp="Some systems have problems with vfork(). Do you want to use it?" | |
7994 | . ./myread | |
7995 | case "$ans" in | |
7996 | y|Y) ;; | |
7997 | *) | |
7998 | echo "Ok, we won't use vfork()." | |
7999 | val="$undef" | |
8000 | ;; | |
8001 | esac | |
ecfc5424 AD |
8002 | ;; |
8003 | esac | |
4633a7c4 LW |
8004 | set d_vfork |
8005 | eval $setvar | |
8006 | case "$d_vfork" in | |
8007 | $define) usevfork='true';; | |
8008 | *) usevfork='false';; | |
8009 | esac | |
ecfc5424 | 8010 | |
4633a7c4 LW |
8011 | : see if this is an sysdir system |
8012 | set sys/dir.h i_sysdir | |
8013 | eval $inhdr | |
8014 | ||
8015 | : see if this is an sysndir system | |
8016 | set sys/ndir.h i_sysndir | |
8017 | eval $inhdr | |
8018 | ||
8019 | : see if closedir exists | |
8020 | set closedir d_closedir | |
8021 | eval $inlibc | |
8022 | ||
8023 | case "$d_closedir" in | |
8024 | "$define") | |
16d20bd9 | 8025 | echo " " |
4633a7c4 LW |
8026 | echo "Checking whether closedir() returns a status..." >&4 |
8027 | cat > closedir.c <<EOM | |
8028 | #$i_dirent I_DIRENT /**/ | |
8029 | #$i_sysdir I_SYS_DIR /**/ | |
8030 | #$i_sysndir I_SYS_NDIR /**/ | |
8031 | ||
8032 | #if defined(I_DIRENT) | |
8033 | #include <dirent.h> | |
8034 | #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ | |
8035 | #include <sys/dir.h> | |
4aa0a1f7 | 8036 | #endif |
4633a7c4 LW |
8037 | #else |
8038 | #ifdef I_SYS_NDIR | |
8039 | #include <sys/ndir.h> | |
8040 | #else | |
8041 | #ifdef I_SYS_DIR | |
8042 | #ifdef hp9000s500 | |
8043 | #include <ndir.h> /* may be wrong in the future */ | |
8044 | #else | |
8045 | #include <sys/dir.h> | |
8046 | #endif | |
8047 | #endif | |
8048 | #endif | |
8049 | #endif | |
8050 | int main() { return closedir(opendir(".")); } | |
8051 | EOM | |
8052 | if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then | |
8053 | if ./closedir > /dev/null 2>&1 ; then | |
8054 | echo "Yes, it does." | |
8055 | val="$undef" | |
ecfc5424 | 8056 | else |
4633a7c4 LW |
8057 | echo "No, it doesn't." |
8058 | val="$define" | |
ecfc5424 AD |
8059 | fi |
8060 | else | |
4633a7c4 LW |
8061 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
8062 | val="$define" | |
ecfc5424 | 8063 | fi |
ecfc5424 | 8064 | ;; |
4633a7c4 LW |
8065 | *) |
8066 | val="$undef"; | |
ecfc5424 AD |
8067 | ;; |
8068 | esac | |
4633a7c4 LW |
8069 | set d_void_closedir |
8070 | eval $setvar | |
8071 | $rm -f closedir* | |
8072 | : check for volatile keyword | |
ecfc5424 | 8073 | echo " " |
4633a7c4 LW |
8074 | echo 'Checking to see if your C compiler knows about "volatile"...' >&4 |
8075 | $cat >try.c <<'EOCP' | |
8076 | main() | |
8077 | { | |
8078 | typedef struct _goo_struct goo_struct; | |
8079 | goo_struct * volatile goo = ((goo_struct *)0); | |
8080 | struct _goo_struct { | |
8081 | long long_int; | |
8082 | int reg_int; | |
8083 | char char_var; | |
8084 | }; | |
8085 | typedef unsigned short foo_t; | |
8086 | char *volatile foo; | |
8087 | volatile int bar; | |
8088 | volatile foo_t blech; | |
8089 | foo = foo; | |
a0d0e21e LW |
8090 | } |
8091 | EOCP | |
4633a7c4 LW |
8092 | if $cc -c $ccflags try.c >/dev/null 2>&1 ; then |
8093 | val="$define" | |
8094 | echo "Yup, it does." | |
8095 | else | |
8096 | val="$undef" | |
8097 | echo "Nope, it doesn't." | |
8098 | fi | |
8099 | set d_volatile | |
8100 | eval $setvar | |
8101 | $rm -f try.* | |
a0d0e21e | 8102 | |
4633a7c4 LW |
8103 | : see if there is a wait4 |
8104 | set wait4 d_wait4 | |
8e07c86e AD |
8105 | eval $inlibc |
8106 | ||
4633a7c4 LW |
8107 | : see if waitpid exists |
8108 | set waitpid d_waitpid | |
8109 | eval $inlibc | |
8110 | ||
8111 | : see if wcstombs exists | |
8112 | set wcstombs d_wcstombs | |
8113 | eval $inlibc | |
8114 | ||
8115 | : see if wctomb exists | |
8116 | set wctomb d_wctomb | |
8117 | eval $inlibc | |
8118 | ||
8119 | : preserve RCS keywords in files with variable substitution, grrr | |
8120 | Date='$Date' | |
8121 | Id='$Id' | |
8122 | Log='$Log' | |
8123 | RCSfile='$RCSfile' | |
8124 | Revision='$Revision' | |
8125 | ||
8126 | : check for alignment requirements | |
8127 | echo " " | |
8128 | case "$alignbytes" in | |
8129 | '') echo "Checking alignment constraints..." >&4 | |
8130 | $cat >try.c <<'EOCP' | |
8131 | struct foobar { | |
8132 | char foo; | |
8133 | double bar; | |
8134 | } try; | |
8135 | main() | |
8136 | { | |
8137 | printf("%d\n", (char *)&try.bar - (char *)&try.foo); | |
8138 | } | |
8139 | EOCP | |
8140 | if $cc $ccflags try.c -o try >/dev/null 2>&1; then | |
8141 | dflt=`./try` | |
8142 | else | |
8143 | dflt='8' | |
41992daf | 8144 | echo "(I can't seem to compile the test program...)" |
4633a7c4 | 8145 | fi |
ecfc5424 | 8146 | ;; |
4633a7c4 | 8147 | *) dflt="$alignbytes" |
8e07c86e | 8148 | ;; |
ecfc5424 | 8149 | esac |
4633a7c4 LW |
8150 | rp="Doubles must be aligned on a how-many-byte boundary?" |
8151 | . ./myread | |
8152 | alignbytes="$ans" | |
8153 | $rm -f try.c try | |
85e6fe83 | 8154 | |
4633a7c4 LW |
8155 | : check for ordering of bytes in a long |
8156 | case "$byteorder" in | |
8157 | '') | |
8158 | $cat <<'EOM' | |
8159 | ||
8160 | In the following, larger digits indicate more significance. A big-endian | |
8161 | machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A | |
8162 | little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other | |
8163 | machines may have weird orders like 3412. A Cray will report 87654321. If | |
8164 | the test program works the default is probably right. | |
8165 | I'm now running the test program... | |
8166 | EOM | |
8167 | $cat >try.c <<'EOCP' | |
8168 | #include <stdio.h> | |
8169 | main() | |
8170 | { | |
8171 | int i; | |
8172 | union { | |
8173 | unsigned long l; | |
8174 | char c[sizeof(long)]; | |
8175 | } u; | |
8176 | ||
8177 | if (sizeof(long) > 4) | |
8178 | u.l = (0x08070605L << 32) | 0x04030201L; | |
8179 | else | |
8180 | u.l = 0x04030201L; | |
8181 | for (i = 0; i < sizeof(long); i++) | |
8182 | printf("%c", u.c[i]+'0'); | |
8183 | printf("\n"); | |
8184 | exit(0); | |
8185 | } | |
8186 | EOCP | |
8187 | xxx_prompt=y | |
8188 | if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then | |
8189 | dflt=`./try` | |
8190 | case "$dflt" in | |
8191 | [1-4][1-4][1-4][1-4]|12345678|87654321) | |
8192 | echo "(The test program ran ok.)" | |
8193 | echo "byteorder=$dflt" | |
8194 | xxx_prompt=n | |
8195 | ;; | |
8196 | ????|????????) echo "(The test program ran ok.)" ;; | |
8197 | *) echo "(The test program didn't run right for some reason.)" ;; | |
8198 | esac | |
8199 | else | |
8200 | dflt='4321' | |
8201 | cat <<'EOM' | |
8202 | (I can't seem to compile the test program. Guessing big-endian...) | |
8203 | EOM | |
8204 | fi | |
8205 | case "$xxx_prompt" in | |
8206 | y) | |
8207 | rp="What is the order of bytes in a long?" | |
8208 | . ./myread | |
8209 | byteorder="$ans" | |
8210 | ;; | |
8211 | *) byteorder=$dflt | |
ecfc5424 AD |
8212 | ;; |
8213 | esac | |
8214 | ;; | |
8215 | esac | |
4633a7c4 | 8216 | $rm -f try.c try |
85e6fe83 | 8217 | |
4633a7c4 | 8218 | : how do we catenate cpp tokens here? |
2304df62 | 8219 | echo " " |
4633a7c4 LW |
8220 | echo "Checking to see how your cpp does stuff like catenate tokens..." >&4 |
8221 | $cat >cpp_stuff.c <<'EOCP' | |
8222 | #define RCAT(a,b)a/**/b | |
8223 | #define ACAT(a,b)a ## b | |
8224 | RCAT(Rei,ser) | |
8225 | ACAT(Cir,cus) | |
8226 | EOCP | |
8227 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 | |
8228 | if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then | |
8229 | echo "Oh! Smells like ANSI's been here." | |
8230 | echo "We can catify or stringify, separately or together!" | |
8231 | cpp_stuff=42 | |
8232 | elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then | |
8233 | echo "Ah, yes! The good old days!" | |
8234 | echo "However, in the good old days we don't know how to stringify and" | |
8235 | echo "catify at the same time." | |
8236 | cpp_stuff=1 | |
8237 | else | |
8238 | $cat >&4 <<EOM | |
8239 | Hmm, I don't seem to be able to catenate tokens with your cpp. You're going | |
8240 | to have to edit the values of CAT[2-5] in config.h... | |
a0d0e21e | 8241 | EOM |
4633a7c4 LW |
8242 | cpp_stuff="/* Help! How do we handle cpp_stuff? */*/" |
8243 | fi | |
8244 | $rm -f cpp_stuff.* | |
a0d0e21e | 8245 | |
4633a7c4 LW |
8246 | : see if this is a db.h system |
8247 | set db.h i_db | |
8248 | eval $inhdr | |
8249 | ||
8250 | case "$i_db" in | |
68dc0745 | 8251 | $define) |
8252 | : Check db version. We can not use version 2. | |
8253 | echo " " | |
8254 | echo "Checking Berkeley DB version ..." >&4 | |
8255 | $cat >try.c <<EOCP | |
8256 | #$d_const HASCONST | |
8257 | #ifndef HASCONST | |
8258 | #define const | |
8259 | #endif | |
8260 | #include <sys/types.h> | |
8261 | #include <stdio.h> | |
8262 | #include <db.h> | |
8263 | main() | |
8264 | { | |
6a1b87e5 | 8265 | #ifdef DB_VERSION_MAJOR /* DB version >= 2: not yet. */ |
68dc0745 | 8266 | printf("You have Berkeley DB Version %d.%d\n", |
8267 | DB_VERSION_MAJOR, DB_VERSION_MINOR); | |
8268 | printf("Perl currently only supports up to version 1.86.\n"); | |
6a1b87e5 | 8269 | exit(2); |
68dc0745 | 8270 | #else |
6a1b87e5 JH |
8271 | #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) |
8272 | exit(0); /* DB version < 2: the coast is clear. */ | |
8273 | #else | |
8274 | exit(1); /* <db.h> not Berkeley DB? */ | |
8275 | #endif | |
68dc0745 | 8276 | #endif |
8277 | } | |
8278 | EOCP | |
8279 | if $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try; then | |
8280 | echo 'Looks OK. (Perl supports up to version 1.86).' >&4 | |
8281 | else | |
8282 | echo "I can't use your Berkeley DB. I'll disable it." >&4 | |
8283 | i_db=$undef | |
8284 | case " $libs " in | |
8285 | *"-ldb "*) | |
8286 | : Remove db from list of libraries to use | |
8287 | echo "Removing unusable -ldb from library list" >&4 | |
8288 | set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'` | |
8289 | shift | |
8290 | libs="$*" | |
8291 | echo "libs = $libs" >&4 | |
8292 | ;; | |
8293 | esac | |
8294 | fi | |
8295 | $rm -f try.* | |
8296 | ;; | |
8297 | esac | |
8298 | ||
8299 | case "$i_db" in | |
4633a7c4 LW |
8300 | define) |
8301 | : Check the return type needed for hash | |
8302 | echo " " | |
8303 | echo "Checking return type needed for hash for Berkeley DB ..." >&4 | |
8304 | $cat >try.c <<EOCP | |
8305 | #$d_const HASCONST | |
8306 | #ifndef HASCONST | |
8307 | #define const | |
8308 | #endif | |
8309 | #include <sys/types.h> | |
8310 | #include <db.h> | |
8311 | u_int32_t hash_cb (ptr, size) | |
8312 | const void *ptr; | |
8313 | size_t size; | |
8314 | { | |
8315 | } | |
8316 | HASHINFO info; | |
8317 | main() | |
8318 | { | |
8319 | info.hash = hash_cb; | |
8320 | } | |
8321 | EOCP | |
8322 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
8323 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
8324 | db_hashtype='int' | |
8325 | else | |
8326 | db_hashtype='u_int32_t' | |
8327 | fi | |
8328 | else | |
68dc0745 | 8329 | : XXX Maybe we should just give up here. |
8330 | db_hashtype=u_int32_t | |
8331 | echo "Help: I can't seem to compile the db test program." >&4 | |
8332 | echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 | |
4633a7c4 LW |
8333 | fi |
8334 | $rm -f try.* | |
8335 | echo "Your version of Berkeley DB uses $db_hashtype for hash." | |
8336 | ;; | |
68dc0745 | 8337 | *) db_hashtype=u_int32_t |
4633a7c4 LW |
8338 | ;; |
8339 | esac | |
a0d0e21e | 8340 | |
4633a7c4 LW |
8341 | case "$i_db" in |
8342 | define) | |
8343 | : Check the return type needed for prefix | |
8344 | echo " " | |
8345 | echo "Checking return type needed for prefix for Berkeley DB ..." >&4 | |
8346 | cat >try.c <<EOCP | |
8347 | #$d_const HASCONST | |
8348 | #ifndef HASCONST | |
8349 | #define const | |
8350 | #endif | |
8351 | #include <sys/types.h> | |
8352 | #include <db.h> | |
8353 | size_t prefix_cb (key1, key2) | |
8354 | const DBT *key1; | |
8355 | const DBT *key2; | |
8356 | { | |
8357 | } | |
8358 | BTREEINFO info; | |
8359 | main() | |
8360 | { | |
8361 | info.prefix = prefix_cb; | |
8362 | } | |
8363 | EOCP | |
8364 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
8365 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
8366 | db_prefixtype='int' | |
8367 | else | |
8368 | db_prefixtype='size_t' | |
8369 | fi | |
8370 | else | |
68dc0745 | 8371 | db_prefixtype='size_t' |
8372 | : XXX Maybe we should just give up here. | |
8373 | echo "Help: I can't seem to compile the db test program." >&4 | |
8374 | echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 | |
4633a7c4 LW |
8375 | fi |
8376 | $rm -f try.* | |
8377 | echo "Your version of Berkeley DB uses $db_prefixtype for prefix." | |
a0d0e21e | 8378 | ;; |
68dc0745 | 8379 | *) db_prefixtype='size_t' |
4633a7c4 LW |
8380 | ;; |
8381 | esac | |
a0d0e21e | 8382 | |
4633a7c4 LW |
8383 | : check for void type |
8384 | echo " " | |
8385 | echo "Checking to see how well your C compiler groks the void type..." >&4 | |
8386 | echo " " | |
8387 | $cat >&4 <<EOM | |
8388 | Support flag bits are: | |
8389 | 1: basic void declarations. | |
8390 | 2: arrays of pointers to functions returning void. | |
8391 | 4: operations between pointers to and addresses of void functions. | |
8392 | 8: generic void pointers. | |
a0d0e21e | 8393 | EOM |
4633a7c4 LW |
8394 | echo " " |
8395 | case "$voidflags" in | |
8396 | '') | |
8397 | $cat >try.c <<'EOCP' | |
8398 | #if TRY & 1 | |
760ac839 | 8399 | void sub() { |
4633a7c4 | 8400 | #else |
760ac839 | 8401 | sub() { |
4633a7c4 LW |
8402 | #endif |
8403 | extern void moo(); /* function returning void */ | |
8404 | void (*goo)(); /* ptr to func returning void */ | |
8405 | #if TRY & 8 | |
8406 | void *hue; /* generic ptr */ | |
8407 | #endif | |
8408 | #if TRY & 2 | |
8409 | void (*foo[10])(); | |
8410 | #endif | |
a0d0e21e | 8411 | |
4633a7c4 LW |
8412 | #if TRY & 4 |
8413 | if(goo == moo) { | |
8414 | exit(0); | |
8415 | } | |
8416 | #endif | |
8417 | exit(0); | |
8418 | } | |
760ac839 | 8419 | main() { sub(); } |
4633a7c4 | 8420 | EOCP |
760ac839 | 8421 | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then |
4633a7c4 LW |
8422 | voidflags=$defvoidused |
8423 | echo "It appears to support void to the level $package wants ($defvoidused)." | |
8424 | if $contains warning .out >/dev/null 2>&1; then | |
8425 | echo "However, you might get some warnings that look like this:" | |
8426 | $cat .out | |
8427 | fi | |
8428 | else | |
8429 | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 | |
760ac839 | 8430 | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then |
4633a7c4 | 8431 | echo "It supports 1..." |
760ac839 | 8432 | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then |
4633a7c4 | 8433 | echo "It also supports 2..." |
760ac839 | 8434 | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8435 | voidflags=7 |
8436 | echo "And it supports 4 but not 8 definitely." | |
8437 | else | |
8438 | echo "It doesn't support 4..." | |
760ac839 | 8439 | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8440 | voidflags=11 |
8441 | echo "But it supports 8." | |
8442 | else | |
8443 | voidflags=3 | |
8444 | echo "Neither does it support 8." | |
8445 | fi | |
8446 | fi | |
8447 | else | |
8448 | echo "It does not support 2..." | |
760ac839 | 8449 | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8450 | voidflags=13 |
8451 | echo "But it supports 4 and 8." | |
8452 | else | |
760ac839 | 8453 | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8454 | voidflags=5 |
8455 | echo "And it supports 4 but has not heard about 8." | |
8456 | else | |
8457 | echo "However it supports 8 but not 4." | |
8458 | fi | |
8459 | fi | |
8460 | fi | |
8461 | else | |
8462 | echo "There is no support at all for void." | |
8463 | voidflags=0 | |
8464 | fi | |
8465 | fi | |
8466 | esac | |
2c7991dc | 8467 | : Only prompt user if support does not match the level we want |
4633a7c4 | 8468 | case "$voidflags" in |
2c7991dc | 8469 | "$defvoidused") ;; |
8470 | *) | |
8471 | dflt="$voidflags"; | |
4633a7c4 | 8472 | rp="Your void support flags add up to what?" |
a0d0e21e | 8473 | . ./myread |
4633a7c4 | 8474 | voidflags="$ans" |
a0d0e21e LW |
8475 | ;; |
8476 | esac | |
4633a7c4 | 8477 | $rm -f try.* .out |
a0d0e21e LW |
8478 | |
8479 | : see what type file positions are declared as in the library | |
8480 | set fpos_t fpostype long stdio.h sys/types.h | |
8481 | eval $typedef | |
8482 | echo " " | |
8483 | dflt="$fpostype" | |
8484 | rp="What is the type for file position used by fsetpos()?" | |
2304df62 | 8485 | . ./myread |
a0d0e21e | 8486 | fpostype="$ans" |
2304df62 | 8487 | |
1aef975c AD |
8488 | : Store the full pathname to the sed program for use in the C program |
8489 | full_sed=$sed | |
8490 | ||
2304df62 | 8491 | : see what type gids are declared as in the kernel |
a0d0e21e LW |
8492 | set gid_t gidtype xxx stdio.h sys/types.h |
8493 | eval $typedef | |
2304df62 | 8494 | case "$gidtype" in |
a0d0e21e LW |
8495 | xxx) |
8496 | xxx=`./findhdr sys/user.h` | |
8497 | set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short | |
8498 | case $1 in | |
8499 | unsigned) dflt="$1 $2" ;; | |
8500 | *) dflt="$1" ;; | |
8501 | esac | |
2304df62 | 8502 | ;; |
a0d0e21e | 8503 | *) dflt="$gidtype";; |
2304df62 AD |
8504 | esac |
8505 | echo " " | |
8506 | rp="What is the type for group ids returned by getgid()?" | |
8507 | . ./myread | |
a0d0e21e LW |
8508 | gidtype="$ans" |
8509 | ||
2304df62 AD |
8510 | : see if getgroups exists |
8511 | set getgroups d_getgrps | |
8512 | eval $inlibc | |
8513 | ||
5cd24f17 | 8514 | : see if setgroups exists |
8515 | set setgroups d_setgrps | |
8516 | eval $inlibc | |
8517 | ||
8cc95fdb | 8518 | : Find type of 2nd arg to 'getgroups()' and 'setgroups()' |
a0d0e21e | 8519 | echo " " |
5cd24f17 | 8520 | case "$d_getgrps$d_setgrps" in |
8521 | *define*) | |
a0d0e21e | 8522 | case "$groupstype" in |
2304df62 AD |
8523 | '') dflt="$gidtype" ;; |
8524 | *) dflt="$groupstype" ;; | |
a0d0e21e LW |
8525 | esac |
8526 | $cat <<EOM | |
5cd24f17 | 8527 | What is the type of the second argument to getgroups() and setgroups()? |
8528 | Usually this is the same as group ids, $gidtype, but not always. | |
2304df62 AD |
8529 | |
8530 | EOM | |
5cd24f17 | 8531 | rp='What type is the second argument to getgroups() and setgroups()?' |
a0d0e21e LW |
8532 | . ./myread |
8533 | groupstype="$ans" | |
8534 | ;; | |
8535 | *) groupstype="$gidtype";; | |
2304df62 | 8536 | esac |
2304df62 | 8537 | |
85e6fe83 | 8538 | : see what type lseek is declared as in the kernel |
a0d0e21e LW |
8539 | set off_t lseektype long stdio.h sys/types.h |
8540 | eval $typedef | |
2304df62 | 8541 | echo " " |
a0d0e21e | 8542 | dflt="$lseektype" |
85e6fe83 LW |
8543 | rp="What type is lseek's offset on this system declared as?" |
8544 | . ./myread | |
8545 | lseektype="$ans" | |
2304df62 | 8546 | |
8ff267be | 8547 | echo " " |
8548 | case "$make" in | |
8549 | '') | |
8550 | make=`./loc make make $pth` | |
8551 | case "$make" in | |
8552 | /*) echo make is in $make. ;; | |
8553 | ?:[\\/]*) echo make is in $make. ;; | |
8554 | *) echo "I don't know where 'make' is, and my life depends on it." >&4 | |
8555 | echo "Go find a make program or fix your PATH setting!" >&4 | |
8556 | exit 1 | |
8557 | ;; | |
8558 | esac | |
8559 | ;; | |
8560 | *) echo make is in $make. ;; | |
8561 | esac | |
8562 | ||
8563 | $echo $n "Checking if your $make program sets \$(MAKE)... $c" >&4 | |
8564 | case "$make_set_make" in | |
8565 | '') | |
8566 | $sed 's/^X //' > testmake.mak << 'EOF' | |
8567 | Xall: | |
8568 | X @echo 'ac_maketemp="$(MAKE)"' | |
8569 | EOF | |
8570 | : GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
8571 | case "`$make -f testmake.mak 2>/dev/null`" in | |
8572 | *ac_maketemp=*) make_set_make='#' ;; | |
8573 | *) make_set_make="MAKE=$make" ;; | |
8574 | esac | |
8575 | $rm -f testmake.mak | |
8576 | ;; | |
8577 | esac | |
8578 | case "$make_set_make" in | |
8579 | '#') echo "Yup, it does." >&4 ;; | |
8580 | *) echo "Nope, it doesn't." >&4 ;; | |
8581 | esac | |
8582 | ||
a0d0e21e LW |
8583 | : see what type is used for mode_t |
8584 | set mode_t modetype int stdio.h sys/types.h | |
8585 | eval $typedef | |
8586 | dflt="$modetype" | |
85e6fe83 | 8587 | echo " " |
a0d0e21e | 8588 | rp="What type is used for file modes?" |
85e6fe83 | 8589 | . ./myread |
a0d0e21e | 8590 | modetype="$ans" |
85e6fe83 | 8591 | |
2c7991dc | 8592 | : locate the preferred pager for this system |
8593 | case "$pager" in | |
8594 | '') | |
8595 | dflt='' | |
8596 | case "$pg" in | |
8597 | /*) dflt=$pg;; | |
8598 | esac | |
8599 | case "$more" in | |
8600 | /*) dflt=$more;; | |
8601 | esac | |
8602 | case "$less" in | |
8603 | /*) dflt=$less;; | |
8604 | esac | |
8605 | case "$dflt" in | |
8606 | '') dflt=/usr/ucb/more;; | |
8607 | esac | |
8608 | ;; | |
8609 | *) dflt="$pager";; | |
8610 | esac | |
8611 | echo " " | |
8612 | fn=f/ | |
8613 | rp='What pager is used on your system?' | |
8614 | . ./getfile | |
8615 | pager="$ans" | |
8616 | ||
2304df62 AD |
8617 | : Cruising for prototypes |
8618 | echo " " | |
8619 | echo "Checking out function prototypes..." >&4 | |
8620 | $cat >prototype.c <<'EOCP' | |
8621 | main(int argc, char *argv[]) { | |
8622 | exit(0);} | |
8623 | EOCP | |
a0d0e21e | 8624 | if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then |
2304df62 AD |
8625 | echo "Your C compiler appears to support function prototypes." |
8626 | val="$define" | |
8627 | else | |
8628 | echo "Your C compiler doesn't seem to understand function prototypes." | |
8629 | val="$undef" | |
8630 | fi | |
8631 | set prototype | |
8632 | eval $setvar | |
8633 | $rm -f prototype* | |
8634 | ||
8635 | : check for size of random number generator | |
8636 | echo " " | |
8637 | case "$randbits" in | |
8638 | '') | |
8639 | echo "Checking to see how many bits your rand function produces..." >&4 | |
8ff267be | 8640 | $cat >try.c <<EOCP |
8641 | #$i_unistd I_UNISTD | |
8642 | #$i_stdlib I_STDLIB | |
2304df62 | 8643 | #include <stdio.h> |
8ff267be | 8644 | #ifdef I_UNISTD |
8645 | # include <unistd.h> | |
8646 | #endif | |
8647 | #ifdef I_STDLIB | |
8648 | # include <stdlib.h> | |
8649 | #endif | |
8650 | EOCP | |
8651 | $cat >>try.c <<'EOCP' | |
2304df62 AD |
8652 | main() |
8653 | { | |
8654 | register int i; | |
8655 | register unsigned long tmp; | |
8656 | register unsigned long max = 0L; | |
8657 | ||
8658 | for (i = 1000; i; i--) { | |
8659 | tmp = (unsigned long)rand(); | |
8660 | if (tmp > max) max = tmp; | |
8661 | } | |
8662 | for (i = 0; max; i++) | |
8663 | max /= 2; | |
8664 | printf("%d\n",i); | |
1e422769 | 8665 | fflush(stdout); |
2304df62 AD |
8666 | } |
8667 | EOCP | |
b971f6e4 | 8668 | if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then |
2304df62 AD |
8669 | dflt=`try` |
8670 | else | |
8671 | dflt='?' | |
8672 | echo "(I can't seem to compile the test program...)" | |
8673 | fi | |
8674 | ;; | |
8675 | *) | |
8676 | dflt="$randbits" | |
8677 | ;; | |
8678 | esac | |
a0d0e21e LW |
8679 | rp='How many bits does your rand() function produce?' |
8680 | . ./myread | |
8681 | randbits="$ans" | |
b971f6e4 | 8682 | $rm -f try.c try.o try |
a0d0e21e LW |
8683 | |
8684 | : see if ar generates random libraries by itself | |
8685 | echo " " | |
8686 | echo "Checking how to generate random libraries on your machine..." >&4 | |
8687 | echo 'int bar1() { return bar2(); }' > bar1.c | |
8688 | echo 'int bar2() { return 2; }' > bar2.c | |
8689 | $cat > foo.c <<'EOP' | |
8690 | main() { printf("%d\n", bar1()); exit(0); } | |
8691 | EOP | |
8692 | $cc $ccflags -c bar1.c >/dev/null 2>&1 | |
8693 | $cc $ccflags -c bar2.c >/dev/null 2>&1 | |
8694 | $cc $ccflags -c foo.c >/dev/null 2>&1 | |
5f05dabc | 8695 | ar rc bar$lib_ext bar2.o bar1.o >/dev/null 2>&1 |
8696 | if $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 && | |
a0d0e21e LW |
8697 | ./foobar >/dev/null 2>&1; then |
8698 | echo "ar appears to generate random libraries itself." | |
8699 | orderlib=false | |
8700 | ranlib=":" | |
5f05dabc | 8701 | elif ar ts bar$lib_ext >/dev/null 2>&1 && |
8702 | $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 && | |
a0d0e21e LW |
8703 | ./foobar >/dev/null 2>&1; then |
8704 | echo "a table of contents needs to be added with 'ar ts'." | |
8705 | orderlib=false | |
8706 | ranlib="ar ts" | |
8707 | else | |
ecfc5424 AD |
8708 | case "$ranlib" in |
8709 | :) ranlib='';; | |
8710 | '') | |
8711 | ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin` | |
8712 | $test -f $ranlib || ranlib='' | |
8713 | ;; | |
8714 | esac | |
a0d0e21e | 8715 | if $test -n "$ranlib"; then |
ecfc5424 | 8716 | echo "your system has '$ranlib'; we'll use that." |
a0d0e21e LW |
8717 | orderlib=false |
8718 | else | |
8719 | echo "your system doesn't seem to support random libraries" | |
8720 | echo "so we'll use lorder and tsort to order the libraries." | |
8721 | orderlib=true | |
8722 | ranlib=":" | |
8723 | fi | |
8724 | fi | |
8725 | $rm -f foo* bar* | |
8726 | ||
a0d0e21e LW |
8727 | : see if sys/select.h has to be included |
8728 | set sys/select.h i_sysselct | |
8729 | eval $inhdr | |
8730 | ||
8731 | : see if we should include time.h, sys/time.h, or both | |
8732 | echo " " | |
8733 | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 | |
8734 | $echo $n "I'm now running the test program...$c" | |
8735 | $cat >try.c <<'EOCP' | |
8736 | #include <sys/types.h> | |
8737 | #ifdef I_TIME | |
8738 | #include <time.h> | |
8739 | #endif | |
8740 | #ifdef I_SYSTIME | |
8741 | #ifdef SYSTIMEKERNEL | |
8742 | #define KERNEL | |
8743 | #endif | |
8744 | #include <sys/time.h> | |
8745 | #endif | |
8746 | #ifdef I_SYSSELECT | |
8747 | #include <sys/select.h> | |
8748 | #endif | |
8749 | main() | |
8750 | { | |
8751 | struct tm foo; | |
8752 | #ifdef S_TIMEVAL | |
8753 | struct timeval bar; | |
8754 | #endif | |
8755 | #ifdef S_TIMEZONE | |
8756 | struct timezone tzp; | |
8757 | #endif | |
8758 | if (foo.tm_sec == foo.tm_sec) | |
8759 | exit(0); | |
8760 | #ifdef S_TIMEVAL | |
8761 | if (bar.tv_sec == bar.tv_sec) | |
8762 | exit(0); | |
8763 | #endif | |
8764 | exit(1); | |
8765 | } | |
8766 | EOCP | |
8767 | flags='' | |
40a7a20a | 8768 | for s_timezone in '-DS_TIMEZONE' ''; do |
a0d0e21e LW |
8769 | sysselect='' |
8770 | for s_timeval in '-DS_TIMEVAL' ''; do | |
8771 | for i_systimek in '' '-DSYSTIMEKERNEL'; do | |
8772 | for i_time in '' '-DI_TIME'; do | |
8773 | for i_systime in '-DI_SYSTIME' ''; do | |
8774 | case "$flags" in | |
8775 | '') $echo $n ".$c" | |
8776 | if $cc $ccflags \ | |
8777 | $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \ | |
8778 | try.c -o try >/dev/null 2>&1 ; then | |
8779 | set X $i_time $i_systime $i_systimek $sysselect $s_timeval | |
8780 | shift | |
8781 | flags="$*" | |
8782 | echo " " | |
8783 | $echo $n "Succeeded with $flags$c" | |
8784 | fi | |
8785 | ;; | |
8786 | esac | |
8787 | done | |
8788 | done | |
8789 | done | |
8790 | done | |
40a7a20a | 8791 | done |
a0d0e21e LW |
8792 | timeincl='' |
8793 | echo " " | |
8794 | case "$flags" in | |
8795 | *SYSTIMEKERNEL*) i_systimek="$define" | |
8796 | timeincl=`./findhdr sys/time.h` | |
8797 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; | |
8798 | *) i_systimek="$undef";; | |
8799 | esac | |
8800 | case "$flags" in | |
8801 | *I_TIME*) i_time="$define" | |
8802 | timeincl=`./findhdr time.h`" $timeincl" | |
8803 | echo "We'll include <time.h>." >&4;; | |
8804 | *) i_time="$undef";; | |
8805 | esac | |
8806 | case "$flags" in | |
8807 | *I_SYSTIME*) i_systime="$define" | |
8808 | timeincl=`./findhdr sys/time.h`" $timeincl" | |
8809 | echo "We'll include <sys/time.h>." >&4;; | |
8810 | *) i_systime="$undef";; | |
8811 | esac | |
2304df62 AD |
8812 | $rm -f try.c try |
8813 | ||
a0d0e21e LW |
8814 | : check for fd_set items |
8815 | $cat <<EOM | |
8816 | ||
8817 | Checking to see how well your C compiler handles fd_set and friends ... | |
8818 | EOM | |
8819 | $cat >fd_set.c <<EOCP | |
8820 | #$i_systime I_SYS_TIME | |
8821 | #$i_sysselct I_SYS_SELECT | |
8822 | #$d_socket HAS_SOCKET | |
8823 | #include <sys/types.h> | |
8824 | #ifdef HAS_SOCKET | |
8825 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
8826 | #endif | |
8827 | #ifdef I_SYS_TIME | |
8828 | #include <sys/time.h> | |
a4f3eea9 | 8829 | #endif |
a0d0e21e LW |
8830 | #ifdef I_SYS_SELECT |
8831 | #include <sys/select.h> | |
8832 | #endif | |
a0d0e21e LW |
8833 | main() { |
8834 | fd_set fds; | |
8835 | ||
8836 | #ifdef TRYBITS | |
8837 | if(fds.fds_bits); | |
8838 | #endif | |
8839 | ||
8840 | #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) | |
8841 | exit(0); | |
8842 | #else | |
8843 | exit(1); | |
8844 | #endif | |
8845 | } | |
8846 | EOCP | |
8847 | if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then | |
8848 | d_fds_bits="$define" | |
8849 | d_fd_set="$define" | |
8850 | echo "Well, your system knows about the normal fd_set typedef..." >&4 | |
8851 | if ./fd_set; then | |
8852 | echo "and you have the normal fd_set macros (just as I'd expect)." >&4 | |
8853 | d_fd_macros="$define" | |
85e6fe83 | 8854 | else |
a0d0e21e LW |
8855 | $cat >&4 <<'EOM' |
8856 | but not the normal fd_set macros! Gaaack! I'll have to cover for you. | |
8857 | EOM | |
8858 | d_fd_macros="$undef" | |
85e6fe83 LW |
8859 | fi |
8860 | else | |
a0d0e21e LW |
8861 | $cat <<'EOM' |
8862 | Hmm, your compiler has some difficulty with fd_set. Checking further... | |
8863 | EOM | |
8864 | if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then | |
8865 | d_fds_bits="$undef" | |
8866 | d_fd_set="$define" | |
8867 | echo "Well, your system has some sort of fd_set available..." >&4 | |
8868 | if ./fd_set; then | |
8869 | echo "and you have the normal fd_set macros." >&4 | |
8870 | d_fd_macros="$define" | |
8871 | else | |
8872 | $cat <<'EOM' | |
8873 | but not the normal fd_set macros! Gross! More work for me... | |
8874 | EOM | |
8875 | d_fd_macros="$undef" | |
8876 | fi | |
85e6fe83 | 8877 | else |
a0d0e21e LW |
8878 | echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 |
8879 | d_fd_set="$undef" | |
8880 | d_fds_bits="$undef" | |
8881 | d_fd_macros="$undef" | |
85e6fe83 LW |
8882 | fi |
8883 | fi | |
a0d0e21e LW |
8884 | $rm -f fd_set* |
8885 | ||
8886 | ||
8887 | : check for type of arguments to select. This will only really | |
8888 | : work if the system supports prototypes and provides one for | |
8889 | : select. | |
8890 | case "$d_select" in | |
8891 | $define) | |
8892 | : Make initial guess | |
8893 | case "$selecttype" in | |
8894 | ''|' ') | |
8895 | case "$d_fd_set" in | |
8896 | $define) xxx='fd_set *' ;; | |
8897 | *) xxx='int *' ;; | |
8898 | esac | |
8899 | ;; | |
8900 | *) xxx="$selecttype" | |
8901 | ;; | |
8902 | esac | |
8903 | : backup guess | |
8904 | case "$xxx" in | |
8905 | 'fd_set *') yyy='int *' ;; | |
8906 | 'int *') yyy='fd_set *' ;; | |
8907 | esac | |
85e6fe83 | 8908 | |
2304df62 AD |
8909 | $cat <<EOM |
8910 | ||
a0d0e21e | 8911 | Checking to see what type of arguments are expected by select(). |
2304df62 | 8912 | EOM |
a0d0e21e LW |
8913 | $cat >try.c <<EOCP |
8914 | #$i_systime I_SYS_TIME | |
8915 | #$i_sysselct I_SYS_SELECT | |
8916 | #$d_socket HAS_SOCKET | |
8917 | #include <sys/types.h> | |
8918 | #ifdef HAS_SOCKET | |
8919 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
8920 | #endif | |
8921 | #ifdef I_SYS_TIME | |
8922 | #include <sys/time.h> | |
8ff267be | 8923 | #endif |
a0d0e21e LW |
8924 | #ifdef I_SYS_SELECT |
8925 | #include <sys/select.h> | |
8926 | #endif | |
a0d0e21e LW |
8927 | main() |
8928 | { | |
8929 | int width; | |
8930 | Select_fd_set_t readfds; | |
8931 | Select_fd_set_t writefds; | |
8932 | Select_fd_set_t exceptfds; | |
8933 | struct timeval timeout; | |
8934 | select(width, readfds, writefds, exceptfds, &timeout); | |
8935 | exit(0); | |
8936 | } | |
8937 | EOCP | |
8938 | if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then | |
8939 | selecttype="$xxx" | |
8940 | echo "Your system uses $xxx for the arguments to select." >&4 | |
8941 | elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then | |
8942 | selecttype="$yyy" | |
8943 | echo "Your system uses $yyy for the arguments to select." >&4 | |
8944 | else | |
8945 | rp='What is the type for the 2nd, 3rd, and 4th arguments to select?' | |
8946 | dflt="$xxx" | |
8947 | . ./myread | |
8948 | selecttype="$ans" | |
8949 | fi | |
8950 | $rm -f try.[co] | |
8951 | ;; | |
8e07c86e | 8952 | *) selecttype='int *' |
a0d0e21e LW |
8953 | ;; |
8954 | esac | |
2304df62 | 8955 | |
8e07c86e AD |
8956 | : Trace out the files included by signal.h, then look for SIGxxx names. |
8957 | : Remove SIGARRAYSIZE used by HPUX. | |
4633a7c4 | 8958 | : Remove SIGTYP void lines used by OS2. |
8e07c86e AD |
8959 | xxx=`echo '#include <signal.h>' | |
8960 | $cppstdin $cppminus $cppflags 2>/dev/null | | |
8961 | $grep '^[ ]*#.*include' | | |
8962 | $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq` | |
8963 | : Check this list of files to be sure we have parsed the cpp output ok. | |
8964 | : This will also avoid potentially non-existent files, such | |
8965 | : as ../foo/bar.h | |
8966 | xxxfiles='' | |
8967 | for xx in $xxx /dev/null ; do | |
8968 | $test -f "$xx" && xxxfiles="$xxxfiles $xx" | |
8969 | done | |
8970 | : If we have found no files, at least try signal.h | |
8971 | case "$xxxfiles" in | |
8972 | '') xxxfiles=`./findhdr signal.h` ;; | |
8973 | esac | |
8974 | xxx=`awk ' | |
4633a7c4 | 8975 | $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ { |
8e07c86e AD |
8976 | print substr($2, 4, 20) |
8977 | } | |
4633a7c4 | 8978 | $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { |
8e07c86e AD |
8979 | print substr($3, 4, 20) |
8980 | }' $xxxfiles` | |
8981 | : Append some common names just in case the awk scan failed. | |
8982 | xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL" | |
8983 | xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP" | |
8984 | xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM" | |
8985 | xxx="$xxx WINCH WIND WINDOW XCPU XFSZ" | |
8986 | : generate a few handy files for later | |
4633a7c4 LW |
8987 | $cat > signal.c <<'EOP' |
8988 | #include <sys/types.h> | |
8989 | #include <signal.h> | |
8990 | int main() { | |
760ac839 LW |
8991 | |
8992 | /* Strange style to avoid deeply-nested #if/#else/#endif */ | |
8993 | #ifndef NSIG | |
8994 | # ifdef _NSIG | |
8995 | # define NSIG (_NSIG) | |
8996 | # endif | |
8997 | #endif | |
8998 | ||
8999 | #ifndef NSIG | |
9000 | # ifdef SIGMAX | |
9001 | # define NSIG (SIGMAX+1) | |
9002 | # endif | |
9003 | #endif | |
9004 | ||
9005 | #ifndef NSIG | |
9006 | # ifdef SIG_MAX | |
9007 | # define NSIG (SIG_MAX+1) | |
9008 | # endif | |
9009 | #endif | |
9010 | ||
9011 | #ifndef NSIG | |
9012 | # ifdef MAXSIG | |
9013 | # define NSIG (MAXSIG+1) | |
9014 | # endif | |
4633a7c4 | 9015 | #endif |
760ac839 LW |
9016 | |
9017 | #ifndef NSIG | |
9018 | # ifdef MAX_SIG | |
9019 | # define NSIG (MAX_SIG+1) | |
9020 | # endif | |
9021 | #endif | |
9022 | ||
9023 | #ifndef NSIG | |
9024 | # ifdef SIGARRAYSIZE | |
9025 | # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ | |
9026 | # endif | |
9027 | #endif | |
9028 | ||
9029 | #ifndef NSIG | |
9030 | # ifdef _sys_nsig | |
9031 | # define NSIG (_sys_nsig) /* Solaris 2.5 */ | |
9032 | # endif | |
9033 | #endif | |
9034 | ||
9035 | /* Default to some arbitrary number that's big enough to get most | |
9036 | of the common signals. | |
9037 | */ | |
9038 | #ifndef NSIG | |
9039 | # define NSIG 50 | |
4633a7c4 | 9040 | #endif |
760ac839 LW |
9041 | |
9042 | printf("NSIG %d\n", NSIG); | |
9043 | ||
4633a7c4 LW |
9044 | EOP |
9045 | echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk ' | |
8e07c86e AD |
9046 | { |
9047 | printf "#ifdef SIG"; printf $1; printf "\n" | |
9048 | printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; | |
9049 | printf $1; printf ");\n" | |
9050 | printf "#endif\n" | |
2304df62 | 9051 | } |
2304df62 | 9052 | END { |
8e07c86e | 9053 | printf "}\n"; |
2304df62 | 9054 | } |
4633a7c4 LW |
9055 | ' >>signal.c |
9056 | $cat >signal.awk <<'EOP' | |
9057 | BEGIN { ndups = 0 } | |
9058 | $1 ~ /^NSIG$/ { nsig = $2 } | |
9059 | ($1 !~ /^NSIG$/) && (NF == 2) { | |
9060 | if ($2 > maxsig) { maxsig = $2 } | |
9061 | if (sig_name[$2]) { | |
9062 | dup_name[ndups] = $1 | |
9063 | dup_num[ndups] = $2 | |
9064 | ndups++ | |
9065 | } | |
9066 | else { | |
9067 | sig_name[$2] = $1 | |
9068 | sig_num[$2] = $2 | |
9069 | } | |
9070 | ||
9071 | } | |
9072 | END { | |
9073 | if (nsig == 0) { nsig = maxsig + 1 } | |
9074 | for (n = 1; n < nsig; n++) { | |
9075 | if (sig_name[n]) { | |
9076 | printf("%s %d\n", sig_name[n], sig_num[n]) | |
9077 | } | |
9078 | else { | |
9079 | printf("NUM%d %d\n", n, n) | |
9080 | } | |
9081 | } | |
9082 | for (n = 0; n < ndups; n++) { | |
9083 | printf("%s %d\n", dup_name[n], dup_num[n]) | |
9084 | } | |
9085 | } | |
9086 | EOP | |
9087 | $cat >signal_cmd <<EOS | |
8e07c86e AD |
9088 | $startsh |
9089 | $test -s signal.lst && exit 0 | |
9090 | if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then | |
4633a7c4 | 9091 | ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst |
8e07c86e AD |
9092 | else |
9093 | echo "(I can't seem be able to compile the test program -- Guessing)" | |
9094 | echo 'kill -l' >signal | |
9095 | set X \`csh -f <signal\` | |
9096 | $rm -f signal | |
2304df62 | 9097 | shift |
8e07c86e AD |
9098 | case \$# in |
9099 | 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; | |
2304df62 | 9100 | esac |
8e07c86e AD |
9101 | echo \$@ | $tr ' ' '\012' | \ |
9102 | $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst | |
9103 | fi | |
9104 | $rm -f signal.c signal signal.o | |
9105 | EOS | |
4633a7c4 LW |
9106 | chmod a+x signal_cmd |
9107 | $eunicefix signal_cmd | |
8e07c86e AD |
9108 | |
9109 | : generate list of signal names | |
9110 | echo " " | |
9111 | case "$sig_name" in | |
4633a7c4 LW |
9112 | '') sig_num='' ;; |
9113 | esac | |
9114 | case "$sig_num" in | |
9115 | '') sig_name='' ;; | |
9116 | esac | |
9117 | case "$sig_name" in | |
8e07c86e | 9118 | '') |
4633a7c4 LW |
9119 | echo "Generating a list of signal names and numbers..." >&4 |
9120 | ./signal_cmd | |
8e07c86e AD |
9121 | sig_name=`$awk '{printf "%s ", $1}' signal.lst` |
9122 | sig_name="ZERO $sig_name" | |
4633a7c4 LW |
9123 | sig_num=`$awk '{printf "%d ", $2}' signal.lst` |
9124 | sig_num="0 $sig_num" | |
a0d0e21e | 9125 | ;; |
2304df62 | 9126 | esac |
a0d0e21e LW |
9127 | echo "The following signals are available:" |
9128 | echo " " | |
9129 | echo $sig_name | $awk \ | |
9130 | 'BEGIN { linelen = 0 } | |
9131 | { | |
8e07c86e | 9132 | for (i = 1; i <= NF; i++) { |
a0d0e21e LW |
9133 | name = "SIG" $i " " |
9134 | linelen = linelen + length(name) | |
9135 | if (linelen > 70) { | |
9136 | printf "\n" | |
9137 | linelen = length(name) | |
9138 | } | |
9139 | printf "%s", name | |
9140 | } | |
8e07c86e | 9141 | printf "\n" |
a0d0e21e | 9142 | }' |
4633a7c4 | 9143 | $rm -f signal signal.c signal.awk signal.lst signal_cmd |
a0d0e21e LW |
9144 | |
9145 | : see what type is used for size_t | |
9146 | set size_t sizetype 'unsigned int' stdio.h sys/types.h | |
9147 | eval $typedef | |
9148 | dflt="$sizetype" | |
9149 | echo " " | |
9150 | rp="What type is used for the length parameter for string functions?" | |
2304df62 | 9151 | . ./myread |
a0d0e21e LW |
9152 | sizetype="$ans" |
9153 | ||
9154 | : see what type is used for signed size_t | |
9155 | set ssize_t ssizetype int stdio.h sys/types.h | |
9156 | eval $typedef | |
9157 | dflt="$ssizetype" | |
9158 | $cat > ssize.c <<EOM | |
9159 | #include <stdio.h> | |
9160 | #include <sys/types.h> | |
9161 | #define Size_t $sizetype | |
9162 | #define SSize_t $dflt | |
9163 | main() | |
9164 | { | |
9165 | if (sizeof(Size_t) == sizeof(SSize_t)) | |
9166 | printf("$dflt\n"); | |
9167 | else if (sizeof(Size_t) == sizeof(int)) | |
9168 | printf("int\n"); | |
9169 | else | |
9170 | printf("long\n"); | |
d97d40b5 | 9171 | fflush(stdout); |
760ac839 | 9172 | exit(0); |
a0d0e21e LW |
9173 | } |
9174 | EOM | |
9175 | echo " " | |
24fef2a7 AD |
9176 | # If $libs contains -lsfio, and sfio is mis-configured, then it |
9177 | # sometimes (apparently) runs and exits with a 0 status, but with no | |
9178 | # output!. Thus we check with test -s whether we actually got any | |
9179 | # output. I think it has to do with sfio's use of _exit vs. exit, | |
9180 | # but I don't know for sure. --Andy Dougherty 1/27/97. | |
9181 | if $cc $optimize $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 && | |
9182 | ./ssize > ssize.out 2>/dev/null && test -s ssize.out ; then | |
9183 | ssizetype=`$cat ssize.out` | |
a0d0e21e LW |
9184 | echo "I'll be using $ssizetype for functions returning a byte count." >&4 |
9185 | else | |
24fef2a7 AD |
9186 | $cat >&4 <<EOM |
9187 | ||
9188 | Help! I can't compile and run the ssize_t test program: please enlighten me! | |
9189 | (This is probably a misconfiguration in your system or libraries, and | |
9190 | you really ought to fix it. Still, I'll try anyway.) | |
a0d0e21e LW |
9191 | |
9192 | I need a type that is the same size as $sizetype, but is guaranteed to | |
24fef2a7 | 9193 | be signed. Common values are ssize_t, int and long. |
a0d0e21e LW |
9194 | |
9195 | EOM | |
9196 | rp="What signed type is the same size as $sizetype?" | |
9197 | . ./myread | |
9198 | ssizetype="$ans" | |
9199 | fi | |
24fef2a7 | 9200 | $rm -f ssize ssize.[co] ssize.out |
a0d0e21e LW |
9201 | |
9202 | : see what type of char stdio uses. | |
9203 | echo " " | |
9204 | if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then | |
9205 | echo "Your stdio uses unsigned chars." >&4 | |
9206 | stdchar="unsigned char" | |
9207 | else | |
9208 | echo "Your stdio uses signed chars." >&4 | |
9209 | stdchar="char" | |
9210 | fi | |
9211 | ||
9212 | : see if time exists | |
9213 | echo " " | |
ecfc5424 | 9214 | if set time val -f d_time; eval $csym; $val; then |
a0d0e21e | 9215 | echo 'time() found.' >&4 |
ecfc5424 | 9216 | val="$define" |
a0d0e21e LW |
9217 | set time_t timetype long stdio.h sys/types.h |
9218 | eval $typedef | |
9219 | dflt="$timetype" | |
9220 | echo " " | |
c2960299 | 9221 | rp="What type is returned by time() on this system?" |
a0d0e21e LW |
9222 | . ./myread |
9223 | timetype="$ans" | |
9224 | else | |
9225 | echo 'time() not found, hope that will do.' >&4 | |
ecfc5424 | 9226 | val="$undef" |
a0d0e21e LW |
9227 | timetype='int'; |
9228 | fi | |
a0d0e21e LW |
9229 | set d_time |
9230 | eval $setvar | |
9231 | ||
9232 | : see what type uids are declared as in the kernel | |
9233 | set uid_t uidtype xxx stdio.h sys/types.h | |
9234 | eval $typedef | |
9235 | case "$uidtype" in | |
9236 | xxx) | |
9237 | xxx=`./findhdr sys/user.h` | |
9238 | set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short | |
9239 | case $1 in | |
9240 | unsigned) dflt="$1 $2" ;; | |
9241 | *) dflt="$1" ;; | |
9242 | esac | |
9243 | ;; | |
4633a7c4 LW |
9244 | *) dflt="$uidtype";; |
9245 | esac | |
9246 | echo " " | |
9247 | rp="What is the type for user ids returned by getuid()?" | |
9248 | . ./myread | |
9249 | uidtype="$ans" | |
9250 | ||
9251 | : see if dbm.h is available | |
9252 | : see if dbmclose exists | |
9253 | set dbmclose d_dbmclose | |
9254 | eval $inlibc | |
9255 | ||
9256 | case "$d_dbmclose" in | |
9257 | $define) | |
9258 | set dbm.h i_dbm | |
9259 | eval $inhdr | |
9260 | case "$i_dbm" in | |
9261 | $define) | |
9262 | val="$undef" | |
9263 | set i_rpcsvcdbm | |
9264 | eval $setvar | |
9265 | ;; | |
9266 | *) set rpcsvc/dbm.h i_rpcsvcdbm | |
9267 | eval $inhdr | |
9268 | ;; | |
9269 | esac | |
9270 | ;; | |
9271 | *) echo "We won't be including <dbm.h>" | |
9272 | val="$undef" | |
9273 | set i_dbm | |
9274 | eval $setvar | |
9275 | val="$undef" | |
9276 | set i_rpcsvcdbm | |
9277 | eval $setvar | |
9278 | ;; | |
a0d0e21e | 9279 | esac |
2304df62 | 9280 | |
2304df62 AD |
9281 | : see if this is a sys/file.h system |
9282 | val='' | |
9283 | set sys/file.h val | |
9284 | eval $inhdr | |
9285 | ||
8e07c86e | 9286 | : do we need to include sys/file.h ? |
2304df62 AD |
9287 | case "$val" in |
9288 | "$define") | |
9289 | echo " " | |
9290 | if $h_sysfile; then | |
9291 | val="$define" | |
9292 | echo "We'll be including <sys/file.h>." >&4 | |
9293 | else | |
9294 | val="$undef" | |
9295 | echo "We won't be including <sys/file.h>." >&4 | |
9296 | fi | |
9297 | ;; | |
9298 | *) | |
9299 | h_sysfile=false | |
9300 | ;; | |
9301 | esac | |
9302 | set i_sysfile | |
9303 | eval $setvar | |
9304 | ||
9305 | : see if fcntl.h is there | |
9306 | val='' | |
9307 | set fcntl.h val | |
9308 | eval $inhdr | |
9309 | ||
9310 | : see if we can include fcntl.h | |
9311 | case "$val" in | |
9312 | "$define") | |
9313 | echo " " | |
9314 | if $h_fcntl; then | |
9315 | val="$define" | |
9316 | echo "We'll be including <fcntl.h>." >&4 | |
9317 | else | |
9318 | val="$undef" | |
9319 | if $h_sysfile; then | |
9320 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 | |
9321 | else | |
9322 | echo "We won't be including <fcntl.h>." >&4 | |
9323 | fi | |
9324 | fi | |
9325 | ;; | |
9326 | *) | |
9327 | h_fcntl=false | |
9328 | val="$undef" | |
9329 | ;; | |
9330 | esac | |
9331 | set i_fcntl | |
9332 | eval $setvar | |
9333 | ||
2304df62 AD |
9334 | : see if this is an grp system |
9335 | set grp.h i_grp | |
9336 | eval $inhdr | |
9337 | ||
4633a7c4 LW |
9338 | : see if locale.h is available |
9339 | set locale.h i_locale | |
9340 | eval $inhdr | |
9341 | ||
a0d0e21e LW |
9342 | : see if this is a math.h system |
9343 | set math.h i_math | |
9344 | eval $inhdr | |
9345 | ||
4633a7c4 LW |
9346 | : see if ndbm.h is available |
9347 | set ndbm.h t_ndbm | |
9348 | eval $inhdr | |
9349 | case "$t_ndbm" in | |
9350 | $define) | |
9351 | : see if dbm_open exists | |
9352 | set dbm_open d_dbm_open | |
9353 | eval $inlibc | |
9354 | case "$d_dbm_open" in | |
9355 | $undef) | |
9356 | t_ndbm="$undef" | |
9357 | echo "We won't be including <ndbm.h>" | |
9358 | ;; | |
9359 | esac | |
9360 | ;; | |
9361 | esac | |
9362 | val="$t_ndbm" | |
9363 | set i_ndbm | |
9364 | eval $setvar | |
9365 | ||
85e6fe83 | 9366 | : see if net/errno.h is available |
a0d0e21e LW |
9367 | val='' |
9368 | set net/errno.h val | |
2304df62 | 9369 | eval $inhdr |
a0d0e21e | 9370 | |
85e6fe83 | 9371 | : Unfortunately, it causes problems on some systems. Arrgh. |
a0d0e21e LW |
9372 | case "$val" in |
9373 | $define) | |
9374 | cat > try.c <<'EOM' | |
85e6fe83 LW |
9375 | #include <stdio.h> |
9376 | #include <errno.h> | |
9377 | #include <net/errno.h> | |
9378 | int func() | |
9379 | { | |
a0d0e21e | 9380 | return ENOTSOCK; |
85e6fe83 LW |
9381 | } |
9382 | EOM | |
a0d0e21e LW |
9383 | if $cc $ccflags -c try.c >/dev/null 2>&1; then |
9384 | echo "We'll be including <net/errno.h>." >&4 | |
9385 | else | |
9386 | echo "We won't be including <net/errno.h>." >&4 | |
9387 | val="$undef" | |
9388 | fi | |
9389 | $rm -f try.* try | |
9390 | ;; | |
85e6fe83 | 9391 | esac |
a0d0e21e LW |
9392 | set i_neterrno |
9393 | eval $setvar | |
2304df62 AD |
9394 | |
9395 | : get C preprocessor symbols handy | |
9396 | echo " " | |
ecfc5424 | 9397 | $echo $n "Hmm... $c" |
a0d0e21e | 9398 | echo $al | $tr ' ' '\012' >Cppsym.know |
2304df62 AD |
9399 | $cat <<EOSS >Cppsym |
9400 | $startsh | |
9401 | case "\$1" in | |
9402 | -l) list=true | |
9403 | shift | |
9404 | ;; | |
9405 | esac | |
9406 | unknown='' | |
9407 | case "\$list\$#" in | |
9408 | 1|2) | |
9409 | for sym do | |
9410 | if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then | |
9411 | exit 0 | |
9412 | elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then | |
9413 | : | |
9414 | else | |
9415 | unknown="\$unknown \$sym" | |
9416 | fi | |
9417 | done | |
9418 | set X \$unknown | |
9419 | shift | |
9420 | ;; | |
9421 | esac | |
9422 | case \$# in | |
9423 | 0) exit 1;; | |
9424 | esac | |
9425 | echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\ | |
9426 | #ifdef \1\\ | |
9427 | exit 0; _ _ _ _\1\\ \1\\ | |
9428 | #endif\\ | |
9429 | /' >Cppsym\$\$ | |
9430 | echo "exit 1; _ _ _" >>Cppsym\$\$ | |
9431 | $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$ | |
9432 | case "\$list" in | |
9433 | true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;; | |
9434 | *) | |
9435 | sh Cppsym2\$\$ | |
9436 | status=\$? | |
9437 | ;; | |
9438 | esac | |
9439 | $rm -f Cppsym\$\$ Cppsym2\$\$ | |
9440 | exit \$status | |
9441 | EOSS | |
9442 | chmod +x Cppsym | |
9443 | $eunicefix Cppsym | |
ecfc5424 AD |
9444 | ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true |
9445 | ||
9446 | : now check the C compiler for additional symbols | |
9447 | $cat >ccsym <<EOS | |
9448 | $startsh | |
9449 | $cat >tmp.c <<EOF | |
9450 | extern int foo; | |
9451 | EOF | |
9452 | for i in \`$cc -v -c tmp.c 2>&1\` | |
9453 | do | |
9454 | case "\$i" in | |
9455 | -D*) echo "\$i" | $sed 's/^-D//';; | |
9456 | -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';; | |
9457 | esac | |
9458 | done | |
9459 | $rm -f try.c | |
9460 | EOS | |
9461 | chmod +x ccsym | |
9462 | $eunicefix ccsym | |
9463 | ./ccsym | $sort | $uniq >ccsym.raw | |
f0b7e567 AD |
9464 | $awk '/\=/ { print $0; next } |
9465 | { print $0"=1" }' ccsym.raw >ccsym.list | |
ecfc5424 AD |
9466 | $awk '{ print $0"=1" }' Cppsym.true >ccsym.true |
9467 | $comm -13 ccsym.true ccsym.list >ccsym.own | |
9468 | $comm -12 ccsym.true ccsym.list >ccsym.com | |
9469 | $comm -23 ccsym.true ccsym.list >ccsym.cpp | |
9470 | also='' | |
9471 | symbols='symbols' | |
9472 | if $test -z ccsym.raw; then | |
9473 | echo "Your C compiler doesn't seem to define any symbol!" >&4 | |
9474 | echo " " | |
9475 | echo "However, your C preprocessor defines the following ones:" | |
9476 | $cat Cppsym.true | |
9477 | else | |
9478 | if $test -s ccsym.com; then | |
9479 | echo "Your C compiler and pre-processor define these symbols:" | |
9480 | $sed -e 's/\(.*\)=.*/\1/' ccsym.com | |
9481 | also='also ' | |
9482 | symbols='ones' | |
9483 | $test "$silent" || sleep 1 | |
9484 | fi | |
9485 | if $test -s ccsym.cpp; then | |
9486 | $test "$also" && echo " " | |
9487 | echo "Your C pre-processor ${also}defines the following $symbols:" | |
9488 | $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp | |
9489 | also='further ' | |
9490 | $test "$silent" || sleep 1 | |
9491 | fi | |
9492 | if $test -s ccsym.own; then | |
9493 | $test "$also" && echo " " | |
9494 | echo "Your C compiler ${also}defines the following cpp variables:" | |
9495 | $sed -e 's/\(.*\)=1/\1/' ccsym.own | |
9496 | $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true | |
9497 | $test "$silent" || sleep 1 | |
9498 | fi | |
9499 | fi | |
9500 | $rm -f ccsym* | |
2304df62 AD |
9501 | |
9502 | : see if this is a termio system | |
9503 | val="$undef" | |
9504 | val2="$undef" | |
9505 | val3="$undef" | |
9506 | if $test `./findhdr termios.h`; then | |
9507 | set tcsetattr i_termios | |
9508 | eval $inlibc | |
9509 | val3="$i_termios" | |
9510 | fi | |
9511 | echo " " | |
9512 | case "$val3" in | |
9513 | "$define") echo "You have POSIX termios.h... good!" >&4;; | |
ecfc5424 | 9514 | *) if ./Cppsym pyr; then |
2304df62 AD |
9515 | case "`/bin/universe`" in |
9516 | ucb) if $test `./findhdr sgtty.h`; then | |
9517 | val2="$define" | |
9518 | echo "<sgtty.h> found." >&4 | |
9519 | else | |
9520 | echo "System is pyramid with BSD universe." | |
9521 | echo "<sgtty.h> not found--you could have problems." >&4 | |
9522 | fi;; | |
9523 | *) if $test `./findhdr termio.h`; then | |
9524 | val="$define" | |
9525 | echo "<termio.h> found." >&4 | |
9526 | else | |
9527 | echo "System is pyramid with USG universe." | |
9528 | echo "<termio.h> not found--you could have problems." >&4 | |
9529 | fi;; | |
9530 | esac | |
ecfc5424 | 9531 | elif ./usg; then |
2304df62 AD |
9532 | if $test `./findhdr termio.h`; then |
9533 | echo "<termio.h> found." >&4 | |
9534 | val="$define" | |
9535 | elif $test `./findhdr sgtty.h`; then | |
9536 | echo "<sgtty.h> found." >&4 | |
9537 | val2="$define" | |
9538 | else | |
9539 | echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4 | |
9540 | fi | |
9541 | else | |
9542 | if $test `./findhdr sgtty.h`; then | |
9543 | echo "<sgtty.h> found." >&4 | |
9544 | val2="$define" | |
9545 | elif $test `./findhdr termio.h`; then | |
9546 | echo "<termio.h> found." >&4 | |
9547 | val="$define" | |
9548 | else | |
9549 | echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4 | |
9550 | fi | |
9551 | fi;; | |
9552 | esac | |
9553 | set i_termio; eval $setvar | |
9554 | val=$val2; set i_sgtty; eval $setvar | |
9555 | val=$val3; set i_termios; eval $setvar | |
9556 | ||
a0d0e21e | 9557 | : see if stdarg is available |
2304df62 | 9558 | echo " " |
a0d0e21e LW |
9559 | if $test `./findhdr stdarg.h`; then |
9560 | echo "<stdarg.h> found." >&4 | |
9561 | valstd="$define" | |
2304df62 | 9562 | else |
a0d0e21e LW |
9563 | echo "<stdarg.h> NOT found." >&4 |
9564 | valstd="$undef" | |
2304df62 | 9565 | fi |
85e6fe83 | 9566 | |
a0d0e21e | 9567 | : see if varags is available |
2304df62 AD |
9568 | echo " " |
9569 | if $test `./findhdr varargs.h`; then | |
2304df62 AD |
9570 | echo "<varargs.h> found." >&4 |
9571 | else | |
2304df62 AD |
9572 | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 |
9573 | fi | |
2304df62 AD |
9574 | |
9575 | : set up the varargs testing programs | |
9576 | $cat > varargs.c <<EOP | |
9577 | #ifdef I_STDARG | |
9578 | #include <stdarg.h> | |
9579 | #endif | |
9580 | #ifdef I_VARARGS | |
9581 | #include <varargs.h> | |
9582 | #endif | |
9583 | ||
9584 | #ifdef I_STDARG | |
9585 | int f(char *p, ...) | |
9586 | #else | |
9587 | int f(va_alist) | |
9588 | va_dcl | |
9589 | #endif | |
9590 | { | |
9591 | va_list ap; | |
9592 | #ifndef I_STDARG | |
9593 | char *p; | |
9594 | #endif | |
9595 | #ifdef I_STDARG | |
9596 | va_start(ap,p); | |
9597 | #else | |
9598 | va_start(ap); | |
9599 | p = va_arg(ap, char *); | |
9600 | #endif | |
9601 | va_end(ap); | |
9602 | } | |
9603 | EOP | |
9604 | $cat > varargs <<EOP | |
40a7a20a | 9605 | $startsh |
2304df62 AD |
9606 | if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then |
9607 | echo "true" | |
9608 | else | |
9609 | echo "false" | |
9610 | fi | |
9611 | $rm -f varargs.o | |
9612 | EOP | |
9613 | chmod +x varargs | |
9614 | ||
9615 | : now check which varargs header should be included | |
9616 | echo " " | |
9617 | i_varhdr='' | |
a0d0e21e | 9618 | case "$valstd" in |
2304df62 AD |
9619 | "$define") |
9620 | if `./varargs I_STDARG`; then | |
a0d0e21e | 9621 | val='stdarg.h' |
2304df62 | 9622 | elif `./varargs I_VARARGS`; then |
a0d0e21e | 9623 | val='varargs.h' |
2304df62 AD |
9624 | fi |
9625 | ;; | |
9626 | *) | |
9627 | if `./varargs I_VARARGS`; then | |
a0d0e21e | 9628 | val='varargs.h' |
2304df62 AD |
9629 | fi |
9630 | ;; | |
9631 | esac | |
a0d0e21e | 9632 | case "$val" in |
2304df62 AD |
9633 | '') |
9634 | echo "I could not find the definition for va_dcl... You have problems..." >&4 | |
a0d0e21e LW |
9635 | val="$undef"; set i_stdarg; eval $setvar |
9636 | val="$undef"; set i_varargs; eval $setvar | |
2304df62 | 9637 | ;; |
a0d0e21e LW |
9638 | *) |
9639 | set i_varhdr | |
9640 | eval $setvar | |
9641 | case "$i_varhdr" in | |
9642 | stdarg.h) | |
9643 | val="$define"; set i_stdarg; eval $setvar | |
9644 | val="$undef"; set i_varargs; eval $setvar | |
9645 | ;; | |
9646 | varargs.h) | |
9647 | val="$undef"; set i_stdarg; eval $setvar | |
9648 | val="$define"; set i_varargs; eval $setvar | |
9649 | ;; | |
9650 | esac | |
9651 | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; | |
2304df62 AD |
9652 | esac |
9653 | $rm -f varargs* | |
9654 | ||
a0d0e21e LW |
9655 | : see if stddef is available |
9656 | set stddef.h i_stddef | |
9657 | eval $inhdr | |
9658 | ||
a0d0e21e LW |
9659 | : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl |
9660 | set sys/filio.h i_sysfilio | |
9661 | eval $inhdr | |
9662 | echo " " | |
9663 | if $test `./findhdr sys/ioctl.h`; then | |
9664 | val="$define" | |
9665 | echo '<sys/ioctl.h> found.' >&4 | |
9666 | else | |
9667 | val="$undef" | |
9668 | if $test $i_sysfilio = "$define"; then | |
9669 | echo '<sys/ioctl.h> NOT found.' >&4 | |
9670 | else | |
9671 | $test $i_sgtty = "$define" && xxx="sgtty.h" | |
9672 | $test $i_termio = "$define" && xxx="termio.h" | |
9673 | $test $i_termios = "$define" && xxx="termios.h" | |
9674 | echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4 | |
9675 | fi | |
9676 | fi | |
9677 | set i_sysioctl | |
9678 | eval $setvar | |
9679 | ||
9680 | : see if this is a sys/param system | |
9681 | set sys/param.h i_sysparam | |
9682 | eval $inhdr | |
9683 | ||
8ff267be | 9684 | : see if sys/resource.h has to be included |
9685 | set sys/resource.h i_sysresrc | |
9686 | eval $inhdr | |
9687 | ||
1aef975c AD |
9688 | : see if sys/stat.h is available |
9689 | set sys/stat.h i_sysstat | |
9690 | eval $inhdr | |
9691 | ||
fed7345c AD |
9692 | : see if sys/types.h has to be included |
9693 | set sys/types.h i_systypes | |
9694 | eval $inhdr | |
9695 | ||
25f94b33 AD |
9696 | : see if this is a sys/un.h system |
9697 | set sys/un.h i_sysun | |
9698 | eval $inhdr | |
9699 | ||
8ff267be | 9700 | : see if this is a syswait system |
9701 | set sys/wait.h i_syswait | |
a0d0e21e LW |
9702 | eval $inhdr |
9703 | ||
9704 | : see if this is an utime system | |
9705 | set utime.h i_utime | |
9706 | eval $inhdr | |
9707 | ||
760ac839 LW |
9708 | : see if this is a values.h system |
9709 | set values.h i_values | |
9710 | eval $inhdr | |
9711 | ||
2304df62 | 9712 | : see if this is a vfork system |
85e6fe83 | 9713 | case "$d_vfork" in |
a0d0e21e LW |
9714 | "$define") |
9715 | set vfork.h i_vfork | |
85e6fe83 LW |
9716 | eval $inhdr |
9717 | ;; | |
a0d0e21e LW |
9718 | *) |
9719 | i_vfork="$undef" | |
9720 | ;; | |
85e6fe83 | 9721 | esac |
a0d0e21e | 9722 | |
4633a7c4 LW |
9723 | : see if gdbm.h is available |
9724 | set gdbm.h t_gdbm | |
9725 | eval $inhdr | |
9726 | case "$t_gdbm" in | |
9727 | $define) | |
9728 | : see if gdbm_open exists | |
9729 | set gdbm_open d_gdbm_open | |
9730 | eval $inlibc | |
9731 | case "$d_gdbm_open" in | |
9732 | $undef) | |
9733 | t_gdbm="$undef" | |
9734 | echo "We won't be including <gdbm.h>" | |
9735 | ;; | |
9736 | esac | |
9737 | ;; | |
9738 | esac | |
9739 | val="$t_gdbm" | |
9740 | set i_gdbm | |
9741 | eval $setvar | |
9742 | ||
9743 | echo " " | |
9744 | echo "Looking for extensions..." >&4 | |
9745 | cd ../ext | |
9746 | : If we are using the old config.sh, known_extensions may contain | |
9747 | : old or inaccurate or duplicate values. | |
9748 | known_extensions='' | |
9749 | : We do not use find because it might not be available. | |
9750 | : We do not just use MANIFEST because the user may have dropped | |
9751 | : some additional extensions into the source tree and expect them | |
9752 | : to be built. | |
9753 | for xxx in * ; do | |
5f05dabc | 9754 | case "$xxx" in |
9755 | DynaLoader) ;; | |
9756 | *) if $test -f $xxx/$xxx.xs; then | |
9757 | known_extensions="$known_extensions $xxx" | |
9758 | else | |
9759 | if $test -d $xxx; then | |
9760 | cd $xxx | |
9761 | for yyy in * ; do | |
9762 | if $test -f $yyy/$yyy.xs; then | |
9763 | known_extensions="$known_extensions $xxx/$yyy" | |
9764 | fi | |
9765 | done | |
9766 | cd .. | |
9767 | fi | |
9768 | fi ;; | |
9769 | esac | |
4633a7c4 LW |
9770 | done |
9771 | set X $known_extensions | |
9772 | shift | |
9773 | known_extensions="$*" | |
9774 | cd ../UU | |
9775 | ||
9776 | : Now see which are supported on this system. | |
9777 | avail_ext='' | |
9778 | for xxx in $known_extensions ; do | |
9779 | case "$xxx" in | |
9780 | DB_File) case "$i_db" in | |
9781 | $define) avail_ext="$avail_ext $xxx" ;; | |
9782 | esac | |
9783 | ;; | |
9784 | GDBM_File) case "$i_gdbm" in | |
9785 | $define) avail_ext="$avail_ext $xxx" ;; | |
9786 | esac | |
9787 | ;; | |
9788 | NDBM_File) case "$i_ndbm" in | |
9789 | $define) avail_ext="$avail_ext $xxx" ;; | |
9790 | esac | |
9791 | ;; | |
9792 | ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in | |
9793 | *"${define}"*) avail_ext="$avail_ext $xxx" ;; | |
9794 | esac | |
9795 | ;; | |
9796 | POSIX) case "$useposix" in | |
9797 | true|define|y) avail_ext="$avail_ext $xxx" ;; | |
9798 | esac | |
9799 | ;; | |
8ff267be | 9800 | Opcode) case "$useopcode" in |
2c7991dc | 9801 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
9802 | esac | |
9803 | ;; | |
4633a7c4 LW |
9804 | Socket) case "$d_socket" in |
9805 | $define) avail_ext="$avail_ext $xxx" ;; | |
9806 | esac | |
9807 | ;; | |
9808 | *) avail_ext="$avail_ext $xxx" | |
9809 | ;; | |
9810 | esac | |
9811 | done | |
9812 | ||
9813 | set X $avail_ext | |
9814 | shift | |
9815 | avail_ext="$*" | |
9816 | ||
9817 | case $usedl in | |
9818 | $define) | |
9819 | $cat <<EOM | |
9820 | A number of extensions are supplied with $package. You may choose to | |
9821 | compile these extensions for dynamic loading (the default), compile | |
9822 | them into the $package executable (static loading), or not include | |
9823 | them at all. Answer "none" to include no extensions. | |
9824 | ||
9825 | EOM | |
9826 | case "$dynamic_ext" in | |
9827 | '') dflt="$avail_ext" ;; | |
9828 | *) dflt="$dynamic_ext" ;; | |
9829 | esac | |
9830 | case "$dflt" in | |
9831 | '') dflt=none;; | |
9832 | esac | |
9833 | rp="What extensions do you wish to load dynamically?" | |
9834 | . ./myread | |
9835 | case "$ans" in | |
9836 | none) dynamic_ext=' ' ;; | |
9837 | *) dynamic_ext="$ans" ;; | |
9838 | esac | |
9839 | ||
9840 | case "$static_ext" in | |
9841 | '') | |
9842 | : Exclude those already listed in dynamic linking | |
9843 | dflt='' | |
9844 | for xxx in $avail_ext; do | |
9845 | case " $dynamic_ext " in | |
9846 | *" $xxx "*) ;; | |
9847 | *) dflt="$dflt $xxx" ;; | |
9848 | esac | |
9849 | done | |
9850 | set X $dflt | |
9851 | shift | |
9852 | dflt="$*" | |
9853 | ;; | |
9854 | *) dflt="$static_ext" | |
9855 | ;; | |
9856 | esac | |
9857 | ||
9858 | case "$dflt" in | |
9859 | '') dflt=none;; | |
9860 | esac | |
9861 | rp="What extensions do you wish to load statically?" | |
9862 | . ./myread | |
9863 | case "$ans" in | |
9864 | none) static_ext=' ' ;; | |
9865 | *) static_ext="$ans" ;; | |
9866 | esac | |
9867 | ;; | |
9868 | *) | |
9869 | $cat <<EOM | |
9870 | A number of extensions are supplied with $package. Answer "none" | |
9871 | to include no extensions. | |
9872 | ||
9873 | EOM | |
9874 | case "$static_ext" in | |
9875 | '') dflt="$avail_ext" ;; | |
9876 | *) dflt="$static_ext" ;; | |
9877 | esac | |
9878 | ||
9879 | case "$dflt" in | |
9880 | '') dflt=none;; | |
9881 | esac | |
9882 | rp="What extensions do you wish to include?" | |
9883 | . ./myread | |
9884 | case "$ans" in | |
9885 | none) static_ext=' ' ;; | |
9886 | *) static_ext="$ans" ;; | |
9887 | esac | |
9888 | ;; | |
9889 | esac | |
9890 | ||
9891 | set X $dynamic_ext $static_ext | |
9892 | shift | |
9893 | extensions="$*" | |
9894 | ||
16d20bd9 AD |
9895 | : Remove build directory name from cppstdin so it can be used from |
9896 | : either the present location or the final installed location. | |
9897 | echo " " | |
9898 | : Get out of the UU directory to get correct path name. | |
9899 | cd .. | |
9900 | case "$cppstdin" in | |
9901 | `pwd`/cppstdin) | |
9902 | echo "Stripping down cppstdin path name" | |
9903 | cppstdin=cppstdin | |
9904 | ;; | |
9905 | esac | |
9906 | cd UU | |
9907 | ||
2304df62 AD |
9908 | : end of configuration questions |
9909 | echo " " | |
9910 | echo "End of configuration questions." | |
9911 | echo " " | |
9912 | ||
9913 | : back to where it started | |
9914 | if test -d ../UU; then | |
9915 | cd .. | |
9916 | fi | |
9917 | ||
9918 | : configuration may be patched via a 'config.over' file | |
9919 | if $test -f config.over; then | |
9920 | echo " " | |
9921 | dflt=y | |
9922 | rp='I see a config.over file. Do you wish to load it?' | |
9923 | . UU/myread | |
9924 | case "$ans" in | |
9925 | n*) echo "OK, I'll ignore it.";; | |
9926 | *) . ./config.over | |
9927 | echo "Configuration override changes have been loaded." | |
9928 | ;; | |
9929 | esac | |
9930 | fi | |
9931 | ||
ecfc5424 AD |
9932 | : in case they want portability, strip down executable paths |
9933 | case "$d_portable" in | |
9934 | "$define") | |
9935 | echo " " | |
9936 | echo "Stripping down executable paths..." >&4 | |
9937 | for file in $loclist $trylist; do | |
9938 | eval $file="\$file" | |
9939 | done | |
9940 | ;; | |
9941 | esac | |
9942 | ||
2304df62 AD |
9943 | : create config.sh file |
9944 | echo " " | |
9945 | echo "Creating config.sh..." >&4 | |
9946 | $spitshell <<EOT >config.sh | |
9947 | $startsh | |
9948 | # | |
5cd24f17 | 9949 | # This file was produced by running the Configure script. It holds all |
9950 | # the definitions figured out by Configure. Should you modify any of | |
9951 | # these values, do not forget to propagate your changes by running | |
9952 | # "Configure -S"; or, equivalently, you may run each .SH file yourself. | |
2304df62 AD |
9953 | # |
9954 | ||
9955 | # Configuration time: $cf_time | |
9956 | # Configured by: $cf_by | |
9957 | # Target system: $myuname | |
9958 | ||
2304df62 AD |
9959 | Author='$Author' |
9960 | Date='$Date' | |
9961 | Header='$Header' | |
9962 | Id='$Id' | |
9963 | Locker='$Locker' | |
9964 | Log='$Log' | |
ecfc5424 | 9965 | Mcc='$Mcc' |
2304df62 AD |
9966 | RCSfile='$RCSfile' |
9967 | Revision='$Revision' | |
9968 | Source='$Source' | |
9969 | State='$State' | |
9970 | afs='$afs' | |
a0d0e21e | 9971 | alignbytes='$alignbytes' |
ecfc5424 | 9972 | aphostname='$aphostname' |
4633a7c4 | 9973 | ar='$ar' |
a0d0e21e LW |
9974 | archlib='$archlib' |
9975 | archlibexp='$archlibexp' | |
9976 | archname='$archname' | |
4633a7c4 | 9977 | archobjs='$archobjs' |
ecfc5424 AD |
9978 | awk='$awk' |
9979 | baserev='$baserev' | |
9980 | bash='$bash' | |
2304df62 | 9981 | bin='$bin' |
5f05dabc | 9982 | bincompat3='$bincompat3' |
2304df62 | 9983 | binexp='$binexp' |
ecfc5424 AD |
9984 | bison='$bison' |
9985 | byacc='$byacc' | |
2304df62 | 9986 | byteorder='$byteorder' |
ecfc5424 AD |
9987 | c='$c' |
9988 | castflags='$castflags' | |
9989 | cat='$cat' | |
2304df62 | 9990 | cc='$cc' |
ecfc5424 AD |
9991 | cccdlflags='$cccdlflags' |
9992 | ccdlflags='$ccdlflags' | |
2304df62 | 9993 | ccflags='$ccflags' |
2304df62 | 9994 | cf_by='$cf_by' |
8e07c86e | 9995 | cf_email='$cf_email' |
2304df62 | 9996 | cf_time='$cf_time' |
ecfc5424 AD |
9997 | chgrp='$chgrp' |
9998 | chmod='$chmod' | |
9999 | chown='$chown' | |
10000 | clocktype='$clocktype' | |
10001 | comm='$comm' | |
10002 | compress='$compress' | |
2304df62 | 10003 | contains='$contains' |
ecfc5424 AD |
10004 | cp='$cp' |
10005 | cpio='$cpio' | |
10006 | cpp='$cpp' | |
a0d0e21e | 10007 | cpp_stuff='$cpp_stuff' |
ecfc5424 | 10008 | cppflags='$cppflags' |
2304df62 AD |
10009 | cpplast='$cpplast' |
10010 | cppminus='$cppminus' | |
10011 | cpprun='$cpprun' | |
10012 | cppstdin='$cppstdin' | |
ecfc5424 AD |
10013 | cryptlib='$cryptlib' |
10014 | csh='$csh' | |
10015 | d_Gconvert='$d_Gconvert' | |
2304df62 | 10016 | d_access='$d_access' |
a0d0e21e | 10017 | d_alarm='$d_alarm' |
ecfc5424 AD |
10018 | d_archlib='$d_archlib' |
10019 | d_attribut='$d_attribut' | |
2304df62 AD |
10020 | d_bcmp='$d_bcmp' |
10021 | d_bcopy='$d_bcopy' | |
5f05dabc | 10022 | d_bincompat3='$d_bincompat3' |
ecfc5424 | 10023 | d_bsd='$d_bsd' |
2afac517 | 10024 | d_bsdgetpgrp='$d_bsdgetpgrp' |
ecfc5424 | 10025 | d_bsdpgrp='$d_bsdpgrp' |
2afac517 | 10026 | d_bsdsetpgrp='$d_bsdsetpgrp' |
2304df62 AD |
10027 | d_bzero='$d_bzero' |
10028 | d_casti32='$d_casti32' | |
2304df62 | 10029 | d_castneg='$d_castneg' |
ecfc5424 | 10030 | d_charvspr='$d_charvspr' |
a0d0e21e LW |
10031 | d_chown='$d_chown' |
10032 | d_chroot='$d_chroot' | |
2304df62 | 10033 | d_chsize='$d_chsize' |
a0d0e21e | 10034 | d_closedir='$d_closedir' |
2304df62 | 10035 | d_const='$d_const' |
2304df62 AD |
10036 | d_crypt='$d_crypt' |
10037 | d_csh='$d_csh' | |
a0d0e21e LW |
10038 | d_cuserid='$d_cuserid' |
10039 | d_dbl_dig='$d_dbl_dig' | |
10040 | d_difftime='$d_difftime' | |
ecfc5424 | 10041 | d_dirnamlen='$d_dirnamlen' |
a0d0e21e LW |
10042 | d_dlerror='$d_dlerror' |
10043 | d_dlopen='$d_dlopen' | |
10044 | d_dlsymun='$d_dlsymun' | |
2304df62 AD |
10045 | d_dosuid='$d_dosuid' |
10046 | d_dup2='$d_dup2' | |
8e07c86e | 10047 | d_eofnblk='$d_eofnblk' |
40a7a20a | 10048 | d_eunice='$d_eunice' |
2304df62 AD |
10049 | d_fchmod='$d_fchmod' |
10050 | d_fchown='$d_fchown' | |
10051 | d_fcntl='$d_fcntl' | |
a0d0e21e LW |
10052 | d_fd_macros='$d_fd_macros' |
10053 | d_fd_set='$d_fd_set' | |
10054 | d_fds_bits='$d_fds_bits' | |
10055 | d_fgetpos='$d_fgetpos' | |
2304df62 AD |
10056 | d_flexfnam='$d_flexfnam' |
10057 | d_flock='$d_flock' | |
a0d0e21e | 10058 | d_fork='$d_fork' |
ecfc5424 | 10059 | d_fpathconf='$d_fpathconf' |
a0d0e21e | 10060 | d_fsetpos='$d_fsetpos' |
5f05dabc | 10061 | d_ftime='$d_ftime' |
2304df62 | 10062 | d_getgrps='$d_getgrps' |
5cd24f17 | 10063 | d_setgrps='$d_setgrps' |
2304df62 | 10064 | d_gethent='$d_gethent' |
2304df62 | 10065 | d_gethname='$d_gethname' |
a0d0e21e | 10066 | d_getlogin='$d_getlogin' |
2afac517 | 10067 | d_getpgid='$d_getpgid' |
2304df62 AD |
10068 | d_getpgrp2='$d_getpgrp2' |
10069 | d_getpgrp='$d_getpgrp' | |
a0d0e21e | 10070 | d_getppid='$d_getppid' |
2304df62 | 10071 | d_getprior='$d_getprior' |
5f05dabc | 10072 | d_gettimeod='$d_gettimeod' |
a4f3eea9 | 10073 | d_gnulibc='$d_gnulibc' |
2304df62 | 10074 | d_htonl='$d_htonl' |
ecfc5424 | 10075 | d_index='$d_index' |
7e1af8bc | 10076 | d_inetaton='$d_inetaton' |
2304df62 AD |
10077 | d_isascii='$d_isascii' |
10078 | d_killpg='$d_killpg' | |
10079 | d_link='$d_link' | |
a0d0e21e LW |
10080 | d_locconv='$d_locconv' |
10081 | d_lockf='$d_lockf' | |
2304df62 | 10082 | d_lstat='$d_lstat' |
a0d0e21e LW |
10083 | d_mblen='$d_mblen' |
10084 | d_mbstowcs='$d_mbstowcs' | |
10085 | d_mbtowc='$d_mbtowc' | |
2304df62 AD |
10086 | d_memcmp='$d_memcmp' |
10087 | d_memcpy='$d_memcpy' | |
10088 | d_memmove='$d_memmove' | |
10089 | d_memset='$d_memset' | |
10090 | d_mkdir='$d_mkdir' | |
a0d0e21e LW |
10091 | d_mkfifo='$d_mkfifo' |
10092 | d_mktime='$d_mktime' | |
2304df62 AD |
10093 | d_msg='$d_msg' |
10094 | d_msgctl='$d_msgctl' | |
10095 | d_msgget='$d_msgget' | |
10096 | d_msgrcv='$d_msgrcv' | |
10097 | d_msgsnd='$d_msgsnd' | |
ecfc5424 | 10098 | d_mymalloc='$d_mymalloc' |
a0d0e21e | 10099 | d_nice='$d_nice' |
4633a7c4 | 10100 | d_oldarchlib='$d_oldarchlib' |
ecfc5424 | 10101 | d_oldsock='$d_oldsock' |
2304df62 | 10102 | d_open3='$d_open3' |
a0d0e21e LW |
10103 | d_pathconf='$d_pathconf' |
10104 | d_pause='$d_pause' | |
ecfc5424 | 10105 | d_phostname='$d_phostname' |
a0d0e21e | 10106 | d_pipe='$d_pipe' |
8e07c86e | 10107 | d_poll='$d_poll' |
2304df62 | 10108 | d_portable='$d_portable' |
ecfc5424 AD |
10109 | d_pwage='$d_pwage' |
10110 | d_pwchange='$d_pwchange' | |
10111 | d_pwclass='$d_pwclass' | |
10112 | d_pwcomment='$d_pwcomment' | |
10113 | d_pwexpire='$d_pwexpire' | |
10114 | d_pwquota='$d_pwquota' | |
2304df62 | 10115 | d_readdir='$d_readdir' |
a0d0e21e | 10116 | d_readlink='$d_readlink' |
2304df62 | 10117 | d_rename='$d_rename' |
ecfc5424 | 10118 | d_rewinddir='$d_rewinddir' |
2304df62 AD |
10119 | d_rmdir='$d_rmdir' |
10120 | d_safebcpy='$d_safebcpy' | |
10121 | d_safemcpy='$d_safemcpy' | |
36477c24 | 10122 | d_sanemcmp='$d_sanemcmp' |
ecfc5424 | 10123 | d_seekdir='$d_seekdir' |
2304df62 AD |
10124 | d_select='$d_select' |
10125 | d_sem='$d_sem' | |
10126 | d_semctl='$d_semctl' | |
10127 | d_semget='$d_semget' | |
10128 | d_semop='$d_semop' | |
10129 | d_setegid='$d_setegid' | |
10130 | d_seteuid='$d_seteuid' | |
a0d0e21e | 10131 | d_setlinebuf='$d_setlinebuf' |
2304df62 AD |
10132 | d_setlocale='$d_setlocale' |
10133 | d_setpgid='$d_setpgid' | |
10134 | d_setpgrp2='$d_setpgrp2' | |
2304df62 AD |
10135 | d_setpgrp='$d_setpgrp' |
10136 | d_setprior='$d_setprior' | |
10137 | d_setregid='$d_setregid' | |
10138 | d_setresgid='$d_setresgid' | |
10139 | d_setresuid='$d_setresuid' | |
10140 | d_setreuid='$d_setreuid' | |
10141 | d_setrgid='$d_setrgid' | |
10142 | d_setruid='$d_setruid' | |
10143 | d_setsid='$d_setsid' | |
760ac839 | 10144 | d_sfio='$d_sfio' |
2304df62 AD |
10145 | d_shm='$d_shm' |
10146 | d_shmat='$d_shmat' | |
a0d0e21e | 10147 | d_shmatprototype='$d_shmatprototype' |
2304df62 AD |
10148 | d_shmctl='$d_shmctl' |
10149 | d_shmdt='$d_shmdt' | |
10150 | d_shmget='$d_shmget' | |
2c7991dc | 10151 | d_sigaction='$d_sigaction' |
a5f75d66 | 10152 | d_sigsetjmp='$d_sigsetjmp' |
2304df62 AD |
10153 | d_socket='$d_socket' |
10154 | d_sockpair='$d_sockpair' | |
2304df62 | 10155 | d_statblks='$d_statblks' |
c2960299 AD |
10156 | d_stdio_cnt_lval='$d_stdio_cnt_lval' |
10157 | d_stdio_ptr_lval='$d_stdio_ptr_lval' | |
16d20bd9 | 10158 | d_stdiobase='$d_stdiobase' |
2304df62 | 10159 | d_stdstdio='$d_stdstdio' |
2304df62 | 10160 | d_strchr='$d_strchr' |
a0d0e21e | 10161 | d_strcoll='$d_strcoll' |
2304df62 AD |
10162 | d_strctcpy='$d_strctcpy' |
10163 | d_strerrm='$d_strerrm' | |
10164 | d_strerror='$d_strerror' | |
a89d8a78 DH |
10165 | d_strtod='$d_strtod' |
10166 | d_strtol='$d_strtol' | |
10167 | d_strtoul='$d_strtoul' | |
a0d0e21e | 10168 | d_strxfrm='$d_strxfrm' |
ecfc5424 | 10169 | d_suidsafe='$d_suidsafe' |
2304df62 AD |
10170 | d_symlink='$d_symlink' |
10171 | d_syscall='$d_syscall' | |
a0d0e21e | 10172 | d_sysconf='$d_sysconf' |
ecfc5424 AD |
10173 | d_sysernlst='$d_sysernlst' |
10174 | d_syserrlst='$d_syserrlst' | |
2304df62 | 10175 | d_system='$d_system' |
a0d0e21e LW |
10176 | d_tcgetpgrp='$d_tcgetpgrp' |
10177 | d_tcsetpgrp='$d_tcsetpgrp' | |
ecfc5424 | 10178 | d_telldir='$d_telldir' |
85e6fe83 | 10179 | d_time='$d_time' |
2304df62 AD |
10180 | d_times='$d_times' |
10181 | d_truncate='$d_truncate' | |
a0d0e21e LW |
10182 | d_tzname='$d_tzname' |
10183 | d_umask='$d_umask' | |
ecfc5424 | 10184 | d_uname='$d_uname' |
2304df62 | 10185 | d_vfork='$d_vfork' |
ecfc5424 | 10186 | d_void_closedir='$d_void_closedir' |
2304df62 | 10187 | d_voidsig='$d_voidsig' |
ecfc5424 | 10188 | d_voidtty='$d_voidtty' |
2304df62 | 10189 | d_volatile='$d_volatile' |
2304df62 AD |
10190 | d_vprintf='$d_vprintf' |
10191 | d_wait4='$d_wait4' | |
10192 | d_waitpid='$d_waitpid' | |
a0d0e21e LW |
10193 | d_wcstombs='$d_wcstombs' |
10194 | d_wctomb='$d_wctomb' | |
ecfc5424 AD |
10195 | d_xenix='$d_xenix' |
10196 | date='$date' | |
10197 | db_hashtype='$db_hashtype' | |
10198 | db_prefixtype='$db_prefixtype' | |
10199 | defvoidused='$defvoidused' | |
10200 | direntrytype='$direntrytype' | |
a0d0e21e | 10201 | dlext='$dlext' |
2304df62 | 10202 | dlsrc='$dlsrc' |
ecfc5424 | 10203 | dynamic_ext='$dynamic_ext' |
8e07c86e | 10204 | eagain='$eagain' |
ecfc5424 AD |
10205 | echo='$echo' |
10206 | egrep='$egrep' | |
10207 | emacs='$emacs' | |
10208 | eunicefix='$eunicefix' | |
4633a7c4 | 10209 | exe_ext='$exe_ext' |
ecfc5424 AD |
10210 | expr='$expr' |
10211 | extensions='$extensions' | |
10212 | find='$find' | |
4633a7c4 | 10213 | firstmakefile='$firstmakefile' |
ecfc5424 | 10214 | flex='$flex' |
a0d0e21e | 10215 | fpostype='$fpostype' |
94b6baf5 | 10216 | freetype='$freetype' |
1aef975c AD |
10217 | full_csh='$full_csh' |
10218 | full_sed='$full_sed' | |
ecfc5424 AD |
10219 | gcc='$gcc' |
10220 | gccversion='$gccversion' | |
2304df62 | 10221 | gidtype='$gidtype' |
ecfc5424 AD |
10222 | glibpth='$glibpth' |
10223 | grep='$grep' | |
10224 | groupcat='$groupcat' | |
2304df62 | 10225 | groupstype='$groupstype' |
8ff267be | 10226 | gzip='$gzip' |
2304df62 AD |
10227 | h_fcntl='$h_fcntl' |
10228 | h_sysfile='$h_sysfile' | |
ecfc5424 AD |
10229 | hint='$hint' |
10230 | hostcat='$hostcat' | |
10231 | huge='$huge' | |
10232 | i_bsdioctl='$i_bsdioctl' | |
a0d0e21e | 10233 | i_db='$i_db' |
2304df62 | 10234 | i_dbm='$i_dbm' |
2304df62 | 10235 | i_dirent='$i_dirent' |
a0d0e21e | 10236 | i_dld='$i_dld' |
2304df62 AD |
10237 | i_dlfcn='$i_dlfcn' |
10238 | i_fcntl='$i_fcntl' | |
a0d0e21e | 10239 | i_float='$i_float' |
2304df62 AD |
10240 | i_gdbm='$i_gdbm' |
10241 | i_grp='$i_grp' | |
a0d0e21e | 10242 | i_limits='$i_limits' |
4633a7c4 | 10243 | i_locale='$i_locale' |
a0d0e21e LW |
10244 | i_malloc='$i_malloc' |
10245 | i_math='$i_math' | |
85e6fe83 | 10246 | i_memory='$i_memory' |
2304df62 | 10247 | i_ndbm='$i_ndbm' |
85e6fe83 | 10248 | i_neterrno='$i_neterrno' |
2304df62 | 10249 | i_niin='$i_niin' |
2304df62 | 10250 | i_pwd='$i_pwd' |
8e07c86e | 10251 | i_rpcsvcdbm='$i_rpcsvcdbm' |
760ac839 | 10252 | i_sfio='$i_sfio' |
ecfc5424 AD |
10253 | i_sgtty='$i_sgtty' |
10254 | i_stdarg='$i_stdarg' | |
2304df62 | 10255 | i_stddef='$i_stddef' |
a0d0e21e | 10256 | i_stdlib='$i_stdlib' |
2304df62 | 10257 | i_string='$i_string' |
2304df62 AD |
10258 | i_sysdir='$i_sysdir' |
10259 | i_sysfile='$i_sysfile' | |
a0d0e21e | 10260 | i_sysfilio='$i_sysfilio' |
ecfc5424 | 10261 | i_sysin='$i_sysin' |
2304df62 | 10262 | i_sysioctl='$i_sysioctl' |
2304df62 | 10263 | i_sysndir='$i_sysndir' |
a0d0e21e | 10264 | i_sysparam='$i_sysparam' |
8ff267be | 10265 | i_sysresrc='$i_sysresrc' |
2304df62 | 10266 | i_sysselct='$i_sysselct' |
ecfc5424 | 10267 | i_syssockio='$i_syssockio' |
1aef975c | 10268 | i_sysstat='$i_sysstat' |
ecfc5424 AD |
10269 | i_systime='$i_systime' |
10270 | i_systimek='$i_systimek' | |
a0d0e21e | 10271 | i_systimes='$i_systimes' |
fed7345c | 10272 | i_systypes='$i_systypes' |
25f94b33 | 10273 | i_sysun='$i_sysun' |
8ff267be | 10274 | i_syswait='$i_syswait' |
2304df62 AD |
10275 | i_termio='$i_termio' |
10276 | i_termios='$i_termios' | |
2304df62 | 10277 | i_time='$i_time' |
85e6fe83 | 10278 | i_unistd='$i_unistd' |
2304df62 | 10279 | i_utime='$i_utime' |
760ac839 | 10280 | i_values='$i_values' |
2304df62 AD |
10281 | i_varargs='$i_varargs' |
10282 | i_varhdr='$i_varhdr' | |
10283 | i_vfork='$i_vfork' | |
ecfc5424 AD |
10284 | incpath='$incpath' |
10285 | inews='$inews' | |
10286 | installarchlib='$installarchlib' | |
10287 | installbin='$installbin' | |
16d20bd9 AD |
10288 | installman1dir='$installman1dir' |
10289 | installman3dir='$installman3dir' | |
ecfc5424 AD |
10290 | installprivlib='$installprivlib' |
10291 | installscript='$installscript' | |
4633a7c4 | 10292 | installsitearch='$installsitearch' |
25f94b33 | 10293 | installsitelib='$installsitelib' |
2304df62 | 10294 | intsize='$intsize' |
ecfc5424 AD |
10295 | known_extensions='$known_extensions' |
10296 | ksh='$ksh' | |
10297 | large='$large' | |
232e078e | 10298 | ld='$ld' |
ecfc5424 AD |
10299 | lddlflags='$lddlflags' |
10300 | ldflags='$ldflags' | |
10301 | less='$less' | |
4633a7c4 | 10302 | lib_ext='$lib_ext' |
2304df62 | 10303 | libc='$libc' |
8ff267be | 10304 | libperl='$libperl' |
2304df62 | 10305 | libpth='$libpth' |
2304df62 | 10306 | libs='$libs' |
ecfc5424 AD |
10307 | libswanted='$libswanted' |
10308 | line='$line' | |
10309 | lint='$lint' | |
10310 | lkflags='$lkflags' | |
10311 | ln='$ln' | |
85e6fe83 | 10312 | lns='$lns' |
8e07c86e AD |
10313 | locincpth='$locincpth' |
10314 | loclibpth='$loclibpth' | |
24fef2a7 | 10315 | longsize='$longsize' |
ecfc5424 AD |
10316 | lp='$lp' |
10317 | lpr='$lpr' | |
10318 | ls='$ls' | |
85e6fe83 | 10319 | lseektype='$lseektype' |
ecfc5424 AD |
10320 | mail='$mail' |
10321 | mailx='$mailx' | |
10322 | make='$make' | |
8ff267be | 10323 | make_set_make='$make_set_make' |
2304df62 AD |
10324 | mallocobj='$mallocobj' |
10325 | mallocsrc='$mallocsrc' | |
10326 | malloctype='$malloctype' | |
16d20bd9 AD |
10327 | man1dir='$man1dir' |
10328 | man1direxp='$man1direxp' | |
10329 | man1ext='$man1ext' | |
10330 | man3dir='$man3dir' | |
10331 | man3direxp='$man3direxp' | |
10332 | man3ext='$man3ext' | |
2304df62 | 10333 | medium='$medium' |
ecfc5424 AD |
10334 | mips='$mips' |
10335 | mips_type='$mips_type' | |
10336 | mkdir='$mkdir' | |
2304df62 | 10337 | models='$models' |
a0d0e21e | 10338 | modetype='$modetype' |
ecfc5424 AD |
10339 | more='$more' |
10340 | mv='$mv' | |
40000a8c | 10341 | myarchname='$myarchname' |
2304df62 AD |
10342 | mydomain='$mydomain' |
10343 | myhostname='$myhostname' | |
ecfc5424 | 10344 | myuname='$myuname' |
2304df62 | 10345 | n='$n' |
ecfc5424 | 10346 | nm_opt='$nm_opt' |
40a7a20a | 10347 | nm_so_opt='$nm_so_opt' |
ecfc5424 | 10348 | nroff='$nroff' |
8e07c86e | 10349 | o_nonblock='$o_nonblock' |
4633a7c4 LW |
10350 | obj_ext='$obj_ext' |
10351 | oldarchlib='$oldarchlib' | |
10352 | oldarchlibexp='$oldarchlibexp' | |
ecfc5424 | 10353 | optimize='$optimize' |
85e6fe83 | 10354 | orderlib='$orderlib' |
ecfc5424 AD |
10355 | osname='$osname' |
10356 | osvers='$osvers' | |
2304df62 | 10357 | package='$package' |
2c7991dc | 10358 | pager='$pager' |
ecfc5424 AD |
10359 | passcat='$passcat' |
10360 | patchlevel='$patchlevel' | |
4633a7c4 | 10361 | path_sep='$path_sep' |
ecfc5424 | 10362 | perl='$perl' |
8e07c86e | 10363 | perladmin='$perladmin' |
4633a7c4 | 10364 | perlpath='$perlpath' |
ecfc5424 AD |
10365 | pg='$pg' |
10366 | phostname='$phostname' | |
10367 | plibpth='$plibpth' | |
10368 | pmake='$pmake' | |
10369 | pr='$pr' | |
a0d0e21e | 10370 | prefix='$prefix' |
1aef975c | 10371 | prefixexp='$prefixexp' |
2304df62 AD |
10372 | privlib='$privlib' |
10373 | privlibexp='$privlibexp' | |
10374 | prototype='$prototype' | |
10375 | randbits='$randbits' | |
ecfc5424 | 10376 | ranlib='$ranlib' |
8e07c86e | 10377 | rd_nodata='$rd_nodata' |
ecfc5424 AD |
10378 | rm='$rm' |
10379 | rmail='$rmail' | |
10380 | runnm='$runnm' | |
2304df62 AD |
10381 | scriptdir='$scriptdir' |
10382 | scriptdirexp='$scriptdirexp' | |
ecfc5424 | 10383 | sed='$sed' |
a0d0e21e | 10384 | selecttype='$selecttype' |
ecfc5424 AD |
10385 | sendmail='$sendmail' |
10386 | sh='$sh' | |
10387 | shar='$shar' | |
10388 | sharpbang='$sharpbang' | |
10389 | shmattype='$shmattype' | |
24fef2a7 | 10390 | shortsize='$shortsize' |
2afac517 | 10391 | shrpenv='$shrpenv' |
ecfc5424 | 10392 | shsharp='$shsharp' |
2304df62 | 10393 | sig_name='$sig_name' |
8e07c86e | 10394 | sig_num='$sig_num' |
ecfc5424 | 10395 | signal_t='$signal_t' |
4633a7c4 LW |
10396 | sitearch='$sitearch' |
10397 | sitearchexp='$sitearchexp' | |
25f94b33 AD |
10398 | sitelib='$sitelib' |
10399 | sitelibexp='$sitelibexp' | |
a0d0e21e | 10400 | sizetype='$sizetype' |
ecfc5424 AD |
10401 | sleep='$sleep' |
10402 | smail='$smail' | |
10403 | small='$small' | |
a0d0e21e | 10404 | so='$so' |
ecfc5424 AD |
10405 | sockethdr='$sockethdr' |
10406 | socketlib='$socketlib' | |
10407 | sort='$sort' | |
10408 | spackage='$spackage' | |
2304df62 | 10409 | spitshell='$spitshell' |
ecfc5424 | 10410 | split='$split' |
a0d0e21e | 10411 | ssizetype='$ssizetype' |
4633a7c4 | 10412 | startperl='$startperl' |
2304df62 | 10413 | startsh='$startsh' |
ecfc5424 | 10414 | static_ext='$static_ext' |
2304df62 | 10415 | stdchar='$stdchar' |
16d20bd9 AD |
10416 | stdio_base='$stdio_base' |
10417 | stdio_bufsiz='$stdio_bufsiz' | |
10418 | stdio_cnt='$stdio_cnt' | |
10419 | stdio_ptr='$stdio_ptr' | |
ecfc5424 AD |
10420 | strings='$strings' |
10421 | submit='$submit' | |
f55a7265 | 10422 | subversion='$subversion' |
2304df62 | 10423 | sysman='$sysman' |
ecfc5424 AD |
10424 | tail='$tail' |
10425 | tar='$tar' | |
10426 | tbl='$tbl' | |
10427 | test='$test' | |
10428 | timeincl='$timeincl' | |
10429 | timetype='$timetype' | |
10430 | touch='$touch' | |
10431 | tr='$tr' | |
10432 | troff='$troff' | |
2304df62 | 10433 | uidtype='$uidtype' |
ecfc5424 AD |
10434 | uname='$uname' |
10435 | uniq='$uniq' | |
10436 | usedl='$usedl' | |
10437 | usemymalloc='$usemymalloc' | |
2304df62 | 10438 | usenm='$usenm' |
8ff267be | 10439 | useopcode='$useopcode' |
10440 | useperlio='$useperlio' | |
ecfc5424 | 10441 | useposix='$useposix' |
8ff267be | 10442 | usesfio='$usesfio' |
10443 | useshrplib='$useshrplib' | |
ecfc5424 | 10444 | usevfork='$usevfork' |
2304df62 | 10445 | usrinc='$usrinc' |
ecfc5424 AD |
10446 | uuname='$uuname' |
10447 | vi='$vi' | |
2304df62 | 10448 | voidflags='$voidflags' |
ecfc5424 AD |
10449 | xlibpth='$xlibpth' |
10450 | zcat='$zcat' | |
8ff267be | 10451 | zip='$zip' |
2304df62 AD |
10452 | EOT |
10453 | ||
10454 | : add special variables | |
10455 | $test -f patchlevel.h && \ | |
10456 | awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh | |
10457 | echo "CONFIG=true" >>config.sh | |
10458 | ||
10459 | : propagate old symbols | |
10460 | if $test -f UU/config.sh; then | |
10461 | <UU/config.sh sort | uniq >UU/oldconfig.sh | |
10462 | sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\ | |
10463 | sort | uniq -u >UU/oldsyms | |
10464 | set X `cat UU/oldsyms` | |
10465 | shift | |
10466 | case $# in | |
10467 | 0) ;; | |
10468 | *) | |
10469 | cat <<EOM | |
10470 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em... | |
10471 | EOM | |
10472 | echo "# Variables propagated from previous config.sh file." >>config.sh | |
10473 | for sym in `cat UU/oldsyms`; do | |
10474 | echo " Propagating $hint variable "'$'"$sym..." | |
10475 | eval 'tmp="$'"${sym}"'"' | |
10476 | echo "$tmp" | \ | |
10477 | sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh | |
10478 | done | |
10479 | ;; | |
10480 | esac | |
10481 | fi | |
10482 | ||
10483 | : Finish up by extracting the .SH files | |
10484 | case "$alldone" in | |
10485 | exit) | |
10486 | $rm -rf UU | |
10487 | echo "Done." | |
10488 | exit 0 | |
10489 | ;; | |
10490 | cont) | |
10491 | ;; | |
10492 | '') | |
2304df62 AD |
10493 | dflt='' |
10494 | nostick=true | |
40000a8c AD |
10495 | $cat <<EOM |
10496 | ||
10497 | If you'd like to make any changes to the config.sh file before I begin | |
10498 | to configure things, do it as a shell escape now (e.g. !vi config.sh). | |
10499 | ||
10500 | EOM | |
10501 | rp="Press return or use a shell escape to edit config.sh:" | |
2304df62 AD |
10502 | . UU/myread |
10503 | nostick='' | |
10504 | case "$ans" in | |
10505 | '') ;; | |
10506 | *) : in case they cannot read | |
10507 | sh 1>&4 -c "$ans";; | |
10508 | esac | |
10509 | ;; | |
10510 | esac | |
10511 | ||
10512 | : if this fails, just run all the .SH files by hand | |
10513 | . ./config.sh | |
10514 | ||
10515 | echo " " | |
10516 | exec 1>&4 | |
10517 | . ./UU/extract | |
10518 | ||
10519 | if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then | |
10520 | dflt=y | |
10521 | case "$silent" in | |
10522 | true) ;; | |
10523 | *) | |
10524 | $cat <<EOM | |
10525 | ||
10526 | Now you need to generate make dependencies by running "make depend". | |
10527 | You might prefer to run it in background: "make depend > makedepend.out &" | |
10528 | It can take a while, so you might not want to run it right now. | |
10529 | ||
10530 | EOM | |
10531 | ;; | |
10532 | esac | |
10533 | rp="Run make depend now?" | |
10534 | . UU/myread | |
10535 | case "$ans" in | |
10536 | y*) | |
10537 | make depend && echo "Now you must run a make." | |
10538 | ;; | |
10539 | *) | |
10540 | echo "You must run 'make depend' then 'make'." | |
10541 | ;; | |
10542 | esac | |
10543 | elif test -f [Mm]akefile; then | |
10544 | echo " " | |
10545 | echo "Now you must run a make." | |
10546 | else | |
10547 | echo "Done." | |
10548 | fi | |
10549 | ||
10550 | $rm -f kit*isdone ark*isdone | |
10551 | $rm -rf UU | |
a0d0e21e | 10552 | |
2304df62 | 10553 | : End of Configure |
a0d0e21e | 10554 |