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 | |
---|
21 | # $Id: Configure,v 1.2 1997-11-14 19:24:31 ghudson Exp $ |
---|
22 | # |
---|
23 | # Generated on Sat Feb 1 00:26:40 EST 1997 [metaconfig 3.0 PL60] |
---|
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 | |
---|
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 | |
---|
58 | : Proper PATH separator |
---|
59 | p_=: |
---|
60 | : On OS/2 this directory should exist if this is not floppy only system :-] |
---|
61 | if test -d c:/. -a -n "$OS2_SHELL"; then |
---|
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 |
---|
66 | |
---|
67 | : Proper PATH setting |
---|
68 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' |
---|
69 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
---|
70 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
---|
71 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
---|
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" |
---|
76 | |
---|
77 | for p in $paths |
---|
78 | do |
---|
79 | case "$p_$PATH$p_" in |
---|
80 | *$p_$p$p_*) ;; |
---|
81 | *) test -d $p && PATH=$PATH$p_$p ;; |
---|
82 | esac |
---|
83 | done |
---|
84 | |
---|
85 | PATH=.$p_$PATH |
---|
86 | export PATH |
---|
87 | |
---|
88 | : This should not matter in scripts, but apparently it does, sometimes |
---|
89 | case "$CDPATH" in |
---|
90 | '') ;; |
---|
91 | *) CDPATH='' ;; |
---|
92 | esac |
---|
93 | |
---|
94 | : Test and see if we are running under ksh, either blatantly or in disguise. |
---|
95 | if (PATH=.; alias -x) >/dev/null 2>&1; then |
---|
96 | : running under ksh. Is this a good thing? |
---|
97 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname ; then |
---|
98 | if test X`/usr/bin/uname -v` = X4 ; then |
---|
99 | : on AIX 4, /bin/sh is really ksh, and it causes us problems. |
---|
100 | : Avoid it |
---|
101 | cat <<'EOM' |
---|
102 | (Feeding myself to /usr/bin/bsh to avoid AIX 4's /bin/sh.) |
---|
103 | EOM |
---|
104 | unset ENV |
---|
105 | exec /usr/bin/bsh $0 "$@" |
---|
106 | fi |
---|
107 | else |
---|
108 | if test ! -f /hp-ux ; then |
---|
109 | : Warn them if they use ksh on other systems |
---|
110 | cat <<EOM |
---|
111 | (I see you are using the Korn shell. Some ksh's blow up on $me, |
---|
112 | especially on older exotic systems. If yours does, try the Bourne |
---|
113 | shell instead.) |
---|
114 | EOM |
---|
115 | unset ENV |
---|
116 | fi |
---|
117 | fi |
---|
118 | else |
---|
119 | : Not running under ksh. Maybe we should be? |
---|
120 | : On HP-UX, large Configure scripts may exercise a bug in /bin/sh |
---|
121 | if test -f /hp-ux -a -f /bin/ksh; then |
---|
122 | cat <<'EOM' |
---|
123 | (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.) |
---|
124 | EOM |
---|
125 | unset ENV |
---|
126 | exec /bin/ksh $0 "$@" |
---|
127 | fi |
---|
128 | fi |
---|
129 | |
---|
130 | : Configure runs within the UU subdirectory |
---|
131 | test -d UU || mkdir UU |
---|
132 | cd UU && rm -f ./* |
---|
133 | |
---|
134 | dynamic_ext='' |
---|
135 | extensions='' |
---|
136 | known_extensions='' |
---|
137 | static_ext='' |
---|
138 | useopcode='' |
---|
139 | useposix='' |
---|
140 | d_bsd='' |
---|
141 | d_eunice='' |
---|
142 | d_xenix='' |
---|
143 | eunicefix='' |
---|
144 | Mcc='' |
---|
145 | awk='' |
---|
146 | bash='' |
---|
147 | bison='' |
---|
148 | byacc='' |
---|
149 | cat='' |
---|
150 | chgrp='' |
---|
151 | chmod='' |
---|
152 | chown='' |
---|
153 | comm='' |
---|
154 | compress='' |
---|
155 | cp='' |
---|
156 | cpio='' |
---|
157 | cpp='' |
---|
158 | csh='' |
---|
159 | date='' |
---|
160 | echo='' |
---|
161 | egrep='' |
---|
162 | emacs='' |
---|
163 | expr='' |
---|
164 | find='' |
---|
165 | flex='' |
---|
166 | gcc='' |
---|
167 | grep='' |
---|
168 | gzip='' |
---|
169 | inews='' |
---|
170 | ksh='' |
---|
171 | less='' |
---|
172 | line='' |
---|
173 | lint='' |
---|
174 | ln='' |
---|
175 | lp='' |
---|
176 | lpr='' |
---|
177 | ls='' |
---|
178 | mail='' |
---|
179 | mailx='' |
---|
180 | mkdir='' |
---|
181 | more='' |
---|
182 | mv='' |
---|
183 | nroff='' |
---|
184 | perl='' |
---|
185 | pg='' |
---|
186 | pmake='' |
---|
187 | pr='' |
---|
188 | rm='' |
---|
189 | rmail='' |
---|
190 | sed='' |
---|
191 | sendmail='' |
---|
192 | shar='' |
---|
193 | sleep='' |
---|
194 | smail='' |
---|
195 | sort='' |
---|
196 | submit='' |
---|
197 | tail='' |
---|
198 | tar='' |
---|
199 | tbl='' |
---|
200 | test='' |
---|
201 | touch='' |
---|
202 | tr='' |
---|
203 | troff='' |
---|
204 | uname='' |
---|
205 | uniq='' |
---|
206 | uuname='' |
---|
207 | vi='' |
---|
208 | zcat='' |
---|
209 | zip='' |
---|
210 | full_sed='' |
---|
211 | libswanted='' |
---|
212 | hint='' |
---|
213 | myuname='' |
---|
214 | osname='' |
---|
215 | osvers='' |
---|
216 | Author='' |
---|
217 | Date='' |
---|
218 | Header='' |
---|
219 | Id='' |
---|
220 | Locker='' |
---|
221 | Log='' |
---|
222 | RCSfile='' |
---|
223 | Revision='' |
---|
224 | Source='' |
---|
225 | State='' |
---|
226 | ar='' |
---|
227 | archobjs='' |
---|
228 | exe_ext='' |
---|
229 | firstmakefile='' |
---|
230 | lib_ext='' |
---|
231 | obj_ext='' |
---|
232 | path_sep='' |
---|
233 | afs='' |
---|
234 | alignbytes='' |
---|
235 | archlib='' |
---|
236 | archlibexp='' |
---|
237 | d_archlib='' |
---|
238 | installarchlib='' |
---|
239 | archname='' |
---|
240 | myarchname='' |
---|
241 | baserev='' |
---|
242 | bin='' |
---|
243 | binexp='' |
---|
244 | installbin='' |
---|
245 | bincompat3='' |
---|
246 | d_bincompat3='' |
---|
247 | byteorder='' |
---|
248 | cc='' |
---|
249 | gccversion='' |
---|
250 | ccflags='' |
---|
251 | cppflags='' |
---|
252 | ldflags='' |
---|
253 | lkflags='' |
---|
254 | locincpth='' |
---|
255 | optimize='' |
---|
256 | cf_email='' |
---|
257 | cf_by='' |
---|
258 | cf_time='' |
---|
259 | contains='' |
---|
260 | cpp_stuff='' |
---|
261 | cpplast='' |
---|
262 | cppminus='' |
---|
263 | cpprun='' |
---|
264 | cppstdin='' |
---|
265 | d_access='' |
---|
266 | d_alarm='' |
---|
267 | d_attribut='' |
---|
268 | d_bcmp='' |
---|
269 | d_bcopy='' |
---|
270 | d_bzero='' |
---|
271 | d_casti32='' |
---|
272 | castflags='' |
---|
273 | d_castneg='' |
---|
274 | d_chown='' |
---|
275 | d_chroot='' |
---|
276 | d_chsize='' |
---|
277 | d_closedir='' |
---|
278 | d_void_closedir='' |
---|
279 | d_const='' |
---|
280 | cryptlib='' |
---|
281 | d_crypt='' |
---|
282 | d_csh='' |
---|
283 | full_csh='' |
---|
284 | d_cuserid='' |
---|
285 | d_dbl_dig='' |
---|
286 | d_difftime='' |
---|
287 | d_dlerror='' |
---|
288 | d_dlopen='' |
---|
289 | d_dlsymun='' |
---|
290 | d_dosuid='' |
---|
291 | d_suidsafe='' |
---|
292 | d_dup2='' |
---|
293 | d_fchmod='' |
---|
294 | d_fchown='' |
---|
295 | d_fcntl='' |
---|
296 | d_fd_macros='' |
---|
297 | d_fd_set='' |
---|
298 | d_fds_bits='' |
---|
299 | d_fgetpos='' |
---|
300 | d_flexfnam='' |
---|
301 | d_flock='' |
---|
302 | d_fork='' |
---|
303 | d_fsetpos='' |
---|
304 | d_ftime='' |
---|
305 | d_gettimeod='' |
---|
306 | d_Gconvert='' |
---|
307 | d_getgrps='' |
---|
308 | d_setgrps='' |
---|
309 | d_gethent='' |
---|
310 | aphostname='' |
---|
311 | d_gethname='' |
---|
312 | d_phostname='' |
---|
313 | d_uname='' |
---|
314 | d_getlogin='' |
---|
315 | d_getpgid='' |
---|
316 | d_getpgrp2='' |
---|
317 | d_bsdgetpgrp='' |
---|
318 | d_getpgrp='' |
---|
319 | d_getppid='' |
---|
320 | d_getprior='' |
---|
321 | d_gnulibc='' |
---|
322 | d_htonl='' |
---|
323 | d_inetaton='' |
---|
324 | d_isascii='' |
---|
325 | d_killpg='' |
---|
326 | d_link='' |
---|
327 | d_locconv='' |
---|
328 | d_lockf='' |
---|
329 | d_lstat='' |
---|
330 | d_mblen='' |
---|
331 | d_mbstowcs='' |
---|
332 | d_mbtowc='' |
---|
333 | d_memcmp='' |
---|
334 | d_memcpy='' |
---|
335 | d_memmove='' |
---|
336 | d_memset='' |
---|
337 | d_mkdir='' |
---|
338 | d_mkfifo='' |
---|
339 | d_mktime='' |
---|
340 | d_msg='' |
---|
341 | d_msgctl='' |
---|
342 | d_msgget='' |
---|
343 | d_msgrcv='' |
---|
344 | d_msgsnd='' |
---|
345 | d_nice='' |
---|
346 | d_open3='' |
---|
347 | d_fpathconf='' |
---|
348 | d_pathconf='' |
---|
349 | d_pause='' |
---|
350 | d_pipe='' |
---|
351 | d_poll='' |
---|
352 | d_portable='' |
---|
353 | d_readdir='' |
---|
354 | d_rewinddir='' |
---|
355 | d_seekdir='' |
---|
356 | d_telldir='' |
---|
357 | d_readlink='' |
---|
358 | d_rename='' |
---|
359 | d_rmdir='' |
---|
360 | d_safebcpy='' |
---|
361 | d_safemcpy='' |
---|
362 | d_sanemcmp='' |
---|
363 | d_select='' |
---|
364 | d_sem='' |
---|
365 | d_semctl='' |
---|
366 | d_semget='' |
---|
367 | d_semop='' |
---|
368 | d_setegid='' |
---|
369 | d_seteuid='' |
---|
370 | d_setlinebuf='' |
---|
371 | d_setlocale='' |
---|
372 | d_setpgid='' |
---|
373 | d_setpgrp2='' |
---|
374 | d_bsdpgrp='' |
---|
375 | d_bsdsetpgrp='' |
---|
376 | d_setpgrp='' |
---|
377 | d_setprior='' |
---|
378 | d_setregid='' |
---|
379 | d_setresgid='' |
---|
380 | d_setresuid='' |
---|
381 | d_setreuid='' |
---|
382 | d_setrgid='' |
---|
383 | d_setruid='' |
---|
384 | d_setsid='' |
---|
385 | d_sfio='' |
---|
386 | usesfio='' |
---|
387 | d_shm='' |
---|
388 | d_shmat='' |
---|
389 | d_shmatprototype='' |
---|
390 | shmattype='' |
---|
391 | d_shmctl='' |
---|
392 | d_shmdt='' |
---|
393 | d_shmget='' |
---|
394 | d_sigaction='' |
---|
395 | d_sigsetjmp='' |
---|
396 | d_oldsock='' |
---|
397 | d_socket='' |
---|
398 | d_sockpair='' |
---|
399 | sockethdr='' |
---|
400 | socketlib='' |
---|
401 | d_statblks='' |
---|
402 | d_stdio_cnt_lval='' |
---|
403 | d_stdio_ptr_lval='' |
---|
404 | d_stdiobase='' |
---|
405 | d_stdstdio='' |
---|
406 | stdio_base='' |
---|
407 | stdio_bufsiz='' |
---|
408 | stdio_cnt='' |
---|
409 | stdio_ptr='' |
---|
410 | d_index='' |
---|
411 | d_strchr='' |
---|
412 | d_strcoll='' |
---|
413 | d_strctcpy='' |
---|
414 | d_strerrm='' |
---|
415 | d_strerror='' |
---|
416 | d_sysernlst='' |
---|
417 | d_syserrlst='' |
---|
418 | d_strtod='' |
---|
419 | d_strtol='' |
---|
420 | d_strtoul='' |
---|
421 | d_strxfrm='' |
---|
422 | d_symlink='' |
---|
423 | d_syscall='' |
---|
424 | d_sysconf='' |
---|
425 | d_system='' |
---|
426 | d_tcgetpgrp='' |
---|
427 | d_tcsetpgrp='' |
---|
428 | d_time='' |
---|
429 | timetype='' |
---|
430 | clocktype='' |
---|
431 | d_times='' |
---|
432 | d_truncate='' |
---|
433 | d_tzname='' |
---|
434 | d_umask='' |
---|
435 | d_vfork='' |
---|
436 | usevfork='' |
---|
437 | d_voidsig='' |
---|
438 | signal_t='' |
---|
439 | d_volatile='' |
---|
440 | d_charvspr='' |
---|
441 | d_vprintf='' |
---|
442 | d_wait4='' |
---|
443 | d_waitpid='' |
---|
444 | d_wcstombs='' |
---|
445 | d_wctomb='' |
---|
446 | dlext='' |
---|
447 | cccdlflags='' |
---|
448 | ccdlflags='' |
---|
449 | dlsrc='' |
---|
450 | ld='' |
---|
451 | lddlflags='' |
---|
452 | usedl='' |
---|
453 | fpostype='' |
---|
454 | gidtype='' |
---|
455 | groupstype='' |
---|
456 | h_fcntl='' |
---|
457 | h_sysfile='' |
---|
458 | db_hashtype='' |
---|
459 | db_prefixtype='' |
---|
460 | i_db='' |
---|
461 | i_dbm='' |
---|
462 | i_rpcsvcdbm='' |
---|
463 | d_dirnamlen='' |
---|
464 | direntrytype='' |
---|
465 | i_dirent='' |
---|
466 | i_dld='' |
---|
467 | i_dlfcn='' |
---|
468 | i_fcntl='' |
---|
469 | i_float='' |
---|
470 | i_gdbm='' |
---|
471 | i_grp='' |
---|
472 | i_limits='' |
---|
473 | i_locale='' |
---|
474 | i_malloc='' |
---|
475 | i_math='' |
---|
476 | i_memory='' |
---|
477 | i_ndbm='' |
---|
478 | i_neterrno='' |
---|
479 | i_niin='' |
---|
480 | i_sysin='' |
---|
481 | d_pwage='' |
---|
482 | d_pwchange='' |
---|
483 | d_pwclass='' |
---|
484 | d_pwcomment='' |
---|
485 | d_pwexpire='' |
---|
486 | d_pwquota='' |
---|
487 | i_pwd='' |
---|
488 | i_sfio='' |
---|
489 | i_stddef='' |
---|
490 | i_stdlib='' |
---|
491 | i_string='' |
---|
492 | strings='' |
---|
493 | i_sysdir='' |
---|
494 | i_sysfile='' |
---|
495 | d_voidtty='' |
---|
496 | i_bsdioctl='' |
---|
497 | i_sysfilio='' |
---|
498 | i_sysioctl='' |
---|
499 | i_syssockio='' |
---|
500 | i_sysndir='' |
---|
501 | i_sysparam='' |
---|
502 | i_sysresrc='' |
---|
503 | i_sysselct='' |
---|
504 | i_sysstat='' |
---|
505 | i_systimes='' |
---|
506 | i_systypes='' |
---|
507 | i_sysun='' |
---|
508 | i_syswait='' |
---|
509 | i_sgtty='' |
---|
510 | i_termio='' |
---|
511 | i_termios='' |
---|
512 | i_systime='' |
---|
513 | i_systimek='' |
---|
514 | i_time='' |
---|
515 | timeincl='' |
---|
516 | i_unistd='' |
---|
517 | i_utime='' |
---|
518 | i_values='' |
---|
519 | i_stdarg='' |
---|
520 | i_varargs='' |
---|
521 | i_varhdr='' |
---|
522 | i_vfork='' |
---|
523 | intsize='' |
---|
524 | longsize='' |
---|
525 | shortsize='' |
---|
526 | libc='' |
---|
527 | libperl='' |
---|
528 | shrpenv='' |
---|
529 | useshrplib='' |
---|
530 | glibpth='' |
---|
531 | libpth='' |
---|
532 | loclibpth='' |
---|
533 | plibpth='' |
---|
534 | xlibpth='' |
---|
535 | libs='' |
---|
536 | lns='' |
---|
537 | lseektype='' |
---|
538 | make='' |
---|
539 | make_set_make='' |
---|
540 | d_mymalloc='' |
---|
541 | freetype='' |
---|
542 | mallocobj='' |
---|
543 | mallocsrc='' |
---|
544 | malloctype='' |
---|
545 | usemymalloc='' |
---|
546 | installman1dir='' |
---|
547 | man1dir='' |
---|
548 | man1direxp='' |
---|
549 | man1ext='' |
---|
550 | installman3dir='' |
---|
551 | man3dir='' |
---|
552 | man3direxp='' |
---|
553 | man3ext='' |
---|
554 | huge='' |
---|
555 | large='' |
---|
556 | medium='' |
---|
557 | models='' |
---|
558 | small='' |
---|
559 | split='' |
---|
560 | modetype='' |
---|
561 | mydomain='' |
---|
562 | myhostname='' |
---|
563 | phostname='' |
---|
564 | c='' |
---|
565 | n='' |
---|
566 | d_eofnblk='' |
---|
567 | eagain='' |
---|
568 | o_nonblock='' |
---|
569 | rd_nodata='' |
---|
570 | groupcat='' |
---|
571 | hostcat='' |
---|
572 | passcat='' |
---|
573 | d_oldarchlib='' |
---|
574 | oldarchlib='' |
---|
575 | oldarchlibexp='' |
---|
576 | orderlib='' |
---|
577 | ranlib='' |
---|
578 | package='' |
---|
579 | spackage='' |
---|
580 | pager='' |
---|
581 | patchlevel='' |
---|
582 | subversion='' |
---|
583 | perladmin='' |
---|
584 | perlpath='' |
---|
585 | prefix='' |
---|
586 | prefixexp='' |
---|
587 | installprivlib='' |
---|
588 | privlib='' |
---|
589 | privlibexp='' |
---|
590 | prototype='' |
---|
591 | randbits='' |
---|
592 | installscript='' |
---|
593 | scriptdir='' |
---|
594 | scriptdirexp='' |
---|
595 | selecttype='' |
---|
596 | sh='' |
---|
597 | sig_name='' |
---|
598 | sig_num='' |
---|
599 | installsitearch='' |
---|
600 | sitearch='' |
---|
601 | sitearchexp='' |
---|
602 | installsitelib='' |
---|
603 | sitelib='' |
---|
604 | sitelibexp='' |
---|
605 | sizetype='' |
---|
606 | so='' |
---|
607 | sharpbang='' |
---|
608 | shsharp='' |
---|
609 | spitshell='' |
---|
610 | ssizetype='' |
---|
611 | startperl='' |
---|
612 | startsh='' |
---|
613 | stdchar='' |
---|
614 | sysman='' |
---|
615 | uidtype='' |
---|
616 | nm_opt='' |
---|
617 | nm_so_opt='' |
---|
618 | runnm='' |
---|
619 | usenm='' |
---|
620 | useperlio='' |
---|
621 | incpath='' |
---|
622 | mips='' |
---|
623 | mips_type='' |
---|
624 | usrinc='' |
---|
625 | defvoidused='' |
---|
626 | voidflags='' |
---|
627 | CONFIG='' |
---|
628 | |
---|
629 | define='define' |
---|
630 | undef='undef' |
---|
631 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' |
---|
632 | rmlist='' |
---|
633 | |
---|
634 | : We must find out about Eunice early |
---|
635 | eunicefix=':' |
---|
636 | if test -f /etc/unixtovms; then |
---|
637 | eunicefix=/etc/unixtovms |
---|
638 | fi |
---|
639 | if test -f /etc/unixtovms.exe; then |
---|
640 | eunicefix=/etc/unixtovms.exe |
---|
641 | fi |
---|
642 | |
---|
643 | : list of known cpp symbols, sorted alphabetically |
---|
644 | al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2" |
---|
645 | al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH" |
---|
646 | al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" |
---|
647 | al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" |
---|
648 | al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" |
---|
649 | al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" |
---|
650 | al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4" |
---|
651 | al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" |
---|
652 | al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" |
---|
653 | al="$al VMS Xenix286" |
---|
654 | al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI" |
---|
655 | al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET" |
---|
656 | al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" |
---|
657 | al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" |
---|
658 | al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" |
---|
659 | al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" |
---|
660 | al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" |
---|
661 | al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" |
---|
662 | al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" |
---|
663 | al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" |
---|
664 | al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" |
---|
665 | al="$al __SVR4_2__ __UMAXV__" |
---|
666 | al="$al ____386BSD____ __alpha __alpha__ __amiga" |
---|
667 | al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" |
---|
668 | al="$al __host_mips__" |
---|
669 | al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" |
---|
670 | al="$al __hp9000s500 __hp9000s700 __hp9000s800" |
---|
671 | al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" |
---|
672 | al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" |
---|
673 | al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" |
---|
674 | al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" |
---|
675 | al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" |
---|
676 | al="$al __mc88100 __mc88100__ __mips __mips__" |
---|
677 | al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" |
---|
678 | al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" |
---|
679 | al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" |
---|
680 | al="$al _host_mips _mips _unix" |
---|
681 | al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" |
---|
682 | al="$al apollo ardent att386 att3b" |
---|
683 | al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" |
---|
684 | al="$al cadmus clipper concurrent convex cray ctix" |
---|
685 | al="$al dmert encore gcos gcx gimpel gould" |
---|
686 | al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" |
---|
687 | al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" |
---|
688 | al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" |
---|
689 | al="$al i186 i286 i386 i486 i8086" |
---|
690 | al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" |
---|
691 | al="$al ksr1 linux luna luna88k m68k m88100 m88k" |
---|
692 | al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" |
---|
693 | al="$al mc68040 mc68060 mc68k mc68k32 mc700" |
---|
694 | al="$al mc88000 mc88100 merlin mert mips mvs n16" |
---|
695 | al="$al ncl_el ncl_mr" |
---|
696 | al="$al news1500 news1700 news1800 news1900 news3700" |
---|
697 | al="$al news700 news800 news900 ns16000 ns32000" |
---|
698 | al="$al ns32016 ns32332 ns32k nsc32000 os osf" |
---|
699 | al="$al parisc pc532 pdp11 plexus posix pyr" |
---|
700 | al="$al riscix riscos scs sequent sgi sinix sony sony_news" |
---|
701 | al="$al sonyrisc sparc sparclite spectrum stardent stratos" |
---|
702 | al="$al sun sun3 sun386 svr4 sysV68 sysV88" |
---|
703 | al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" |
---|
704 | al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" |
---|
705 | al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms" |
---|
706 | al="$al xenix z8000" |
---|
707 | |
---|
708 | groupstype='' |
---|
709 | i_whoami='' |
---|
710 | : default library list |
---|
711 | libswanted='' |
---|
712 | : set useposix=false in your hint file to disable the POSIX extension. |
---|
713 | useposix=true |
---|
714 | : set useopcode=false in your hint file to disable the Opcode extension. |
---|
715 | useopcode=true |
---|
716 | : Define several unixisms. These can be used in hint files. |
---|
717 | exe_ext='' |
---|
718 | : Extra object files, if any, needed on this platform. |
---|
719 | archobjs='' |
---|
720 | : Possible local include directories to search. |
---|
721 | : Set locincpth to "" in a hint file to defeat local include searches. |
---|
722 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
---|
723 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" |
---|
724 | : |
---|
725 | : no include file wanted by default |
---|
726 | inclwanted='' |
---|
727 | |
---|
728 | : change the next line if compiling for Xenix/286 on Xenix/386 |
---|
729 | xlibpth='/usr/lib/386 /lib/386' |
---|
730 | |
---|
731 | : Possible local library directories to search. |
---|
732 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" |
---|
733 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" |
---|
734 | |
---|
735 | : general looking path for locating libraries |
---|
736 | glibpth="/shlib /usr/shlib /usr/lib/pa1.1 /usr/lib/large" |
---|
737 | glibpth="$glibpth /lib /usr/lib $xlibpth" |
---|
738 | glibpth="$glibpth /lib/large /usr/lib/small /lib/small" |
---|
739 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" |
---|
740 | |
---|
741 | : Private path used by Configure to find libraries. Its value |
---|
742 | : is prepended to libpth. This variable takes care of special |
---|
743 | : machines, like the mips. Usually, it should be empty. |
---|
744 | plibpth='' |
---|
745 | |
---|
746 | : full support for void wanted by default |
---|
747 | defvoidused=15 |
---|
748 | |
---|
749 | : List of libraries we want. |
---|
750 | libswanted='sfio net socket inet nsl nm ndbm gdbm dbm db malloc dl' |
---|
751 | libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" |
---|
752 | libswanted="$libswanted ucb bsd BSD PW x" |
---|
753 | : We probably want to search /usr/shlib before most other libraries. |
---|
754 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
---|
755 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
---|
756 | glibpth="/usr/shlib $glibpth" |
---|
757 | : Do not use vfork unless overridden by a hint file. |
---|
758 | usevfork=false |
---|
759 | |
---|
760 | : Find the basic shell for Bourne shell scripts |
---|
761 | case "$sh" in |
---|
762 | '') |
---|
763 | : SYSTYPE is for some older MIPS systems. |
---|
764 | : I do not know if it is still needed. |
---|
765 | case "$SYSTYPE" in |
---|
766 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; |
---|
767 | *) xxx='/bin/sh';; |
---|
768 | esac |
---|
769 | if test -f "$xxx"; then |
---|
770 | sh="$xxx" |
---|
771 | else |
---|
772 | : Build up a list and do a single loop so we can 'break' out. |
---|
773 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
---|
774 | for xxx in sh bash ksh pdksh ash; do |
---|
775 | for p in $pth; do |
---|
776 | try="$try ${p}/${xxx}" |
---|
777 | done |
---|
778 | done |
---|
779 | for xxx in $try; do |
---|
780 | if test -f "$xxx"; then |
---|
781 | sh="$xxx"; |
---|
782 | echo "Your Bourne shell appears to be in $sh." |
---|
783 | break |
---|
784 | elif test -f "$xxx.exe"; then |
---|
785 | sh="$xxx"; |
---|
786 | echo "Hmm. Your Bourne shell appears to be in $sh." |
---|
787 | break |
---|
788 | fi |
---|
789 | done |
---|
790 | fi |
---|
791 | ;; |
---|
792 | esac |
---|
793 | |
---|
794 | case "$sh" in |
---|
795 | '') cat <<EOM >&2 |
---|
796 | $me: Fatal Error: I can't find a Bourne Shell anywhere. |
---|
797 | Usually it's in /bin/sh. How did you even get this far? |
---|
798 | Please contact me (Chip Salzenberg) at chip@perl.com and |
---|
799 | we'll try to straigten this all out. |
---|
800 | EOM |
---|
801 | exit 1 |
---|
802 | ;; |
---|
803 | esac |
---|
804 | |
---|
805 | : see if sh knows # comments |
---|
806 | if `$sh -c '#' >/dev/null 2>&1`; then |
---|
807 | shsharp=true |
---|
808 | spitshell=cat |
---|
809 | echo " " |
---|
810 | xcat=/bin/cat |
---|
811 | test -f $xcat || xcat=/usr/bin/cat |
---|
812 | echo "#!$xcat" >try |
---|
813 | $eunicefix try |
---|
814 | chmod +x try |
---|
815 | ./try > today |
---|
816 | if test -s today; then |
---|
817 | sharpbang='#!' |
---|
818 | else |
---|
819 | echo "#! $xcat" > try |
---|
820 | $eunicefix try |
---|
821 | chmod +x try |
---|
822 | ./try > today |
---|
823 | if test -s today; then |
---|
824 | sharpbang='#! ' |
---|
825 | else |
---|
826 | echo "Okay, let's see if #! works on this system..." |
---|
827 | echo "It's just a comment." |
---|
828 | sharpbang=': use ' |
---|
829 | fi |
---|
830 | fi |
---|
831 | else |
---|
832 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
---|
833 | shsharp=false |
---|
834 | cd .. |
---|
835 | echo "exec grep -v '^[ ]*#'" >spitshell |
---|
836 | chmod +x spitshell |
---|
837 | $eunicefix spitshell |
---|
838 | spitshell=`pwd`/spitshell |
---|
839 | cd UU |
---|
840 | echo "I presume that if # doesn't work, #! won't work either!" |
---|
841 | sharpbang=': use ' |
---|
842 | fi |
---|
843 | rm -f try today |
---|
844 | |
---|
845 | : figure out how to guarantee sh startup |
---|
846 | case "$startsh" in |
---|
847 | '') startsh=${sharpbang}${sh} ;; |
---|
848 | *) |
---|
849 | esac |
---|
850 | cat >try <<EOSS |
---|
851 | $startsh |
---|
852 | set abc |
---|
853 | test "$?abc" != 1 |
---|
854 | EOSS |
---|
855 | |
---|
856 | chmod +x try |
---|
857 | $eunicefix try |
---|
858 | if ./try; then |
---|
859 | : echo "Yup, it does." |
---|
860 | else |
---|
861 | echo "Hmm. '$startsh' didn't work." |
---|
862 | echo "You may have to fix up the shell scripts to make sure sh runs them." |
---|
863 | fi |
---|
864 | rm -f try |
---|
865 | |
---|
866 | : script used to extract .SH files with variable substitutions |
---|
867 | cat >extract <<EOS |
---|
868 | $startsh |
---|
869 | EOS |
---|
870 | cat >>extract <<'EOS' |
---|
871 | CONFIG=true |
---|
872 | echo "Doing variable substitutions on .SH files..." |
---|
873 | if test -f MANIFEST; then |
---|
874 | shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'` |
---|
875 | : Pick up possible extension manifests. |
---|
876 | for dir in ext/* ; do |
---|
877 | if test -f $dir/MANIFEST; then |
---|
878 | xxx=`awk '{print $1}' < $dir/MANIFEST | |
---|
879 | sed -n "/\.SH$/ s@^@$dir/@p"` |
---|
880 | shlist="$shlist $xxx" |
---|
881 | fi |
---|
882 | done |
---|
883 | set x $shlist |
---|
884 | else |
---|
885 | echo "(Looking for .SH files under the current directory.)" |
---|
886 | set x `find . -name "*.SH" -print` |
---|
887 | fi |
---|
888 | shift |
---|
889 | case $# in |
---|
890 | 0) set x *.SH; shift;; |
---|
891 | esac |
---|
892 | if test ! -f $1; then |
---|
893 | shift |
---|
894 | fi |
---|
895 | for file in $*; do |
---|
896 | case "$file" in |
---|
897 | */*) |
---|
898 | dir=`expr X$file : 'X\(.*\)/'` |
---|
899 | file=`expr X$file : 'X.*/\(.*\)'` |
---|
900 | (cd $dir && . ./$file) |
---|
901 | ;; |
---|
902 | *) |
---|
903 | . ./$file |
---|
904 | ;; |
---|
905 | esac |
---|
906 | done |
---|
907 | if test -f config_h.SH; then |
---|
908 | if test ! -f config.h; then |
---|
909 | : oops, they left it out of MANIFEST, probably, so do it anyway. |
---|
910 | . ./config_h.SH |
---|
911 | fi |
---|
912 | fi |
---|
913 | EOS |
---|
914 | |
---|
915 | : produce awk script to parse command line options |
---|
916 | cat >options.awk <<'EOF' |
---|
917 | BEGIN { |
---|
918 | optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification |
---|
919 | |
---|
920 | len = length(optstr); |
---|
921 | for (i = 1; i <= len; i++) { |
---|
922 | c = substr(optstr, i, 1); |
---|
923 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; |
---|
924 | if (a == ":") { |
---|
925 | arg[c] = 1; |
---|
926 | i++; |
---|
927 | } |
---|
928 | opt[c] = 1; |
---|
929 | } |
---|
930 | } |
---|
931 | { |
---|
932 | expect = 0; |
---|
933 | str = $0; |
---|
934 | if (substr(str, 1, 1) != "-") { |
---|
935 | printf("'%s'\n", str); |
---|
936 | next; |
---|
937 | } |
---|
938 | len = length($0); |
---|
939 | for (i = 2; i <= len; i++) { |
---|
940 | c = substr(str, i, 1); |
---|
941 | if (!opt[c]) { |
---|
942 | printf("-%s\n", substr(str, i)); |
---|
943 | next; |
---|
944 | } |
---|
945 | printf("-%s\n", c); |
---|
946 | if (arg[c]) { |
---|
947 | if (i < len) |
---|
948 | printf("'%s'\n", substr(str, i + 1)); |
---|
949 | else |
---|
950 | expect = 1; |
---|
951 | next; |
---|
952 | } |
---|
953 | } |
---|
954 | } |
---|
955 | END { |
---|
956 | if (expect) |
---|
957 | print "?"; |
---|
958 | } |
---|
959 | EOF |
---|
960 | |
---|
961 | : process the command line options |
---|
962 | set X `for arg in "$@"; do echo "X$arg"; done | |
---|
963 | sed -e s/X// | awk -f options.awk` |
---|
964 | eval "set $*" |
---|
965 | shift |
---|
966 | rm -f options.awk |
---|
967 | |
---|
968 | : set up default values |
---|
969 | fastread='' |
---|
970 | reuseval=false |
---|
971 | config_sh='' |
---|
972 | alldone='' |
---|
973 | error='' |
---|
974 | silent='' |
---|
975 | extractsh='' |
---|
976 | override='' |
---|
977 | knowitall='' |
---|
978 | |
---|
979 | rm -f optdef.sh |
---|
980 | cat >optdef.sh <<EOS |
---|
981 | $startsh |
---|
982 | EOS |
---|
983 | |
---|
984 | : option parsing |
---|
985 | while test $# -gt 0; do |
---|
986 | case "$1" in |
---|
987 | -d) shift; fastread=yes;; |
---|
988 | -e) shift; alldone=cont;; |
---|
989 | -f) |
---|
990 | shift |
---|
991 | cd .. |
---|
992 | if test -r "$1"; then |
---|
993 | config_sh="$1" |
---|
994 | else |
---|
995 | echo "$me: cannot read config file $1." >&2 |
---|
996 | error=true |
---|
997 | fi |
---|
998 | cd UU |
---|
999 | shift;; |
---|
1000 | -h) shift; error=true;; |
---|
1001 | -r) shift; reuseval=true;; |
---|
1002 | -s) shift; silent=true;; |
---|
1003 | -E) shift; alldone=exit;; |
---|
1004 | -K) shift; knowitall=true;; |
---|
1005 | -O) shift; override=true;; |
---|
1006 | -S) shift; extractsh=true;; |
---|
1007 | -D) |
---|
1008 | shift |
---|
1009 | case "$1" in |
---|
1010 | *=) |
---|
1011 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 |
---|
1012 | echo "$me: ignoring -D $1" >&2 |
---|
1013 | ;; |
---|
1014 | *=*) echo "$1" | \ |
---|
1015 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
---|
1016 | *) echo "$1='define'" >> optdef.sh;; |
---|
1017 | esac |
---|
1018 | shift |
---|
1019 | ;; |
---|
1020 | -U) |
---|
1021 | shift |
---|
1022 | case "$1" in |
---|
1023 | *=) echo "$1" >> optdef.sh;; |
---|
1024 | *=*) |
---|
1025 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 |
---|
1026 | echo "$me: ignoring -U $1" >&2 |
---|
1027 | ;; |
---|
1028 | *) echo "$1='undef'" >> optdef.sh;; |
---|
1029 | esac |
---|
1030 | shift |
---|
1031 | ;; |
---|
1032 | -V) echo "$me generated by metaconfig 3.0 PL60." >&2 |
---|
1033 | exit 0;; |
---|
1034 | --) break;; |
---|
1035 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
---|
1036 | *) break;; |
---|
1037 | esac |
---|
1038 | done |
---|
1039 | |
---|
1040 | case "$error" in |
---|
1041 | true) |
---|
1042 | cat >&2 <<EOM |
---|
1043 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
---|
1044 | [-U symbol] [-U symbol=] |
---|
1045 | -d : use defaults for all answers. |
---|
1046 | -e : go on without questioning past the production of config.sh. |
---|
1047 | -f : specify an alternate default configuration file. |
---|
1048 | -h : print this help message and exit (with an error status). |
---|
1049 | -r : reuse C symbols value if possible (skips costly nm extraction). |
---|
1050 | -s : silent mode, only echoes questions and essential information. |
---|
1051 | -D : define symbol to have some value: |
---|
1052 | -D symbol symbol gets the value 'define' |
---|
1053 | -D symbol=value symbol gets the value 'value' |
---|
1054 | -E : stop at the end of questions, after having produced config.sh. |
---|
1055 | -K : do not use unless you know what you are doing. |
---|
1056 | -O : let -D and -U override definitions from loaded configuration file. |
---|
1057 | -S : perform variable substitutions on all .SH files (can mix with -f) |
---|
1058 | -U : undefine symbol: |
---|
1059 | -U symbol symbol gets the value 'undef' |
---|
1060 | -U symbol= symbol gets completely empty |
---|
1061 | -V : print version number and exit (with a zero status). |
---|
1062 | EOM |
---|
1063 | exit 1 |
---|
1064 | ;; |
---|
1065 | esac |
---|
1066 | |
---|
1067 | exec 4>&1 |
---|
1068 | case "$silent" in |
---|
1069 | true) exec 1>/dev/null;; |
---|
1070 | esac |
---|
1071 | |
---|
1072 | : run the defines and the undefines, if any, but leave the file out there... |
---|
1073 | touch optdef.sh |
---|
1074 | . ./optdef.sh |
---|
1075 | |
---|
1076 | case "$extractsh" in |
---|
1077 | true) |
---|
1078 | case "$config_sh" in |
---|
1079 | '') config_sh='config.sh'; config='./config.sh';; |
---|
1080 | /*) config="$config_sh";; |
---|
1081 | *) config="./$config_sh";; |
---|
1082 | esac |
---|
1083 | echo " " |
---|
1084 | echo "Fetching answers from $config_sh..." |
---|
1085 | cd .. |
---|
1086 | . $config |
---|
1087 | test "$override" && . ./optdef.sh |
---|
1088 | echo " " |
---|
1089 | . ./UU/extract |
---|
1090 | rm -rf UU |
---|
1091 | echo "Done." |
---|
1092 | exit 0 |
---|
1093 | ;; |
---|
1094 | esac |
---|
1095 | |
---|
1096 | : set package name |
---|
1097 | package=perl5 |
---|
1098 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
---|
1099 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` |
---|
1100 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in |
---|
1101 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; |
---|
1102 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; |
---|
1103 | esac |
---|
1104 | |
---|
1105 | : Eunice requires " " instead of "", can you believe it |
---|
1106 | echo " " |
---|
1107 | : Here we go... |
---|
1108 | echo "Beginning of configuration questions for $package." |
---|
1109 | |
---|
1110 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 |
---|
1111 | |
---|
1112 | : Some greps do not return status, grrr. |
---|
1113 | echo "grimblepritz" >grimble |
---|
1114 | if grep blurfldyick grimble >/dev/null 2>&1 ; then |
---|
1115 | contains=contains |
---|
1116 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then |
---|
1117 | contains=grep |
---|
1118 | else |
---|
1119 | contains=contains |
---|
1120 | fi |
---|
1121 | rm -f grimble |
---|
1122 | : the following should work in any shell |
---|
1123 | case "$contains" in |
---|
1124 | contains*) |
---|
1125 | echo " " |
---|
1126 | echo "AGH! Grep doesn't return a status. Attempting remedial action." |
---|
1127 | cat >contains <<'EOSS' |
---|
1128 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp |
---|
1129 | EOSS |
---|
1130 | chmod +x contains |
---|
1131 | esac |
---|
1132 | |
---|
1133 | : first determine how to suppress newline on echo command |
---|
1134 | echo " " |
---|
1135 | echo "Checking echo to see how to suppress newlines..." |
---|
1136 | (echo "hi there\c" ; echo " ") >.echotmp |
---|
1137 | if $contains c .echotmp >/dev/null 2>&1 ; then |
---|
1138 | echo "...using -n." |
---|
1139 | n='-n' |
---|
1140 | c='' |
---|
1141 | else |
---|
1142 | cat <<'EOM' |
---|
1143 | ...using \c |
---|
1144 | EOM |
---|
1145 | n='' |
---|
1146 | c='\c' |
---|
1147 | fi |
---|
1148 | echo $n "The star should be here-->$c" |
---|
1149 | echo '*' |
---|
1150 | rm -f .echotmp |
---|
1151 | |
---|
1152 | : Now test for existence of everything in MANIFEST |
---|
1153 | echo " " |
---|
1154 | if test -f ../MANIFEST; then |
---|
1155 | echo "First let's make sure your kit is complete. Checking..." >&4 |
---|
1156 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50 |
---|
1157 | rm -f missing |
---|
1158 | for filelist in x??; do |
---|
1159 | (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing) |
---|
1160 | done |
---|
1161 | if test -s missing; then |
---|
1162 | cat missing >&4 |
---|
1163 | cat >&4 <<'EOM' |
---|
1164 | |
---|
1165 | THIS PACKAGE SEEMS TO BE INCOMPLETE. |
---|
1166 | |
---|
1167 | You have the option of continuing the configuration process, despite the |
---|
1168 | distinct possibility that your kit is damaged, by typing 'y'es. If you |
---|
1169 | do, don't blame me if something goes wrong. I advise you to type 'n'o |
---|
1170 | and contact the author (chip@perl.com). |
---|
1171 | |
---|
1172 | EOM |
---|
1173 | echo $n "Continue? [n] $c" >&4 |
---|
1174 | read ans |
---|
1175 | case "$ans" in |
---|
1176 | y*) |
---|
1177 | echo "Continuing..." >&4 |
---|
1178 | rm -f missing |
---|
1179 | ;; |
---|
1180 | *) |
---|
1181 | echo "ABORTING..." >&4 |
---|
1182 | kill $$ |
---|
1183 | ;; |
---|
1184 | esac |
---|
1185 | else |
---|
1186 | echo "Looks good..." >&4 |
---|
1187 | fi |
---|
1188 | else |
---|
1189 | echo "There is no MANIFEST file. I hope your kit is complete !" |
---|
1190 | fi |
---|
1191 | rm -f missing x?? |
---|
1192 | |
---|
1193 | : compute the number of columns on the terminal for proper question formatting |
---|
1194 | case "$COLUMNS" in |
---|
1195 | '') COLUMNS='80';; |
---|
1196 | esac |
---|
1197 | |
---|
1198 | : set up the echo used in my read |
---|
1199 | myecho="case \"\$xxxm\" in |
---|
1200 | '') echo $n \"\$rp $c\" >&4;; |
---|
1201 | *) case \"\$rp\" in |
---|
1202 | '') echo $n \"[\$xxxm] $c\";; |
---|
1203 | *) |
---|
1204 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then |
---|
1205 | echo \"\$rp\" >&4 |
---|
1206 | echo $n \"[\$xxxm] $c\" >&4 |
---|
1207 | else |
---|
1208 | echo $n \"\$rp [\$xxxm] $c\" >&4 |
---|
1209 | fi |
---|
1210 | ;; |
---|
1211 | esac;; |
---|
1212 | esac" |
---|
1213 | |
---|
1214 | : now set up to do reads with possible shell escape and default assignment |
---|
1215 | cat <<EOSC >myread |
---|
1216 | $startsh |
---|
1217 | xxxm=\$dflt |
---|
1218 | $myecho |
---|
1219 | ans='!' |
---|
1220 | case "\$fastread" in |
---|
1221 | yes) case "\$dflt" in |
---|
1222 | '') ;; |
---|
1223 | *) ans=''; |
---|
1224 | case "\$silent-\$rp" in |
---|
1225 | true-) ;; |
---|
1226 | *) echo " " >&4;; |
---|
1227 | esac;; |
---|
1228 | esac;; |
---|
1229 | *) case "\$silent" in |
---|
1230 | true) case "\$rp" in |
---|
1231 | '') ans='';; |
---|
1232 | esac;; |
---|
1233 | esac;; |
---|
1234 | esac |
---|
1235 | while expr "X\$ans" : "X!" >/dev/null; do |
---|
1236 | read answ |
---|
1237 | set x \$xxxm |
---|
1238 | shift |
---|
1239 | aok=''; eval ans="\\"\$answ\\"" && aok=y |
---|
1240 | case "\$answ" in |
---|
1241 | "\$ans") |
---|
1242 | case "\$ans" in |
---|
1243 | \\&*) |
---|
1244 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` |
---|
1245 | shift |
---|
1246 | case "\$1" in |
---|
1247 | -d) |
---|
1248 | fastread=yes |
---|
1249 | echo "(OK, I'll run with -d after this question.)" >&4 |
---|
1250 | ;; |
---|
1251 | -*) |
---|
1252 | echo "*** Sorry, \$1 not supported yet." >&4 |
---|
1253 | ;; |
---|
1254 | esac |
---|
1255 | $myecho |
---|
1256 | ans=! |
---|
1257 | ;; |
---|
1258 | "!") |
---|
1259 | sh 1>&4 |
---|
1260 | echo " " |
---|
1261 | $myecho |
---|
1262 | ;; |
---|
1263 | !*) |
---|
1264 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` |
---|
1265 | shift |
---|
1266 | sh 1>&4 -c "\$*" |
---|
1267 | echo " " |
---|
1268 | $myecho |
---|
1269 | ;; |
---|
1270 | esac;; |
---|
1271 | *) |
---|
1272 | case "\$aok" in |
---|
1273 | y) |
---|
1274 | echo "*** Substitution done -- please confirm." |
---|
1275 | xxxm="\$ans" |
---|
1276 | ans=\`echo $n "\$ans$c" | tr '\012' ' '\` |
---|
1277 | xxxm="\$ans" |
---|
1278 | ans=! |
---|
1279 | ;; |
---|
1280 | *) |
---|
1281 | echo "*** Error -- try again." |
---|
1282 | ans=! |
---|
1283 | ;; |
---|
1284 | esac |
---|
1285 | $myecho |
---|
1286 | ;; |
---|
1287 | esac |
---|
1288 | case "\$ans\$xxxm\$nostick" in |
---|
1289 | '') |
---|
1290 | ans=! |
---|
1291 | $myecho |
---|
1292 | ;; |
---|
1293 | esac |
---|
1294 | done |
---|
1295 | case "\$ans" in |
---|
1296 | '') ans="\$xxxm";; |
---|
1297 | esac |
---|
1298 | EOSC |
---|
1299 | |
---|
1300 | : create .config dir to save info across Configure sessions |
---|
1301 | test -d ../.config || mkdir ../.config |
---|
1302 | cat >../.config/README <<EOF |
---|
1303 | This directory created by Configure to save information that should |
---|
1304 | persist across sessions. |
---|
1305 | |
---|
1306 | You may safely delete it if you wish. |
---|
1307 | EOF |
---|
1308 | |
---|
1309 | : general instructions |
---|
1310 | needman=true |
---|
1311 | firsttime=true |
---|
1312 | user=`(logname) 2>/dev/null` |
---|
1313 | case "$user" in "") |
---|
1314 | user=`whoami 2>&1` ;; |
---|
1315 | esac |
---|
1316 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
---|
1317 | firsttime=false |
---|
1318 | echo " " |
---|
1319 | rp='Would you like to see the instructions?' |
---|
1320 | dflt=n |
---|
1321 | . ./myread |
---|
1322 | case "$ans" in |
---|
1323 | [yY]*) ;; |
---|
1324 | *) needman=false;; |
---|
1325 | esac |
---|
1326 | fi |
---|
1327 | if $needman; then |
---|
1328 | cat <<EOH |
---|
1329 | |
---|
1330 | This installation shell script will examine your system and ask you questions |
---|
1331 | to determine how the perl5 package should be installed. If you get |
---|
1332 | stuck on a question, you may use a ! shell escape to start a subshell or |
---|
1333 | execute a command. Many of the questions will have default answers in square |
---|
1334 | brackets; typing carriage return will give you the default. |
---|
1335 | |
---|
1336 | On some of the questions which ask for file or directory names you are allowed |
---|
1337 | to use the ~name construct to specify the login directory belonging to "name", |
---|
1338 | even if you don't have a shell which knows about that. Questions where this is |
---|
1339 | allowed will be marked "(~name ok)". |
---|
1340 | |
---|
1341 | EOH |
---|
1342 | rp='' |
---|
1343 | dflt='Type carriage return to continue' |
---|
1344 | . ./myread |
---|
1345 | cat <<'EOH' |
---|
1346 | |
---|
1347 | The prompter used in this script allows you to use shell variables and |
---|
1348 | backticks in your answers. You may use $1, $2, etc... to refer to the words |
---|
1349 | in the default answer, as if the default line was a set of arguments given to a |
---|
1350 | script shell. This means you may also use $* to repeat the whole default line, |
---|
1351 | so you do not have to re-type everything to add something to the default. |
---|
1352 | |
---|
1353 | Everytime there is a substitution, you will have to confirm. If there is an |
---|
1354 | error (e.g. an unmatched backtick), the default answer will remain unchanged |
---|
1355 | and you will be prompted again. |
---|
1356 | |
---|
1357 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all |
---|
1358 | the questions and use the computed defaults (or the previous answers if there |
---|
1359 | was already a config.sh file). Type 'Configure -h' for a list of options. |
---|
1360 | You may also start interactively and then answer '& -d' at any prompt to turn |
---|
1361 | on the non-interactive behavior for the remainder of the execution. |
---|
1362 | |
---|
1363 | EOH |
---|
1364 | . ./myread |
---|
1365 | cat <<EOH |
---|
1366 | |
---|
1367 | Much effort has been expended to ensure that this shell script will run on any |
---|
1368 | Unix system. If despite that it blows up on yours, your best bet is to edit |
---|
1369 | Configure and run it again. If you can't run Configure for some reason, |
---|
1370 | you'll have to generate a config.sh file by hand. Whatever problems you |
---|
1371 | have, let me (chip@perl.com) know how I blew it. |
---|
1372 | |
---|
1373 | This installation script affects things in two ways: |
---|
1374 | |
---|
1375 | 1) it may do direct variable substitutions on some of the files included |
---|
1376 | in this kit. |
---|
1377 | 2) it builds a config.h file for inclusion in C programs. You may edit |
---|
1378 | any of these files as the need arises after running this script. |
---|
1379 | |
---|
1380 | If you make a mistake on a question, there is no easy way to back up to it |
---|
1381 | currently. The easiest thing to do is to edit config.sh and rerun all the SH |
---|
1382 | files. Configure will offer to let you do this before it runs the SH files. |
---|
1383 | |
---|
1384 | EOH |
---|
1385 | dflt='Type carriage return to continue' |
---|
1386 | . ./myread |
---|
1387 | case "$firsttime" in |
---|
1388 | true) echo $user >>../.config/instruct;; |
---|
1389 | esac |
---|
1390 | fi |
---|
1391 | |
---|
1392 | : find out where common programs are |
---|
1393 | echo " " |
---|
1394 | echo "Locating common programs..." >&4 |
---|
1395 | cat <<EOSC >loc |
---|
1396 | $startsh |
---|
1397 | case \$# in |
---|
1398 | 0) exit 1;; |
---|
1399 | esac |
---|
1400 | thing=\$1 |
---|
1401 | shift |
---|
1402 | dflt=\$1 |
---|
1403 | shift |
---|
1404 | for dir in \$*; do |
---|
1405 | case "\$thing" in |
---|
1406 | .) |
---|
1407 | if test -d \$dir/\$thing; then |
---|
1408 | echo \$dir |
---|
1409 | exit 0 |
---|
1410 | fi |
---|
1411 | ;; |
---|
1412 | *) |
---|
1413 | for thisthing in \$dir/\$thing; do |
---|
1414 | : just loop through to pick last item |
---|
1415 | done |
---|
1416 | if test -f \$thisthing; then |
---|
1417 | echo \$thisthing |
---|
1418 | exit 0 |
---|
1419 | elif test -f \$dir/\$thing.exe; then |
---|
1420 | : on Eunice apparently |
---|
1421 | echo \$dir/\$thing |
---|
1422 | exit 0 |
---|
1423 | fi |
---|
1424 | ;; |
---|
1425 | esac |
---|
1426 | done |
---|
1427 | echo \$dflt |
---|
1428 | exit 1 |
---|
1429 | EOSC |
---|
1430 | chmod +x loc |
---|
1431 | $eunicefix loc |
---|
1432 | loclist=" |
---|
1433 | awk |
---|
1434 | cat |
---|
1435 | comm |
---|
1436 | cp |
---|
1437 | echo |
---|
1438 | expr |
---|
1439 | find |
---|
1440 | grep |
---|
1441 | ls |
---|
1442 | mkdir |
---|
1443 | rm |
---|
1444 | sed |
---|
1445 | sort |
---|
1446 | touch |
---|
1447 | tr |
---|
1448 | uniq |
---|
1449 | " |
---|
1450 | trylist=" |
---|
1451 | Mcc |
---|
1452 | byacc |
---|
1453 | cpp |
---|
1454 | csh |
---|
1455 | date |
---|
1456 | egrep |
---|
1457 | gzip |
---|
1458 | less |
---|
1459 | line |
---|
1460 | ln |
---|
1461 | more |
---|
1462 | nroff |
---|
1463 | perl |
---|
1464 | pg |
---|
1465 | sendmail |
---|
1466 | test |
---|
1467 | uname |
---|
1468 | zip |
---|
1469 | " |
---|
1470 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
---|
1471 | pth="$pth /lib /usr/lib" |
---|
1472 | for file in $loclist; do |
---|
1473 | xxx=`./loc $file $file $pth` |
---|
1474 | eval $file=$xxx |
---|
1475 | eval _$file=$xxx |
---|
1476 | case "$xxx" in |
---|
1477 | /*) |
---|
1478 | echo $file is in $xxx. |
---|
1479 | ;; |
---|
1480 | ?:[\\/]*) |
---|
1481 | echo $file is in $xxx. |
---|
1482 | ;; |
---|
1483 | *) |
---|
1484 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
---|
1485 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 |
---|
1486 | exit 1 |
---|
1487 | ;; |
---|
1488 | esac |
---|
1489 | done |
---|
1490 | echo " " |
---|
1491 | echo "Don't worry if any of the following aren't found..." |
---|
1492 | say=offhand |
---|
1493 | for file in $trylist; do |
---|
1494 | xxx=`./loc $file $file $pth` |
---|
1495 | eval $file=$xxx |
---|
1496 | eval _$file=$xxx |
---|
1497 | case "$xxx" in |
---|
1498 | /*) |
---|
1499 | echo $file is in $xxx. |
---|
1500 | ;; |
---|
1501 | ?:[\\/]*) |
---|
1502 | echo $file is in $xxx. |
---|
1503 | ;; |
---|
1504 | *) |
---|
1505 | echo "I don't see $file out there, $say." |
---|
1506 | say=either |
---|
1507 | ;; |
---|
1508 | esac |
---|
1509 | done |
---|
1510 | case "$egrep" in |
---|
1511 | egrep) |
---|
1512 | echo "Substituting grep for egrep." |
---|
1513 | egrep=$grep |
---|
1514 | ;; |
---|
1515 | esac |
---|
1516 | case "$ln" in |
---|
1517 | ln) |
---|
1518 | echo "Substituting cp for ln." |
---|
1519 | ln=$cp |
---|
1520 | ;; |
---|
1521 | esac |
---|
1522 | case "$test" in |
---|
1523 | test) |
---|
1524 | echo "Hopefully test is built into your sh." |
---|
1525 | ;; |
---|
1526 | *) |
---|
1527 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
---|
1528 | echo "Using the test built into your sh." |
---|
1529 | test=test |
---|
1530 | _test=test |
---|
1531 | fi |
---|
1532 | ;; |
---|
1533 | esac |
---|
1534 | case "$echo" in |
---|
1535 | echo) |
---|
1536 | echo "Hopefully echo is built into your sh." |
---|
1537 | ;; |
---|
1538 | '') ;; |
---|
1539 | *) |
---|
1540 | echo " " |
---|
1541 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 |
---|
1542 | $echo $n "hi there$c" >foo1 |
---|
1543 | echo $n "hi there$c" >foo2 |
---|
1544 | if cmp foo1 foo2 >/dev/null 2>&1; then |
---|
1545 | echo "They are compatible. In fact, they may be identical." |
---|
1546 | else |
---|
1547 | case "$n" in |
---|
1548 | '-n') n='' c='\c';; |
---|
1549 | *) n='-n' c='';; |
---|
1550 | esac |
---|
1551 | cat <<FOO |
---|
1552 | They are not compatible! You are probably running ksh on a non-USG system. |
---|
1553 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't |
---|
1554 | have echo built in and we may have to run some Bourne shell scripts. That |
---|
1555 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. |
---|
1556 | |
---|
1557 | FOO |
---|
1558 | $echo $n "The star should be here-->$c" |
---|
1559 | $echo "*" |
---|
1560 | fi |
---|
1561 | $rm -f foo1 foo2 |
---|
1562 | ;; |
---|
1563 | esac |
---|
1564 | |
---|
1565 | : determine whether symbolic links are supported |
---|
1566 | echo " " |
---|
1567 | $touch blurfl |
---|
1568 | if $ln -s blurfl sym > /dev/null 2>&1 ; then |
---|
1569 | echo "Symbolic links are supported." >&4 |
---|
1570 | lns="$ln -s" |
---|
1571 | else |
---|
1572 | echo "Symbolic links are NOT supported." >&4 |
---|
1573 | lns="$ln" |
---|
1574 | fi |
---|
1575 | $rm -f blurfl sym |
---|
1576 | |
---|
1577 | : see whether [:lower:] and [:upper:] are supported character classes |
---|
1578 | echo " " |
---|
1579 | up='[A-Z]' |
---|
1580 | low='[a-z]' |
---|
1581 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in |
---|
1582 | ABYZ) |
---|
1583 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 |
---|
1584 | up='[:upper:]' |
---|
1585 | low='[:lower:]' |
---|
1586 | ;; |
---|
1587 | *) |
---|
1588 | echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 |
---|
1589 | ;; |
---|
1590 | esac |
---|
1591 | : set up the translation script tr, must be called with ./tr of course |
---|
1592 | cat >tr <<EOSC |
---|
1593 | $startsh |
---|
1594 | case "\$1\$2" in |
---|
1595 | '[A-Z][a-z]') exec $tr '$up' '$low';; |
---|
1596 | '[a-z][A-Z]') exec $tr '$low' '$up';; |
---|
1597 | esac |
---|
1598 | exec $tr "\$@" |
---|
1599 | EOSC |
---|
1600 | chmod +x tr |
---|
1601 | $eunicefix tr |
---|
1602 | |
---|
1603 | : Try to determine whether config.sh was made on this system |
---|
1604 | case "$config_sh" in |
---|
1605 | '') |
---|
1606 | myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` |
---|
1607 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
---|
1608 | ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` |
---|
1609 | newmyuname="$myuname" |
---|
1610 | dflt=n |
---|
1611 | case "$knowitall" in |
---|
1612 | '') |
---|
1613 | if test -f ../config.sh; then |
---|
1614 | if $contains myuname= ../config.sh >/dev/null 2>&1; then |
---|
1615 | eval "`grep myuname= ../config.sh`" |
---|
1616 | fi |
---|
1617 | if test "X$myuname" = "X$newmyuname"; then |
---|
1618 | dflt=y |
---|
1619 | fi |
---|
1620 | fi |
---|
1621 | ;; |
---|
1622 | *) dflt=y;; |
---|
1623 | esac |
---|
1624 | |
---|
1625 | : Get old answers from old config file if Configure was run on the |
---|
1626 | : same system, otherwise use the hints. |
---|
1627 | hint=default |
---|
1628 | cd .. |
---|
1629 | if test -f config.sh; then |
---|
1630 | echo " " |
---|
1631 | rp="I see a config.sh file. Shall I use it to set the defaults?" |
---|
1632 | . UU/myread |
---|
1633 | case "$ans" in |
---|
1634 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; |
---|
1635 | *) echo "Fetching default answers from your old config.sh file..." >&4 |
---|
1636 | tmp_n="$n" |
---|
1637 | tmp_c="$c" |
---|
1638 | tmp_sh="$sh" |
---|
1639 | . ./config.sh |
---|
1640 | cp config.sh UU |
---|
1641 | n="$tmp_n" |
---|
1642 | c="$tmp_c" |
---|
1643 | : Older versions did not always set $sh. Catch re-use of such |
---|
1644 | : an old config.sh. |
---|
1645 | case "$sh" in |
---|
1646 | '') sh="$tmp_sh" ;; |
---|
1647 | esac |
---|
1648 | hint=previous |
---|
1649 | ;; |
---|
1650 | esac |
---|
1651 | fi |
---|
1652 | if test ! -f config.sh; then |
---|
1653 | $cat <<EOM |
---|
1654 | |
---|
1655 | First time through, eh? I have some defaults handy for the following systems: |
---|
1656 | |
---|
1657 | EOM |
---|
1658 | cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4 |
---|
1659 | dflt='' |
---|
1660 | : Half the following guesses are probably wrong... If you have better |
---|
1661 | : tests or hints, please send them to chip@perl.com |
---|
1662 | : The metaconfig authors would also appreciate a copy... |
---|
1663 | $test -f /irix && osname=irix |
---|
1664 | $test -f /xenix && osname=sco_xenix |
---|
1665 | $test -f /dynix && osname=dynix |
---|
1666 | $test -f /dnix && osname=dnix |
---|
1667 | $test -f /lynx.os && osname=lynxos |
---|
1668 | $test -f /unicos && osname=unicos && osvers=`$uname -r` |
---|
1669 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
---|
1670 | $test -f /bin/mips && /bin/mips && osname=mips |
---|
1671 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
---|
1672 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 |
---|
1673 | $test -d /usr/apollo/bin && osname=apollo |
---|
1674 | $test -f /etc/saf/_sactab && osname=svr4 |
---|
1675 | $test -d /usr/include/minix && osname=minix |
---|
1676 | if $test -d /MachTen; then |
---|
1677 | osname=machten |
---|
1678 | if $test -x /sbin/version; then |
---|
1679 | osvers=`/sbin/version | $awk '{print $2}' | |
---|
1680 | $sed -e 's/[A-Za-z]$//'` |
---|
1681 | elif $test -x /usr/etc/version; then |
---|
1682 | osvers=`/usr/etc/version | $awk '{print $2}' | |
---|
1683 | $sed -e 's/[A-Za-z]$//'` |
---|
1684 | else |
---|
1685 | osvers="$2.$3" |
---|
1686 | fi |
---|
1687 | fi |
---|
1688 | if $test -f $uname; then |
---|
1689 | set X $myuname |
---|
1690 | shift |
---|
1691 | |
---|
1692 | case "$5" in |
---|
1693 | fps*) osname=fps ;; |
---|
1694 | mips*) |
---|
1695 | case "$4" in |
---|
1696 | umips) osname=umips ;; |
---|
1697 | *) osname=mips ;; |
---|
1698 | esac;; |
---|
1699 | [23]100) osname=mips ;; |
---|
1700 | next*) osname=next ;; |
---|
1701 | i386*) |
---|
1702 | if $test -f /etc/kconfig; then |
---|
1703 | osname=isc |
---|
1704 | if test "$lns" = "ln -s"; then |
---|
1705 | osvers=4 |
---|
1706 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then |
---|
1707 | osvers=3 |
---|
1708 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
---|
1709 | osvers=2 |
---|
1710 | fi |
---|
1711 | fi |
---|
1712 | ;; |
---|
1713 | esac |
---|
1714 | |
---|
1715 | case "$1" in |
---|
1716 | aix) osname=aix |
---|
1717 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` |
---|
1718 | case "$tmp" in |
---|
1719 | 'not found') osvers="$4"."$3" ;; |
---|
1720 | '<3240'|'<>3240') osvers=3.2.0 ;; |
---|
1721 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; |
---|
1722 | '=3250'|'>3250') osvers=3.2.5 ;; |
---|
1723 | *) osvers=$tmp;; |
---|
1724 | esac |
---|
1725 | ;; |
---|
1726 | *dc.osx) osname=dcosx |
---|
1727 | osvers="$3" |
---|
1728 | ;; |
---|
1729 | dnix) osname=dnix |
---|
1730 | osvers="$3" |
---|
1731 | ;; |
---|
1732 | domainos) osname=apollo |
---|
1733 | osvers="$3" |
---|
1734 | ;; |
---|
1735 | dgux) osname=dgux |
---|
1736 | osvers="$3" |
---|
1737 | ;; |
---|
1738 | dynixptx*) osname=dynixptx |
---|
1739 | osvers="$3" |
---|
1740 | ;; |
---|
1741 | freebsd) osname=freebsd |
---|
1742 | osvers="$3" ;; |
---|
1743 | genix) osname=genix ;; |
---|
1744 | hp*) osname=hpux |
---|
1745 | case "$3" in |
---|
1746 | *.08.*) osvers=9 ;; |
---|
1747 | *.09.*) osvers=9 ;; |
---|
1748 | *.10.*) osvers=10 ;; |
---|
1749 | *) osvers="$3" ;; |
---|
1750 | esac |
---|
1751 | ;; |
---|
1752 | irix*) osname=irix |
---|
1753 | case "$3" in |
---|
1754 | 4*) osvers=4 ;; |
---|
1755 | 5*) osvers=5 ;; |
---|
1756 | *) osvers="$3" ;; |
---|
1757 | esac |
---|
1758 | ;; |
---|
1759 | linux) osname=linux |
---|
1760 | case "$3" in |
---|
1761 | *) osvers="$3" ;; |
---|
1762 | esac |
---|
1763 | ;; |
---|
1764 | netbsd*) osname=netbsd |
---|
1765 | osvers="$3" |
---|
1766 | ;; |
---|
1767 | news-os) osvers="$3" |
---|
1768 | case "$3" in |
---|
1769 | 4*) osname=newsos4 ;; |
---|
1770 | *) osname=newsos ;; |
---|
1771 | esac |
---|
1772 | ;; |
---|
1773 | bsd386) osname=bsd386 |
---|
1774 | osvers=`$uname -r` |
---|
1775 | ;; |
---|
1776 | powerux | power_ux | powermax_os | powermaxos | \ |
---|
1777 | powerunix | power_unix) osname=powerux |
---|
1778 | osvers="$3" |
---|
1779 | ;; |
---|
1780 | next*) osname=next ;; |
---|
1781 | solaris) osname=solaris |
---|
1782 | case "$3" in |
---|
1783 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; |
---|
1784 | *) osvers="$3" ;; |
---|
1785 | esac |
---|
1786 | ;; |
---|
1787 | sunos) osname=sunos |
---|
1788 | case "$3" in |
---|
1789 | 5*) osname=solaris |
---|
1790 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; |
---|
1791 | *) osvers="$3" ;; |
---|
1792 | esac |
---|
1793 | ;; |
---|
1794 | titanos) osname=titanos |
---|
1795 | case "$3" in |
---|
1796 | 1*) osvers=1 ;; |
---|
1797 | 2*) osvers=2 ;; |
---|
1798 | 3*) osvers=3 ;; |
---|
1799 | 4*) osvers=4 ;; |
---|
1800 | *) osvers="$3" ;; |
---|
1801 | esac |
---|
1802 | ;; |
---|
1803 | ultrix) osname=ultrix |
---|
1804 | osvers="$3" |
---|
1805 | ;; |
---|
1806 | osf1|mls+) case "$5" in |
---|
1807 | alpha) |
---|
1808 | osname=dec_osf |
---|
1809 | osvers=`echo "$3" | sed 's/^[vt]//'` |
---|
1810 | ;; |
---|
1811 | hp*) osname=hp_osf1 ;; |
---|
1812 | mips) osname=mips_osf1 ;; |
---|
1813 | esac |
---|
1814 | ;; |
---|
1815 | uts) osname=uts |
---|
1816 | osvers="$3" |
---|
1817 | ;; |
---|
1818 | qnx) osname=qnx |
---|
1819 | osvers="$4" |
---|
1820 | ;; |
---|
1821 | $2) case "$osname" in |
---|
1822 | *isc*) ;; |
---|
1823 | *freebsd*) ;; |
---|
1824 | svr*) |
---|
1825 | : svr4.x or possibly later |
---|
1826 | case "svr$3" in |
---|
1827 | ${osname}*) |
---|
1828 | osname=svr$3 |
---|
1829 | osvers=$4 |
---|
1830 | ;; |
---|
1831 | esac |
---|
1832 | case "$osname" in |
---|
1833 | svr4.0) |
---|
1834 | : Check for ESIX |
---|
1835 | if test -f /stand/boot ; then |
---|
1836 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` |
---|
1837 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
---|
1838 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` |
---|
1839 | if test -n "$isesix"; then |
---|
1840 | osname=esix4 |
---|
1841 | fi |
---|
1842 | fi |
---|
1843 | fi |
---|
1844 | ;; |
---|
1845 | esac |
---|
1846 | ;; |
---|
1847 | *) if test -f /etc/systemid; then |
---|
1848 | osname=sco |
---|
1849 | set `echo $3 | $sed 's/\./ /g'` $4 |
---|
1850 | if $test -f sco_$1_$2_$3.sh; then |
---|
1851 | osvers=$1.$2.$3 |
---|
1852 | elif $test -f sco_$1_$2.sh; then |
---|
1853 | osvers=$1.$2 |
---|
1854 | elif $test -f sco_$1.sh; then |
---|
1855 | osvers=$1 |
---|
1856 | fi |
---|
1857 | else |
---|
1858 | case "$osname" in |
---|
1859 | '') : Still unknown. Probably a generic Sys V. |
---|
1860 | osname="sysv" |
---|
1861 | osvers="$3" |
---|
1862 | ;; |
---|
1863 | esac |
---|
1864 | fi |
---|
1865 | ;; |
---|
1866 | esac |
---|
1867 | ;; |
---|
1868 | *) case "$osname" in |
---|
1869 | '') : Still unknown. Probably a generic BSD. |
---|
1870 | osname="$1" |
---|
1871 | osvers="$3" |
---|
1872 | ;; |
---|
1873 | esac |
---|
1874 | ;; |
---|
1875 | esac |
---|
1876 | else |
---|
1877 | if test -f /vmunix -a -f newsos4.sh; then |
---|
1878 | (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1 |
---|
1879 | if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then |
---|
1880 | osname=newsos4 |
---|
1881 | fi |
---|
1882 | $rm -f ../UU/kernel.what |
---|
1883 | elif test -d c:/.; then |
---|
1884 | set X $myuname |
---|
1885 | osname=os2 |
---|
1886 | osvers="$5" |
---|
1887 | fi |
---|
1888 | fi |
---|
1889 | |
---|
1890 | : Now look for a hint file osname_osvers, unless one has been |
---|
1891 | : specified already. |
---|
1892 | case "$hintfile" in |
---|
1893 | ''|' ') |
---|
1894 | file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` |
---|
1895 | : Also try without trailing minor version numbers. |
---|
1896 | xfile=`echo $file | $sed -e 's@_[^_]*$@@'` |
---|
1897 | xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` |
---|
1898 | xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` |
---|
1899 | xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` |
---|
1900 | case "$file" in |
---|
1901 | '') dflt=none ;; |
---|
1902 | *) case "$osvers" in |
---|
1903 | '') dflt=$file |
---|
1904 | ;; |
---|
1905 | *) if $test -f $file.sh ; then |
---|
1906 | dflt=$file |
---|
1907 | elif $test -f $xfile.sh ; then |
---|
1908 | dflt=$xfile |
---|
1909 | elif $test -f $xxfile.sh ; then |
---|
1910 | dflt=$xxfile |
---|
1911 | elif $test -f $xxxfile.sh ; then |
---|
1912 | dflt=$xxxfile |
---|
1913 | elif $test -f $xxxxfile.sh ; then |
---|
1914 | dflt=$xxxxfile |
---|
1915 | elif $test -f "${osname}.sh" ; then |
---|
1916 | dflt="${osname}" |
---|
1917 | else |
---|
1918 | dflt=none |
---|
1919 | fi |
---|
1920 | ;; |
---|
1921 | esac |
---|
1922 | ;; |
---|
1923 | esac |
---|
1924 | ;; |
---|
1925 | *) |
---|
1926 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
---|
1927 | ;; |
---|
1928 | esac |
---|
1929 | |
---|
1930 | $cat <<EOM |
---|
1931 | |
---|
1932 | You may give one or more space-separated answers, or "none" if appropriate. |
---|
1933 | If your OS version has no hints, DO NOT give a wrong version -- say "none". |
---|
1934 | |
---|
1935 | EOM |
---|
1936 | rp="Which of these apply, if any?" |
---|
1937 | . ../UU/myread |
---|
1938 | tans=$ans |
---|
1939 | for file in $tans; do |
---|
1940 | if $test -f $file.sh; then |
---|
1941 | . ./$file.sh |
---|
1942 | $cat $file.sh >> ../UU/config.sh |
---|
1943 | elif $test X$tans = X -o X$tans = Xnone ; then |
---|
1944 | : nothing |
---|
1945 | else |
---|
1946 | : Give one chance to correct a possible typo. |
---|
1947 | echo "$file.sh does not exist" |
---|
1948 | dflt=$file |
---|
1949 | rp="hint to use instead?" |
---|
1950 | . ../UU/myread |
---|
1951 | for file in $ans; do |
---|
1952 | if $test -f "$file.sh"; then |
---|
1953 | . ./$file.sh |
---|
1954 | $cat $file.sh >> ../UU/config.sh |
---|
1955 | elif $test X$ans = X -o X$ans = Xnone ; then |
---|
1956 | : nothing |
---|
1957 | else |
---|
1958 | echo "$file.sh does not exist -- ignored." |
---|
1959 | fi |
---|
1960 | done |
---|
1961 | fi |
---|
1962 | done |
---|
1963 | |
---|
1964 | hint=recommended |
---|
1965 | : Remember our hint file for later. |
---|
1966 | if $test -f "$file.sh" ; then |
---|
1967 | hintfile="$file" |
---|
1968 | else |
---|
1969 | hintfile='' |
---|
1970 | fi |
---|
1971 | |
---|
1972 | cd .. |
---|
1973 | fi |
---|
1974 | cd UU |
---|
1975 | ;; |
---|
1976 | *) |
---|
1977 | echo " " |
---|
1978 | echo "Fetching default answers from $config_sh..." >&4 |
---|
1979 | tmp_n="$n" |
---|
1980 | tmp_c="$c" |
---|
1981 | cd .. |
---|
1982 | cp $config_sh config.sh 2>/dev/null |
---|
1983 | chmod +w config.sh |
---|
1984 | . ./config.sh |
---|
1985 | cd UU |
---|
1986 | cp ../config.sh . |
---|
1987 | n="$tmp_n" |
---|
1988 | c="$tmp_c" |
---|
1989 | hint=previous |
---|
1990 | ;; |
---|
1991 | esac |
---|
1992 | test "$override" && . ./optdef.sh |
---|
1993 | myuname="$newmyuname" |
---|
1994 | |
---|
1995 | : Restore computed paths |
---|
1996 | for file in $loclist $trylist; do |
---|
1997 | eval $file="\$_$file" |
---|
1998 | done |
---|
1999 | |
---|
2000 | cat << EOM |
---|
2001 | |
---|
2002 | Configure uses the operating system name and version to set some defaults. |
---|
2003 | The default value is probably right if the name rings a bell. Otherwise, |
---|
2004 | since spelling matters for me, either accept the default or answer "none" |
---|
2005 | to leave it blank. |
---|
2006 | |
---|
2007 | EOM |
---|
2008 | case "$osname" in |
---|
2009 | ''|' ') |
---|
2010 | case "$hintfile" in |
---|
2011 | ''|' '|none) dflt=none ;; |
---|
2012 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
---|
2013 | esac |
---|
2014 | ;; |
---|
2015 | *) dflt="$osname" ;; |
---|
2016 | esac |
---|
2017 | rp="Operating system name?" |
---|
2018 | . ./myread |
---|
2019 | case "$ans" in |
---|
2020 | none) osname='' ;; |
---|
2021 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; |
---|
2022 | esac |
---|
2023 | echo " " |
---|
2024 | case "$osvers" in |
---|
2025 | ''|' ') |
---|
2026 | case "$hintfile" in |
---|
2027 | ''|' '|none) dflt=none ;; |
---|
2028 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` |
---|
2029 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` |
---|
2030 | case "$dflt" in |
---|
2031 | ''|' ') dflt=none ;; |
---|
2032 | esac |
---|
2033 | ;; |
---|
2034 | esac |
---|
2035 | ;; |
---|
2036 | *) dflt="$osvers" ;; |
---|
2037 | esac |
---|
2038 | rp="Operating system version?" |
---|
2039 | . ./myread |
---|
2040 | case "$ans" in |
---|
2041 | none) osvers='' ;; |
---|
2042 | *) osvers="$ans" ;; |
---|
2043 | esac |
---|
2044 | |
---|
2045 | |
---|
2046 | |
---|
2047 | : who configured the system |
---|
2048 | cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1` |
---|
2049 | cf_by=`(logname) 2>/dev/null` |
---|
2050 | case "$cf_by" in "") |
---|
2051 | cf_by=`(whoami) 2>/dev/null` |
---|
2052 | case "$cf_by" in "") |
---|
2053 | cf_by=unknown ;; |
---|
2054 | esac ;; |
---|
2055 | esac |
---|
2056 | |
---|
2057 | : determine the architecture name |
---|
2058 | echo " " |
---|
2059 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
---|
2060 | tarch=`arch`"-$osname" |
---|
2061 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then |
---|
2062 | if uname -m > tmparch 2>&1 ; then |
---|
2063 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ |
---|
2064 | -e 's/$/'"-$osname/" tmparch` |
---|
2065 | else |
---|
2066 | tarch="$osname" |
---|
2067 | fi |
---|
2068 | $rm -f tmparch |
---|
2069 | else |
---|
2070 | tarch="$osname" |
---|
2071 | fi |
---|
2072 | case "$myarchname" in |
---|
2073 | ''|"$tarch") ;; |
---|
2074 | *) |
---|
2075 | echo "(Your architecture name used to be $myarchname.)" |
---|
2076 | archname='' |
---|
2077 | ;; |
---|
2078 | esac |
---|
2079 | case "$archname" in |
---|
2080 | '') dflt="$tarch";; |
---|
2081 | *) dflt="$archname";; |
---|
2082 | esac |
---|
2083 | rp='What is your architecture name' |
---|
2084 | . ./myread |
---|
2085 | archname="$ans" |
---|
2086 | myarchname="$tarch" |
---|
2087 | |
---|
2088 | : is AFS running? |
---|
2089 | echo " " |
---|
2090 | case "$afs" in |
---|
2091 | $define|true) afs=true ;; |
---|
2092 | $undef|false) afs=false ;; |
---|
2093 | *) if test -d /afs; then |
---|
2094 | afs=true |
---|
2095 | else |
---|
2096 | afs=false |
---|
2097 | fi |
---|
2098 | ;; |
---|
2099 | esac |
---|
2100 | if $afs; then |
---|
2101 | echo "AFS may be running... I'll be extra cautious then..." >&4 |
---|
2102 | else |
---|
2103 | echo "AFS does not seem to be running..." >&4 |
---|
2104 | fi |
---|
2105 | |
---|
2106 | : decide how portable to be. Allow command line overrides. |
---|
2107 | case "$d_portable" in |
---|
2108 | "$undef") ;; |
---|
2109 | *) d_portable="$define" ;; |
---|
2110 | esac |
---|
2111 | |
---|
2112 | : set up shell script to do ~ expansion |
---|
2113 | cat >filexp <<EOSS |
---|
2114 | $startsh |
---|
2115 | : expand filename |
---|
2116 | case "\$1" in |
---|
2117 | ~/*|~) |
---|
2118 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" |
---|
2119 | ;; |
---|
2120 | ~*) |
---|
2121 | if $test -f /bin/csh; then |
---|
2122 | /bin/csh -f -c "glob \$1" |
---|
2123 | failed=\$? |
---|
2124 | echo "" |
---|
2125 | exit \$failed |
---|
2126 | else |
---|
2127 | name=\`$expr x\$1 : '..\([^/]*\)'\` |
---|
2128 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` |
---|
2129 | if $test ! -d "\$dir"; then |
---|
2130 | me=\`basename \$0\` |
---|
2131 | echo "\$me: can't locate home directory for: \$name" >&2 |
---|
2132 | exit 1 |
---|
2133 | fi |
---|
2134 | case "\$1" in |
---|
2135 | */*) |
---|
2136 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` |
---|
2137 | ;; |
---|
2138 | *) |
---|
2139 | echo \$dir |
---|
2140 | ;; |
---|
2141 | esac |
---|
2142 | fi |
---|
2143 | ;; |
---|
2144 | *) |
---|
2145 | echo \$1 |
---|
2146 | ;; |
---|
2147 | esac |
---|
2148 | EOSS |
---|
2149 | chmod +x filexp |
---|
2150 | $eunicefix filexp |
---|
2151 | |
---|
2152 | : now set up to get a file name |
---|
2153 | cat <<EOS >getfile |
---|
2154 | $startsh |
---|
2155 | EOS |
---|
2156 | cat <<'EOSC' >>getfile |
---|
2157 | tilde='' |
---|
2158 | fullpath='' |
---|
2159 | already='' |
---|
2160 | skip='' |
---|
2161 | none_ok='' |
---|
2162 | exp_file='' |
---|
2163 | nopath_ok='' |
---|
2164 | orig_rp="$rp" |
---|
2165 | orig_dflt="$dflt" |
---|
2166 | |
---|
2167 | case "$fn" in |
---|
2168 | *\(*) |
---|
2169 | expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok |
---|
2170 | fn=`echo $fn | sed 's/(.*)//'` |
---|
2171 | ;; |
---|
2172 | esac |
---|
2173 | |
---|
2174 | case "$fn" in |
---|
2175 | *:*) |
---|
2176 | loc_file=`expr $fn : '.*:\(.*\)'` |
---|
2177 | fn=`expr $fn : '\(.*\):.*'` |
---|
2178 | ;; |
---|
2179 | esac |
---|
2180 | |
---|
2181 | case "$fn" in |
---|
2182 | *~*) tilde=true;; |
---|
2183 | esac |
---|
2184 | case "$fn" in |
---|
2185 | */*) fullpath=true;; |
---|
2186 | esac |
---|
2187 | case "$fn" in |
---|
2188 | *+*) skip=true;; |
---|
2189 | esac |
---|
2190 | case "$fn" in |
---|
2191 | *n*) none_ok=true;; |
---|
2192 | esac |
---|
2193 | case "$fn" in |
---|
2194 | *e*) exp_file=true;; |
---|
2195 | esac |
---|
2196 | case "$fn" in |
---|
2197 | *p*) nopath_ok=true;; |
---|
2198 | esac |
---|
2199 | |
---|
2200 | case "$fn" in |
---|
2201 | *f*) type='File';; |
---|
2202 | *d*) type='Directory';; |
---|
2203 | *l*) type='Locate';; |
---|
2204 | esac |
---|
2205 | |
---|
2206 | what="$type" |
---|
2207 | case "$what" in |
---|
2208 | Locate) what='File';; |
---|
2209 | esac |
---|
2210 | |
---|
2211 | case "$exp_file" in |
---|
2212 | '') |
---|
2213 | case "$d_portable" in |
---|
2214 | "$define") ;; |
---|
2215 | *) exp_file=true;; |
---|
2216 | esac |
---|
2217 | ;; |
---|
2218 | esac |
---|
2219 | |
---|
2220 | cd .. |
---|
2221 | while test "$type"; do |
---|
2222 | redo='' |
---|
2223 | rp="$orig_rp" |
---|
2224 | dflt="$orig_dflt" |
---|
2225 | case "$tilde" in |
---|
2226 | true) rp="$rp (~name ok)";; |
---|
2227 | esac |
---|
2228 | . UU/myread |
---|
2229 | if test -f UU/getfile.ok && \ |
---|
2230 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 |
---|
2231 | then |
---|
2232 | value="$ans" |
---|
2233 | ansexp="$ans" |
---|
2234 | break |
---|
2235 | fi |
---|
2236 | case "$ans" in |
---|
2237 | none) |
---|
2238 | value='' |
---|
2239 | ansexp='' |
---|
2240 | case "$none_ok" in |
---|
2241 | true) type='';; |
---|
2242 | esac |
---|
2243 | ;; |
---|
2244 | *) |
---|
2245 | case "$tilde" in |
---|
2246 | '') value="$ans" |
---|
2247 | ansexp="$ans";; |
---|
2248 | *) |
---|
2249 | value=`UU/filexp $ans` |
---|
2250 | case $? in |
---|
2251 | 0) |
---|
2252 | if test "$ans" != "$value"; then |
---|
2253 | echo "(That expands to $value on this system.)" |
---|
2254 | fi |
---|
2255 | ;; |
---|
2256 | *) value="$ans";; |
---|
2257 | esac |
---|
2258 | ansexp="$value" |
---|
2259 | case "$exp_file" in |
---|
2260 | '') value="$ans";; |
---|
2261 | esac |
---|
2262 | ;; |
---|
2263 | esac |
---|
2264 | case "$fullpath" in |
---|
2265 | true) |
---|
2266 | case "$ansexp" in |
---|
2267 | /*) value="$ansexp" ;; |
---|
2268 | *) |
---|
2269 | redo=true |
---|
2270 | case "$already" in |
---|
2271 | true) |
---|
2272 | echo "I shall only accept a full path name, as in /bin/ls." >&4 |
---|
2273 | echo "Use a ! shell escape if you wish to check pathnames." >&4 |
---|
2274 | ;; |
---|
2275 | *) |
---|
2276 | echo "Please give a full path name, starting with slash." >&4 |
---|
2277 | case "$tilde" in |
---|
2278 | true) |
---|
2279 | echo "Note that using ~name is ok provided it expands well." >&4 |
---|
2280 | already=true |
---|
2281 | ;; |
---|
2282 | esac |
---|
2283 | esac |
---|
2284 | ;; |
---|
2285 | esac |
---|
2286 | ;; |
---|
2287 | esac |
---|
2288 | case "$redo" in |
---|
2289 | '') |
---|
2290 | case "$type" in |
---|
2291 | File) |
---|
2292 | if test -f "$ansexp"; then |
---|
2293 | type='' |
---|
2294 | elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 |
---|
2295 | then |
---|
2296 | echo "($value is not a plain file, but that's ok.)" |
---|
2297 | type='' |
---|
2298 | fi |
---|
2299 | ;; |
---|
2300 | Directory) |
---|
2301 | if test -d "$ansexp"; then |
---|
2302 | type='' |
---|
2303 | fi |
---|
2304 | ;; |
---|
2305 | Locate) |
---|
2306 | if test -d "$ansexp"; then |
---|
2307 | echo "(Looking for $loc_file in directory $value.)" |
---|
2308 | value="$value/$loc_file" |
---|
2309 | ansexp="$ansexp/$loc_file" |
---|
2310 | fi |
---|
2311 | if test -f "$ansexp"; then |
---|
2312 | type='' |
---|
2313 | fi |
---|
2314 | case "$nopath_ok" in |
---|
2315 | true) case "$value" in |
---|
2316 | */*) ;; |
---|
2317 | *) echo "Assuming $value will be in people's path." |
---|
2318 | type='' |
---|
2319 | ;; |
---|
2320 | esac |
---|
2321 | ;; |
---|
2322 | esac |
---|
2323 | ;; |
---|
2324 | esac |
---|
2325 | |
---|
2326 | case "$skip" in |
---|
2327 | true) type=''; |
---|
2328 | esac |
---|
2329 | |
---|
2330 | case "$type" in |
---|
2331 | '') ;; |
---|
2332 | *) |
---|
2333 | if test "$fastread" = yes; then |
---|
2334 | dflt=y |
---|
2335 | else |
---|
2336 | dflt=n |
---|
2337 | fi |
---|
2338 | rp="$what $value doesn't exist. Use that name anyway?" |
---|
2339 | . UU/myread |
---|
2340 | dflt='' |
---|
2341 | case "$ans" in |
---|
2342 | y*) type='';; |
---|
2343 | *) echo " ";; |
---|
2344 | esac |
---|
2345 | ;; |
---|
2346 | esac |
---|
2347 | ;; |
---|
2348 | esac |
---|
2349 | ;; |
---|
2350 | esac |
---|
2351 | done |
---|
2352 | cd UU |
---|
2353 | ans="$value" |
---|
2354 | rp="$orig_rp" |
---|
2355 | dflt="$orig_dflt" |
---|
2356 | rm -f getfile.ok |
---|
2357 | EOSC |
---|
2358 | |
---|
2359 | : determine root of directory hierarchy where package will be installed. |
---|
2360 | case "$prefix" in |
---|
2361 | '') |
---|
2362 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` |
---|
2363 | ;; |
---|
2364 | *) |
---|
2365 | dflt="$prefix" |
---|
2366 | ;; |
---|
2367 | esac |
---|
2368 | $cat <<EOM |
---|
2369 | |
---|
2370 | By default, $package will be installed in $dflt/bin, manual |
---|
2371 | pages under $dflt/man, etc..., i.e. with $dflt as prefix for |
---|
2372 | all installation directories. Typically set to /usr/local, but you |
---|
2373 | may choose /usr if you wish to install $package among your system |
---|
2374 | binaries. If you wish to have binaries under /bin but manual pages |
---|
2375 | under /usr/local/man, that's ok: you will be prompted separately |
---|
2376 | for each of the installation directories, the prefix being only used |
---|
2377 | to set the defaults. |
---|
2378 | |
---|
2379 | EOM |
---|
2380 | fn=d~ |
---|
2381 | rp='Installation prefix to use?' |
---|
2382 | . ./getfile |
---|
2383 | oldprefix='' |
---|
2384 | case "$prefix" in |
---|
2385 | '') ;; |
---|
2386 | *) |
---|
2387 | case "$ans" in |
---|
2388 | "$prefix") ;; |
---|
2389 | *) oldprefix="$prefix";; |
---|
2390 | esac |
---|
2391 | ;; |
---|
2392 | esac |
---|
2393 | prefix="$ans" |
---|
2394 | prefixexp="$ansexp" |
---|
2395 | |
---|
2396 | : set the prefixit variable, to compute a suitable default value |
---|
2397 | prefixit='case "$3" in |
---|
2398 | ""|none) |
---|
2399 | case "$oldprefix" in |
---|
2400 | "") eval "$1=\"\$$2\"";; |
---|
2401 | *) |
---|
2402 | case "$3" in |
---|
2403 | "") eval "$1=";; |
---|
2404 | none) |
---|
2405 | eval "tp=\"\$$2\""; |
---|
2406 | case "$tp" in |
---|
2407 | ""|" ") eval "$1=\"\$$2\"";; |
---|
2408 | *) eval "$1=";; |
---|
2409 | esac;; |
---|
2410 | esac;; |
---|
2411 | esac;; |
---|
2412 | *) |
---|
2413 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; |
---|
2414 | case "$tp" in |
---|
2415 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; |
---|
2416 | /*-$oldprefix/*|\~*-$oldprefix/*) |
---|
2417 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; |
---|
2418 | *) eval "$1=\"\$$2\"";; |
---|
2419 | esac;; |
---|
2420 | esac' |
---|
2421 | |
---|
2422 | : determine where private library files go |
---|
2423 | : Usual default is /usr/local/lib/perl5. Also allow things like |
---|
2424 | : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant. |
---|
2425 | case "$prefix" in |
---|
2426 | *perl*) set dflt privlib lib ;; |
---|
2427 | *) set dflt privlib lib/$package ;; |
---|
2428 | esac |
---|
2429 | eval $prefixit |
---|
2430 | $cat <<EOM |
---|
2431 | |
---|
2432 | There are some auxiliary files for $package that need to be put into a |
---|
2433 | private library directory that is accessible by everyone. |
---|
2434 | |
---|
2435 | EOM |
---|
2436 | fn=d~+ |
---|
2437 | rp='Pathname where the private library files will reside?' |
---|
2438 | . ./getfile |
---|
2439 | if $test "X$privlibexp" != "X$ansexp"; then |
---|
2440 | installprivlib='' |
---|
2441 | fi |
---|
2442 | privlib="$ans" |
---|
2443 | privlibexp="$ansexp" |
---|
2444 | if $afs; then |
---|
2445 | $cat <<EOM |
---|
2446 | |
---|
2447 | Since you are running AFS, I need to distinguish the directory in which |
---|
2448 | private files reside from the directory in which they are installed (and from |
---|
2449 | which they are presumably copied to the former directory by occult means). |
---|
2450 | |
---|
2451 | EOM |
---|
2452 | case "$installprivlib" in |
---|
2453 | '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;; |
---|
2454 | *) dflt="$installprivlib";; |
---|
2455 | esac |
---|
2456 | fn=de~ |
---|
2457 | rp='Where will private files be installed?' |
---|
2458 | . ./getfile |
---|
2459 | installprivlib="$ans" |
---|
2460 | else |
---|
2461 | installprivlib="$privlibexp" |
---|
2462 | fi |
---|
2463 | |
---|
2464 | : set the base revision |
---|
2465 | baserev=5.0 |
---|
2466 | |
---|
2467 | : get the patchlevel |
---|
2468 | echo " " |
---|
2469 | echo "Getting the current patchlevel..." >&4 |
---|
2470 | if $test -r ../patchlevel.h;then |
---|
2471 | patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h` |
---|
2472 | subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h` |
---|
2473 | else |
---|
2474 | patchlevel=0 |
---|
2475 | subversion=0 |
---|
2476 | fi |
---|
2477 | $echo $n "(You have $package" $c |
---|
2478 | case "$package" in |
---|
2479 | "*$baserev") ;; |
---|
2480 | *) $echo $n " $baserev" $c ;; |
---|
2481 | esac |
---|
2482 | $echo $n " patchlevel $patchlevel" $c |
---|
2483 | test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c |
---|
2484 | echo ".)" |
---|
2485 | |
---|
2486 | : set the prefixup variable, to restore leading tilda escape |
---|
2487 | prefixup='case "$prefixexp" in |
---|
2488 | "$prefix") ;; |
---|
2489 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; |
---|
2490 | esac' |
---|
2491 | |
---|
2492 | : determine where public architecture dependent libraries go |
---|
2493 | set archlib archlib |
---|
2494 | eval $prefixit |
---|
2495 | case "$archlib" in |
---|
2496 | '') |
---|
2497 | case "$privlib" in |
---|
2498 | '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` |
---|
2499 | set dflt |
---|
2500 | eval $prefixup |
---|
2501 | ;; |
---|
2502 | *) if test 0 -eq "$subversion"; then |
---|
2503 | version=`LC_ALL=C; export LC_ALL; \ |
---|
2504 | echo $baserev $patchlevel | \ |
---|
2505 | $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'` |
---|
2506 | else |
---|
2507 | version=`LC_ALL=C; export LC_ALL; \ |
---|
2508 | echo $baserev $patchlevel $subversion | \ |
---|
2509 | $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'` |
---|
2510 | fi |
---|
2511 | dflt="$privlib/$archname/$version" |
---|
2512 | ;; |
---|
2513 | esac |
---|
2514 | ;; |
---|
2515 | *) |
---|
2516 | dflt="$archlib" |
---|
2517 | ;; |
---|
2518 | esac |
---|
2519 | cat <<EOM |
---|
2520 | |
---|
2521 | $spackage contains architecture-dependent library files. If you are |
---|
2522 | sharing libraries in a heterogeneous environment, you might store |
---|
2523 | these files in a separate location. Otherwise, you can just include |
---|
2524 | them with the rest of the public library files. |
---|
2525 | |
---|
2526 | EOM |
---|
2527 | fn=d+~ |
---|
2528 | rp='Where do you want to put the public architecture-dependent libraries?' |
---|
2529 | . ./getfile |
---|
2530 | archlib="$ans" |
---|
2531 | archlibexp="$ansexp" |
---|
2532 | |
---|
2533 | if $afs; then |
---|
2534 | $cat <<EOM |
---|
2535 | |
---|
2536 | Since you are running AFS, I need to distinguish the directory in |
---|
2537 | which architecture-dependent library files reside from the directory |
---|
2538 | in which they are installed (and from which they are presumably copied |
---|
2539 | to the former directory by occult means). |
---|
2540 | |
---|
2541 | EOM |
---|
2542 | case "$installarchlib" in |
---|
2543 | '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;; |
---|
2544 | *) dflt="$installarchlib";; |
---|
2545 | esac |
---|
2546 | fn=de~ |
---|
2547 | rp='Where will architecture-dependent library files be installed?' |
---|
2548 | . ./getfile |
---|
2549 | installarchlib="$ans" |
---|
2550 | else |
---|
2551 | installarchlib="$archlibexp" |
---|
2552 | fi |
---|
2553 | if $test X"$archlib" = X"$privlib"; then |
---|
2554 | d_archlib="$undef" |
---|
2555 | else |
---|
2556 | d_archlib="$define" |
---|
2557 | fi |
---|
2558 | |
---|
2559 | : set up the script used to warn in case of inconsistency |
---|
2560 | cat <<EOS >whoa |
---|
2561 | $startsh |
---|
2562 | EOS |
---|
2563 | cat <<'EOSC' >>whoa |
---|
2564 | dflt=y |
---|
2565 | echo " " |
---|
2566 | echo "*** WHOA THERE!!! ***" >&4 |
---|
2567 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 |
---|
2568 | rp=" Keep the $hint value?" |
---|
2569 | . ./myread |
---|
2570 | case "$ans" in |
---|
2571 | y) td=$was; tu=$was;; |
---|
2572 | esac |
---|
2573 | EOSC |
---|
2574 | |
---|
2575 | : function used to set $1 to $val |
---|
2576 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; |
---|
2577 | case "$val$was" in |
---|
2578 | $define$undef) . ./whoa; eval "$var=\$td";; |
---|
2579 | $undef$define) . ./whoa; eval "$var=\$tu";; |
---|
2580 | *) eval "$var=$val";; |
---|
2581 | esac' |
---|
2582 | |
---|
2583 | $cat <<EOM |
---|
2584 | |
---|
2585 | Perl 5.004 can be compiled for binary compatibility with 5.003. |
---|
2586 | If you decide to do so, you will be able to continue using any |
---|
2587 | extensions that were compiled for Perl 5.003. However, binary |
---|
2588 | compatibility forces Perl to expose some of its internal symbols |
---|
2589 | in the same way that 5.003 did. So you may have symbol conflicts |
---|
2590 | if you embed a binary-compatible Perl in other programs. |
---|
2591 | |
---|
2592 | EOM |
---|
2593 | case "$d_bincompat3" in |
---|
2594 | "$undef") dflt=n ;; |
---|
2595 | *) dflt=y ;; |
---|
2596 | esac |
---|
2597 | rp='Binary compatibility with Perl 5.003?' |
---|
2598 | . ./myread |
---|
2599 | case "$ans" in |
---|
2600 | y*) val="$define" ;; |
---|
2601 | *) val="$undef" ;; |
---|
2602 | esac |
---|
2603 | set d_bincompat3 |
---|
2604 | eval $setvar |
---|
2605 | case "$d_bincompat3" in |
---|
2606 | "$define") bincompat3=y ;; |
---|
2607 | *) bincompat3=n ;; |
---|
2608 | esac |
---|
2609 | |
---|
2610 | : make some quick guesses about what we are up against |
---|
2611 | echo " " |
---|
2612 | $echo $n "Hmm... $c" |
---|
2613 | echo exit 1 >bsd |
---|
2614 | echo exit 1 >usg |
---|
2615 | echo exit 1 >v7 |
---|
2616 | echo exit 1 >osf1 |
---|
2617 | echo exit 1 >eunice |
---|
2618 | echo exit 1 >xenix |
---|
2619 | echo exit 1 >venix |
---|
2620 | echo exit 1 >os2 |
---|
2621 | d_bsd="$undef" |
---|
2622 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null |
---|
2623 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 |
---|
2624 | then |
---|
2625 | echo "Looks kind of like an OSF/1 system, but we'll see..." |
---|
2626 | echo exit 0 >osf1 |
---|
2627 | elif test `echo abc | tr a-z A-Z` = Abc ; then |
---|
2628 | xxx=`./loc addbib blurfl $pth` |
---|
2629 | if $test -f $xxx; then |
---|
2630 | echo "Looks kind of like a USG system with BSD features, but we'll see..." |
---|
2631 | echo exit 0 >bsd |
---|
2632 | echo exit 0 >usg |
---|
2633 | else |
---|
2634 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then |
---|
2635 | echo "Looks kind of like an extended USG system, but we'll see..." |
---|
2636 | else |
---|
2637 | echo "Looks kind of like a USG system, but we'll see..." |
---|
2638 | fi |
---|
2639 | echo exit 0 >usg |
---|
2640 | fi |
---|
2641 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then |
---|
2642 | echo "Looks kind of like a BSD system, but we'll see..." |
---|
2643 | d_bsd="$define" |
---|
2644 | echo exit 0 >bsd |
---|
2645 | else |
---|
2646 | echo "Looks kind of like a Version 7 system, but we'll see..." |
---|
2647 | echo exit 0 >v7 |
---|
2648 | fi |
---|
2649 | case "$eunicefix" in |
---|
2650 | *unixtovms*) |
---|
2651 | $cat <<'EOI' |
---|
2652 | There is, however, a strange, musty smell in the air that reminds me of |
---|
2653 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. |
---|
2654 | EOI |
---|
2655 | echo exit 0 >eunice |
---|
2656 | d_eunice="$define" |
---|
2657 | : it so happens the Eunice I know will not run shell scripts in Unix format |
---|
2658 | ;; |
---|
2659 | *) |
---|
2660 | echo " " |
---|
2661 | echo "Congratulations. You aren't running Eunice." |
---|
2662 | d_eunice="$undef" |
---|
2663 | ;; |
---|
2664 | esac |
---|
2665 | : Detect OS2. The p_ variable is set above in the Head.U unit. |
---|
2666 | case "$p_" in |
---|
2667 | :) ;; |
---|
2668 | *) |
---|
2669 | $cat <<'EOI' |
---|
2670 | I have the feeling something is not exactly right, however...don't tell me... |
---|
2671 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! |
---|
2672 | EOI |
---|
2673 | echo exit 0 >os2 |
---|
2674 | ;; |
---|
2675 | esac |
---|
2676 | if test -f /xenix; then |
---|
2677 | echo "Actually, this looks more like a XENIX system..." |
---|
2678 | echo exit 0 >xenix |
---|
2679 | d_xenix="$define" |
---|
2680 | else |
---|
2681 | echo " " |
---|
2682 | echo "It's not Xenix..." |
---|
2683 | d_xenix="$undef" |
---|
2684 | fi |
---|
2685 | chmod +x xenix |
---|
2686 | $eunicefix xenix |
---|
2687 | if test -f /venix; then |
---|
2688 | echo "Actually, this looks more like a VENIX system..." |
---|
2689 | echo exit 0 >venix |
---|
2690 | else |
---|
2691 | echo " " |
---|
2692 | if ./xenix; then |
---|
2693 | : null |
---|
2694 | else |
---|
2695 | echo "Nor is it Venix..." |
---|
2696 | fi |
---|
2697 | fi |
---|
2698 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 |
---|
2699 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 |
---|
2700 | $rm -f foo |
---|
2701 | |
---|
2702 | : see if setuid scripts can be secure |
---|
2703 | $cat <<EOM |
---|
2704 | |
---|
2705 | Some kernels have a bug that prevents setuid #! scripts from being |
---|
2706 | secure. Some sites have disabled setuid #! scripts because of this. |
---|
2707 | |
---|
2708 | First let's decide if your kernel supports secure setuid #! scripts. |
---|
2709 | (If setuid #! scripts would be secure but have been disabled anyway, |
---|
2710 | don't say that they are secure if asked.) |
---|
2711 | |
---|
2712 | EOM |
---|
2713 | |
---|
2714 | val="$undef" |
---|
2715 | if $test -d /dev/fd; then |
---|
2716 | echo "#!$ls" >reflect |
---|
2717 | chmod +x,u+s reflect |
---|
2718 | ./reflect >flect 2>&1 |
---|
2719 | if $contains "/dev/fd" flect >/dev/null; then |
---|
2720 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 |
---|
2721 | val="$define" |
---|
2722 | else |
---|
2723 | $cat <<EOM |
---|
2724 | If you are not sure if they are secure, I can check but I'll need a |
---|
2725 | username and password different from the one you are using right now. |
---|
2726 | If you don't have such a username or don't want me to test, simply |
---|
2727 | enter 'none'. |
---|
2728 | |
---|
2729 | EOM |
---|
2730 | rp='Other username to test security of setuid scripts with?' |
---|
2731 | dflt='none' |
---|
2732 | . ./myread |
---|
2733 | case "$ans" in |
---|
2734 | n|none) |
---|
2735 | case "$d_suidsafe" in |
---|
2736 | '') echo "I'll assume setuid scripts are *not* secure." >&4 |
---|
2737 | dflt=n;; |
---|
2738 | "$undef") |
---|
2739 | echo "Well, the $hint value is *not* secure." >&4 |
---|
2740 | dflt=n;; |
---|
2741 | *) echo "Well, the $hint value *is* secure." >&4 |
---|
2742 | dflt=y;; |
---|
2743 | esac |
---|
2744 | ;; |
---|
2745 | *) |
---|
2746 | $rm -f reflect flect |
---|
2747 | echo "#!$ls" >reflect |
---|
2748 | chmod +x,u+s reflect |
---|
2749 | echo >flect |
---|
2750 | chmod a+w flect |
---|
2751 | echo '"su" will (probably) prompt you for '"$ans's password." |
---|
2752 | su $ans -c './reflect >flect' |
---|
2753 | if $contains "/dev/fd" flect >/dev/null; then |
---|
2754 | echo "Okay, it looks like setuid scripts are secure." >&4 |
---|
2755 | dflt=y |
---|
2756 | else |
---|
2757 | echo "I don't think setuid scripts are secure." >&4 |
---|
2758 | dflt=n |
---|
2759 | fi |
---|
2760 | ;; |
---|
2761 | esac |
---|
2762 | rp='Does your kernel have *secure* setuid scripts?' |
---|
2763 | . ./myread |
---|
2764 | case "$ans" in |
---|
2765 | [yY]*) val="$define";; |
---|
2766 | *) val="$undef";; |
---|
2767 | esac |
---|
2768 | fi |
---|
2769 | else |
---|
2770 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 |
---|
2771 | echo "(That's for file descriptors, not floppy disks.)" |
---|
2772 | val="$undef" |
---|
2773 | fi |
---|
2774 | set d_suidsafe |
---|
2775 | eval $setvar |
---|
2776 | |
---|
2777 | $rm -f reflect flect |
---|
2778 | |
---|
2779 | : now see if they want to do setuid emulation |
---|
2780 | echo " " |
---|
2781 | val="$undef" |
---|
2782 | case "$d_suidsafe" in |
---|
2783 | "$define") |
---|
2784 | val="$undef" |
---|
2785 | echo "No need to emulate SUID scripts since they are secure here." >& 4 |
---|
2786 | ;; |
---|
2787 | *) |
---|
2788 | $cat <<EOM |
---|
2789 | Some systems have disabled setuid scripts, especially systems where |
---|
2790 | setuid scripts cannot be secure. On systems where setuid scripts have |
---|
2791 | been disabled, the setuid/setgid bits on scripts are currently |
---|
2792 | useless. It is possible for $package to detect those bits and emulate |
---|
2793 | setuid/setgid in a secure fashion. This emulation will only work if |
---|
2794 | setuid scripts have been disabled in your kernel. |
---|
2795 | |
---|
2796 | EOM |
---|
2797 | case "$d_dosuid" in |
---|
2798 | "$define") dflt=y ;; |
---|
2799 | *) dflt=n ;; |
---|
2800 | esac |
---|
2801 | rp="Do you want to do setuid/setgid emulation?" |
---|
2802 | . ./myread |
---|
2803 | case "$ans" in |
---|
2804 | [yY]*) val="$define";; |
---|
2805 | *) val="$undef";; |
---|
2806 | esac |
---|
2807 | ;; |
---|
2808 | esac |
---|
2809 | set d_dosuid |
---|
2810 | eval $setvar |
---|
2811 | |
---|
2812 | : determine where site specific libraries go. |
---|
2813 | set sitelib sitelib |
---|
2814 | eval $prefixit |
---|
2815 | case "$sitelib" in |
---|
2816 | '') dflt="$privlib/site_perl" ;; |
---|
2817 | *) dflt="$sitelib" ;; |
---|
2818 | esac |
---|
2819 | $cat <<EOM |
---|
2820 | |
---|
2821 | The installation process will also create a directory for |
---|
2822 | site-specific extensions and modules. Some users find it convenient |
---|
2823 | to place all local files in this directory rather than in the main |
---|
2824 | distribution directory. |
---|
2825 | |
---|
2826 | EOM |
---|
2827 | fn=d~+ |
---|
2828 | rp='Pathname for the site-specific library files?' |
---|
2829 | . ./getfile |
---|
2830 | if $test "X$sitelibexp" != "X$ansexp"; then |
---|
2831 | installsitelib='' |
---|
2832 | fi |
---|
2833 | sitelib="$ans" |
---|
2834 | sitelibexp="$ansexp" |
---|
2835 | if $afs; then |
---|
2836 | $cat <<EOM |
---|
2837 | |
---|
2838 | Since you are running AFS, I need to distinguish the directory in |
---|
2839 | which site-specific files reside from the directory in which they are |
---|
2840 | installed (and from which they are presumably copied to the former |
---|
2841 | directory by occult means). |
---|
2842 | |
---|
2843 | EOM |
---|
2844 | case "$installsitelib" in |
---|
2845 | '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;; |
---|
2846 | *) dflt="$installsitelib";; |
---|
2847 | esac |
---|
2848 | fn=de~ |
---|
2849 | rp='Where will site-specific files be installed?' |
---|
2850 | . ./getfile |
---|
2851 | installsitelib="$ans" |
---|
2852 | else |
---|
2853 | installsitelib="$sitelibexp" |
---|
2854 | fi |
---|
2855 | |
---|
2856 | : determine where site specific architecture-dependent libraries go. |
---|
2857 | xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'` |
---|
2858 | : xxx is usuually lib/site_perl/archname. |
---|
2859 | set sitearch sitearch none |
---|
2860 | eval $prefixit |
---|
2861 | case "$sitearch" in |
---|
2862 | '') dflt="$sitelib/$archname" ;; |
---|
2863 | *) dflt="$sitearch" ;; |
---|
2864 | esac |
---|
2865 | $cat <<EOM |
---|
2866 | |
---|
2867 | The installation process will also create a directory for |
---|
2868 | architecture-dependent site-specific extensions and modules. |
---|
2869 | |
---|
2870 | EOM |
---|
2871 | fn=nd~+ |
---|
2872 | rp='Pathname for the site-specific architecture-dependent library files?' |
---|
2873 | . ./getfile |
---|
2874 | if $test "X$sitearchexp" != "X$ansexp"; then |
---|
2875 | installsitearch='' |
---|
2876 | fi |
---|
2877 | sitearch="$ans" |
---|
2878 | sitearchexp="$ansexp" |
---|
2879 | if $afs; then |
---|
2880 | $cat <<EOM |
---|
2881 | |
---|
2882 | Since you are running AFS, I need to distinguish the directory in |
---|
2883 | which site-specific architecture-dependent library files reside from |
---|
2884 | the directory in which they are installed (and from which they are |
---|
2885 | presumably copied to the former directory by occult means). |
---|
2886 | |
---|
2887 | EOM |
---|
2888 | case "$installsitearch" in |
---|
2889 | '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;; |
---|
2890 | *) dflt="$installsitearch";; |
---|
2891 | esac |
---|
2892 | fn=de~ |
---|
2893 | rp='Where will site-specific architecture-dependent files be installed?' |
---|
2894 | . ./getfile |
---|
2895 | installsitearch="$ans" |
---|
2896 | else |
---|
2897 | installsitearch="$sitearchexp" |
---|
2898 | fi |
---|
2899 | |
---|
2900 | : determine where old public architecture dependent libraries might be |
---|
2901 | case "$oldarchlib" in |
---|
2902 | '') case "$privlib" in |
---|
2903 | '') ;; |
---|
2904 | *) dflt="$privlib/$archname" |
---|
2905 | ;; |
---|
2906 | esac |
---|
2907 | ;; |
---|
2908 | *) dflt="$oldarchlib" |
---|
2909 | ;; |
---|
2910 | esac |
---|
2911 | if $test ! -d "$dflt/auto"; then |
---|
2912 | dflt=none |
---|
2913 | fi |
---|
2914 | cat <<EOM |
---|
2915 | |
---|
2916 | In 5.001, Perl stored architecture-dependent library files in a directory |
---|
2917 | with a name such as $privlib/$archname, |
---|
2918 | and this directory contained files from the standard extensions and |
---|
2919 | files from any additional extensions you might have added. Starting |
---|
2920 | with version 5.002, all the architecture-dependent standard extensions |
---|
2921 | will go into a version-specific directory such as |
---|
2922 | $archlib, |
---|
2923 | while locally-added extensions will go into |
---|
2924 | $sitearch. |
---|
2925 | |
---|
2926 | If you wish Perl to continue to search the old architecture-dependent |
---|
2927 | library for your local extensions, give the path to that directory. |
---|
2928 | If you do not wish to use your old architecture-dependent library |
---|
2929 | files, answer 'none'. |
---|
2930 | |
---|
2931 | EOM |
---|
2932 | fn=dn~ |
---|
2933 | rp='Directory for your old 5.001 architecture-dependent libraries?' |
---|
2934 | . ./getfile |
---|
2935 | oldarchlib="$ans" |
---|
2936 | oldarchlibexp="$ansexp" |
---|
2937 | case "$oldarchlib" in |
---|
2938 | ''|' ') val="$undef" ;; |
---|
2939 | *) val="$define" ;; |
---|
2940 | esac |
---|
2941 | set d_oldarchlib |
---|
2942 | eval $setvar |
---|
2943 | |
---|
2944 | : determine where public executables go |
---|
2945 | echo " " |
---|
2946 | set dflt bin bin |
---|
2947 | eval $prefixit |
---|
2948 | fn=d~ |
---|
2949 | rp='Pathname where the public executables will reside?' |
---|
2950 | . ./getfile |
---|
2951 | if $test "X$ansexp" != "X$binexp"; then |
---|
2952 | installbin='' |
---|
2953 | fi |
---|
2954 | bin="$ans" |
---|
2955 | binexp="$ansexp" |
---|
2956 | if $afs; then |
---|
2957 | $cat <<EOM |
---|
2958 | |
---|
2959 | Since you are running AFS, I need to distinguish the directory in which |
---|
2960 | executables reside from the directory in which they are installed (and from |
---|
2961 | which they are presumably copied to the former directory by occult means). |
---|
2962 | |
---|
2963 | EOM |
---|
2964 | case "$installbin" in |
---|
2965 | '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;; |
---|
2966 | *) dflt="$installbin";; |
---|
2967 | esac |
---|
2968 | fn=de~ |
---|
2969 | rp='Where will public executables be installed?' |
---|
2970 | . ./getfile |
---|
2971 | installbin="$ans" |
---|
2972 | else |
---|
2973 | installbin="$binexp" |
---|
2974 | fi |
---|
2975 | |
---|
2976 | : determine where manual pages are on this system |
---|
2977 | echo " " |
---|
2978 | case "$sysman" in |
---|
2979 | '') |
---|
2980 | syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' |
---|
2981 | syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" |
---|
2982 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" |
---|
2983 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" |
---|
2984 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" |
---|
2985 | sysman=`./loc . /usr/man/man1 $syspath` |
---|
2986 | ;; |
---|
2987 | esac |
---|
2988 | if $test -d "$sysman"; then |
---|
2989 | echo "System manual is in $sysman." >&4 |
---|
2990 | else |
---|
2991 | echo "Could not find manual pages in source form." >&4 |
---|
2992 | fi |
---|
2993 | |
---|
2994 | : see what memory models we can support |
---|
2995 | case "$models" in |
---|
2996 | '') |
---|
2997 | $cat >pdp11.c <<'EOP' |
---|
2998 | main() { |
---|
2999 | #ifdef pdp11 |
---|
3000 | exit(0); |
---|
3001 | #else |
---|
3002 | exit(1); |
---|
3003 | #endif |
---|
3004 | } |
---|
3005 | EOP |
---|
3006 | (cc -o pdp11 pdp11.c) >/dev/null 2>&1 |
---|
3007 | if $test -f pdp11 && ./pdp11 2>/dev/null; then |
---|
3008 | dflt='unsplit split' |
---|
3009 | else |
---|
3010 | tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` |
---|
3011 | case "$tans" in |
---|
3012 | X) dflt='none';; |
---|
3013 | *) if $test -d /lib/small || $test -d /usr/lib/small; then |
---|
3014 | dflt='small' |
---|
3015 | else |
---|
3016 | dflt='' |
---|
3017 | fi |
---|
3018 | if $test -d /lib/medium || $test -d /usr/lib/medium; then |
---|
3019 | dflt="$dflt medium" |
---|
3020 | fi |
---|
3021 | if $test -d /lib/large || $test -d /usr/lib/large; then |
---|
3022 | dflt="$dflt large" |
---|
3023 | fi |
---|
3024 | if $test -d /lib/huge || $test -d /usr/lib/huge; then |
---|
3025 | dflt="$dflt huge" |
---|
3026 | fi |
---|
3027 | esac |
---|
3028 | fi;; |
---|
3029 | *) dflt="$models";; |
---|
3030 | esac |
---|
3031 | $cat <<EOM |
---|
3032 | |
---|
3033 | Some systems have different model sizes. On most systems they are called |
---|
3034 | small, medium, large, and huge. On the PDP11 they are called unsplit and |
---|
3035 | split. If your system doesn't support different memory models, say "none". |
---|
3036 | If you wish to force everything to one memory model, say "none" here and |
---|
3037 | put the appropriate flags later when it asks you for other cc and ld flags. |
---|
3038 | Venix systems may wish to put "none" and let the compiler figure things out. |
---|
3039 | (In the following question multiple model names should be space separated.) |
---|
3040 | |
---|
3041 | EOM |
---|
3042 | rp="Which memory models are supported?" |
---|
3043 | . ./myread |
---|
3044 | models="$ans" |
---|
3045 | |
---|
3046 | case "$models" in |
---|
3047 | none) |
---|
3048 | small='' |
---|
3049 | medium='' |
---|
3050 | large='' |
---|
3051 | huge='' |
---|
3052 | unsplit='' |
---|
3053 | split='' |
---|
3054 | ;; |
---|
3055 | *split) |
---|
3056 | case "$split" in |
---|
3057 | '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \ |
---|
3058 | $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then |
---|
3059 | dflt='-i' |
---|
3060 | else |
---|
3061 | dflt='none' |
---|
3062 | fi;; |
---|
3063 | *) dflt="$split";; |
---|
3064 | esac |
---|
3065 | rp="What flag indicates separate I and D space?" |
---|
3066 | . ./myread |
---|
3067 | tans="$ans" |
---|
3068 | case "$tans" in |
---|
3069 | none) tans='';; |
---|
3070 | esac |
---|
3071 | split="$tans" |
---|
3072 | unsplit='';; |
---|
3073 | *large*|*small*|*medium*|*huge*) |
---|
3074 | case "$models" in |
---|
3075 | *large*) |
---|
3076 | case "$large" in |
---|
3077 | '') dflt='-Ml';; |
---|
3078 | *) dflt="$large";; |
---|
3079 | esac |
---|
3080 | rp="What flag indicates large model?" |
---|
3081 | . ./myread |
---|
3082 | tans="$ans" |
---|
3083 | case "$tans" in |
---|
3084 | none) tans=''; |
---|
3085 | esac |
---|
3086 | large="$tans";; |
---|
3087 | *) large='';; |
---|
3088 | esac |
---|
3089 | case "$models" in |
---|
3090 | *huge*) case "$huge" in |
---|
3091 | '') dflt='-Mh';; |
---|
3092 | *) dflt="$huge";; |
---|
3093 | esac |
---|
3094 | rp="What flag indicates huge model?" |
---|
3095 | . ./myread |
---|
3096 | tans="$ans" |
---|
3097 | case "$tans" in |
---|
3098 | none) tans=''; |
---|
3099 | esac |
---|
3100 | huge="$tans";; |
---|
3101 | *) huge="$large";; |
---|
3102 | esac |
---|
3103 | case "$models" in |
---|
3104 | *medium*) case "$medium" in |
---|
3105 | '') dflt='-Mm';; |
---|
3106 | *) dflt="$medium";; |
---|
3107 | esac |
---|
3108 | rp="What flag indicates medium model?" |
---|
3109 | . ./myread |
---|
3110 | tans="$ans" |
---|
3111 | case "$tans" in |
---|
3112 | none) tans=''; |
---|
3113 | esac |
---|
3114 | medium="$tans";; |
---|
3115 | *) medium="$large";; |
---|
3116 | esac |
---|
3117 | case "$models" in |
---|
3118 | *small*) case "$small" in |
---|
3119 | '') dflt='none';; |
---|
3120 | *) dflt="$small";; |
---|
3121 | esac |
---|
3122 | rp="What flag indicates small model?" |
---|
3123 | . ./myread |
---|
3124 | tans="$ans" |
---|
3125 | case "$tans" in |
---|
3126 | none) tans=''; |
---|
3127 | esac |
---|
3128 | small="$tans";; |
---|
3129 | *) small='';; |
---|
3130 | esac |
---|
3131 | ;; |
---|
3132 | *) |
---|
3133 | echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 |
---|
3134 | ;; |
---|
3135 | esac |
---|
3136 | |
---|
3137 | : see if we need a special compiler |
---|
3138 | echo " " |
---|
3139 | if ./usg; then |
---|
3140 | case "$cc" in |
---|
3141 | '') case "$Mcc" in |
---|
3142 | /*) dflt='Mcc';; |
---|
3143 | *) case "$large" in |
---|
3144 | -M*) dflt='cc';; |
---|
3145 | *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then |
---|
3146 | if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then |
---|
3147 | dflt='cc' |
---|
3148 | else |
---|
3149 | dflt='cc -M' |
---|
3150 | fi |
---|
3151 | else |
---|
3152 | dflt='cc' |
---|
3153 | fi;; |
---|
3154 | esac;; |
---|
3155 | esac;; |
---|
3156 | *) dflt="$cc";; |
---|
3157 | esac |
---|
3158 | $cat <<'EOM' |
---|
3159 | On some systems the default C compiler will not resolve multiple global |
---|
3160 | references that happen to have the same name. On some such systems the "Mcc" |
---|
3161 | command may be used to force these to be resolved. On other systems a "cc -M" |
---|
3162 | command is required. (Note that the -M flag on other systems indicates a |
---|
3163 | memory model to use!) If you have the Gnu C compiler, you might wish to use |
---|
3164 | that instead. |
---|
3165 | |
---|
3166 | EOM |
---|
3167 | rp="What command will force resolution on this system?" |
---|
3168 | . ./myread |
---|
3169 | cc="$ans" |
---|
3170 | else |
---|
3171 | case "$cc" in |
---|
3172 | '') dflt=cc;; |
---|
3173 | *) dflt="$cc";; |
---|
3174 | esac |
---|
3175 | rp="Use which C compiler?" |
---|
3176 | . ./myread |
---|
3177 | cc="$ans" |
---|
3178 | fi |
---|
3179 | echo " " |
---|
3180 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 |
---|
3181 | $cat >gccvers.c <<EOM |
---|
3182 | #include <stdio.h> |
---|
3183 | int main() { |
---|
3184 | #ifdef __GNUC__ |
---|
3185 | #ifdef __VERSION__ |
---|
3186 | printf("%s\n", __VERSION__); |
---|
3187 | #else |
---|
3188 | printf("%s\n", "1"); |
---|
3189 | #endif |
---|
3190 | #endif |
---|
3191 | exit(0); |
---|
3192 | } |
---|
3193 | EOM |
---|
3194 | if $cc -o gccvers gccvers.c >/dev/null 2>&1; then |
---|
3195 | gccversion=`./gccvers` |
---|
3196 | case "$gccversion" in |
---|
3197 | '') echo "You are not using GNU cc." ;; |
---|
3198 | *) echo "You are using GNU cc $gccversion." ;; |
---|
3199 | esac |
---|
3200 | else |
---|
3201 | echo " " |
---|
3202 | echo "*** WHOA THERE!!! ***" >&4 |
---|
3203 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 |
---|
3204 | case "$knowitall" in |
---|
3205 | '') |
---|
3206 | echo " You'd better start hunting for one and let me know about it." >&4 |
---|
3207 | exit 1 |
---|
3208 | ;; |
---|
3209 | esac |
---|
3210 | fi |
---|
3211 | $rm -f gccvers* |
---|
3212 | case "$gccversion" in |
---|
3213 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; |
---|
3214 | esac |
---|
3215 | |
---|
3216 | : What should the include directory be ? |
---|
3217 | echo " " |
---|
3218 | $echo $n "Hmm... $c" |
---|
3219 | dflt='/usr/include' |
---|
3220 | incpath='' |
---|
3221 | mips_type='' |
---|
3222 | if $test -f /bin/mips && /bin/mips; then |
---|
3223 | echo "Looks like a MIPS system..." |
---|
3224 | $cat >usr.c <<'EOCP' |
---|
3225 | #ifdef SYSTYPE_BSD43 |
---|
3226 | /bsd43 |
---|
3227 | #endif |
---|
3228 | EOCP |
---|
3229 | if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then |
---|
3230 | dflt='/bsd43/usr/include' |
---|
3231 | incpath='/bsd43' |
---|
3232 | mips_type='BSD 4.3' |
---|
3233 | else |
---|
3234 | mips_type='System V' |
---|
3235 | fi |
---|
3236 | $rm -f usr.c usr.out |
---|
3237 | echo "and you're compiling with the $mips_type compiler and libraries." |
---|
3238 | xxx_prompt=y |
---|
3239 | echo "exit 0" >mips |
---|
3240 | else |
---|
3241 | echo "Doesn't look like a MIPS system." |
---|
3242 | xxx_prompt=n |
---|
3243 | echo "exit 1" >mips |
---|
3244 | fi |
---|
3245 | chmod +x mips |
---|
3246 | $eunicefix mips |
---|
3247 | echo " " |
---|
3248 | case "$usrinc" in |
---|
3249 | '') ;; |
---|
3250 | *) dflt="$usrinc";; |
---|
3251 | esac |
---|
3252 | case "$xxx_prompt" in |
---|
3253 | y) fn=d/ |
---|
3254 | rp='Where are the include files you want to use?' |
---|
3255 | . ./getfile |
---|
3256 | usrinc="$ans" |
---|
3257 | ;; |
---|
3258 | *) usrinc="$dflt" |
---|
3259 | ;; |
---|
3260 | esac |
---|
3261 | |
---|
3262 | : Set private lib path |
---|
3263 | case "$plibpth" in |
---|
3264 | '') if ./mips; then |
---|
3265 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" |
---|
3266 | fi;; |
---|
3267 | esac |
---|
3268 | case "$libpth" in |
---|
3269 | ' ') dlist='';; |
---|
3270 | '') dlist="$loclibpth $plibpth $glibpth";; |
---|
3271 | *) dlist="$libpth";; |
---|
3272 | esac |
---|
3273 | |
---|
3274 | : Now check and see which directories actually exist, avoiding duplicates |
---|
3275 | libpth='' |
---|
3276 | for xxx in $dlist |
---|
3277 | do |
---|
3278 | if $test -d $xxx; then |
---|
3279 | case " $libpth " in |
---|
3280 | *" $xxx "*) ;; |
---|
3281 | *) libpth="$libpth $xxx";; |
---|
3282 | esac |
---|
3283 | fi |
---|
3284 | done |
---|
3285 | $cat <<'EOM' |
---|
3286 | |
---|
3287 | Some systems have incompatible or broken versions of libraries. Among |
---|
3288 | the directories listed in the question below, please remove any you |
---|
3289 | know not to be holding relevant libraries, and add any that are needed. |
---|
3290 | Say "none" for none. |
---|
3291 | |
---|
3292 | EOM |
---|
3293 | case "$libpth" in |
---|
3294 | '') dflt='none';; |
---|
3295 | *) |
---|
3296 | set X $libpth |
---|
3297 | shift |
---|
3298 | dflt=${1+"$@"} |
---|
3299 | ;; |
---|
3300 | esac |
---|
3301 | rp="Directories to use for library searches?" |
---|
3302 | . ./myread |
---|
3303 | case "$ans" in |
---|
3304 | none) libpth=' ';; |
---|
3305 | *) libpth="$ans";; |
---|
3306 | esac |
---|
3307 | |
---|
3308 | : Define several unixisms. Hints files or command line options |
---|
3309 | : can be used to override them. |
---|
3310 | case "$ar" in |
---|
3311 | '') ar='ar';; |
---|
3312 | esac |
---|
3313 | case "$lib_ext" in |
---|
3314 | '') lib_ext='.a';; |
---|
3315 | esac |
---|
3316 | case "$obj_ext" in |
---|
3317 | '') obj_ext='.o';; |
---|
3318 | esac |
---|
3319 | case "$path_sep" in |
---|
3320 | '') path_sep=':';; |
---|
3321 | esac |
---|
3322 | : Which makefile gets called first. This is used by make depend. |
---|
3323 | case "$firstmakefile" in |
---|
3324 | '') firstmakefile='makefile';; |
---|
3325 | esac |
---|
3326 | |
---|
3327 | : compute shared library extension |
---|
3328 | case "$so" in |
---|
3329 | '') |
---|
3330 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then |
---|
3331 | dflt='sl' |
---|
3332 | else |
---|
3333 | dflt='so' |
---|
3334 | fi |
---|
3335 | ;; |
---|
3336 | *) dflt="$so";; |
---|
3337 | esac |
---|
3338 | $cat <<EOM |
---|
3339 | |
---|
3340 | On some systems, shared libraries may be available. Answer 'none' if |
---|
3341 | you want to suppress searching of shared libraries for the remaining |
---|
3342 | of this configuration. |
---|
3343 | |
---|
3344 | EOM |
---|
3345 | rp='What is the file extension used for shared libraries?' |
---|
3346 | . ./myread |
---|
3347 | so="$ans" |
---|
3348 | |
---|
3349 | : Looking for optional libraries |
---|
3350 | echo " " |
---|
3351 | echo "Checking for optional libraries..." >&4 |
---|
3352 | case "$libs" in |
---|
3353 | ' '|'') dflt='';; |
---|
3354 | *) dflt="$libs";; |
---|
3355 | esac |
---|
3356 | case "$libswanted" in |
---|
3357 | '') libswanted='c_s';; |
---|
3358 | esac |
---|
3359 | for thislib in $libswanted; do |
---|
3360 | |
---|
3361 | if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then |
---|
3362 | echo "Found -l$thislib (shared)." |
---|
3363 | case " $dflt " in |
---|
3364 | *"-l$thislib "*);; |
---|
3365 | *) dflt="$dflt -l$thislib";; |
---|
3366 | esac |
---|
3367 | elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then |
---|
3368 | echo "Found -l$thislib (shared)." |
---|
3369 | case " $dflt " in |
---|
3370 | *"-l$thislib "*);; |
---|
3371 | *) dflt="$dflt -l$thislib";; |
---|
3372 | esac |
---|
3373 | elif xxx=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$xxx"; then |
---|
3374 | echo "Found -l$thislib." |
---|
3375 | case " $dflt " in |
---|
3376 | *"-l$thislib "*);; |
---|
3377 | *) dflt="$dflt -l$thislib";; |
---|
3378 | esac |
---|
3379 | elif xxx=`./loc $thislib$lib_ext X $libpth`; $test -f "$xxx"; then |
---|
3380 | echo "Found -l$thislib." |
---|
3381 | case " $dflt " in |
---|
3382 | *"-l$thislib "*);; |
---|
3383 | *) dflt="$dflt -l$thislib";; |
---|
3384 | esac |
---|
3385 | elif xxx=`./loc lib${thislib}_s$lib_ext X $libpth`; $test -f "$xxx"; then |
---|
3386 | echo "Found -l${thislib}_s." |
---|
3387 | case " $dflt " in |
---|
3388 | *"-l$thislib "*);; |
---|
3389 | *) dflt="$dflt -l${thislib}_s";; |
---|
3390 | esac |
---|
3391 | elif xxx=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$xxx"; then |
---|
3392 | echo "Found -l$thislib." |
---|
3393 | case " $dflt " in |
---|
3394 | *"-l$thislib "*);; |
---|
3395 | *) dflt="$dflt -l$thislib";; |
---|
3396 | esac |
---|
3397 | else |
---|
3398 | echo "No -l$thislib." |
---|
3399 | fi |
---|
3400 | done |
---|
3401 | set X $dflt |
---|
3402 | shift |
---|
3403 | dflt="$*" |
---|
3404 | case "$libs" in |
---|
3405 | '') dflt="$dflt";; |
---|
3406 | *) dflt="$libs";; |
---|
3407 | esac |
---|
3408 | case "$dflt" in |
---|
3409 | ' '|'') dflt='none';; |
---|
3410 | esac |
---|
3411 | |
---|
3412 | $cat <<EOM |
---|
3413 | |
---|
3414 | Some versions of Unix support shared libraries, which make executables smaller |
---|
3415 | but make load time slightly longer. |
---|
3416 | |
---|
3417 | On some systems, mostly System V Release 3's, the shared library is included |
---|
3418 | by putting the option "-lc_s" as the last thing on the cc command line when |
---|
3419 | linking. Other systems use shared libraries by default. There may be other |
---|
3420 | libraries needed to compile $package on your machine as well. If your system |
---|
3421 | needs the "-lc_s" option, include it here. Include any other special libraries |
---|
3422 | here as well. Say "none" for none. |
---|
3423 | EOM |
---|
3424 | |
---|
3425 | echo " " |
---|
3426 | rp="Any additional libraries?" |
---|
3427 | . ./myread |
---|
3428 | case "$ans" in |
---|
3429 | none) libs=' ';; |
---|
3430 | *) libs="$ans";; |
---|
3431 | esac |
---|
3432 | |
---|
3433 | : see how we invoke the C preprocessor |
---|
3434 | echo " " |
---|
3435 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 |
---|
3436 | cat <<'EOT' >testcpp.c |
---|
3437 | #define ABC abc |
---|
3438 | #define XYZ xyz |
---|
3439 | ABC.XYZ |
---|
3440 | EOT |
---|
3441 | cd .. |
---|
3442 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin |
---|
3443 | chmod 755 cppstdin |
---|
3444 | wrapper=`pwd`/cppstdin |
---|
3445 | ok='false' |
---|
3446 | cd UU |
---|
3447 | |
---|
3448 | if $test "X$cppstdin" != "X" && \ |
---|
3449 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ |
---|
3450 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 |
---|
3451 | then |
---|
3452 | echo "You used to use $cppstdin $cppminus so we'll use that again." |
---|
3453 | case "$cpprun" in |
---|
3454 | '') echo "But let's see if we can live without a wrapper..." ;; |
---|
3455 | *) |
---|
3456 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ |
---|
3457 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 |
---|
3458 | then |
---|
3459 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" |
---|
3460 | ok='true' |
---|
3461 | else |
---|
3462 | echo "(However, $cpprun $cpplast does not work, let's see...)" |
---|
3463 | fi |
---|
3464 | ;; |
---|
3465 | esac |
---|
3466 | else |
---|
3467 | case "$cppstdin" in |
---|
3468 | '') ;; |
---|
3469 | *) |
---|
3470 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." |
---|
3471 | ;; |
---|
3472 | esac |
---|
3473 | fi |
---|
3474 | |
---|
3475 | if $ok; then |
---|
3476 | : nothing |
---|
3477 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ |
---|
3478 | $cc -E <testcpp.c >testcpp.out 2>&1; \ |
---|
3479 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3480 | echo "Yup, it does." |
---|
3481 | x_cpp="$cc -E" |
---|
3482 | x_minus=''; |
---|
3483 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ |
---|
3484 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ |
---|
3485 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3486 | echo "Yup, it does." |
---|
3487 | x_cpp="$cc -E" |
---|
3488 | x_minus='-'; |
---|
3489 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ |
---|
3490 | $cc -P <testcpp.c >testcpp.out 2>&1; \ |
---|
3491 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3492 | echo "Yipee, that works!" |
---|
3493 | x_cpp="$cc -P" |
---|
3494 | x_minus=''; |
---|
3495 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ |
---|
3496 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ |
---|
3497 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3498 | echo "At long last!" |
---|
3499 | x_cpp="$cc -P" |
---|
3500 | x_minus='-'; |
---|
3501 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ |
---|
3502 | $cpp <testcpp.c >testcpp.out 2>&1; \ |
---|
3503 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3504 | echo "It works!" |
---|
3505 | x_cpp="$cpp" |
---|
3506 | x_minus=''; |
---|
3507 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ |
---|
3508 | $cpp - <testcpp.c >testcpp.out 2>&1; \ |
---|
3509 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3510 | echo "Hooray, it works! I was beginning to wonder." |
---|
3511 | x_cpp="$cpp" |
---|
3512 | x_minus='-'; |
---|
3513 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ |
---|
3514 | $wrapper <testcpp.c >testcpp.out 2>&1; \ |
---|
3515 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3516 | x_cpp="$wrapper" |
---|
3517 | x_minus='' |
---|
3518 | echo "Eureka!" |
---|
3519 | else |
---|
3520 | dflt='' |
---|
3521 | rp="No dice. I can't find a C preprocessor. Name one:" |
---|
3522 | . ./myread |
---|
3523 | x_cpp="$ans" |
---|
3524 | x_minus='' |
---|
3525 | $x_cpp <testcpp.c >testcpp.out 2>&1 |
---|
3526 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then |
---|
3527 | echo "OK, that will do." >&4 |
---|
3528 | else |
---|
3529 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 |
---|
3530 | exit 1 |
---|
3531 | fi |
---|
3532 | fi |
---|
3533 | |
---|
3534 | case "$ok" in |
---|
3535 | false) |
---|
3536 | cppstdin="$x_cpp" |
---|
3537 | cppminus="$x_minus" |
---|
3538 | cpprun="$x_cpp" |
---|
3539 | cpplast="$x_minus" |
---|
3540 | set X $x_cpp |
---|
3541 | shift |
---|
3542 | case "$1" in |
---|
3543 | "$cpp") |
---|
3544 | echo "Perhaps can we force $cc -E using a wrapper..." |
---|
3545 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ |
---|
3546 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 |
---|
3547 | then |
---|
3548 | echo "Yup, we can." |
---|
3549 | cppstdin="$wrapper" |
---|
3550 | cppminus=''; |
---|
3551 | else |
---|
3552 | echo "Nope, we'll have to live without it..." |
---|
3553 | fi |
---|
3554 | ;; |
---|
3555 | esac |
---|
3556 | case "$cpprun" in |
---|
3557 | "$wrapper") |
---|
3558 | cpprun='' |
---|
3559 | cpplast='' |
---|
3560 | ;; |
---|
3561 | esac |
---|
3562 | ;; |
---|
3563 | esac |
---|
3564 | |
---|
3565 | case "$cppstdin" in |
---|
3566 | "$wrapper") ;; |
---|
3567 | *) $rm -f $wrapper;; |
---|
3568 | esac |
---|
3569 | $rm -f testcpp.c testcpp.out |
---|
3570 | |
---|
3571 | : determine optimize, if desired, or use for debug flag also |
---|
3572 | case "$optimize" in |
---|
3573 | ' '|$undef) dflt='none';; |
---|
3574 | '') dflt='-O';; |
---|
3575 | *) dflt="$optimize";; |
---|
3576 | esac |
---|
3577 | $cat <<EOH |
---|
3578 | |
---|
3579 | Some C compilers have problems with their optimizers. By default, $package |
---|
3580 | compiles with the -O flag to use the optimizer. Alternately, you might want |
---|
3581 | to use the symbolic debugger, which uses the -g flag (on traditional Unix |
---|
3582 | systems). Either flag can be specified here. To use neither flag, specify |
---|
3583 | the word "none". |
---|
3584 | |
---|
3585 | EOH |
---|
3586 | rp="What optimizer/debugger flag should be used?" |
---|
3587 | . ./myread |
---|
3588 | optimize="$ans" |
---|
3589 | case "$optimize" in |
---|
3590 | 'none') optimize=" ";; |
---|
3591 | esac |
---|
3592 | |
---|
3593 | dflt='' |
---|
3594 | : We will not override a previous value, but we might want to |
---|
3595 | : augment a hint file |
---|
3596 | case "$hint" in |
---|
3597 | none|recommended) |
---|
3598 | case "$gccversion" in |
---|
3599 | 1*) dflt='-fpcc-struct-return' ;; |
---|
3600 | esac |
---|
3601 | case "$optimize" in |
---|
3602 | *-g*) dflt="$dflt -DDEBUGGING";; |
---|
3603 | esac |
---|
3604 | case "$gccversion" in |
---|
3605 | 2*) if test -d /etc/conf/kconfig.d && |
---|
3606 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 |
---|
3607 | then |
---|
3608 | dflt="$dflt -posix" |
---|
3609 | fi |
---|
3610 | ;; |
---|
3611 | esac |
---|
3612 | ;; |
---|
3613 | esac |
---|
3614 | |
---|
3615 | case "$mips_type" in |
---|
3616 | *BSD*|'') inclwanted="$locincpth $usrinc";; |
---|
3617 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; |
---|
3618 | esac |
---|
3619 | for thisincl in $inclwanted; do |
---|
3620 | if $test -d $thisincl; then |
---|
3621 | if $test x$thisincl != x$usrinc; then |
---|
3622 | case "$dflt" in |
---|
3623 | *$thisincl*);; |
---|
3624 | *) dflt="$dflt -I$thisincl";; |
---|
3625 | esac |
---|
3626 | fi |
---|
3627 | fi |
---|
3628 | done |
---|
3629 | |
---|
3630 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then |
---|
3631 | xxx=true; |
---|
3632 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then |
---|
3633 | xxx=true; |
---|
3634 | else |
---|
3635 | xxx=false; |
---|
3636 | fi; |
---|
3637 | if $xxx; then |
---|
3638 | case "$dflt" in |
---|
3639 | *$2*);; |
---|
3640 | *) dflt="$dflt -D$2";; |
---|
3641 | esac; |
---|
3642 | fi' |
---|
3643 | |
---|
3644 | if ./osf1; then |
---|
3645 | set signal.h __LANGUAGE_C__; eval $inctest |
---|
3646 | else |
---|
3647 | set signal.h LANGUAGE_C; eval $inctest |
---|
3648 | fi |
---|
3649 | |
---|
3650 | case "$hint" in |
---|
3651 | none|recommended) dflt="$ccflags $dflt" ;; |
---|
3652 | *) dflt="$ccflags";; |
---|
3653 | esac |
---|
3654 | |
---|
3655 | case "$dflt" in |
---|
3656 | ''|' ') dflt=none;; |
---|
3657 | esac |
---|
3658 | $cat <<EOH |
---|
3659 | |
---|
3660 | Your C compiler may want other flags. For this question you should include |
---|
3661 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, |
---|
3662 | but you should NOT include libraries or ld flags like -lwhatever. If you |
---|
3663 | want $package to honor its debug switch, you should include -DDEBUGGING here. |
---|
3664 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE, |
---|
3665 | -DHIDEMYMALLOC or -DCRIPPLED_CC. |
---|
3666 | |
---|
3667 | To use no flags, specify the word "none". |
---|
3668 | |
---|
3669 | EOH |
---|
3670 | set X $dflt |
---|
3671 | shift |
---|
3672 | dflt=${1+"$@"} |
---|
3673 | rp="Any additional cc flags?" |
---|
3674 | . ./myread |
---|
3675 | case "$ans" in |
---|
3676 | none) ccflags='';; |
---|
3677 | *) ccflags="$ans";; |
---|
3678 | esac |
---|
3679 | |
---|
3680 | : the following weeds options from ccflags that are of no interest to cpp |
---|
3681 | cppflags="$ccflags" |
---|
3682 | case "$gccversion" in |
---|
3683 | 1*) cppflags="$cppflags -D__GNUC__" |
---|
3684 | esac |
---|
3685 | case "$mips_type" in |
---|
3686 | '');; |
---|
3687 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; |
---|
3688 | esac |
---|
3689 | case "$cppflags" in |
---|
3690 | '');; |
---|
3691 | *) |
---|
3692 | echo " " |
---|
3693 | echo "Let me guess what the preprocessor flags are..." >&4 |
---|
3694 | set X $cppflags |
---|
3695 | shift |
---|
3696 | cppflags='' |
---|
3697 | $cat >cpp.c <<'EOM' |
---|
3698 | #define BLURFL foo |
---|
3699 | |
---|
3700 | BLURFL xx LFRULB |
---|
3701 | EOM |
---|
3702 | previous='' |
---|
3703 | for flag in $* |
---|
3704 | do |
---|
3705 | case "$flag" in |
---|
3706 | -*) ftry="$flag";; |
---|
3707 | *) ftry="$previous $flag";; |
---|
3708 | esac |
---|
3709 | if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \ |
---|
3710 | >cpp1.out 2>/dev/null && \ |
---|
3711 | $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \ |
---|
3712 | >cpp2.out 2>/dev/null && \ |
---|
3713 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ |
---|
3714 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 |
---|
3715 | then |
---|
3716 | cppflags="$cppflags $ftry" |
---|
3717 | previous='' |
---|
3718 | else |
---|
3719 | previous="$flag" |
---|
3720 | fi |
---|
3721 | done |
---|
3722 | set X $cppflags |
---|
3723 | shift |
---|
3724 | cppflags=${1+"$@"} |
---|
3725 | case "$cppflags" in |
---|
3726 | *-*) echo "They appear to be: $cppflags";; |
---|
3727 | esac |
---|
3728 | $rm -f cpp.c cpp?.out |
---|
3729 | ;; |
---|
3730 | esac |
---|
3731 | |
---|
3732 | : flags used in final linking phase |
---|
3733 | |
---|
3734 | case "$ldflags" in |
---|
3735 | '') if ./venix; then |
---|
3736 | dflt='-i -z' |
---|
3737 | else |
---|
3738 | dflt='' |
---|
3739 | fi |
---|
3740 | case "$ccflags" in |
---|
3741 | *-posix*) dflt="$dflt -posix" ;; |
---|
3742 | esac |
---|
3743 | ;; |
---|
3744 | *) dflt="$ldflags";; |
---|
3745 | esac |
---|
3746 | |
---|
3747 | : Try to guess additional flags to pick up local libraries. |
---|
3748 | for thislibdir in $libpth; do |
---|
3749 | case " $loclibpth " in |
---|
3750 | *" $thislibdir "*) |
---|
3751 | case "$dflt " in |
---|
3752 | *"-L$thislibdir "*) ;; |
---|
3753 | *) dflt="$dflt -L$thislibdir" ;; |
---|
3754 | esac |
---|
3755 | ;; |
---|
3756 | esac |
---|
3757 | done |
---|
3758 | |
---|
3759 | case "$dflt" in |
---|
3760 | '') dflt='none' ;; |
---|
3761 | esac |
---|
3762 | |
---|
3763 | $cat <<EOH |
---|
3764 | |
---|
3765 | Your C linker may need flags. For this question you should |
---|
3766 | include -L/whatever and any other flags used by the C linker, but you |
---|
3767 | should NOT include libraries like -lwhatever. |
---|
3768 | |
---|
3769 | Make sure you include the appropriate -L/path flags if your C linker |
---|
3770 | does not normally search all of the directories you specified above, |
---|
3771 | namely |
---|
3772 | $libpth |
---|
3773 | To use no flags, specify the word "none". |
---|
3774 | |
---|
3775 | EOH |
---|
3776 | |
---|
3777 | rp="Any additional ld flags (NOT including libraries)?" |
---|
3778 | . ./myread |
---|
3779 | case "$ans" in |
---|
3780 | none) ldflags='';; |
---|
3781 | *) ldflags="$ans";; |
---|
3782 | esac |
---|
3783 | rmlist="$rmlist pdp11" |
---|
3784 | |
---|
3785 | : coherency check |
---|
3786 | echo " " |
---|
3787 | echo "Checking your choice of C compiler, libs, and flags for coherency..." >&4 |
---|
3788 | set X $cc $optimize $ccflags $ldflags -o try try.c $libs |
---|
3789 | shift |
---|
3790 | $cat >try.msg <<EOM |
---|
3791 | I've tried to compile and run a simple program with: |
---|
3792 | |
---|
3793 | $* |
---|
3794 | ./try |
---|
3795 | |
---|
3796 | and I got the following output: |
---|
3797 | |
---|
3798 | EOM |
---|
3799 | $cat > try.c <<'EOF' |
---|
3800 | #include <stdio.h> |
---|
3801 | main() { exit(0); } |
---|
3802 | EOF |
---|
3803 | dflt=y |
---|
3804 | if sh -c "$cc $optimize $ccflags -o try try.c $ldflags $libs" >>try.msg 2>&1; then |
---|
3805 | if sh -c './try' >>try.msg 2>&1; then |
---|
3806 | dflt=n |
---|
3807 | else |
---|
3808 | echo "The program compiled OK, but exited with status $?." >>try.msg |
---|
3809 | rp="You have a problem. Shall I abort Configure (and explain the problem)" |
---|
3810 | dflt=y |
---|
3811 | fi |
---|
3812 | else |
---|
3813 | echo "I can't compile the test program." >>try.msg |
---|
3814 | rp="You have a BIG problem. Shall I abort Configure (and explain the problem)" |
---|
3815 | dflt=y |
---|
3816 | fi |
---|
3817 | case "$dflt" in |
---|
3818 | y) |
---|
3819 | $cat try.msg >&4 |
---|
3820 | case "$knowitall" in |
---|
3821 | '') |
---|
3822 | echo "(The supplied flags might be incorrect with this C compiler.)" |
---|
3823 | ;; |
---|
3824 | *) dflt=n;; |
---|
3825 | esac |
---|
3826 | echo " " |
---|
3827 | . ./myread |
---|
3828 | case "$ans" in |
---|
3829 | n*|N*) ;; |
---|
3830 | *) echo "Ok. Stopping Configure." >&4 |
---|
3831 | exit 1 |
---|
3832 | ;; |
---|
3833 | esac |
---|
3834 | ;; |
---|
3835 | n) echo "OK, that should do.";; |
---|
3836 | esac |
---|
3837 | $rm -f try try.* core |
---|
3838 | |
---|
3839 | echo " " |
---|
3840 | echo "Checking for GNU C Library..." >&4 |
---|
3841 | cat >gnulibc.c <<EOM |
---|
3842 | int |
---|
3843 | main() |
---|
3844 | { |
---|
3845 | return __libc_main(); |
---|
3846 | } |
---|
3847 | EOM |
---|
3848 | if $cc $ccflags $ldflags -o gnulibc gnulibc.c $libs >/dev/null 2>&1 && \ |
---|
3849 | ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then |
---|
3850 | val="$define" |
---|
3851 | echo "You are using the GNU C Library" |
---|
3852 | else |
---|
3853 | val="$undef" |
---|
3854 | echo "You are not using the GNU C Library" |
---|
3855 | fi |
---|
3856 | $rm -f gnulibc* |
---|
3857 | set d_gnulibc |
---|
3858 | eval $setvar |
---|
3859 | |
---|
3860 | : see if nm is to be used to determine whether a symbol is defined or not |
---|
3861 | case "$usenm" in |
---|
3862 | '') |
---|
3863 | case "$d_gnulibc" in |
---|
3864 | $define) |
---|
3865 | dflt=n |
---|
3866 | ;; |
---|
3867 | *) |
---|
3868 | dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` |
---|
3869 | if $test $dflt -gt 20; then |
---|
3870 | dflt=y |
---|
3871 | else |
---|
3872 | dflt=n |
---|
3873 | fi |
---|
3874 | ;; |
---|
3875 | esac |
---|
3876 | ;; |
---|
3877 | *) |
---|
3878 | case "$usenm" in |
---|
3879 | true) dflt=y;; |
---|
3880 | *) dflt=n;; |
---|
3881 | esac |
---|
3882 | ;; |
---|
3883 | esac |
---|
3884 | $cat <<EOM |
---|
3885 | |
---|
3886 | I can use 'nm' to extract the symbols from your C libraries. This is a time |
---|
3887 | consuming task which may generate huge output on the disk (up to 3 megabytes) |
---|
3888 | but that should make the symbols extraction faster. The alternative is to skip |
---|
3889 | the 'nm' extraction part and to compile a small test program instead to |
---|
3890 | determine whether each symbol is present. If you have a fast C compiler and/or |
---|
3891 | if your 'nm' output cannot be parsed, this may be the best solution. |
---|
3892 | You shouldn't let me use 'nm' if you have the GNU C Library. |
---|
3893 | |
---|
3894 | EOM |
---|
3895 | rp='Shall I use nm to extract C symbols from the libraries?' |
---|
3896 | . ./myread |
---|
3897 | case "$ans" in |
---|
3898 | n|N) usenm=false;; |
---|
3899 | *) usenm=true;; |
---|
3900 | esac |
---|
3901 | |
---|
3902 | runnm=$usenm |
---|
3903 | case "$reuseval" in |
---|
3904 | true) runnm=false;; |
---|
3905 | esac |
---|
3906 | |
---|
3907 | : nm options which may be necessary |
---|
3908 | case "$nm_opt" in |
---|
3909 | '') if $test -f /mach_boot; then |
---|
3910 | nm_opt='' # Mach |
---|
3911 | elif $test -d /usr/ccs/lib; then |
---|
3912 | nm_opt='-p' # Solaris (and SunOS?) |
---|
3913 | elif $test -f /dgux; then |
---|
3914 | nm_opt='-p' # DG-UX |
---|
3915 | elif $test -f /lib64/rld; then |
---|
3916 | nm_opt='-p' # 64-bit Irix |
---|
3917 | else |
---|
3918 | nm_opt='' |
---|
3919 | fi;; |
---|
3920 | esac |
---|
3921 | |
---|
3922 | : nm options which may be necessary for shared libraries but illegal |
---|
3923 | : for archive libraries. Thank you, Linux. |
---|
3924 | case "$nm_so_opt" in |
---|
3925 | '') case "$myuname" in |
---|
3926 | *linux*) |
---|
3927 | if nm --help | $grep 'dynamic' > /dev/null 2>&1; then |
---|
3928 | nm_so_opt='--dynamic' |
---|
3929 | fi |
---|
3930 | ;; |
---|
3931 | esac |
---|
3932 | ;; |
---|
3933 | esac |
---|
3934 | |
---|
3935 | case "$runnm" in |
---|
3936 | true) |
---|
3937 | : get list of predefined functions in a handy place |
---|
3938 | echo " " |
---|
3939 | case "$libc" in |
---|
3940 | '') libc=unknown |
---|
3941 | case "$libs" in |
---|
3942 | *-lc_s*) libc=`./loc libc_s$lib_ext $libc $libpth` |
---|
3943 | esac |
---|
3944 | ;; |
---|
3945 | esac |
---|
3946 | libnames=''; |
---|
3947 | case "$libs" in |
---|
3948 | '') ;; |
---|
3949 | *) for thislib in $libs; do |
---|
3950 | case "$thislib" in |
---|
3951 | -lc|-lc_s) |
---|
3952 | : Handle C library specially below. |
---|
3953 | ;; |
---|
3954 | -l*) |
---|
3955 | thislib=`echo $thislib | $sed -e 's/^-l//'` |
---|
3956 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then |
---|
3957 | : |
---|
3958 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then |
---|
3959 | : |
---|
3960 | elif try=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$try"; then |
---|
3961 | : |
---|
3962 | elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then |
---|
3963 | : |
---|
3964 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then |
---|
3965 | : |
---|
3966 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then |
---|
3967 | : |
---|
3968 | elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then |
---|
3969 | : |
---|
3970 | else |
---|
3971 | try='' |
---|
3972 | fi |
---|
3973 | libnames="$libnames $try" |
---|
3974 | ;; |
---|
3975 | *) libnames="$libnames $thislib" ;; |
---|
3976 | esac |
---|
3977 | done |
---|
3978 | ;; |
---|
3979 | esac |
---|
3980 | xxx=normal |
---|
3981 | case "$libc" in |
---|
3982 | unknown) |
---|
3983 | set /lib/libc.$so |
---|
3984 | for xxx in $libpth; do |
---|
3985 | $test -r $1 || set $xxx/libc.$so |
---|
3986 | : The messy sed command sorts on library version numbers. |
---|
3987 | $test -r $1 || \ |
---|
3988 | set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ |
---|
3989 | tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e ' |
---|
3990 | h |
---|
3991 | s/[0-9][0-9]*/0000&/g |
---|
3992 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g |
---|
3993 | G |
---|
3994 | s/\n/ /' | \ |
---|
3995 | sort | $sed -e 's/^.* //'` |
---|
3996 | eval set \$$# |
---|
3997 | done |
---|
3998 | $test -r $1 || set /usr/ccs/lib/libc.$so |
---|
3999 | $test -r $1 || set /lib/libsys_s$lib_ext |
---|
4000 | ;; |
---|
4001 | *) |
---|
4002 | set blurfl |
---|
4003 | ;; |
---|
4004 | esac |
---|
4005 | if $test -r "$1"; then |
---|
4006 | echo "Your (shared) C library seems to be in $1." |
---|
4007 | libc="$1" |
---|
4008 | elif $test -r /lib/libc && $test -r /lib/clib; then |
---|
4009 | echo "Your C library seems to be in both /lib/clib and /lib/libc." |
---|
4010 | xxx=apollo |
---|
4011 | libc='/lib/clib /lib/libc' |
---|
4012 | if $test -r /lib/syslib; then |
---|
4013 | echo "(Your math library is in /lib/syslib.)" |
---|
4014 | libc="$libc /lib/syslib" |
---|
4015 | fi |
---|
4016 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then |
---|
4017 | echo "Your C library seems to be in $libc, as you said before." |
---|
4018 | elif $test -r $incpath/usr/lib/libc$lib_ext; then |
---|
4019 | libc=$incpath/usr/lib/libc$lib_ext; |
---|
4020 | echo "Your C library seems to be in $libc. That's fine." |
---|
4021 | elif $test -r /lib/libc$lib_ext; then |
---|
4022 | libc=/lib/libc$lib_ext; |
---|
4023 | echo "Your C library seems to be in $libc. You're normal." |
---|
4024 | else |
---|
4025 | if tans=`./loc libc$lib_ext blurfl/dyick $libpth`; $test -r "$tans"; then |
---|
4026 | : |
---|
4027 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then |
---|
4028 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` |
---|
4029 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then |
---|
4030 | : |
---|
4031 | elif tans=`./loc Slibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then |
---|
4032 | : |
---|
4033 | elif tans=`./loc Mlibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then |
---|
4034 | : |
---|
4035 | else |
---|
4036 | tans=`./loc Llibc$lib_ext blurfl/dyick $xlibpth` |
---|
4037 | fi |
---|
4038 | if $test -r "$tans"; then |
---|
4039 | echo "Your C library seems to be in $tans, of all places." |
---|
4040 | libc=$tans |
---|
4041 | else |
---|
4042 | libc='blurfl' |
---|
4043 | fi |
---|
4044 | fi |
---|
4045 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then |
---|
4046 | dflt="$libc" |
---|
4047 | cat <<EOM |
---|
4048 | |
---|
4049 | If the guess above is wrong (which it might be if you're using a strange |
---|
4050 | compiler, or your machine supports multiple models), you can override it here. |
---|
4051 | |
---|
4052 | EOM |
---|
4053 | else |
---|
4054 | dflt='' |
---|
4055 | echo $libpth | tr ' ' '\012' | sort | uniq > libpath |
---|
4056 | cat >&4 <<EOM |
---|
4057 | I can't seem to find your C library. I've looked in the following places: |
---|
4058 | |
---|
4059 | EOM |
---|
4060 | $sed 's/^/ /' libpath |
---|
4061 | cat <<EOM |
---|
4062 | |
---|
4063 | None of these seems to contain your C library. I need to get its name... |
---|
4064 | |
---|
4065 | EOM |
---|
4066 | fi |
---|
4067 | fn=f |
---|
4068 | rp='Where is your C library?' |
---|
4069 | . ./getfile |
---|
4070 | libc="$ans" |
---|
4071 | |
---|
4072 | echo " " |
---|
4073 | echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames |
---|
4074 | set X `cat libnames` |
---|
4075 | shift |
---|
4076 | xxx=files |
---|
4077 | case $# in 1) xxx=file; esac |
---|
4078 | echo "Extracting names from the following $xxx for later perusal:" >&4 |
---|
4079 | echo " " |
---|
4080 | $sed 's/^/ /' libnames >&4 |
---|
4081 | echo " " |
---|
4082 | $echo $n "This may take a while...$c" >&4 |
---|
4083 | |
---|
4084 | : Linux may need the special Dynamic option to nm for shared libraries. |
---|
4085 | : In general, this is stored in the nm_so_opt variable. |
---|
4086 | : Unfortunately, that option may be fatal on non-shared libraries. |
---|
4087 | for nm_libs_ext in $*; do |
---|
4088 | case $nm_libs_ext in |
---|
4089 | *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;; |
---|
4090 | *) nm $nm_opt $nm_libs_ext 2>/dev/null ;; |
---|
4091 | esac |
---|
4092 | done > libc.tmp |
---|
4093 | |
---|
4094 | $echo $n ".$c" |
---|
4095 | $grep fprintf libc.tmp > libc.ptf |
---|
4096 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' |
---|
4097 | xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4' |
---|
4098 | xxx='[ADTSIW]' |
---|
4099 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\ |
---|
4100 | eval $xscan;\ |
---|
4101 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4102 | eval $xrun |
---|
4103 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ |
---|
4104 | eval $xscan;\ |
---|
4105 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4106 | eval $xrun |
---|
4107 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ |
---|
4108 | eval $xscan;\ |
---|
4109 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4110 | eval $xrun |
---|
4111 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ |
---|
4112 | eval $xscan;\ |
---|
4113 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4114 | eval $xrun |
---|
4115 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\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'";\ |
---|
4120 | eval $xscan;\ |
---|
4121 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4122 | eval $xrun |
---|
4123 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ |
---|
4124 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ |
---|
4125 | eval $xscan;\ |
---|
4126 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4127 | eval $xrun |
---|
4128 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ |
---|
4129 | eval $xscan;\ |
---|
4130 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4131 | eval $xrun |
---|
4132 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ |
---|
4133 | eval $xscan;\ |
---|
4134 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4135 | eval $xrun |
---|
4136 | elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ |
---|
4137 | eval $xscan;\ |
---|
4138 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4139 | eval $xrun |
---|
4140 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
---|
4141 | eval $xscan;\ |
---|
4142 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4143 | eval $xrun |
---|
4144 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ |
---|
4145 | eval $xscan;\ |
---|
4146 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4147 | eval $xrun |
---|
4148 | elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ |
---|
4149 | eval $xscan;\ |
---|
4150 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then |
---|
4151 | eval $xrun |
---|
4152 | else |
---|
4153 | nm -p $* 2>/dev/null >libc.tmp |
---|
4154 | $grep fprintf libc.tmp > libc.ptf |
---|
4155 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ |
---|
4156 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 |
---|
4157 | then |
---|
4158 | nm_opt='-p' |
---|
4159 | eval $xrun |
---|
4160 | else |
---|
4161 | echo " " |
---|
4162 | echo "nm didn't seem to work right. Trying ar instead..." >&4 |
---|
4163 | com='' |
---|
4164 | if ar t $libc > libc.tmp; then |
---|
4165 | for thisname in $libnames; do |
---|
4166 | ar t $thisname >>libc.tmp |
---|
4167 | done |
---|
4168 | $sed -e 's/\.o$//' < libc.tmp > libc.list |
---|
4169 | echo "Ok." >&4 |
---|
4170 | else |
---|
4171 | echo "ar didn't seem to work right." >&4 |
---|
4172 | echo "Maybe this is a Cray...trying bld instead..." >&4 |
---|
4173 | if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list |
---|
4174 | then |
---|
4175 | for thisname in $libnames; do |
---|
4176 | bld t $libnames | \ |
---|
4177 | $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list |
---|
4178 | ar t $thisname >>libc.tmp |
---|
4179 | done |
---|
4180 | echo "Ok." >&4 |
---|
4181 | else |
---|
4182 | echo "That didn't work either. Giving up." >&4 |
---|
4183 | exit 1 |
---|
4184 | fi |
---|
4185 | fi |
---|
4186 | fi |
---|
4187 | fi |
---|
4188 | nm_extract="$com" |
---|
4189 | if $test -f /lib/syscalls.exp; then |
---|
4190 | echo " " |
---|
4191 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 |
---|
4192 | $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list |
---|
4193 | fi |
---|
4194 | ;; |
---|
4195 | esac |
---|
4196 | $rm -f libnames libpath |
---|
4197 | |
---|
4198 | : determine filename position in cpp output |
---|
4199 | echo " " |
---|
4200 | echo "Computing filename position in cpp output for #include directives..." >&4 |
---|
4201 | echo '#include <stdio.h>' > foo.c |
---|
4202 | $cat >fieldn <<EOF |
---|
4203 | $startsh |
---|
4204 | $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \ |
---|
4205 | $grep '^[ ]*#.*stdio\.h' | \ |
---|
4206 | while read cline; do |
---|
4207 | pos=1 |
---|
4208 | set \$cline |
---|
4209 | while $test \$# -gt 0; do |
---|
4210 | if $test -r \`echo \$1 | $tr -d '"'\`; then |
---|
4211 | echo "\$pos" |
---|
4212 | exit 0 |
---|
4213 | fi |
---|
4214 | shift |
---|
4215 | pos=\`expr \$pos + 1\` |
---|
4216 | done |
---|
4217 | done |
---|
4218 | EOF |
---|
4219 | chmod +x fieldn |
---|
4220 | fieldn=`./fieldn` |
---|
4221 | $rm -f foo.c fieldn |
---|
4222 | case $fieldn in |
---|
4223 | '') pos='???';; |
---|
4224 | 1) pos=first;; |
---|
4225 | 2) pos=second;; |
---|
4226 | 3) pos=third;; |
---|
4227 | *) pos="${fieldn}th";; |
---|
4228 | esac |
---|
4229 | echo "Your cpp writes the filename in the $pos field of the line." |
---|
4230 | |
---|
4231 | : locate header file |
---|
4232 | $cat >findhdr <<EOF |
---|
4233 | $startsh |
---|
4234 | wanted=\$1 |
---|
4235 | name='' |
---|
4236 | if test -f $usrinc/\$wanted; then |
---|
4237 | echo "$usrinc/\$wanted" |
---|
4238 | exit 0 |
---|
4239 | fi |
---|
4240 | awkprg='{ print \$$fieldn }' |
---|
4241 | echo "#include <\$wanted>" > foo\$\$.c |
---|
4242 | $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ |
---|
4243 | $grep "^[ ]*#.*\$wanted" | \ |
---|
4244 | while read cline; do |
---|
4245 | name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` |
---|
4246 | case "\$name" in |
---|
4247 | */\$wanted) echo "\$name"; exit 0;; |
---|
4248 | *) name='';; |
---|
4249 | esac; |
---|
4250 | done; |
---|
4251 | $rm -f foo\$\$.c; |
---|
4252 | case "\$name" in |
---|
4253 | '') exit 1;; |
---|
4254 | esac |
---|
4255 | EOF |
---|
4256 | chmod +x findhdr |
---|
4257 | |
---|
4258 | : define an alternate in-header-list? function |
---|
4259 | inhdr='echo " "; td=$define; tu=$undef; yyy=$@; |
---|
4260 | cont=true; xxf="echo \"<\$1> found.\" >&4"; |
---|
4261 | case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; |
---|
4262 | *) xxnf="echo \"<\$1> NOT found, ...\" >&4";; |
---|
4263 | esac; |
---|
4264 | case $# in 4) instead=instead;; *) instead="at last";; esac; |
---|
4265 | while $test "$cont"; do |
---|
4266 | xxx=`./findhdr $1` |
---|
4267 | var=$2; eval "was=\$$2"; |
---|
4268 | if $test "$xxx" && $test -r "$xxx"; |
---|
4269 | then eval $xxf; |
---|
4270 | eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; |
---|
4271 | cont=""; |
---|
4272 | else eval $xxnf; |
---|
4273 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; |
---|
4274 | set $yyy; shift; shift; yyy=$@; |
---|
4275 | case $# in 0) cont="";; |
---|
4276 | 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; |
---|
4277 | xxnf="echo \"and I did not find <\$1> either.\" >&4";; |
---|
4278 | *) xxf="echo \"but I found <\$1\> instead.\" >&4"; |
---|
4279 | xxnf="echo \"there is no <\$1>, ...\" >&4";; |
---|
4280 | esac; |
---|
4281 | done; |
---|
4282 | while $test "$yyy"; |
---|
4283 | do set $yyy; var=$2; eval "was=\$$2"; |
---|
4284 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; |
---|
4285 | set $yyy; shift; shift; yyy=$@; |
---|
4286 | done' |
---|
4287 | |
---|
4288 | : see if dld is available |
---|
4289 | set dld.h i_dld |
---|
4290 | eval $inhdr |
---|
4291 | |
---|
4292 | : is a C symbol defined? |
---|
4293 | csym='tlook=$1; |
---|
4294 | case "$3" in |
---|
4295 | -v) tf=libc.tmp; tc=""; tdc="";; |
---|
4296 | -a) tf=libc.tmp; tc="[0]"; tdc="[]";; |
---|
4297 | *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; |
---|
4298 | esac; |
---|
4299 | tx=yes; |
---|
4300 | case "$reuseval-$4" in |
---|
4301 | true-) ;; |
---|
4302 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; |
---|
4303 | esac; |
---|
4304 | case "$tx" in |
---|
4305 | yes) |
---|
4306 | case "$runnm" in |
---|
4307 | true) |
---|
4308 | if $contains $tlook $tf >/dev/null 2>&1; |
---|
4309 | then tval=true; |
---|
4310 | else tval=false; |
---|
4311 | fi;; |
---|
4312 | *) |
---|
4313 | echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; |
---|
4314 | if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; |
---|
4315 | then tval=true; |
---|
4316 | else tval=false; |
---|
4317 | fi; |
---|
4318 | $rm -f t t.c;; |
---|
4319 | esac;; |
---|
4320 | *) |
---|
4321 | case "$tval" in |
---|
4322 | $define) tval=true;; |
---|
4323 | *) tval=false;; |
---|
4324 | esac;; |
---|
4325 | esac; |
---|
4326 | eval "$2=$tval"' |
---|
4327 | |
---|
4328 | : define an is-in-libc? function |
---|
4329 | inlibc='echo " "; td=$define; tu=$undef; |
---|
4330 | sym=$1; var=$2; eval "was=\$$2"; |
---|
4331 | tx=yes; |
---|
4332 | case "$reuseval$was" in |
---|
4333 | true) ;; |
---|
4334 | true*) tx=no;; |
---|
4335 | esac; |
---|
4336 | case "$tx" in |
---|
4337 | yes) |
---|
4338 | set $sym tres -f; |
---|
4339 | eval $csym; |
---|
4340 | case "$tres" in |
---|
4341 | true) |
---|
4342 | echo "$sym() found." >&4; |
---|
4343 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; |
---|
4344 | *) |
---|
4345 | echo "$sym() NOT found." >&4; |
---|
4346 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; |
---|
4347 | esac;; |
---|
4348 | *) |
---|
4349 | case "$was" in |
---|
4350 | $define) echo "$sym() found." >&4;; |
---|
4351 | *) echo "$sym() NOT found." >&4;; |
---|
4352 | esac;; |
---|
4353 | esac' |
---|
4354 | |
---|
4355 | : see if dlopen exists |
---|
4356 | xxx_runnm="$runnm" |
---|
4357 | runnm=false |
---|
4358 | set dlopen d_dlopen |
---|
4359 | eval $inlibc |
---|
4360 | runnm="$xxx_runnm" |
---|
4361 | |
---|
4362 | : determine which dynamic loading, if any, to compile in |
---|
4363 | echo " " |
---|
4364 | dldir="ext/DynaLoader" |
---|
4365 | case "$usedl" in |
---|
4366 | $define|y|true) |
---|
4367 | dflt='y' |
---|
4368 | usedl="$define" |
---|
4369 | ;; |
---|
4370 | $undef|n|false) |
---|
4371 | dflt='n' |
---|
4372 | usedl="$undef" |
---|
4373 | ;; |
---|
4374 | *) |
---|
4375 | dflt='n' |
---|
4376 | case "$d_dlopen" in |
---|
4377 | $define) dflt='y' ;; |
---|
4378 | esac |
---|
4379 | case "$i_dld" in |
---|
4380 | $define) dflt='y' ;; |
---|
4381 | esac |
---|
4382 | : Does a dl_xxx.xs file exist for this operating system |
---|
4383 | $test -f ../$dldir/dl_${osname}.xs && dflt='y' |
---|
4384 | ;; |
---|
4385 | esac |
---|
4386 | rp="Do you wish to use dynamic loading?" |
---|
4387 | . ./myread |
---|
4388 | usedl="$ans" |
---|
4389 | case "$ans" in |
---|
4390 | y*) usedl="$define" |
---|
4391 | case "$dlsrc" in |
---|
4392 | '') |
---|
4393 | if $test -f ../$dldir/dl_${osname}.xs ; then |
---|
4394 | dflt="$dldir/dl_${osname}.xs" |
---|
4395 | elif $test "$d_dlopen" = "$define" ; then |
---|
4396 | dflt="$dldir/dl_dlopen.xs" |
---|
4397 | elif $test "$i_dld" = "$define" ; then |
---|
4398 | dflt="$dldir/dl_dld.xs" |
---|
4399 | else |
---|
4400 | dflt='' |
---|
4401 | fi |
---|
4402 | ;; |
---|
4403 | *) dflt="$dldir/$dlsrc" |
---|
4404 | ;; |
---|
4405 | esac |
---|
4406 | echo "The following dynamic loading files are available:" |
---|
4407 | : Can not go over to $dldir because getfile has path hard-coded in. |
---|
4408 | cd ..; ls -C $dldir/dl*.xs; cd UU |
---|
4409 | rp="Source file to use for dynamic loading" |
---|
4410 | fn="fne" |
---|
4411 | . ./getfile |
---|
4412 | usedl="$define" |
---|
4413 | : emulate basename |
---|
4414 | dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'` |
---|
4415 | |
---|
4416 | $cat << EOM |
---|
4417 | |
---|
4418 | Some systems may require passing special flags to $cc -c to |
---|
4419 | compile modules that will be used to create a shared library. |
---|
4420 | To use no flags, say "none". |
---|
4421 | |
---|
4422 | EOM |
---|
4423 | case "$cccdlflags" in |
---|
4424 | '') case "$gccversion" in |
---|
4425 | '') case "$osname" in |
---|
4426 | hpux) dflt='+z' ;; |
---|
4427 | next) dflt='none' ;; |
---|
4428 | svr4*|esix*) dflt='-Kpic' ;; |
---|
4429 | irix*) dflt='-KPIC' ;; |
---|
4430 | solaris) case "$ccflags" in |
---|
4431 | *-DDEBUGGING*) dflt='-KPIC' ;; |
---|
4432 | *) dflt='-Kpic' ;; |
---|
4433 | esac ;; |
---|
4434 | sunos) dflt='-pic' ;; |
---|
4435 | *) dflt='none' ;; |
---|
4436 | esac ;; |
---|
4437 | *) case "$osname/$ccflags" in |
---|
4438 | solaris/*-DDEBUGGING*) dflt='-fPIC' ;; |
---|
4439 | *) dflt='-fpic' ;; |
---|
4440 | esac ;; |
---|
4441 | esac ;; |
---|
4442 | *) dflt="$cccdlflags" ;; |
---|
4443 | esac |
---|
4444 | rp="Any special flags to pass to $cc -c to compile shared library modules?" |
---|
4445 | . ./myread |
---|
4446 | case "$ans" in |
---|
4447 | none) cccdlflags=' ' ;; |
---|
4448 | *) cccdlflags="$ans" ;; |
---|
4449 | esac |
---|
4450 | |
---|
4451 | cat << EOM |
---|
4452 | |
---|
4453 | Some systems use ld to create libraries that can be dynamically loaded, |
---|
4454 | while other systems (such as those using ELF) use $cc. |
---|
4455 | |
---|
4456 | EOM |
---|
4457 | case "$ld" in |
---|
4458 | '') $cat >try.c <<'EOM' |
---|
4459 | /* Test for whether ELF binaries are produced */ |
---|
4460 | #include <fcntl.h> |
---|
4461 | #include <stdlib.h> |
---|
4462 | main() { |
---|
4463 | char b[4]; |
---|
4464 | int i = open("a.out",O_RDONLY); |
---|
4465 | if(i == -1) |
---|
4466 | exit(1); /* fail */ |
---|
4467 | if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') |
---|
4468 | exit(0); /* succeed (yes, it's ELF) */ |
---|
4469 | else |
---|
4470 | exit(1); /* fail */ |
---|
4471 | } |
---|
4472 | EOM |
---|
4473 | if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then |
---|
4474 | cat <<EOM |
---|
4475 | You appear to have ELF support. I'll use $cc to build dynamic libraries. |
---|
4476 | EOM |
---|
4477 | dflt="$cc" |
---|
4478 | else |
---|
4479 | echo "I'll use ld to build dynamic libraries." |
---|
4480 | dflt='ld' |
---|
4481 | fi |
---|
4482 | rm -f try.c a.out |
---|
4483 | ;; |
---|
4484 | *) dflt="$ld" |
---|
4485 | ;; |
---|
4486 | esac |
---|
4487 | |
---|
4488 | rp="What command should be used to create dynamic libraries?" |
---|
4489 | . ./myread |
---|
4490 | ld="$ans" |
---|
4491 | |
---|
4492 | cat << EOM |
---|
4493 | |
---|
4494 | Some systems may require passing special flags to $ld to create a |
---|
4495 | library that can be dynamically loaded. If your ld flags include |
---|
4496 | -L/other/path options to locate libraries outside your loader's normal |
---|
4497 | search path, you may need to specify those -L options here as well. To |
---|
4498 | use no flags, say "none". |
---|
4499 | |
---|
4500 | EOM |
---|
4501 | case "$lddlflags" in |
---|
4502 | '') case "$osname" in |
---|
4503 | hpux) dflt='-b' ;; |
---|
4504 | linux|irix*) dflt='-shared' ;; |
---|
4505 | next) dflt='none' ;; |
---|
4506 | solaris) dflt='-G' ;; |
---|
4507 | sunos) dflt='-assert nodefinitions' ;; |
---|
4508 | svr4*|esix*) dflt="-G $ldflags" ;; |
---|
4509 | *) dflt='none' ;; |
---|
4510 | esac |
---|
4511 | ;; |
---|
4512 | *) dflt="$lddlflags" ;; |
---|
4513 | esac |
---|
4514 | |
---|
4515 | : Try to guess additional flags to pick up local libraries. |
---|
4516 | for thisflag in $ldflags; do |
---|
4517 | case "$thisflag" in |
---|
4518 | -L*) |
---|
4519 | case " $dflt " in |
---|
4520 | *" $thisflag "*) ;; |
---|
4521 | *) dflt="$dflt $thisflag" ;; |
---|
4522 | esac |
---|
4523 | ;; |
---|
4524 | esac |
---|
4525 | done |
---|
4526 | |
---|
4527 | case "$dflt" in |
---|
4528 | '') dflt='none' ;; |
---|
4529 | esac |
---|
4530 | |
---|
4531 | rp="Any special flags to pass to $ld to create a dynamically loaded library?" |
---|
4532 | . ./myread |
---|
4533 | case "$ans" in |
---|
4534 | none) lddlflags=' ' ;; |
---|
4535 | *) lddlflags="$ans" ;; |
---|
4536 | esac |
---|
4537 | |
---|
4538 | cat <<EOM |
---|
4539 | |
---|
4540 | Some systems may require passing special flags to $cc to indicate that |
---|
4541 | the resulting executable will use dynamic linking. To use no flags, |
---|
4542 | say "none". |
---|
4543 | |
---|
4544 | EOM |
---|
4545 | case "$ccdlflags" in |
---|
4546 | '') case "$osname" in |
---|
4547 | hpux) dflt='-Wl,-E' ;; |
---|
4548 | linux) dflt='-rdynamic' ;; |
---|
4549 | next) dflt='none' ;; |
---|
4550 | sunos) dflt='none' ;; |
---|
4551 | *) dflt='none' ;; |
---|
4552 | esac ;; |
---|
4553 | *) dflt="$ccdlflags" ;; |
---|
4554 | esac |
---|
4555 | rp="Any special flags to pass to $cc to use dynamic loading?" |
---|
4556 | . ./myread |
---|
4557 | case "$ans" in |
---|
4558 | none) ccdlflags=' ' ;; |
---|
4559 | *) ccdlflags="$ans" ;; |
---|
4560 | esac |
---|
4561 | ;; |
---|
4562 | *) usedl="$undef" |
---|
4563 | ld='ld' |
---|
4564 | dlsrc='dl_none.xs' |
---|
4565 | lddlflags='' |
---|
4566 | ccdlflags='' |
---|
4567 | ;; |
---|
4568 | esac |
---|
4569 | |
---|
4570 | also='' |
---|
4571 | case "$usedl" in |
---|
4572 | $undef) |
---|
4573 | # No dynamic loading being used, so don't bother even to prompt. |
---|
4574 | useshrplib='false' |
---|
4575 | ;; |
---|
4576 | *) case "$useshrplib" in |
---|
4577 | '') case "$osname" in |
---|
4578 | svr4*|dgux|dynixptx|esix|powerux) |
---|
4579 | dflt=y |
---|
4580 | also='Building a shared libperl is required for dynamic loading to work on your system.' |
---|
4581 | ;; |
---|
4582 | next*) |
---|
4583 | case "$osvers" in |
---|
4584 | 4*) dflt=y |
---|
4585 | also='Building a shared libperl is needed for MAB support.' |
---|
4586 | ;; |
---|
4587 | *) dflt=n |
---|
4588 | ;; |
---|
4589 | esac |
---|
4590 | ;; |
---|
4591 | sunos) |
---|
4592 | dflt=n |
---|
4593 | also='Building a shared libperl will definitely not work on SunOS 4.' |
---|
4594 | ;; |
---|
4595 | *) dflt=n |
---|
4596 | ;; |
---|
4597 | esac |
---|
4598 | ;; |
---|
4599 | $define|true|[Yy]*) |
---|
4600 | dflt=y |
---|
4601 | ;; |
---|
4602 | *) dflt=n |
---|
4603 | ;; |
---|
4604 | esac |
---|
4605 | $cat << EOM |
---|
4606 | |
---|
4607 | The perl executable is normally obtained by linking perlmain.c with |
---|
4608 | libperl${lib_ext}, any static extensions (usually just DynaLoader), and |
---|
4609 | any other libraries needed on this system (such as -lm, etc.). Since |
---|
4610 | your system supports dynamic loading, it is probably possible to build |
---|
4611 | a shared libperl.$so. If you will have more than one executable linked |
---|
4612 | to libperl.$so, this will significantly reduce the size of each |
---|
4613 | executable, but it may have a noticeable affect on performance. The |
---|
4614 | default is probably sensible for your system. |
---|
4615 | $also |
---|
4616 | |
---|
4617 | EOM |
---|
4618 | rp="Build a shared libperl.$so (y/n)" |
---|
4619 | . ./myread |
---|
4620 | case "$ans" in |
---|
4621 | true|$define|[Yy]*) |
---|
4622 | useshrplib='true' |
---|
4623 | # Why does next4 have to be so different? |
---|
4624 | case "${osname}${osvers}" in |
---|
4625 | next4*) xxx='DYLD_LIBRARY_PATH' ;; |
---|
4626 | *) xxx='LD_LIBRARY_PATH' ;; |
---|
4627 | esac |
---|
4628 | $cat <<EOM >&4 |
---|
4629 | |
---|
4630 | To build perl, you must add the current working directory to your |
---|
4631 | $xxx environtment variable before running make. You can do |
---|
4632 | this with |
---|
4633 | $xxx=\`pwd\`; export $xxx |
---|
4634 | for Bourne-style shells, or |
---|
4635 | setenv $xxx \`pwd\` |
---|
4636 | for Csh-style shells. You *MUST* do this before running make. |
---|
4637 | |
---|
4638 | EOM |
---|
4639 | ;; |
---|
4640 | *) useshrplib='false' ;; |
---|
4641 | esac |
---|
4642 | ;; |
---|
4643 | esac |
---|
4644 | |
---|
4645 | case "$useshrplib" in |
---|
4646 | true) |
---|
4647 | case "$libperl" in |
---|
4648 | '') |
---|
4649 | # Figure out a good name for libperl.so. Since it gets stored in |
---|
4650 | # a version-specific architecture-dependent library, the version |
---|
4651 | # number isn't really that important, except for making cc/ld happy. |
---|
4652 | # |
---|
4653 | # A name such as libperl.so.3.1 |
---|
4654 | majmin="libperl.$so.$patchlevel.$subversion" |
---|
4655 | # A name such as libperl.so.301 |
---|
4656 | majonly=`echo $patchlevel $subversion | |
---|
4657 | $awk '{printf "%d%02d", $1, $2}'` |
---|
4658 | majonly=libperl.$so.$majonly |
---|
4659 | # I'd prefer to keep the os-specific stuff here to a minimum, and |
---|
4660 | # rely on figuring it out from the naming of libc. |
---|
4661 | case "${osname}${osvers}" in |
---|
4662 | next4*) |
---|
4663 | dflt=libperl.5.$so |
---|
4664 | # XXX How handle the --version stuff for MAB? |
---|
4665 | ;; |
---|
4666 | linux*) # ld won't link with a bare -lperl otherwise. |
---|
4667 | dflt=libperl.$so |
---|
4668 | ;; |
---|
4669 | *) # Try to guess based on whether libc has major.minor. |
---|
4670 | case "$libc" in |
---|
4671 | *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; |
---|
4672 | *libc.$so.[0-9]*) dflt=$majonly ;; |
---|
4673 | *) dflt=libperl.$so ;; |
---|
4674 | esac |
---|
4675 | ;; |
---|
4676 | esac |
---|
4677 | ;; |
---|
4678 | *) dflt=$libperl |
---|
4679 | ;; |
---|
4680 | esac |
---|
4681 | cat << EOM |
---|
4682 | |
---|
4683 | I need to select a good name for the shared libperl. If your system uses |
---|
4684 | library names with major and minor numbers, then you might want something |
---|
4685 | like $majmin. Alternatively, if your system uses a single version |
---|
4686 | number for shared libraries, then you might want to use $majonly. |
---|
4687 | Or, your system might be quite happy with a simple libperl.$so. |
---|
4688 | |
---|
4689 | Since the shared libperl will get installed into a version-specific |
---|
4690 | architecture-dependent directory, the version number of the shared perl |
---|
4691 | library probably isn't important, so the default should be o.k. |
---|
4692 | |
---|
4693 | EOM |
---|
4694 | rp='What name do you want to give to the shared libperl?' |
---|
4695 | . ./myread |
---|
4696 | libperl=$ans |
---|
4697 | echo "Ok, I'll use $libperl" |
---|
4698 | ;; |
---|
4699 | *) |
---|
4700 | libperl="libperl${lib_ext}" |
---|
4701 | ;; |
---|
4702 | esac |
---|
4703 | |
---|
4704 | # Detect old use of shrpdir via undocumented Configure -Dshrpdir |
---|
4705 | case "$shrpdir" in |
---|
4706 | '') ;; |
---|
4707 | *) $cat >&4 <<EOM |
---|
4708 | WARNING: Use of the shrpdir variable for the installation location of |
---|
4709 | the shared $libperl is not supported. It was never documented and |
---|
4710 | will not work in this version. Let me (chip@perl.com) know of any |
---|
4711 | problems this may cause. |
---|
4712 | |
---|
4713 | EOM |
---|
4714 | case "$shrpdir" in |
---|
4715 | "$archlibexp/CORE") |
---|
4716 | $cat >&4 <<EOM |
---|
4717 | But your current setting of $shrpdir is |
---|
4718 | the default anyway, so it's harmless. |
---|
4719 | EOM |
---|
4720 | ;; |
---|
4721 | *) |
---|
4722 | $cat >&4 <<EOM |
---|
4723 | Further, your current attempted setting of $shrpdir |
---|
4724 | conflicts with the value of $archlibexp/CORE |
---|
4725 | that installperl will use. |
---|
4726 | EOM |
---|
4727 | ;; |
---|
4728 | esac |
---|
4729 | ;; |
---|
4730 | esac |
---|
4731 | |
---|
4732 | # How will the perl executable find the installed shared $libperl? |
---|
4733 | # Add $xxx to ccdlflags. |
---|
4734 | # If we can't figure out a command-line option, use $shrpenv to |
---|
4735 | # set env LD_RUN_PATH. The main perl makefile uses this. |
---|
4736 | shrpdir=$archlibexp/CORE |
---|
4737 | xxx='' |
---|
4738 | tmp_shrpenv='' |
---|
4739 | if "$useshrplib"; then |
---|
4740 | case "$osname" in |
---|
4741 | aix) |
---|
4742 | # We'll set it in Makefile.SH... |
---|
4743 | ;; |
---|
4744 | solaris|netbsd) |
---|
4745 | xxx="-R $shrpdir" |
---|
4746 | ;; |
---|
4747 | freebsd) |
---|
4748 | xxx="-Wl,-R$shrpdir" |
---|
4749 | ;; |
---|
4750 | linux|irix*|dec_osf) |
---|
4751 | xxx="-Wl,-rpath,$shrpdir" |
---|
4752 | ;; |
---|
4753 | next) |
---|
4754 | # next doesn't like the default... |
---|
4755 | ;; |
---|
4756 | *) |
---|
4757 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" |
---|
4758 | ;; |
---|
4759 | esac |
---|
4760 | case "$xxx" in |
---|
4761 | '') ;; |
---|
4762 | *) |
---|
4763 | # Only add $xxx if it isn't already in ccdlflags. |
---|
4764 | case " $ccdlflags " in |
---|
4765 | *" $xxx "*) ;; |
---|
4766 | *) ccdlflags="$ccdlflags $xxx" |
---|
4767 | cat <<EOM >&4 |
---|
4768 | |
---|
4769 | Adding $xxx to the flags |
---|
4770 | passed to $ld so that the perl executable will find the |
---|
4771 | installed shared $libperl. |
---|
4772 | |
---|
4773 | EOM |
---|
4774 | ;; |
---|
4775 | esac |
---|
4776 | ;; |
---|
4777 | esac |
---|
4778 | fi |
---|
4779 | # Respect a hint or command-line value. |
---|
4780 | case "$shrpenv" in |
---|
4781 | '') shrpenv="$tmp_shrpenv" ;; |
---|
4782 | esac |
---|
4783 | |
---|
4784 | : determine where manual pages go |
---|
4785 | set man1dir man1dir none |
---|
4786 | eval $prefixit |
---|
4787 | $cat <<EOM |
---|
4788 | |
---|
4789 | $spackage has manual pages available in source form. |
---|
4790 | EOM |
---|
4791 | case "$nroff" in |
---|
4792 | nroff) |
---|
4793 | echo "However, you don't have nroff, so they're probably useless to you." |
---|
4794 | case "$man1dir" in |
---|
4795 | '') man1dir="none";; |
---|
4796 | esac;; |
---|
4797 | esac |
---|
4798 | echo "If you don't want the manual sources installed, answer 'none'." |
---|
4799 | case "$man1dir" in |
---|
4800 | ' ') dflt=none |
---|
4801 | ;; |
---|
4802 | '') |
---|
4803 | lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1" |
---|
4804 | lookpath="$lookpath $prefixexp/man/p_man/man1" |
---|
4805 | lookpath="$lookpath $prefixexp/man/u_man/man1" |
---|
4806 | lookpath="$lookpath $prefixexp/man/man.1" |
---|
4807 | : If prefix contains 'perl' then we want to keep the man pages |
---|
4808 | : under the prefix directory. Otherwise, look in a variety of |
---|
4809 | : other possible places. This is debatable, but probably a |
---|
4810 | : good compromise. Well, apparently not. |
---|
4811 | : Experience has shown people expect man1dir to be under prefix, |
---|
4812 | : so we now always put it there. Users who want other behavior |
---|
4813 | : can answer interactively or use a command line option. |
---|
4814 | : Does user have System V-style man paths. |
---|
4815 | case "$sysman" in |
---|
4816 | */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;; |
---|
4817 | *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;; |
---|
4818 | esac |
---|
4819 | set dflt |
---|
4820 | eval $prefixup |
---|
4821 | ;; |
---|
4822 | *) dflt="$man1dir" |
---|
4823 | ;; |
---|
4824 | esac |
---|
4825 | echo " " |
---|
4826 | fn=dn+~ |
---|
4827 | rp="Where do the main $spackage manual pages (source) go?" |
---|
4828 | . ./getfile |
---|
4829 | if $test "X$man1direxp" != "X$ansexp"; then |
---|
4830 | installman1dir='' |
---|
4831 | fi |
---|
4832 | man1dir="$ans" |
---|
4833 | man1direxp="$ansexp" |
---|
4834 | case "$man1dir" in |
---|
4835 | '') man1dir=' ' |
---|
4836 | installman1dir='';; |
---|
4837 | esac |
---|
4838 | if $afs; then |
---|
4839 | $cat <<EOM |
---|
4840 | |
---|
4841 | Since you are running AFS, I need to distinguish the directory in which |
---|
4842 | manual pages reside from the directory in which they are installed (and from |
---|
4843 | which they are presumably copied to the former directory by occult means). |
---|
4844 | |
---|
4845 | EOM |
---|
4846 | case "$installman1dir" in |
---|
4847 | '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;; |
---|
4848 | *) dflt="$installman1dir";; |
---|
4849 | esac |
---|
4850 | fn=de~ |
---|
4851 | rp='Where will man pages be installed?' |
---|
4852 | . ./getfile |
---|
4853 | installman1dir="$ans" |
---|
4854 | else |
---|
4855 | installman1dir="$man1direxp" |
---|
4856 | fi |
---|
4857 | |
---|
4858 | : What suffix to use on installed man pages |
---|
4859 | |
---|
4860 | case "$man1dir" in |
---|
4861 | ' ') |
---|
4862 | man1ext='0' |
---|
4863 | ;; |
---|
4864 | *) |
---|
4865 | rp="What suffix should be used for the main $spackage man pages?" |
---|
4866 | case "$man1ext" in |
---|
4867 | '') case "$man1dir" in |
---|
4868 | *1) dflt=1 ;; |
---|
4869 | *1p) dflt=1p ;; |
---|
4870 | *1pm) dflt=1pm ;; |
---|
4871 | *l) dflt=l;; |
---|
4872 | *n) dflt=n;; |
---|
4873 | *o) dflt=o;; |
---|
4874 | *p) dflt=p;; |
---|
4875 | *C) dflt=C;; |
---|
4876 | *L) dflt=L;; |
---|
4877 | *L1) dflt=L1;; |
---|
4878 | *) dflt=1;; |
---|
4879 | esac |
---|
4880 | ;; |
---|
4881 | *) dflt="$man1ext";; |
---|
4882 | esac |
---|
4883 | . ./myread |
---|
4884 | man1ext="$ans" |
---|
4885 | ;; |
---|
4886 | esac |
---|
4887 | |
---|
4888 | : see if we can have long filenames |
---|
4889 | echo " " |
---|
4890 | rmlist="$rmlist /tmp/cf$$" |
---|
4891 | $test -d /tmp/cf$$ || mkdir /tmp/cf$$ |
---|
4892 | first=123456789abcdef |
---|
4893 | second=/tmp/cf$$/$first |
---|
4894 | $rm -f $first $second |
---|
4895 | if (echo hi >$first) 2>/dev/null; then |
---|
4896 | if $test -f 123456789abcde; then |
---|
4897 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 |
---|
4898 | val="$undef" |
---|
4899 | else |
---|
4900 | if (echo hi >$second) 2>/dev/null; then |
---|
4901 | if $test -f /tmp/cf$$/123456789abcde; then |
---|
4902 | $cat <<'EOM' |
---|
4903 | That's peculiar... You can have filenames longer than 14 characters, but only |
---|
4904 | on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems |
---|
4905 | I shall consider your system cannot support long filenames at all. |
---|
4906 | EOM |
---|
4907 | val="$undef" |
---|
4908 | else |
---|
4909 | echo 'You can have filenames longer than 14 characters.' >&4 |
---|
4910 | val="$define" |
---|
4911 | fi |
---|
4912 | else |
---|
4913 | $cat <<'EOM' |
---|
4914 | How confusing! Some of your filesystems are sane enough to allow filenames |
---|
4915 | longer than 14 characters but some others like /tmp can't even think about them. |
---|
4916 | So, for now on, I shall assume your kernel does not allow them at all. |
---|
4917 | EOM |
---|
4918 | val="$undef" |
---|
4919 | fi |
---|
4920 | fi |
---|
4921 | else |
---|
4922 | $cat <<'EOM' |
---|
4923 | You can't have filenames longer than 14 chars. You can't even think about them! |
---|
4924 | EOM |
---|
4925 | val="$undef" |
---|
4926 | fi |
---|
4927 | set d_flexfnam |
---|
4928 | eval $setvar |
---|
4929 | $rm -rf /tmp/cf$$ 123456789abcde* |
---|
4930 | |
---|
4931 | : determine where library module manual pages go |
---|
4932 | set man3dir man3dir none |
---|
4933 | eval $prefixit |
---|
4934 | $cat <<EOM |
---|
4935 | |
---|
4936 | $spackage has manual pages for many of the library modules. |
---|
4937 | EOM |
---|
4938 | |
---|
4939 | case "$nroff" in |
---|
4940 | nroff) |
---|
4941 | $cat <<'EOM' |
---|
4942 | However, you don't have nroff, so they're probably useless to you. |
---|
4943 | You can use the supplied perldoc script instead. |
---|
4944 | EOM |
---|
4945 | case "$man3dir" in |
---|
4946 | '') man3dir="none";; |
---|
4947 | esac;; |
---|
4948 | esac |
---|
4949 | |
---|
4950 | case "$d_flexfnam" in |
---|
4951 | undef) |
---|
4952 | $cat <<'EOM' |
---|
4953 | However, your system can't handle the long file names like File::Basename.3. |
---|
4954 | You can use the supplied perldoc script instead. |
---|
4955 | EOM |
---|
4956 | case "$man3dir" in |
---|
4957 | '') man3dir="none";; |
---|
4958 | esac;; |
---|
4959 | esac |
---|
4960 | |
---|
4961 | echo "If you don't want the manual sources installed, answer 'none'." |
---|
4962 | : We dont use /usr/local/man/man3 because some man programs will |
---|
4963 | : only show the /usr/local/man/man3 contents, and not the system ones, |
---|
4964 | : thus man less will show the perl module less.pm, but not the system |
---|
4965 | : less command. We might also conflict with TCL man pages. |
---|
4966 | : However, something like /opt/perl/man/man3 is fine. |
---|
4967 | case "$man3dir" in |
---|
4968 | '') case "$prefix" in |
---|
4969 | *perl*) dflt=`echo $man1dir | |
---|
4970 | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;; |
---|
4971 | *) dflt="$privlib/man/man3" ;; |
---|
4972 | esac |
---|
4973 | ;; |
---|
4974 | ' ') dflt=none;; |
---|
4975 | *) dflt="$man3dir" ;; |
---|
4976 | esac |
---|
4977 | echo " " |
---|
4978 | |
---|
4979 | fn=dn+~ |
---|
4980 | rp="Where do the $spackage library man pages (source) go?" |
---|
4981 | . ./getfile |
---|
4982 | if test "X$man3direxp" != "X$ansexp"; then |
---|
4983 | installman3dir='' |
---|
4984 | fi |
---|
4985 | |
---|
4986 | man3dir="$ans" |
---|
4987 | man3direxp="$ansexp" |
---|
4988 | case "$man3dir" in |
---|
4989 | '') man3dir=' ' |
---|
4990 | installman3dir='';; |
---|
4991 | esac |
---|
4992 | if $afs; then |
---|
4993 | $cat <<EOM |
---|
4994 | |
---|
4995 | Since you are running AFS, I need to distinguish the directory in which |
---|
4996 | manual pages reside from the directory in which they are installed (and from |
---|
4997 | which they are presumably copied to the former directory by occult means). |
---|
4998 | |
---|
4999 | EOM |
---|
5000 | case "$installman3dir" in |
---|
5001 | '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;; |
---|
5002 | *) dflt="$installman3dir";; |
---|
5003 | esac |
---|
5004 | fn=de~ |
---|
5005 | rp='Where will man pages be installed?' |
---|
5006 | . ./getfile |
---|
5007 | installman3dir="$ans" |
---|
5008 | else |
---|
5009 | installman3dir="$man3direxp" |
---|
5010 | fi |
---|
5011 | |
---|
5012 | : What suffix to use on installed man pages |
---|
5013 | |
---|
5014 | case "$man3dir" in |
---|
5015 | ' ') |
---|
5016 | man3ext='0' |
---|
5017 | ;; |
---|
5018 | *) |
---|
5019 | rp="What suffix should be used for the $spackage library man pages?" |
---|
5020 | case "$man3ext" in |
---|
5021 | '') case "$man3dir" in |
---|
5022 | *3) dflt=3 ;; |
---|
5023 | *3p) dflt=3p ;; |
---|
5024 | *3pm) dflt=3pm ;; |
---|
5025 | *l) dflt=l;; |
---|
5026 | *n) dflt=n;; |
---|
5027 | *o) dflt=o;; |
---|
5028 | *p) dflt=p;; |
---|
5029 | *C) dflt=C;; |
---|
5030 | *L) dflt=L;; |
---|
5031 | *L3) dflt=L3;; |
---|
5032 | *) dflt=3;; |
---|
5033 | esac |
---|
5034 | ;; |
---|
5035 | *) dflt="$man3ext";; |
---|
5036 | esac |
---|
5037 | . ./myread |
---|
5038 | man3ext="$ans" |
---|
5039 | ;; |
---|
5040 | esac |
---|
5041 | |
---|
5042 | : see if we have to deal with yellow pages, now NIS. |
---|
5043 | if $test -d /usr/etc/yp || $test -d /etc/yp; then |
---|
5044 | if $test -f /usr/etc/nibindd; then |
---|
5045 | echo " " |
---|
5046 | echo "I'm fairly confident you're on a NeXT." |
---|
5047 | echo " " |
---|
5048 | rp='Do you get the hosts file via NetInfo?' |
---|
5049 | dflt=y |
---|
5050 | case "$hostcat" in |
---|
5051 | nidump*) ;; |
---|
5052 | '') ;; |
---|
5053 | *) dflt=n;; |
---|
5054 | esac |
---|
5055 | . ./myread |
---|
5056 | case "$ans" in |
---|
5057 | y*) hostcat='nidump hosts .';; |
---|
5058 | *) case "$hostcat" in |
---|
5059 | nidump*) hostcat='';; |
---|
5060 | esac |
---|
5061 | ;; |
---|
5062 | esac |
---|
5063 | fi |
---|
5064 | case "$hostcat" in |
---|
5065 | nidump*) ;; |
---|
5066 | *) |
---|
5067 | case "$hostcat" in |
---|
5068 | *ypcat*) dflt=y;; |
---|
5069 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then |
---|
5070 | dflt=y |
---|
5071 | else |
---|
5072 | dflt=n |
---|
5073 | fi;; |
---|
5074 | *) dflt=n;; |
---|
5075 | esac |
---|
5076 | echo " " |
---|
5077 | rp='Are you getting the hosts file via yellow pages?' |
---|
5078 | . ./myread |
---|
5079 | case "$ans" in |
---|
5080 | y*) hostcat='ypcat hosts';; |
---|
5081 | *) hostcat='cat /etc/hosts';; |
---|
5082 | esac |
---|
5083 | ;; |
---|
5084 | esac |
---|
5085 | fi |
---|
5086 | |
---|
5087 | : now get the host name |
---|
5088 | echo " " |
---|
5089 | echo "Figuring out host name..." >&4 |
---|
5090 | case "$myhostname" in |
---|
5091 | '') cont=true |
---|
5092 | echo 'Maybe "hostname" will work...' |
---|
5093 | if tans=`sh -c hostname 2>&1` ; then |
---|
5094 | myhostname=$tans |
---|
5095 | phostname=hostname |
---|
5096 | cont='' |
---|
5097 | fi |
---|
5098 | ;; |
---|
5099 | *) cont='';; |
---|
5100 | esac |
---|
5101 | if $test "$cont"; then |
---|
5102 | if ./xenix; then |
---|
5103 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' |
---|
5104 | if tans=`cat /etc/systemid 2>&1` ; then |
---|
5105 | myhostname=$tans |
---|
5106 | phostname='cat /etc/systemid' |
---|
5107 | echo "Whadyaknow. Xenix always was a bit strange..." |
---|
5108 | cont='' |
---|
5109 | fi |
---|
5110 | elif $test -r /etc/systemid; then |
---|
5111 | echo "(What is a non-Xenix system doing with /etc/systemid?)" |
---|
5112 | fi |
---|
5113 | fi |
---|
5114 | if $test "$cont"; then |
---|
5115 | echo 'No, maybe "uuname -l" will work...' |
---|
5116 | if tans=`sh -c 'uuname -l' 2>&1` ; then |
---|
5117 | myhostname=$tans |
---|
5118 | phostname='uuname -l' |
---|
5119 | else |
---|
5120 | echo 'Strange. Maybe "uname -n" will work...' |
---|
5121 | if tans=`sh -c 'uname -n' 2>&1` ; then |
---|
5122 | myhostname=$tans |
---|
5123 | phostname='uname -n' |
---|
5124 | else |
---|
5125 | echo 'Oh well, maybe I can mine it out of whoami.h...' |
---|
5126 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then |
---|
5127 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` |
---|
5128 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" |
---|
5129 | else |
---|
5130 | case "$myhostname" in |
---|
5131 | '') echo "Does this machine have an identity crisis or something?" |
---|
5132 | phostname='';; |
---|
5133 | *) |
---|
5134 | echo "Well, you said $myhostname before..." |
---|
5135 | phostname='echo $myhostname';; |
---|
5136 | esac |
---|
5137 | fi |
---|
5138 | fi |
---|
5139 | fi |
---|
5140 | fi |
---|
5141 | : you do not want to know about this |
---|
5142 | set $myhostname |
---|
5143 | myhostname=$1 |
---|
5144 | |
---|
5145 | : verify guess |
---|
5146 | if $test "$myhostname" ; then |
---|
5147 | dflt=y |
---|
5148 | rp='Your host name appears to be "'$myhostname'".'" Right?" |
---|
5149 | . ./myread |
---|
5150 | case "$ans" in |
---|
5151 | y*) ;; |
---|
5152 | *) myhostname='';; |
---|
5153 | esac |
---|
5154 | fi |
---|
5155 | |
---|
5156 | : bad guess or no guess |
---|
5157 | while $test "X$myhostname" = X ; do |
---|
5158 | dflt='' |
---|
5159 | rp="Please type the (one word) name of your host:" |
---|
5160 | . ./myread |
---|
5161 | myhostname="$ans" |
---|
5162 | done |
---|
5163 | |
---|
5164 | : translate upper to lower if necessary |
---|
5165 | case "$myhostname" in |
---|
5166 | *[A-Z]*) |
---|
5167 | echo "(Normalizing case in your host name)" |
---|
5168 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` |
---|
5169 | ;; |
---|
5170 | esac |
---|
5171 | |
---|
5172 | case "$myhostname" in |
---|
5173 | *.*) |
---|
5174 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` |
---|
5175 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` |
---|
5176 | echo "(Trimming domain name from host name--host name is now $myhostname)" |
---|
5177 | ;; |
---|
5178 | *) case "$mydomain" in |
---|
5179 | '') |
---|
5180 | { |
---|
5181 | : If we use NIS, try ypmatch. |
---|
5182 | : Is there some reason why this was not done before? |
---|
5183 | test "X$hostcat" = "Xypcat hosts" && |
---|
5184 | ypmatch "$myhostname" hosts 2>/dev/null |\ |
---|
5185 | $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ |
---|
5186 | $test -s hosts |
---|
5187 | } || { |
---|
5188 | : Extract only the relevant hosts, reducing file size, |
---|
5189 | : remove comments, insert trailing space for later use. |
---|
5190 | $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / |
---|
5191 | /[ ]$myhostname[ . ]/p" > hosts |
---|
5192 | } |
---|
5193 | tmp_re="[ . ]" |
---|
5194 | $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } |
---|
5195 | END { print sum }" hosts` = x1 || tmp_re="[ ]" |
---|
5196 | dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ |
---|
5197 | hosts | $sort | $uniq | \ |
---|
5198 | $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` |
---|
5199 | case `$echo X$dflt` in |
---|
5200 | X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" |
---|
5201 | dflt=. |
---|
5202 | ;; |
---|
5203 | X.) echo "(You do not have fully-qualified names in /etc/hosts)" |
---|
5204 | ;; |
---|
5205 | esac |
---|
5206 | case "$dflt" in |
---|
5207 | .) |
---|
5208 | tans=`./loc resolv.conf X /etc /usr/etc` |
---|
5209 | if $test -f "$tans"; then |
---|
5210 | echo "(Attempting domain name extraction from $tans)" |
---|
5211 | : Why was there an Egrep here, when Sed works? |
---|
5212 | : Look for either a search or a domain directive. |
---|
5213 | dflt=.`$sed -n -e 's/ / /g' \ |
---|
5214 | -e 's/^search *\([^ ]*\).*/\1/p' $tans \ |
---|
5215 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
---|
5216 | case "$dflt" in |
---|
5217 | .) dflt=.`$sed -n -e 's/ / /g' \ |
---|
5218 | -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ |
---|
5219 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
---|
5220 | ;; |
---|
5221 | esac |
---|
5222 | fi |
---|
5223 | ;; |
---|
5224 | esac |
---|
5225 | case "$dflt" in |
---|
5226 | .) echo "(No help from resolv.conf either -- attempting clever guess)" |
---|
5227 | dflt=.`sh -c domainname 2>/dev/null` |
---|
5228 | case "$dflt" in |
---|
5229 | '') dflt='.';; |
---|
5230 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; |
---|
5231 | esac |
---|
5232 | ;; |
---|
5233 | esac |
---|
5234 | case "$dflt" in |
---|
5235 | .) echo "(Lost all hope -- silly guess then)" |
---|
5236 | dflt='.uucp' |
---|
5237 | ;; |
---|
5238 | esac |
---|
5239 | $rm -f hosts |
---|
5240 | ;; |
---|
5241 | *) dflt="$mydomain";; |
---|
5242 | esac;; |
---|
5243 | esac |
---|
5244 | echo " " |
---|
5245 | rp="What is your domain name?" |
---|
5246 | . ./myread |
---|
5247 | tans="$ans" |
---|
5248 | case "$ans" in |
---|
5249 | '') ;; |
---|
5250 | .*) ;; |
---|
5251 | *) tans=".$tans";; |
---|
5252 | esac |
---|
5253 | mydomain="$tans" |
---|
5254 | |
---|
5255 | : translate upper to lower if necessary |
---|
5256 | case "$mydomain" in |
---|
5257 | *[A-Z]*) |
---|
5258 | echo "(Normalizing case in your domain name)" |
---|
5259 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` |
---|
5260 | ;; |
---|
5261 | esac |
---|
5262 | |
---|
5263 | : a little sanity check here |
---|
5264 | case "$phostname" in |
---|
5265 | '') ;; |
---|
5266 | *) |
---|
5267 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in |
---|
5268 | $myhostname$mydomain|$myhostname) ;; |
---|
5269 | *) |
---|
5270 | case "$phostname" in |
---|
5271 | sed*) |
---|
5272 | echo "(That doesn't agree with your whoami.h file, by the way.)" |
---|
5273 | ;; |
---|
5274 | *) |
---|
5275 | echo "(That doesn't agree with your $phostname command, by the way.)" |
---|
5276 | ;; |
---|
5277 | esac |
---|
5278 | ;; |
---|
5279 | esac |
---|
5280 | ;; |
---|
5281 | esac |
---|
5282 | |
---|
5283 | $cat <<EOM |
---|
5284 | |
---|
5285 | I need to get your e-mail address in Internet format if possible, i.e. |
---|
5286 | something like user@host.domain. Please answer accurately since I have |
---|
5287 | no easy means to double check it. The default value provided below |
---|
5288 | is most probably close to the reality but may not be valid from outside |
---|
5289 | your organization... |
---|
5290 | |
---|
5291 | EOM |
---|
5292 | cont=x |
---|
5293 | while test "$cont"; do |
---|
5294 | case "$cf_email" in |
---|
5295 | '') dflt="$cf_by@$myhostname$mydomain";; |
---|
5296 | *) dflt="$cf_email";; |
---|
5297 | esac |
---|
5298 | rp='What is your e-mail address?' |
---|
5299 | . ./myread |
---|
5300 | cf_email="$ans" |
---|
5301 | case "$cf_email" in |
---|
5302 | *@*.*) cont='' ;; |
---|
5303 | *) |
---|
5304 | rp='Address does not look like an Internet one. Use it anyway?' |
---|
5305 | case "$fastread" in |
---|
5306 | yes) dflt=y ;; |
---|
5307 | *) dflt=n ;; |
---|
5308 | esac |
---|
5309 | . ./myread |
---|
5310 | case "$ans" in |
---|
5311 | y*) cont='' ;; |
---|
5312 | *) echo " " ;; |
---|
5313 | esac |
---|
5314 | ;; |
---|
5315 | esac |
---|
5316 | done |
---|
5317 | |
---|
5318 | $cat <<EOM |
---|
5319 | |
---|
5320 | If you or somebody else will be maintaining perl at your site, please |
---|
5321 | fill in the correct e-mail address here so that they may be contacted |
---|
5322 | if necessary. Currently, the "perlbug" program included with perl |
---|
5323 | will send mail to this address in addition to perlbug@perl.com. You may |
---|
5324 | enter "none" for no administrator. |
---|
5325 | |
---|
5326 | EOM |
---|
5327 | case "$perladmin" in |
---|
5328 | '') dflt="$cf_email";; |
---|
5329 | *) dflt="$perladmin";; |
---|
5330 | esac |
---|
5331 | rp='Perl administrator e-mail address' |
---|
5332 | . ./myread |
---|
5333 | perladmin="$ans" |
---|
5334 | |
---|
5335 | : figure out how to guarantee perl startup |
---|
5336 | case "$startperl" in |
---|
5337 | '') |
---|
5338 | case "$sharpbang" in |
---|
5339 | *!) |
---|
5340 | $cat <<EOH |
---|
5341 | |
---|
5342 | I can use the #! construct to start perl on your system. This will |
---|
5343 | make startup of perl scripts faster, but may cause problems if you |
---|
5344 | want to share those scripts and perl is not in a standard place |
---|
5345 | ($binexp/perl) on all your platforms. The alternative is to force |
---|
5346 | a shell by starting the script with a single ':' character. |
---|
5347 | |
---|
5348 | EOH |
---|
5349 | dflt="$binexp/perl" |
---|
5350 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' |
---|
5351 | . ./myread |
---|
5352 | case "$ans" in |
---|
5353 | none) startperl=": # use perl";; |
---|
5354 | *) startperl="#!$ans" |
---|
5355 | if $test 30 -lt `echo "$ans" | wc -c`; then |
---|
5356 | $cat >&4 <<EOM |
---|
5357 | |
---|
5358 | WARNING: Some systems limit the #! command to 32 characters. |
---|
5359 | If you experience difficulty running Perl scripts with #!, try |
---|
5360 | installing Perl in a directory with a shorter pathname. |
---|
5361 | |
---|
5362 | EOM |
---|
5363 | fi ;; |
---|
5364 | esac |
---|
5365 | ;; |
---|
5366 | *) startperl=": # use perl" |
---|
5367 | ;; |
---|
5368 | esac |
---|
5369 | ;; |
---|
5370 | esac |
---|
5371 | echo "I'll use $startperl to start perl scripts." |
---|
5372 | |
---|
5373 | : figure best path for perl in scripts |
---|
5374 | case "$perlpath" in |
---|
5375 | '') |
---|
5376 | perlpath="$binexp/perl" |
---|
5377 | case "$startperl" in |
---|
5378 | *!*) ;; |
---|
5379 | *) |
---|
5380 | $cat <<EOH |
---|
5381 | |
---|
5382 | I will use the "eval 'exec'" idiom to start Perl on your system. |
---|
5383 | I can use the full path of your Perl binary for this purpose, but |
---|
5384 | doing so may cause problems if you want to share those scripts and |
---|
5385 | Perl is not always in a standard place ($binexp/perl). |
---|
5386 | |
---|
5387 | EOH |
---|
5388 | dflt="$binexp/perl" |
---|
5389 | rp="What path shall I use in \"eval 'exec'\"?" |
---|
5390 | . ./myread |
---|
5391 | perlpath="$ans" |
---|
5392 | ;; |
---|
5393 | esac |
---|
5394 | ;; |
---|
5395 | esac |
---|
5396 | case "$startperl" in |
---|
5397 | *!*) ;; |
---|
5398 | *) echo "I'll use $perlpath in \"eval 'exec'\"" ;; |
---|
5399 | esac |
---|
5400 | |
---|
5401 | : determine where public executable scripts go |
---|
5402 | set scriptdir scriptdir |
---|
5403 | eval $prefixit |
---|
5404 | case "$scriptdir" in |
---|
5405 | '') |
---|
5406 | dflt="$bin" |
---|
5407 | : guess some guesses |
---|
5408 | $test -d /usr/share/scripts && dflt=/usr/share/scripts |
---|
5409 | $test -d /usr/share/bin && dflt=/usr/share/bin |
---|
5410 | $test -d /usr/local/script && dflt=/usr/local/script |
---|
5411 | $test -d $prefixexp/script && dflt=$prefixexp/script |
---|
5412 | set dflt |
---|
5413 | eval $prefixup |
---|
5414 | ;; |
---|
5415 | *) dflt="$scriptdir" |
---|
5416 | ;; |
---|
5417 | esac |
---|
5418 | $cat <<EOM |
---|
5419 | |
---|
5420 | Some installations have a separate directory just for executable scripts so |
---|
5421 | that they can mount it across multiple architectures but keep the scripts in |
---|
5422 | one spot. You might, for example, have a subdirectory of /usr/share for this. |
---|
5423 | Or you might just lump your scripts in with all your other executables. |
---|
5424 | |
---|
5425 | EOM |
---|
5426 | fn=d~ |
---|
5427 | rp='Where do you keep publicly executable scripts?' |
---|
5428 | . ./getfile |
---|
5429 | if $test "X$ansexp" != "X$scriptdirexp"; then |
---|
5430 | installscript='' |
---|
5431 | fi |
---|
5432 | scriptdir="$ans" |
---|
5433 | scriptdirexp="$ansexp" |
---|
5434 | if $afs; then |
---|
5435 | $cat <<EOM |
---|
5436 | |
---|
5437 | Since you are running AFS, I need to distinguish the directory in which |
---|
5438 | scripts reside from the directory in which they are installed (and from |
---|
5439 | which they are presumably copied to the former directory by occult means). |
---|
5440 | |
---|
5441 | EOM |
---|
5442 | case "$installscript" in |
---|
5443 | '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;; |
---|
5444 | *) dflt="$installscript";; |
---|
5445 | esac |
---|
5446 | fn=de~ |
---|
5447 | rp='Where will public scripts be installed?' |
---|
5448 | . ./getfile |
---|
5449 | installscript="$ans" |
---|
5450 | else |
---|
5451 | installscript="$scriptdirexp" |
---|
5452 | fi |
---|
5453 | |
---|
5454 | cat <<EOM |
---|
5455 | |
---|
5456 | Previous version of $package used the standard IO mechanisms as defined in |
---|
5457 | <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO |
---|
5458 | mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still |
---|
5459 | the default and is the only supported mechanism. This abstraction |
---|
5460 | layer can use AT&T's sfio (if you already have sfio installed) or |
---|
5461 | fall back on standard IO. This PerlIO abstraction layer is |
---|
5462 | experimental and may cause problems with some extension modules. |
---|
5463 | |
---|
5464 | If this doesn't make any sense to you, just accept the default 'n'. |
---|
5465 | EOM |
---|
5466 | case "$useperlio" in |
---|
5467 | $define|true|[yY]*) dflt='y';; |
---|
5468 | *) dflt='n';; |
---|
5469 | esac |
---|
5470 | rp='Use the experimental PerlIO abstraction layer?' |
---|
5471 | . ./myread |
---|
5472 | case "$ans" in |
---|
5473 | y|Y) |
---|
5474 | val="$define" |
---|
5475 | ;; |
---|
5476 | *) |
---|
5477 | echo "Ok, doing things the stdio way" |
---|
5478 | val="$undef" |
---|
5479 | ;; |
---|
5480 | esac |
---|
5481 | set useperlio |
---|
5482 | eval $setvar |
---|
5483 | |
---|
5484 | : Check how to convert floats to strings. |
---|
5485 | echo " " |
---|
5486 | echo "Checking for an efficient way to convert floats to strings." |
---|
5487 | $cat >try.c <<'EOP' |
---|
5488 | #ifdef TRY_gconvert |
---|
5489 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) |
---|
5490 | char *myname = "gconvert"; |
---|
5491 | #endif |
---|
5492 | #ifdef TRY_gcvt |
---|
5493 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) |
---|
5494 | char *myname = "gcvt"; |
---|
5495 | #endif |
---|
5496 | #ifdef TRY_sprintf |
---|
5497 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) |
---|
5498 | char *myname = "sprintf"; |
---|
5499 | #endif |
---|
5500 | |
---|
5501 | #include <stdio.h> |
---|
5502 | |
---|
5503 | int |
---|
5504 | checkit(expect, got) |
---|
5505 | char *expect; |
---|
5506 | char *got; |
---|
5507 | { |
---|
5508 | if (strcmp(expect, got)) { |
---|
5509 | printf("%s oddity: Expected %s, got %s\n", |
---|
5510 | myname, expect, got); |
---|
5511 | exit(1); |
---|
5512 | } |
---|
5513 | } |
---|
5514 | |
---|
5515 | int |
---|
5516 | main() |
---|
5517 | { |
---|
5518 | char buf[64]; |
---|
5519 | buf[63] = '\0'; |
---|
5520 | |
---|
5521 | /* This must be 1st test on (which?) platform */ |
---|
5522 | /* Alan Burlison <AlanBurlsin@unn.unisys.com> */ |
---|
5523 | Gconvert(0.1, 8, 0, buf); |
---|
5524 | checkit("0.1", buf); |
---|
5525 | |
---|
5526 | Gconvert(1.0, 8, 0, buf); |
---|
5527 | checkit("1", buf); |
---|
5528 | |
---|
5529 | Gconvert(0.0, 8, 0, buf); |
---|
5530 | checkit("0", buf); |
---|
5531 | |
---|
5532 | Gconvert(-1.0, 8, 0, buf); |
---|
5533 | checkit("-1", buf); |
---|
5534 | |
---|
5535 | /* Some Linux gcvt's give 1.e+5 here. */ |
---|
5536 | Gconvert(100000.0, 8, 0, buf); |
---|
5537 | checkit("100000", buf); |
---|
5538 | |
---|
5539 | /* Some Linux gcvt's give -1.e+5 here. */ |
---|
5540 | Gconvert(-100000.0, 8, 0, buf); |
---|
5541 | checkit("-100000", buf); |
---|
5542 | |
---|
5543 | exit(0); |
---|
5544 | } |
---|
5545 | EOP |
---|
5546 | case "$d_Gconvert" in |
---|
5547 | gconvert*) xxx_list='gconvert gcvt sprintf' ;; |
---|
5548 | gcvt*) xxx_list='gcvt gconvert sprintf' ;; |
---|
5549 | sprintf*) xxx_list='sprintf gconvert gcvt' ;; |
---|
5550 | *) xxx_list='gconvert gcvt sprintf' ;; |
---|
5551 | esac |
---|
5552 | |
---|
5553 | for xxx_convert in $xxx_list; do |
---|
5554 | echo "Trying $xxx_convert" |
---|
5555 | $rm -f try try.o |
---|
5556 | if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \ |
---|
5557 | try.c $libs > /dev/null 2>&1 ; then |
---|
5558 | echo "$xxx_convert" found. >&4 |
---|
5559 | if ./try; then |
---|
5560 | echo "I'll use $xxx_convert to convert floats into a string." >&4 |
---|
5561 | break; |
---|
5562 | else |
---|
5563 | echo "...But $xxx_convert didn't work as I expected." |
---|
5564 | fi |
---|
5565 | else |
---|
5566 | echo "$xxx_convert NOT found." >&4 |
---|
5567 | fi |
---|
5568 | done |
---|
5569 | |
---|
5570 | case "$xxx_convert" in |
---|
5571 | gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; |
---|
5572 | gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; |
---|
5573 | *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; |
---|
5574 | esac |
---|
5575 | |
---|
5576 | : Initialize h_fcntl |
---|
5577 | h_fcntl=false |
---|
5578 | |
---|
5579 | : Initialize h_sysfile |
---|
5580 | h_sysfile=false |
---|
5581 | |
---|
5582 | : access call always available on UNIX |
---|
5583 | set access d_access |
---|
5584 | eval $inlibc |
---|
5585 | |
---|
5586 | : locate the flags for 'access()' |
---|
5587 | case "$d_access" in |
---|
5588 | "$define") |
---|
5589 | echo " " |
---|
5590 | $cat >access.c <<'EOCP' |
---|
5591 | #include <sys/types.h> |
---|
5592 | #ifdef I_FCNTL |
---|
5593 | #include <fcntl.h> |
---|
5594 | #endif |
---|
5595 | #ifdef I_SYS_FILE |
---|
5596 | #include <sys/file.h> |
---|
5597 | #endif |
---|
5598 | #ifdef I_UNISTD |
---|
5599 | #include <unistd.h> |
---|
5600 | #endif |
---|
5601 | main() { |
---|
5602 | exit(R_OK); |
---|
5603 | } |
---|
5604 | EOCP |
---|
5605 | : check sys/file.h first, no particular reason here |
---|
5606 | if $test `./findhdr sys/file.h` && \ |
---|
5607 | $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then |
---|
5608 | h_sysfile=true; |
---|
5609 | echo "<sys/file.h> defines the *_OK access constants." >&4 |
---|
5610 | elif $test `./findhdr fcntl.h` && \ |
---|
5611 | $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then |
---|
5612 | h_fcntl=true; |
---|
5613 | echo "<fcntl.h> defines the *_OK access constants." >&4 |
---|
5614 | elif $test `./findhdr unistd.h` && \ |
---|
5615 | $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then |
---|
5616 | echo "<unistd.h> defines the *_OK access constants." >&4 |
---|
5617 | else |
---|
5618 | echo "I can't find the four *_OK access constants--I'll use mine." >&4 |
---|
5619 | fi |
---|
5620 | ;; |
---|
5621 | esac |
---|
5622 | $rm -f access* |
---|
5623 | |
---|
5624 | : see if alarm exists |
---|
5625 | set alarm d_alarm |
---|
5626 | eval $inlibc |
---|
5627 | |
---|
5628 | : Look for GNU-cc style attribute checking |
---|
5629 | echo " " |
---|
5630 | echo "Checking whether your compiler can handle __attribute__ ..." >&4 |
---|
5631 | $cat >attrib.c <<'EOCP' |
---|
5632 | #include <stdio.h> |
---|
5633 | void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn)); |
---|
5634 | EOCP |
---|
5635 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
---|
5636 | if $contains 'warning' attrib.out >/dev/null 2>&1; then |
---|
5637 | echo "Your C compiler doesn't fully support __attribute__." |
---|
5638 | val="$undef" |
---|
5639 | else |
---|
5640 | echo "Your C compiler supports __attribute__." |
---|
5641 | val="$define" |
---|
5642 | fi |
---|
5643 | else |
---|
5644 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
---|
5645 | val="$undef" |
---|
5646 | fi |
---|
5647 | set d_attribut |
---|
5648 | eval $setvar |
---|
5649 | $rm -f attrib* |
---|
5650 | |
---|
5651 | : see if bcmp exists |
---|
5652 | set bcmp d_bcmp |
---|
5653 | eval $inlibc |
---|
5654 | |
---|
5655 | : see if bcopy exists |
---|
5656 | set bcopy d_bcopy |
---|
5657 | eval $inlibc |
---|
5658 | |
---|
5659 | : see if this is a unistd.h system |
---|
5660 | set unistd.h i_unistd |
---|
5661 | eval $inhdr |
---|
5662 | |
---|
5663 | : see if getpgrp exists |
---|
5664 | set getpgrp d_getpgrp |
---|
5665 | eval $inlibc |
---|
5666 | |
---|
5667 | echo "Checking to see which flavor of getpgrp is in use . . . " |
---|
5668 | case "$d_getpgrp" in |
---|
5669 | "$define") |
---|
5670 | echo " " |
---|
5671 | $cat >set.c <<EOP |
---|
5672 | #$i_unistd I_UNISTD |
---|
5673 | #include <sys/types.h> |
---|
5674 | #ifdef I_UNISTD |
---|
5675 | # include <unistd.h> |
---|
5676 | #endif |
---|
5677 | main() |
---|
5678 | { |
---|
5679 | if (getuid() == 0) { |
---|
5680 | printf("(I see you are running Configure as super-user...)\n"); |
---|
5681 | setuid(1); |
---|
5682 | } |
---|
5683 | #ifdef TRY_BSD_PGRP |
---|
5684 | if (getpgrp(1) == 0) |
---|
5685 | exit(0); |
---|
5686 | #else |
---|
5687 | if (getpgrp() > 0) |
---|
5688 | exit(0); |
---|
5689 | #endif |
---|
5690 | exit(1); |
---|
5691 | } |
---|
5692 | EOP |
---|
5693 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
---|
5694 | echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 |
---|
5695 | val="$define" |
---|
5696 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
---|
5697 | echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 |
---|
5698 | val="$undef" |
---|
5699 | else |
---|
5700 | echo "I can't seem to compile and run the test program." |
---|
5701 | if ./usg; then |
---|
5702 | xxx="a USG one, i.e. you use getpgrp()." |
---|
5703 | else |
---|
5704 | # SVR4 systems can appear rather BSD-ish. |
---|
5705 | case "$i_unistd" in |
---|
5706 | $undef) |
---|
5707 | xxx="a BSD one, i.e. you use getpgrp(pid)." |
---|
5708 | val="$define" |
---|
5709 | ;; |
---|
5710 | $define) |
---|
5711 | xxx="probably a USG one, i.e. you use getpgrp()." |
---|
5712 | val="$undef" |
---|
5713 | ;; |
---|
5714 | esac |
---|
5715 | fi |
---|
5716 | echo "Assuming your getpgrp is $xxx" >&4 |
---|
5717 | fi |
---|
5718 | ;; |
---|
5719 | *) val="$undef";; |
---|
5720 | esac |
---|
5721 | set d_bsdgetpgrp |
---|
5722 | eval $setvar |
---|
5723 | $rm -f set set.c |
---|
5724 | |
---|
5725 | : see if setpgrp exists |
---|
5726 | set setpgrp d_setpgrp |
---|
5727 | eval $inlibc |
---|
5728 | |
---|
5729 | echo "Checking to see which flavor of setpgrp is in use . . . " |
---|
5730 | case "$d_setpgrp" in |
---|
5731 | "$define") |
---|
5732 | echo " " |
---|
5733 | $cat >set.c <<EOP |
---|
5734 | #$i_unistd I_UNISTD |
---|
5735 | #include <sys/types.h> |
---|
5736 | #ifdef I_UNISTD |
---|
5737 | # include <unistd.h> |
---|
5738 | #endif |
---|
5739 | main() |
---|
5740 | { |
---|
5741 | if (getuid() == 0) { |
---|
5742 | printf("(I see you are running Configure as super-user...)\n"); |
---|
5743 | setuid(1); |
---|
5744 | } |
---|
5745 | #ifdef TRY_BSD_PGRP |
---|
5746 | if (-1 == setpgrp(1, 1)) |
---|
5747 | exit(0); |
---|
5748 | #else |
---|
5749 | if (setpgrp() != -1) |
---|
5750 | exit(0); |
---|
5751 | #endif |
---|
5752 | exit(1); |
---|
5753 | } |
---|
5754 | EOP |
---|
5755 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
---|
5756 | echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 |
---|
5757 | val="$define" |
---|
5758 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
---|
5759 | echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 |
---|
5760 | val="$undef" |
---|
5761 | else |
---|
5762 | echo "I can't seem to compile and run the test program." |
---|
5763 | if ./usg; then |
---|
5764 | xxx="a USG one, i.e. you use setpgrp()." |
---|
5765 | else |
---|
5766 | # SVR4 systems can appear rather BSD-ish. |
---|
5767 | case "$i_unistd" in |
---|
5768 | $undef) |
---|
5769 | xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." |
---|
5770 | val="$define" |
---|
5771 | ;; |
---|
5772 | $define) |
---|
5773 | xxx="probably a USG one, i.e. you use setpgrp()." |
---|
5774 | val="$undef" |
---|
5775 | ;; |
---|
5776 | esac |
---|
5777 | fi |
---|
5778 | echo "Assuming your setpgrp is $xxx" >&4 |
---|
5779 | fi |
---|
5780 | ;; |
---|
5781 | *) val="$undef";; |
---|
5782 | esac |
---|
5783 | set d_bsdsetpgrp |
---|
5784 | eval $setvar |
---|
5785 | d_bsdpgrp=$d_bsdsetpgrp |
---|
5786 | $rm -f set set.c |
---|
5787 | : see if bzero exists |
---|
5788 | set bzero d_bzero |
---|
5789 | eval $inlibc |
---|
5790 | |
---|
5791 | : check for lengths of integral types |
---|
5792 | echo " " |
---|
5793 | case "$intsize" in |
---|
5794 | '') |
---|
5795 | echo "Checking to see how big your integers are..." >&4 |
---|
5796 | $cat >intsize.c <<'EOCP' |
---|
5797 | #include <stdio.h> |
---|
5798 | main() |
---|
5799 | { |
---|
5800 | printf("intsize=%d;\n", sizeof(int)); |
---|
5801 | printf("longsize=%d;\n", sizeof(long)); |
---|
5802 | printf("shortsize=%d;\n", sizeof(short)); |
---|
5803 | fflush(stdout); |
---|
5804 | exit(0); |
---|
5805 | } |
---|
5806 | EOCP |
---|
5807 | # If $libs contains -lsfio, and sfio is mis-configured, then it |
---|
5808 | # sometimes (apparently) runs and exits with a 0 status, but with no |
---|
5809 | # output!. Thus we check with test -s whether we actually got any |
---|
5810 | # output. I think it has to do with sfio's use of _exit vs. exit, |
---|
5811 | # but I don't know for sure. --Andy Dougherty 1/27/97. |
---|
5812 | if $cc $optimize $ccflags $ldflags -o intsize intsize.c $libs >/dev/null 2>&1 && |
---|
5813 | ./intsize > intsize.out 2>/dev/null && test -s intsize.out ; then |
---|
5814 | eval `$cat intsize.out` |
---|
5815 | echo "Your integers are $intsize bytes long." |
---|
5816 | echo "Your long integers are $longsize bytes long." |
---|
5817 | echo "Your short integers are $shortsize bytes long." |
---|
5818 | else |
---|
5819 | $cat >&4 <<EOM |
---|
5820 | |
---|
5821 | Help! I can't compile and run the intsize test program: please enlighten me! |
---|
5822 | (This is probably a misconfiguration in your system or libraries, and |
---|
5823 | you really ought to fix it. Still, I'll try anyway.) |
---|
5824 | |
---|
5825 | EOM |
---|
5826 | dflt=4 |
---|
5827 | rp="What is the size of an integer (in bytes)?" |
---|
5828 | . ./myread |
---|
5829 | intsize="$ans" |
---|
5830 | dflt=$intsize |
---|
5831 | rp="What is the size of a long integer (in bytes)?" |
---|
5832 | . ./myread |
---|
5833 | longsize="$ans" |
---|
5834 | dflt=2 |
---|
5835 | rp="What is the size of a short integer (in bytes)?" |
---|
5836 | . ./myread |
---|
5837 | shortsize="$ans" |
---|
5838 | fi |
---|
5839 | ;; |
---|
5840 | esac |
---|
5841 | $rm -f intsize intsize.[co] intsize.out |
---|
5842 | |
---|
5843 | : see if signal is declared as pointer to function returning int or void |
---|
5844 | echo " " |
---|
5845 | xxx=`./findhdr signal.h` |
---|
5846 | $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null |
---|
5847 | if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then |
---|
5848 | echo "You have int (*signal())() instead of void." >&4 |
---|
5849 | val="$undef" |
---|
5850 | elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then |
---|
5851 | echo "You have void (*signal())() instead of int." >&4 |
---|
5852 | val="$define" |
---|
5853 | elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then |
---|
5854 | echo "You have int (*signal())() instead of void." >&4 |
---|
5855 | val="$undef" |
---|
5856 | else |
---|
5857 | case "$d_voidsig" in |
---|
5858 | '') |
---|
5859 | echo "I can't determine whether signal handler returns void or int..." >&4 |
---|
5860 | dflt=void |
---|
5861 | rp="What type does your signal handler return?" |
---|
5862 | . ./myread |
---|
5863 | case "$ans" in |
---|
5864 | v*) val="$define";; |
---|
5865 | *) val="$undef";; |
---|
5866 | esac;; |
---|
5867 | "$define") |
---|
5868 | echo "As you already told me, signal handler returns void." >&4;; |
---|
5869 | *) |
---|
5870 | echo "As you already told me, signal handler returns int." >&4;; |
---|
5871 | esac |
---|
5872 | fi |
---|
5873 | set d_voidsig |
---|
5874 | eval $setvar |
---|
5875 | case "$d_voidsig" in |
---|
5876 | "$define") signal_t="void";; |
---|
5877 | *) signal_t="int";; |
---|
5878 | esac |
---|
5879 | $rm -f $$.tmp |
---|
5880 | |
---|
5881 | : check for ability to cast large floats to 32-bit ints. |
---|
5882 | echo " " |
---|
5883 | echo 'Checking whether your C compiler can cast large floats to int32.' >&4 |
---|
5884 | if $test "$intsize" -eq 4; then |
---|
5885 | xxx=int |
---|
5886 | else |
---|
5887 | xxx=long |
---|
5888 | fi |
---|
5889 | $cat >try.c <<EOCP |
---|
5890 | #include <sys/types.h> |
---|
5891 | #include <signal.h> |
---|
5892 | $signal_t blech() { exit(3); } |
---|
5893 | main() |
---|
5894 | { |
---|
5895 | $xxx i32; |
---|
5896 | double f; |
---|
5897 | int result = 0; |
---|
5898 | signal(SIGFPE, blech); |
---|
5899 | |
---|
5900 | f = (double) 0x7fffffff; |
---|
5901 | f = 10 * f; |
---|
5902 | i32 = ($xxx) f; |
---|
5903 | |
---|
5904 | if (i32 != ($xxx) f) |
---|
5905 | result |= 1; |
---|
5906 | exit(result); |
---|
5907 | } |
---|
5908 | EOCP |
---|
5909 | if $cc -o try $ccflags try.c >/dev/null 2>&1; then |
---|
5910 | ./try |
---|
5911 | yyy=$? |
---|
5912 | else |
---|
5913 | echo "(I can't seem to compile the test program--assuming it can't)" |
---|
5914 | yyy=1 |
---|
5915 | fi |
---|
5916 | case "$yyy" in |
---|
5917 | 0) val="$define" |
---|
5918 | echo "Yup, it can." |
---|
5919 | ;; |
---|
5920 | *) val="$undef" |
---|
5921 | echo "Nope, it can't." |
---|
5922 | ;; |
---|
5923 | esac |
---|
5924 | set d_casti32 |
---|
5925 | eval $setvar |
---|
5926 | $rm -f try try.* |
---|
5927 | |
---|
5928 | : check for ability to cast negative floats to unsigned |
---|
5929 | echo " " |
---|
5930 | echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 |
---|
5931 | $cat >try.c <<EOCP |
---|
5932 | #include <sys/types.h> |
---|
5933 | #include <signal.h> |
---|
5934 | $signal_t blech() { exit(7); } |
---|
5935 | $signal_t blech_in_list() { exit(4); } |
---|
5936 | unsigned long dummy_long(p) unsigned long p; { return p; } |
---|
5937 | unsigned int dummy_int(p) unsigned int p; { return p; } |
---|
5938 | unsigned short dummy_short(p) unsigned short p; { return p; } |
---|
5939 | main() |
---|
5940 | { |
---|
5941 | double f = -123.; |
---|
5942 | unsigned long along; |
---|
5943 | unsigned int aint; |
---|
5944 | unsigned short ashort; |
---|
5945 | int result = 0; |
---|
5946 | |
---|
5947 | signal(SIGFPE, blech); |
---|
5948 | along = (unsigned long)f; |
---|
5949 | aint = (unsigned int)f; |
---|
5950 | ashort = (unsigned short)f; |
---|
5951 | if (along != (unsigned long)-123) |
---|
5952 | result |= 1; |
---|
5953 | if (aint != (unsigned int)-123) |
---|
5954 | result |= 1; |
---|
5955 | if (ashort != (unsigned short)-123) |
---|
5956 | result |= 1; |
---|
5957 | f = (double)0x40000000; |
---|
5958 | f = f + f; |
---|
5959 | along = 0; |
---|
5960 | along = (unsigned long)f; |
---|
5961 | if (along != 0x80000000) |
---|
5962 | result |= 2; |
---|
5963 | f -= 1.; |
---|
5964 | along = 0; |
---|
5965 | along = (unsigned long)f; |
---|
5966 | if (along != 0x7fffffff) |
---|
5967 | result |= 1; |
---|
5968 | f += 2.; |
---|
5969 | along = 0; |
---|
5970 | along = (unsigned long)f; |
---|
5971 | if (along != 0x80000001) |
---|
5972 | result |= 2; |
---|
5973 | if (result) |
---|
5974 | exit(result); |
---|
5975 | signal(SIGFPE, blech_in_list); |
---|
5976 | f = 123.; |
---|
5977 | along = dummy_long((unsigned long)f); |
---|
5978 | aint = dummy_int((unsigned int)f); |
---|
5979 | ashort = dummy_short((unsigned short)f); |
---|
5980 | if (along != (unsigned long)123) |
---|
5981 | result |= 4; |
---|
5982 | if (aint != (unsigned int)123) |
---|
5983 | result |= 4; |
---|
5984 | if (ashort != (unsigned short)123) |
---|
5985 | result |= 4; |
---|
5986 | exit(result); |
---|
5987 | |
---|
5988 | } |
---|
5989 | EOCP |
---|
5990 | if $cc -o try $ccflags try.c >/dev/null 2>&1; then |
---|
5991 | ./try |
---|
5992 | castflags=$? |
---|
5993 | else |
---|
5994 | echo "(I can't seem to compile the test program--assuming it can't)" |
---|
5995 | castflags=7 |
---|
5996 | fi |
---|
5997 | case "$castflags" in |
---|
5998 | 0) val="$define" |
---|
5999 | echo "Yup, it can." |
---|
6000 | ;; |
---|
6001 | *) val="$undef" |
---|
6002 | echo "Nope, it can't." |
---|
6003 | ;; |
---|
6004 | esac |
---|
6005 | set d_castneg |
---|
6006 | eval $setvar |
---|
6007 | $rm -f try.* |
---|
6008 | |
---|
6009 | : see if vprintf exists |
---|
6010 | echo " " |
---|
6011 | if set vprintf val -f d_vprintf; eval $csym; $val; then |
---|
6012 | echo 'vprintf() found.' >&4 |
---|
6013 | val="$define" |
---|
6014 | $cat >vprintf.c <<'EOF' |
---|
6015 | #include <varargs.h> |
---|
6016 | |
---|
6017 | main() { xxx("foo"); } |
---|
6018 | |
---|
6019 | xxx(va_alist) |
---|
6020 | va_dcl |
---|
6021 | { |
---|
6022 | va_list args; |
---|
6023 | char buf[10]; |
---|
6024 | |
---|
6025 | va_start(args); |
---|
6026 | exit((unsigned long)vsprintf(buf,"%s",args) > 10L); |
---|
6027 | } |
---|
6028 | EOF |
---|
6029 | if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then |
---|
6030 | echo "Your vsprintf() returns (int)." >&4 |
---|
6031 | val2="$undef" |
---|
6032 | else |
---|
6033 | echo "Your vsprintf() returns (char*)." >&4 |
---|
6034 | val2="$define" |
---|
6035 | fi |
---|
6036 | else |
---|
6037 | echo 'vprintf() NOT found.' >&4 |
---|
6038 | val="$undef" |
---|
6039 | val2="$undef" |
---|
6040 | fi |
---|
6041 | set d_vprintf |
---|
6042 | eval $setvar |
---|
6043 | val=$val2 |
---|
6044 | set d_charvspr |
---|
6045 | eval $setvar |
---|
6046 | |
---|
6047 | : see if chown exists |
---|
6048 | set chown d_chown |
---|
6049 | eval $inlibc |
---|
6050 | |
---|
6051 | : see if chroot exists |
---|
6052 | set chroot d_chroot |
---|
6053 | eval $inlibc |
---|
6054 | |
---|
6055 | : see if chsize exists |
---|
6056 | set chsize d_chsize |
---|
6057 | eval $inlibc |
---|
6058 | |
---|
6059 | : check for const keyword |
---|
6060 | echo " " |
---|
6061 | echo 'Checking to see if your C compiler knows about "const"...' >&4 |
---|
6062 | $cat >const.c <<'EOCP' |
---|
6063 | typedef struct spug { int drokk; } spug; |
---|
6064 | main() |
---|
6065 | { |
---|
6066 | const char *foo; |
---|
6067 | const spug y; |
---|
6068 | } |
---|
6069 | EOCP |
---|
6070 | if $cc -c $ccflags const.c >/dev/null 2>&1 ; then |
---|
6071 | val="$define" |
---|
6072 | echo "Yup, it does." |
---|
6073 | else |
---|
6074 | val="$undef" |
---|
6075 | echo "Nope, it doesn't." |
---|
6076 | fi |
---|
6077 | set d_const |
---|
6078 | eval $setvar |
---|
6079 | |
---|
6080 | : see if crypt exists |
---|
6081 | echo " " |
---|
6082 | if set crypt val -f d_crypt; eval $csym; $val; then |
---|
6083 | echo 'crypt() found.' >&4 |
---|
6084 | val="$define" |
---|
6085 | cryptlib='' |
---|
6086 | else |
---|
6087 | cryptlib=`./loc Slibcrypt$lib_ext "" $xlibpth` |
---|
6088 | if $test -z "$cryptlib"; then |
---|
6089 | cryptlib=`./loc Mlibcrypt$lib_ext "" $xlibpth` |
---|
6090 | else |
---|
6091 | cryptlib=-lcrypt |
---|
6092 | fi |
---|
6093 | if $test -z "$cryptlib"; then |
---|
6094 | cryptlib=`./loc Llibcrypt$lib_ext "" $xlibpth` |
---|
6095 | else |
---|
6096 | cryptlib=-lcrypt |
---|
6097 | fi |
---|
6098 | if $test -z "$cryptlib"; then |
---|
6099 | cryptlib=`./loc libcrypt$lib_ext "" $libpth` |
---|
6100 | else |
---|
6101 | cryptlib=-lcrypt |
---|
6102 | fi |
---|
6103 | if $test -z "$cryptlib"; then |
---|
6104 | echo 'crypt() NOT found.' >&4 |
---|
6105 | val="$undef" |
---|
6106 | else |
---|
6107 | val="$define" |
---|
6108 | fi |
---|
6109 | fi |
---|
6110 | set d_crypt |
---|
6111 | eval $setvar |
---|
6112 | |
---|
6113 | : get csh whereabouts |
---|
6114 | case "$csh" in |
---|
6115 | 'csh') val="$undef" ;; |
---|
6116 | *) val="$define" ;; |
---|
6117 | esac |
---|
6118 | set d_csh |
---|
6119 | eval $setvar |
---|
6120 | : Respect a hint or command line value for full_csh. |
---|
6121 | case "$full_csh" in |
---|
6122 | '') full_csh=$csh ;; |
---|
6123 | esac |
---|
6124 | |
---|
6125 | : see if cuserid exists |
---|
6126 | set cuserid d_cuserid |
---|
6127 | eval $inlibc |
---|
6128 | |
---|
6129 | : see if this is a limits.h system |
---|
6130 | set limits.h i_limits |
---|
6131 | eval $inhdr |
---|
6132 | |
---|
6133 | : see if this is a float.h system |
---|
6134 | set float.h i_float |
---|
6135 | eval $inhdr |
---|
6136 | |
---|
6137 | : See if number of significant digits in a double precision number is known |
---|
6138 | echo " " |
---|
6139 | $cat >dbl_dig.c <<EOM |
---|
6140 | #$i_limits I_LIMITS |
---|
6141 | #$i_float I_FLOAT |
---|
6142 | #ifdef I_LIMITS |
---|
6143 | #include <limits.h> |
---|
6144 | #endif |
---|
6145 | #ifdef I_FLOAT |
---|
6146 | #include <float.h> |
---|
6147 | #endif |
---|
6148 | #ifdef DBL_DIG |
---|
6149 | printf("Contains DBL_DIG"); |
---|
6150 | #endif |
---|
6151 | EOM |
---|
6152 | $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null |
---|
6153 | if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then |
---|
6154 | echo "DBL_DIG found." >&4 |
---|
6155 | val="$define" |
---|
6156 | else |
---|
6157 | echo "DBL_DIG NOT found." >&4 |
---|
6158 | val="$undef" |
---|
6159 | fi |
---|
6160 | $rm -f dbl_dig.? |
---|
6161 | set d_dbl_dig |
---|
6162 | eval $setvar |
---|
6163 | |
---|
6164 | : see if difftime exists |
---|
6165 | set difftime d_difftime |
---|
6166 | eval $inlibc |
---|
6167 | |
---|
6168 | : see if this is a dirent system |
---|
6169 | echo " " |
---|
6170 | if xinc=`./findhdr dirent.h`; $test "$xinc"; then |
---|
6171 | val="$define" |
---|
6172 | echo "<dirent.h> found." >&4 |
---|
6173 | else |
---|
6174 | val="$undef" |
---|
6175 | if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then |
---|
6176 | echo "<sys/dir.h> found." >&4 |
---|
6177 | echo " " |
---|
6178 | else |
---|
6179 | xinc=`./findhdr sys/ndir.h` |
---|
6180 | fi |
---|
6181 | echo "<dirent.h> NOT found." >&4 |
---|
6182 | fi |
---|
6183 | set i_dirent |
---|
6184 | eval $setvar |
---|
6185 | |
---|
6186 | : Look for type of directory structure. |
---|
6187 | echo " " |
---|
6188 | $cppstdin $cppflags $cppminus < "$xinc" > try.c |
---|
6189 | |
---|
6190 | case "$direntrytype" in |
---|
6191 | ''|' ') |
---|
6192 | case "$i_dirent" in |
---|
6193 | $define) guess1='struct dirent' ;; |
---|
6194 | *) guess1='struct direct' ;; |
---|
6195 | esac |
---|
6196 | ;; |
---|
6197 | *) guess1="$direntrytype" |
---|
6198 | ;; |
---|
6199 | esac |
---|
6200 | |
---|
6201 | case "$guess1" in |
---|
6202 | 'struct dirent') guess2='struct direct' ;; |
---|
6203 | *) guess2='struct dirent' ;; |
---|
6204 | esac |
---|
6205 | |
---|
6206 | if $contains "$guess1" try.c >/dev/null 2>&1; then |
---|
6207 | direntrytype="$guess1" |
---|
6208 | echo "Your directory entries are $direntrytype." >&4 |
---|
6209 | elif $contains "$guess2" try.c >/dev/null 2>&1; then |
---|
6210 | direntrytype="$guess2" |
---|
6211 | echo "Your directory entries seem to be $direntrytype." >&4 |
---|
6212 | else |
---|
6213 | echo "I don't recognize your system's directory entries." >&4 |
---|
6214 | rp="What type is used for directory entries on this system?" |
---|
6215 | dflt="$guess1" |
---|
6216 | . ./myread |
---|
6217 | direntrytype="$ans" |
---|
6218 | fi |
---|
6219 | $rm -f try.c |
---|
6220 | |
---|
6221 | |
---|
6222 | : see if the directory entry stores field length |
---|
6223 | echo " " |
---|
6224 | $cppstdin $cppflags $cppminus < "$xinc" > try.c |
---|
6225 | if $contains 'd_namlen' try.c >/dev/null 2>&1; then |
---|
6226 | echo "Good, your directory entry keeps length information in d_namlen." >&4 |
---|
6227 | val="$define" |
---|
6228 | else |
---|
6229 | echo "Your directory entry does not know about the d_namlen field." >&4 |
---|
6230 | val="$undef" |
---|
6231 | fi |
---|
6232 | set d_dirnamlen |
---|
6233 | eval $setvar |
---|
6234 | $rm -f try.c |
---|
6235 | |
---|
6236 | : see if dlerror exists |
---|
6237 | xxx_runnm="$runnm" |
---|
6238 | runnm=false |
---|
6239 | set dlerror d_dlerror |
---|
6240 | eval $inlibc |
---|
6241 | runnm="$xxx_runnm" |
---|
6242 | |
---|
6243 | : see if dlfcn is available |
---|
6244 | set dlfcn.h i_dlfcn |
---|
6245 | eval $inhdr |
---|
6246 | |
---|
6247 | case "$usedl" in |
---|
6248 | $define|y|true) |
---|
6249 | $cat << EOM |
---|
6250 | |
---|
6251 | On a few systems, the dynamically loaded modules that perl generates and uses |
---|
6252 | will need a different extension then shared libs. The default will probably |
---|
6253 | be appropriate. |
---|
6254 | |
---|
6255 | EOM |
---|
6256 | case "$dlext" in |
---|
6257 | '') dflt="$so" ;; |
---|
6258 | *) dflt="$dlext" ;; |
---|
6259 | esac |
---|
6260 | rp='What is the extension of dynamically loaded modules' |
---|
6261 | . ./myread |
---|
6262 | dlext="$ans" |
---|
6263 | ;; |
---|
6264 | *) |
---|
6265 | dlext="none" |
---|
6266 | ;; |
---|
6267 | esac |
---|
6268 | |
---|
6269 | : Check if dlsym need a leading underscore |
---|
6270 | echo " " |
---|
6271 | val="$undef" |
---|
6272 | |
---|
6273 | case "$dlsrc" in |
---|
6274 | dl_dlopen.xs) |
---|
6275 | echo "Checking whether your dlsym() needs a leading underscore ..." >&4 |
---|
6276 | $cat >dyna.c <<'EOM' |
---|
6277 | fred () { } |
---|
6278 | EOM |
---|
6279 | |
---|
6280 | $cat >fred.c<<EOM |
---|
6281 | |
---|
6282 | #include <stdio.h> |
---|
6283 | #$i_dlfcn I_DLFCN |
---|
6284 | #ifdef I_DLFCN |
---|
6285 | #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */ |
---|
6286 | #else |
---|
6287 | #include <sys/types.h> |
---|
6288 | #include <nlist.h> |
---|
6289 | #include <link.h> |
---|
6290 | #endif |
---|
6291 | |
---|
6292 | extern int fred() ; |
---|
6293 | |
---|
6294 | main() |
---|
6295 | { |
---|
6296 | void * handle ; |
---|
6297 | void * symbol ; |
---|
6298 | #ifndef RTLD_LAZY |
---|
6299 | int mode = 1 ; |
---|
6300 | #else |
---|
6301 | int mode = RTLD_LAZY ; |
---|
6302 | #endif |
---|
6303 | handle = dlopen("./dyna.$dlext", mode) ; |
---|
6304 | if (handle == NULL) { |
---|
6305 | printf ("1\n") ; |
---|
6306 | fflush (stdout) ; |
---|
6307 | exit(0); |
---|
6308 | } |
---|
6309 | symbol = dlsym(handle, "fred") ; |
---|
6310 | if (symbol == NULL) { |
---|
6311 | /* try putting a leading underscore */ |
---|
6312 | symbol = dlsym(handle, "_fred") ; |
---|
6313 | if (symbol == NULL) { |
---|
6314 | printf ("2\n") ; |
---|
6315 | fflush (stdout) ; |
---|
6316 | exit(0); |
---|
6317 | } |
---|
6318 | printf ("3\n") ; |
---|
6319 | } |
---|
6320 | else |
---|
6321 | printf ("4\n") ; |
---|
6322 | fflush (stdout) ; |
---|
6323 | exit(0); |
---|
6324 | } |
---|
6325 | EOM |
---|
6326 | : Call the object file tmp-dyna.o in case dlext=o. |
---|
6327 | if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && |
---|
6328 | mv dyna${obj_ext} tmp-dyna${obj_ext} > /dev/null 2>&1 && |
---|
6329 | $ld $lddlflags -o dyna.$dlext tmp-dyna${obj_ext} > /dev/null 2>&1 && |
---|
6330 | $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then |
---|
6331 | xxx=`./fred` |
---|
6332 | case $xxx in |
---|
6333 | 1) echo "Test program failed using dlopen." >&4 |
---|
6334 | echo "Perhaps you should not use dynamic loading." >&4;; |
---|
6335 | 2) echo "Test program failed using dlsym." >&4 |
---|
6336 | echo "Perhaps you should not use dynamic loading." >&4;; |
---|
6337 | 3) echo "dlsym needs a leading underscore" >&4 |
---|
6338 | val="$define" ;; |
---|
6339 | 4) echo "dlsym doesn't need a leading underscore." >&4;; |
---|
6340 | esac |
---|
6341 | else |
---|
6342 | echo "I can't compile and run the test program." >&4 |
---|
6343 | fi |
---|
6344 | ;; |
---|
6345 | esac |
---|
6346 | |
---|
6347 | $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.? |
---|
6348 | |
---|
6349 | set d_dlsymun |
---|
6350 | eval $setvar |
---|
6351 | |
---|
6352 | : see if dup2 exists |
---|
6353 | set dup2 d_dup2 |
---|
6354 | eval $inlibc |
---|
6355 | |
---|
6356 | : Locate the flags for 'open()' |
---|
6357 | echo " " |
---|
6358 | $cat >open3.c <<'EOCP' |
---|
6359 | #include <sys/types.h> |
---|
6360 | #ifdef I_FCNTL |
---|
6361 | #include <fcntl.h> |
---|
6362 | #endif |
---|
6363 | #ifdef I_SYS_FILE |
---|
6364 | #include <sys/file.h> |
---|
6365 | #endif |
---|
6366 | main() { |
---|
6367 | if(O_RDONLY); |
---|
6368 | #ifdef O_TRUNC |
---|
6369 | exit(0); |
---|
6370 | #else |
---|
6371 | exit(1); |
---|
6372 | #endif |
---|
6373 | } |
---|
6374 | EOCP |
---|
6375 | : check sys/file.h first to get FREAD on Sun |
---|
6376 | if $test `./findhdr sys/file.h` && \ |
---|
6377 | $cc $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then |
---|
6378 | h_sysfile=true; |
---|
6379 | echo "<sys/file.h> defines the O_* constants..." >&4 |
---|
6380 | if ./open3; then |
---|
6381 | echo "and you have the 3 argument form of open()." >&4 |
---|
6382 | val="$define" |
---|
6383 | else |
---|
6384 | echo "but not the 3 argument form of open(). Oh, well." >&4 |
---|
6385 | val="$undef" |
---|
6386 | fi |
---|
6387 | elif $test `./findhdr fcntl.h` && \ |
---|
6388 | $cc $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then |
---|
6389 | h_fcntl=true; |
---|
6390 | echo "<fcntl.h> defines the O_* constants..." >&4 |
---|
6391 | if ./open3; then |
---|
6392 | echo "and you have the 3 argument form of open()." >&4 |
---|
6393 | val="$define" |
---|
6394 | else |
---|
6395 | echo "but not the 3 argument form of open(). Oh, well." >&4 |
---|
6396 | val="$undef" |
---|
6397 | fi |
---|
6398 | else |
---|
6399 | val="$undef" |
---|
6400 | echo "I can't find the O_* constant definitions! You got problems." >&4 |
---|
6401 | fi |
---|
6402 | set d_open3 |
---|
6403 | eval $setvar |
---|
6404 | $rm -f open3* |
---|
6405 | |
---|
6406 | : check for non-blocking I/O stuff |
---|
6407 | case "$h_sysfile" in |
---|
6408 | true) echo "#include <sys/file.h>" > head.c;; |
---|
6409 | *) |
---|
6410 | case "$h_fcntl" in |
---|
6411 | true) echo "#include <fcntl.h>" > head.c;; |
---|
6412 | *) echo "#include <sys/fcntl.h>" > head.c;; |
---|
6413 | esac |
---|
6414 | ;; |
---|
6415 | esac |
---|
6416 | echo " " |
---|
6417 | echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 |
---|
6418 | case "$o_nonblock" in |
---|
6419 | '') |
---|
6420 | $cat head.c > try.c |
---|
6421 | $cat >>try.c <<'EOCP' |
---|
6422 | main() { |
---|
6423 | #ifdef O_NONBLOCK |
---|
6424 | printf("O_NONBLOCK\n"); |
---|
6425 | exit(0); |
---|
6426 | #endif |
---|
6427 | #ifdef O_NDELAY |
---|
6428 | printf("O_NDELAY\n"); |
---|
6429 | exit(0); |
---|
6430 | #endif |
---|
6431 | #ifdef FNDELAY |
---|
6432 | printf("FNDELAY\n"); |
---|
6433 | exit(0); |
---|
6434 | #endif |
---|
6435 | exit(0); |
---|
6436 | } |
---|
6437 | EOCP |
---|
6438 | if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then |
---|
6439 | o_nonblock=`./try` |
---|
6440 | case "$o_nonblock" in |
---|
6441 | '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; |
---|
6442 | *) echo "Seems like we can use $o_nonblock.";; |
---|
6443 | esac |
---|
6444 | else |
---|
6445 | echo "(I can't compile the test program; pray O_NONBLOCK is right!)" |
---|
6446 | fi |
---|
6447 | ;; |
---|
6448 | *) echo "Using $hint value $o_nonblock.";; |
---|
6449 | esac |
---|
6450 | $rm -f try try.* .out core |
---|
6451 | |
---|
6452 | echo " " |
---|
6453 | echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 |
---|
6454 | case "$eagain" in |
---|
6455 | '') |
---|
6456 | $cat head.c > try.c |
---|
6457 | $cat >>try.c <<EOCP |
---|
6458 | #include <errno.h> |
---|
6459 | #include <sys/types.h> |
---|
6460 | #include <signal.h> |
---|
6461 | #define MY_O_NONBLOCK $o_nonblock |
---|
6462 | extern int errno; |
---|
6463 | $signal_t blech(x) int x; { exit(3); } |
---|
6464 | EOCP |
---|
6465 | $cat >> try.c <<'EOCP' |
---|
6466 | main() |
---|
6467 | { |
---|
6468 | int pd[2]; |
---|
6469 | int pu[2]; |
---|
6470 | char buf[1]; |
---|
6471 | char string[100]; |
---|
6472 | |
---|
6473 | pipe(pd); /* Down: child -> parent */ |
---|
6474 | pipe(pu); /* Up: parent -> child */ |
---|
6475 | if (0 != fork()) { |
---|
6476 | int ret; |
---|
6477 | close(pd[1]); /* Parent reads from pd[0] */ |
---|
6478 | close(pu[0]); /* Parent writes (blocking) to pu[1] */ |
---|
6479 | if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) |
---|
6480 | exit(1); |
---|
6481 | signal(SIGALRM, blech); |
---|
6482 | alarm(5); |
---|
6483 | if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ |
---|
6484 | exit(2); |
---|
6485 | sprintf(string, "%d\n", ret); |
---|
6486 | write(2, string, strlen(string)); |
---|
6487 | alarm(0); |
---|
6488 | #ifdef EAGAIN |
---|
6489 | if (errno == EAGAIN) { |
---|
6490 | printf("EAGAIN\n"); |
---|
6491 | goto ok; |
---|
6492 | } |
---|
6493 | #endif |
---|
6494 | #ifdef EWOULDBLOCK |
---|
6495 | if (errno == EWOULDBLOCK) |
---|
6496 | printf("EWOULDBLOCK\n"); |
---|
6497 | #endif |
---|
6498 | ok: |
---|
6499 | write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ |
---|
6500 | sleep(2); /* Give it time to close our pipe */ |
---|
6501 | alarm(5); |
---|
6502 | ret = read(pd[0], buf, 1); /* Should read EOF */ |
---|
6503 | alarm(0); |
---|
6504 | sprintf(string, "%d\n", ret); |
---|
6505 | write(3, string, strlen(string)); |
---|
6506 | exit(0); |
---|
6507 | } |
---|
6508 | |
---|
6509 | close(pd[0]); /* We write to pd[1] */ |
---|
6510 | close(pu[1]); /* We read from pu[0] */ |
---|
6511 | read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ |
---|
6512 | close(pd[1]); /* Pipe pd is now fully closed! */ |
---|
6513 | exit(0); /* Bye bye, thank you for playing! */ |
---|
6514 | } |
---|
6515 | EOCP |
---|
6516 | if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then |
---|
6517 | echo "$startsh" >mtry |
---|
6518 | echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry |
---|
6519 | chmod +x mtry |
---|
6520 | ./mtry >/dev/null 2>&1 |
---|
6521 | case $? in |
---|
6522 | 0) eagain=`$cat try.out`;; |
---|
6523 | 1) echo "Could not perform non-blocking setting!";; |
---|
6524 | 2) echo "I did a successful read() for something that was not there!";; |
---|
6525 | 3) echo "Hmm... non-blocking I/O does not seem to be working!";; |
---|
6526 | *) echo "Something terribly wrong happened during testing.";; |
---|
6527 | esac |
---|
6528 | rd_nodata=`$cat try.ret` |
---|
6529 | echo "A read() system call with no data present returns $rd_nodata." |
---|
6530 | case "$rd_nodata" in |
---|
6531 | 0|-1) ;; |
---|
6532 | *) |
---|
6533 | echo "(That's peculiar, fixing that to be -1.)" |
---|
6534 | rd_nodata=-1 |
---|
6535 | ;; |
---|
6536 | esac |
---|
6537 | case "$eagain" in |
---|
6538 | '') |
---|
6539 | echo "Forcing errno EAGAIN on read() with no data available." |
---|
6540 | eagain=EAGAIN |
---|
6541 | ;; |
---|
6542 | *) |
---|
6543 | echo "Your read() sets errno to $eagain when no data is available." |
---|
6544 | ;; |
---|
6545 | esac |
---|
6546 | status=`$cat try.err` |
---|
6547 | case "$status" in |
---|
6548 | 0) echo "And it correctly returns 0 to signal EOF.";; |
---|
6549 | -1) echo "But it also returns -1 to signal EOF, so be careful!";; |
---|
6550 | *) echo "However, your read() returns '$status' on EOF??";; |
---|
6551 | esac |
---|
6552 | val="$define" |
---|
6553 | if test "$status" = "$rd_nodata"; then |
---|
6554 | echo "WARNING: you can't distinguish between EOF and no data!" |
---|
6555 | val="$undef" |
---|
6556 | fi |
---|
6557 | else |
---|
6558 | echo "I can't compile the test program--assuming errno EAGAIN will do." |
---|
6559 | eagain=EAGAIN |
---|
6560 | fi |
---|
6561 | set d_eofnblk |
---|
6562 | eval $setvar |
---|
6563 | ;; |
---|
6564 | *) |
---|
6565 | echo "Using $hint value $eagain." |
---|
6566 | echo "Your read() returns $rd_nodata when no data is present." |
---|
6567 | case "$d_eofnblk" in |
---|
6568 | "$define") echo "And you can see EOF because read() returns 0.";; |
---|
6569 | "$undef") echo "But you can't see EOF status from read() returned value.";; |
---|
6570 | *) |
---|
6571 | echo "(Assuming you can't see EOF status from read anyway.)" |
---|
6572 | d_eofnblk=$undef |
---|
6573 | ;; |
---|
6574 | esac |
---|
6575 | ;; |
---|
6576 | esac |
---|
6577 | $rm -f try try.* .out core head.c mtry |
---|
6578 | |
---|
6579 | : see if fchmod exists |
---|
6580 | set fchmod d_fchmod |
---|
6581 | eval $inlibc |
---|
6582 | |
---|
6583 | : see if fchown exists |
---|
6584 | set fchown d_fchown |
---|
6585 | eval $inlibc |
---|
6586 | |
---|
6587 | : see if this is an fcntl system |
---|
6588 | set fcntl d_fcntl |
---|
6589 | eval $inlibc |
---|
6590 | |
---|
6591 | : see if fgetpos exists |
---|
6592 | set fgetpos d_fgetpos |
---|
6593 | eval $inlibc |
---|
6594 | |
---|
6595 | : see if flock exists |
---|
6596 | set flock d_flock |
---|
6597 | eval $inlibc |
---|
6598 | |
---|
6599 | : see if fork exists |
---|
6600 | set fork d_fork |
---|
6601 | eval $inlibc |
---|
6602 | |
---|
6603 | : see if pathconf exists |
---|
6604 | set pathconf d_pathconf |
---|
6605 | eval $inlibc |
---|
6606 | |
---|
6607 | : see if fpathconf exists |
---|
6608 | set fpathconf d_fpathconf |
---|
6609 | eval $inlibc |
---|
6610 | |
---|
6611 | : see if fsetpos exists |
---|
6612 | set fsetpos d_fsetpos |
---|
6613 | eval $inlibc |
---|
6614 | |
---|
6615 | : see if gethostent exists |
---|
6616 | set gethostent d_gethent |
---|
6617 | eval $inlibc |
---|
6618 | |
---|
6619 | : see if getlogin exists |
---|
6620 | set getlogin d_getlogin |
---|
6621 | eval $inlibc |
---|
6622 | |
---|
6623 | : see if getpgid exists |
---|
6624 | set getpgid d_getpgid |
---|
6625 | eval $inlibc |
---|
6626 | |
---|
6627 | : see if getpgrp2 exists |
---|
6628 | set getpgrp2 d_getpgrp2 |
---|
6629 | eval $inlibc |
---|
6630 | |
---|
6631 | : see if getppid exists |
---|
6632 | set getppid d_getppid |
---|
6633 | eval $inlibc |
---|
6634 | |
---|
6635 | : see if getpriority exists |
---|
6636 | set getpriority d_getprior |
---|
6637 | eval $inlibc |
---|
6638 | |
---|
6639 | : see if gettimeofday or ftime exists |
---|
6640 | set gettimeofday d_gettimeod |
---|
6641 | eval $inlibc |
---|
6642 | case "$d_gettimeod" in |
---|
6643 | "$undef") |
---|
6644 | set ftime d_ftime |
---|
6645 | eval $inlibc |
---|
6646 | ;; |
---|
6647 | *) |
---|
6648 | val="$undef"; set d_ftime; eval $setvar |
---|
6649 | ;; |
---|
6650 | esac |
---|
6651 | case "$d_gettimeod$d_ftime" in |
---|
6652 | "$undef$undef") |
---|
6653 | echo " " |
---|
6654 | echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 |
---|
6655 | ;; |
---|
6656 | esac |
---|
6657 | |
---|
6658 | : see if this is a netinet/in.h or sys/in.h system |
---|
6659 | set netinet/in.h i_niin sys/in.h i_sysin |
---|
6660 | eval $inhdr |
---|
6661 | |
---|
6662 | : see if htonl --and friends-- exists |
---|
6663 | val='' |
---|
6664 | set htonl val |
---|
6665 | eval $inlibc |
---|
6666 | |
---|
6667 | : Maybe they are macros. |
---|
6668 | case "$val" in |
---|
6669 | $undef) |
---|
6670 | $cat >htonl.c <<EOM |
---|
6671 | #include <stdio.h> |
---|
6672 | #include <sys/types.h> |
---|
6673 | #$i_niin I_NETINET_IN |
---|
6674 | #$i_sysin I_SYS_IN |
---|
6675 | #ifdef I_NETINET_IN |
---|
6676 | #include <netinet/in.h> |
---|
6677 | #endif |
---|
6678 | #ifdef I_SYS_IN |
---|
6679 | #include <sys/in.h> |
---|
6680 | #endif |
---|
6681 | #ifdef htonl |
---|
6682 | printf("Defined as a macro."); |
---|
6683 | #endif |
---|
6684 | EOM |
---|
6685 | $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null |
---|
6686 | if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then |
---|
6687 | val="$define" |
---|
6688 | echo "But it seems to be defined as a macro." >&4 |
---|
6689 | fi |
---|
6690 | $rm -f htonl.? |
---|
6691 | ;; |
---|
6692 | esac |
---|
6693 | set d_htonl |
---|
6694 | eval $setvar |
---|
6695 | |
---|
6696 | : see which of string.h or strings.h is needed |
---|
6697 | echo " " |
---|
6698 | strings=`./findhdr string.h` |
---|
6699 | if $test "$strings" && $test -r "$strings"; then |
---|
6700 | echo "Using <string.h> instead of <strings.h>." >&4 |
---|
6701 | val="$define" |
---|
6702 | else |
---|
6703 | val="$undef" |
---|
6704 | strings=`./findhdr strings.h` |
---|
6705 | if $test "$strings" && $test -r "$strings"; then |
---|
6706 | echo "Using <strings.h> instead of <string.h>." >&4 |
---|
6707 | else |
---|
6708 | echo "No string header found -- You'll surely have problems." >&4 |
---|
6709 | fi |
---|
6710 | fi |
---|
6711 | set i_string |
---|
6712 | eval $setvar |
---|
6713 | case "$i_string" in |
---|
6714 | "$undef") strings=`./findhdr strings.h`;; |
---|
6715 | *) strings=`./findhdr string.h`;; |
---|
6716 | esac |
---|
6717 | |
---|
6718 | : index or strchr |
---|
6719 | echo " " |
---|
6720 | if set index val -f; eval $csym; $val; then |
---|
6721 | if set strchr val -f d_strchr; eval $csym; $val; then |
---|
6722 | if $contains strchr "$strings" >/dev/null 2>&1 ; then |
---|
6723 | val="$define" |
---|
6724 | vali="$undef" |
---|
6725 | echo "strchr() found." >&4 |
---|
6726 | else |
---|
6727 | val="$undef" |
---|
6728 | vali="$define" |
---|
6729 | echo "index() found." >&4 |
---|
6730 | fi |
---|
6731 | else |
---|
6732 | val="$undef" |
---|
6733 | vali="$define" |
---|
6734 | echo "index() found." >&4 |
---|
6735 | fi |
---|
6736 | else |
---|
6737 | if set strchr val -f d_strchr; eval $csym; $val; then |
---|
6738 | val="$define" |
---|
6739 | vali="$undef" |
---|
6740 | echo "strchr() found." >&4 |
---|
6741 | else |
---|
6742 | echo "No index() or strchr() found!" >&4 |
---|
6743 | val="$undef" |
---|
6744 | vali="$undef" |
---|
6745 | fi |
---|
6746 | fi |
---|
6747 | set d_strchr; eval $setvar |
---|
6748 | val="$vali" |
---|
6749 | set d_index; eval $setvar |
---|
6750 | |
---|
6751 | : check whether inet_aton exists |
---|
6752 | set inet_aton d_inetaton |
---|
6753 | eval $inlibc |
---|
6754 | |
---|
6755 | : Look for isascii |
---|
6756 | echo " " |
---|
6757 | $cat >isascii.c <<'EOCP' |
---|
6758 | #include <stdio.h> |
---|
6759 | #include <ctype.h> |
---|
6760 | main() { |
---|
6761 | int c = 'A'; |
---|
6762 | if (isascii(c)) |
---|
6763 | exit(0); |
---|
6764 | else |
---|
6765 | exit(1); |
---|
6766 | } |
---|
6767 | EOCP |
---|
6768 | if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then |
---|
6769 | echo "isascii() found." >&4 |
---|
6770 | val="$define" |
---|
6771 | else |
---|
6772 | echo "isascii() NOT found." >&4 |
---|
6773 | val="$undef" |
---|
6774 | fi |
---|
6775 | set d_isascii |
---|
6776 | eval $setvar |
---|
6777 | $rm -f isascii* |
---|
6778 | |
---|
6779 | : see if killpg exists |
---|
6780 | set killpg d_killpg |
---|
6781 | eval $inlibc |
---|
6782 | |
---|
6783 | : see if link exists |
---|
6784 | set link d_link |
---|
6785 | eval $inlibc |
---|
6786 | |
---|
6787 | : see if localeconv exists |
---|
6788 | set localeconv d_locconv |
---|
6789 | eval $inlibc |
---|
6790 | |
---|
6791 | : see if lockf exists |
---|
6792 | set lockf d_lockf |
---|
6793 | eval $inlibc |
---|
6794 | |
---|
6795 | : see if lstat exists |
---|
6796 | set lstat d_lstat |
---|
6797 | eval $inlibc |
---|
6798 | |
---|
6799 | : see if mblen exists |
---|
6800 | set mblen d_mblen |
---|
6801 | eval $inlibc |
---|
6802 | |
---|
6803 | : see if mbstowcs exists |
---|
6804 | set mbstowcs d_mbstowcs |
---|
6805 | eval $inlibc |
---|
6806 | |
---|
6807 | : see if mbtowc exists |
---|
6808 | set mbtowc d_mbtowc |
---|
6809 | eval $inlibc |
---|
6810 | |
---|
6811 | : see if memcmp exists |
---|
6812 | set memcmp d_memcmp |
---|
6813 | eval $inlibc |
---|
6814 | |
---|
6815 | : see if memcpy exists |
---|
6816 | set memcpy d_memcpy |
---|
6817 | eval $inlibc |
---|
6818 | |
---|
6819 | : see if memmove exists |
---|
6820 | set memmove d_memmove |
---|
6821 | eval $inlibc |
---|
6822 | |
---|
6823 | : see if memset exists |
---|
6824 | set memset d_memset |
---|
6825 | eval $inlibc |
---|
6826 | |
---|
6827 | : see if mkdir exists |
---|
6828 | set mkdir d_mkdir |
---|
6829 | eval $inlibc |
---|
6830 | |
---|
6831 | : see if mkfifo exists |
---|
6832 | set mkfifo d_mkfifo |
---|
6833 | eval $inlibc |
---|
6834 | |
---|
6835 | : see if mktime exists |
---|
6836 | set mktime d_mktime |
---|
6837 | eval $inlibc |
---|
6838 | |
---|
6839 | : see if msgctl exists |
---|
6840 | set msgctl d_msgctl |
---|
6841 | eval $inlibc |
---|
6842 | |
---|
6843 | : see if msgget exists |
---|
6844 | set msgget d_msgget |
---|
6845 | eval $inlibc |
---|
6846 | |
---|
6847 | : see if msgsnd exists |
---|
6848 | set msgsnd d_msgsnd |
---|
6849 | eval $inlibc |
---|
6850 | |
---|
6851 | : see if msgrcv exists |
---|
6852 | set msgrcv d_msgrcv |
---|
6853 | eval $inlibc |
---|
6854 | |
---|
6855 | : see how much of the 'msg*(2)' library is present. |
---|
6856 | h_msg=true |
---|
6857 | echo " " |
---|
6858 | case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in |
---|
6859 | *"$undef"*) h_msg=false;; |
---|
6860 | esac |
---|
6861 | : we could also check for sys/ipc.h ... |
---|
6862 | if $h_msg && $test `./findhdr sys/msg.h`; then |
---|
6863 | echo "You have the full msg*(2) library." >&4 |
---|
6864 | val="$define" |
---|
6865 | else |
---|
6866 | echo "You don't have the full msg*(2) library." >&4 |
---|
6867 | val="$undef" |
---|
6868 | fi |
---|
6869 | set d_msg |
---|
6870 | eval $setvar |
---|
6871 | |
---|
6872 | : see if this is a malloc.h system |
---|
6873 | set malloc.h i_malloc |
---|
6874 | eval $inhdr |
---|
6875 | |
---|
6876 | : see if stdlib is available |
---|
6877 | set stdlib.h i_stdlib |
---|
6878 | eval $inhdr |
---|
6879 | |
---|
6880 | : determine which malloc to compile in |
---|
6881 | echo " " |
---|
6882 | case "$usemymalloc" in |
---|
6883 | ''|y*|true) dflt='y' ;; |
---|
6884 | n*|false) dflt='n' ;; |
---|
6885 | *) dflt="$usemymalloc" ;; |
---|
6886 | esac |
---|
6887 | rp="Do you wish to attempt to use the malloc that comes with $package?" |
---|
6888 | . ./myread |
---|
6889 | usemymalloc="$ans" |
---|
6890 | case "$ans" in |
---|
6891 | y*|true) |
---|
6892 | usemymalloc='y' |
---|
6893 | mallocsrc='malloc.c' |
---|
6894 | mallocobj='malloc.o' |
---|
6895 | d_mymalloc="$define" |
---|
6896 | case "$libs" in |
---|
6897 | *-lmalloc*) |
---|
6898 | : Remove malloc from list of libraries to use |
---|
6899 | echo "Removing unneeded -lmalloc from library list" >&4 |
---|
6900 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` |
---|
6901 | shift |
---|
6902 | libs="$*" |
---|
6903 | echo "libs = $libs" >&4 |
---|
6904 | ;; |
---|
6905 | esac |
---|
6906 | ;; |
---|
6907 | *) |
---|
6908 | usemymalloc='n' |
---|
6909 | mallocsrc='' |
---|
6910 | mallocobj='' |
---|
6911 | d_mymalloc="$undef" |
---|
6912 | ;; |
---|
6913 | esac |
---|
6914 | |
---|
6915 | : compute the return types of malloc and free |
---|
6916 | echo " " |
---|
6917 | $cat >malloc.c <<END |
---|
6918 | #$i_malloc I_MALLOC |
---|
6919 | #$i_stdlib I_STDLIB |
---|
6920 | #include <stdio.h> |
---|
6921 | #include <sys/types.h> |
---|
6922 | #ifdef I_MALLOC |
---|
6923 | #include <malloc.h> |
---|
6924 | #endif |
---|
6925 | #ifdef I_STDLIB |
---|
6926 | #include <stdlib.h> |
---|
6927 | #endif |
---|
6928 | #ifdef TRY_MALLOC |
---|
6929 | void *malloc(); |
---|
6930 | #endif |
---|
6931 | #ifdef TRY_FREE |
---|
6932 | void free(); |
---|
6933 | #endif |
---|
6934 | END |
---|
6935 | case "$malloctype" in |
---|
6936 | '') |
---|
6937 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then |
---|
6938 | malloctype='void *' |
---|
6939 | else |
---|
6940 | malloctype='char *' |
---|
6941 | fi |
---|
6942 | ;; |
---|
6943 | esac |
---|
6944 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 |
---|
6945 | |
---|
6946 | case "$freetype" in |
---|
6947 | '') |
---|
6948 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then |
---|
6949 | freetype='void' |
---|
6950 | else |
---|
6951 | freetype='int' |
---|
6952 | fi |
---|
6953 | ;; |
---|
6954 | esac |
---|
6955 | echo "Your system uses $freetype free(), it would seem." >&4 |
---|
6956 | $rm -f malloc.[co] |
---|
6957 | : see if nice exists |
---|
6958 | set nice d_nice |
---|
6959 | eval $inlibc |
---|
6960 | |
---|
6961 | : see if pause exists |
---|
6962 | set pause d_pause |
---|
6963 | eval $inlibc |
---|
6964 | |
---|
6965 | : see if pipe exists |
---|
6966 | set pipe d_pipe |
---|
6967 | eval $inlibc |
---|
6968 | |
---|
6969 | : see if poll exists |
---|
6970 | set poll d_poll |
---|
6971 | eval $inlibc |
---|
6972 | |
---|
6973 | : see if this is a pwd.h system |
---|
6974 | set pwd.h i_pwd |
---|
6975 | eval $inhdr |
---|
6976 | |
---|
6977 | case "$i_pwd" in |
---|
6978 | $define) |
---|
6979 | xxx=`./findhdr pwd.h` |
---|
6980 | $cppstdin $cppflags $cppminus < $xxx >$$.h |
---|
6981 | |
---|
6982 | if $contains 'pw_quota' $$.h >/dev/null 2>&1; then |
---|
6983 | val="$define" |
---|
6984 | else |
---|
6985 | val="$undef" |
---|
6986 | fi |
---|
6987 | set d_pwquota |
---|
6988 | eval $setvar |
---|
6989 | |
---|
6990 | if $contains 'pw_age' $$.h >/dev/null 2>&1; then |
---|
6991 | val="$define" |
---|
6992 | else |
---|
6993 | val="$undef" |
---|
6994 | fi |
---|
6995 | set d_pwage |
---|
6996 | eval $setvar |
---|
6997 | |
---|
6998 | if $contains 'pw_change' $$.h >/dev/null 2>&1; then |
---|
6999 | val="$define" |
---|
7000 | else |
---|
7001 | val="$undef" |
---|
7002 | fi |
---|
7003 | set d_pwchange |
---|
7004 | eval $setvar |
---|
7005 | |
---|
7006 | if $contains 'pw_class' $$.h >/dev/null 2>&1; then |
---|
7007 | val="$define" |
---|
7008 | else |
---|
7009 | val="$undef" |
---|
7010 | fi |
---|
7011 | set d_pwclass |
---|
7012 | eval $setvar |
---|
7013 | |
---|
7014 | if $contains 'pw_expire' $$.h >/dev/null 2>&1; then |
---|
7015 | val="$define" |
---|
7016 | else |
---|
7017 | val="$undef" |
---|
7018 | fi |
---|
7019 | set d_pwexpire |
---|
7020 | eval $setvar |
---|
7021 | |
---|
7022 | if $contains 'pw_comment' $$.h >/dev/null 2>&1; then |
---|
7023 | val="$define" |
---|
7024 | else |
---|
7025 | val="$undef" |
---|
7026 | fi |
---|
7027 | set d_pwcomment |
---|
7028 | eval $setvar |
---|
7029 | |
---|
7030 | $rm -f $$.h |
---|
7031 | ;; |
---|
7032 | *) |
---|
7033 | val="$undef"; |
---|
7034 | set d_pwquota; eval $setvar |
---|
7035 | set d_pwage; eval $setvar |
---|
7036 | set d_pwchange; eval $setvar |
---|
7037 | set d_pwclass; eval $setvar |
---|
7038 | set d_pwexpire; eval $setvar |
---|
7039 | set d_pwcomment; eval $setvar |
---|
7040 | ;; |
---|
7041 | esac |
---|
7042 | |
---|
7043 | : see if readdir and friends exist |
---|
7044 | set readdir d_readdir |
---|
7045 | eval $inlibc |
---|
7046 | set seekdir d_seekdir |
---|
7047 | eval $inlibc |
---|
7048 | set telldir d_telldir |
---|
7049 | eval $inlibc |
---|
7050 | set rewinddir d_rewinddir |
---|
7051 | eval $inlibc |
---|
7052 | |
---|
7053 | : see if readlink exists |
---|
7054 | set readlink d_readlink |
---|
7055 | eval $inlibc |
---|
7056 | |
---|
7057 | : see if rename exists |
---|
7058 | set rename d_rename |
---|
7059 | eval $inlibc |
---|
7060 | |
---|
7061 | : see if rmdir exists |
---|
7062 | set rmdir d_rmdir |
---|
7063 | eval $inlibc |
---|
7064 | |
---|
7065 | : see if memory.h is available. |
---|
7066 | val='' |
---|
7067 | set memory.h val |
---|
7068 | eval $inhdr |
---|
7069 | |
---|
7070 | : See if it conflicts with string.h |
---|
7071 | case "$val" in |
---|
7072 | $define) |
---|
7073 | case "$strings" in |
---|
7074 | '') ;; |
---|
7075 | *) |
---|
7076 | $cppstdin $cppflags $cppminus < $strings > mem.h |
---|
7077 | if $contains 'memcpy' mem.h >/dev/null 2>&1; then |
---|
7078 | echo " " |
---|
7079 | echo "We won't be including <memory.h>." |
---|
7080 | val="$undef" |
---|
7081 | fi |
---|
7082 | $rm -f mem.h |
---|
7083 | ;; |
---|
7084 | esac |
---|
7085 | esac |
---|
7086 | set i_memory |
---|
7087 | eval $setvar |
---|
7088 | |
---|
7089 | : can bcopy handle overlapping blocks? |
---|
7090 | val="$undef" |
---|
7091 | case "$d_bcopy" in |
---|
7092 | "$define") |
---|
7093 | echo " " |
---|
7094 | echo "Checking to see if your bcopy() can do overlapping copies..." >&4 |
---|
7095 | $cat >foo.c <<EOCP |
---|
7096 | #$i_memory I_MEMORY |
---|
7097 | #$i_stdlib I_STDLIB |
---|
7098 | #$i_string I_STRING |
---|
7099 | #$i_unistd I_UNISTD |
---|
7100 | EOCP |
---|
7101 | $cat >>foo.c <<'EOCP' |
---|
7102 | #include <stdio.h> |
---|
7103 | |
---|
7104 | #ifdef I_MEMORY |
---|
7105 | # include <memory.h> |
---|
7106 | #endif |
---|
7107 | #ifdef I_STDLIB |
---|
7108 | # include <stdlib.h> |
---|
7109 | #endif |
---|
7110 | #ifdef I_STRING |
---|
7111 | # include <string.h> |
---|
7112 | #else |
---|
7113 | # include <strings.h> |
---|
7114 | #endif |
---|
7115 | #ifdef I_UNISTD |
---|
7116 | # include <unistd.h> /* Needed for NetBSD */ |
---|
7117 | #endif |
---|
7118 | main() |
---|
7119 | { |
---|
7120 | char buf[128], abc[128]; |
---|
7121 | char *b; |
---|
7122 | int len; |
---|
7123 | int off; |
---|
7124 | int align; |
---|
7125 | |
---|
7126 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
---|
7127 | try to store the string in read-only memory. */ |
---|
7128 | bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36); |
---|
7129 | |
---|
7130 | for (align = 7; align >= 0; align--) { |
---|
7131 | for (len = 36; len; len--) { |
---|
7132 | b = buf+align; |
---|
7133 | bcopy(abc, b, len); |
---|
7134 | for (off = 1; off <= len; off++) { |
---|
7135 | bcopy(b, b+off, len); |
---|
7136 | bcopy(b+off, b, len); |
---|
7137 | if (bcmp(b, abc, len)) |
---|
7138 | exit(1); |
---|
7139 | } |
---|
7140 | } |
---|
7141 | } |
---|
7142 | exit(0); |
---|
7143 | } |
---|
7144 | EOCP |
---|
7145 | if $cc $optimize $ccflags $ldflags foo.c \ |
---|
7146 | -o safebcpy $libs >/dev/null 2>&1; then |
---|
7147 | if ./safebcpy 2>/dev/null; then |
---|
7148 | echo "Yes, it can." |
---|
7149 | val="$define" |
---|
7150 | else |
---|
7151 | echo "It can't, sorry." |
---|
7152 | case "$d_memmove" in |
---|
7153 | "$define") echo "But that's Ok since you have memmove()." ;; |
---|
7154 | esac |
---|
7155 | fi |
---|
7156 | else |
---|
7157 | echo "(I can't compile the test program, so we'll assume not...)" |
---|
7158 | case "$d_memmove" in |
---|
7159 | "$define") echo "But that's Ok since you have memmove()." ;; |
---|
7160 | esac |
---|
7161 | fi |
---|
7162 | ;; |
---|
7163 | esac |
---|
7164 | $rm -f foo.* safebcpy core |
---|
7165 | set d_safebcpy |
---|
7166 | eval $setvar |
---|
7167 | |
---|
7168 | : can memcpy handle overlapping blocks? |
---|
7169 | val="$undef" |
---|
7170 | case "$d_memcpy" in |
---|
7171 | "$define") |
---|
7172 | echo " " |
---|
7173 | echo "Checking to see if your memcpy() can do overlapping copies..." >&4 |
---|
7174 | $cat >foo.c <<EOCP |
---|
7175 | #$i_memory I_MEMORY |
---|
7176 | #$i_stdlib I_STDLIB |
---|
7177 | #$i_string I_STRING |
---|
7178 | #$i_unistd I_UNISTD |
---|
7179 | EOCP |
---|
7180 | $cat >>foo.c <<'EOCP' |
---|
7181 | #include <stdio.h> |
---|
7182 | |
---|
7183 | #ifdef I_MEMORY |
---|
7184 | # include <memory.h> |
---|
7185 | #endif |
---|
7186 | #ifdef I_STDLIB |
---|
7187 | # include <stdlib.h> |
---|
7188 | #endif |
---|
7189 | #ifdef I_STRING |
---|
7190 | # include <string.h> |
---|
7191 | #else |
---|
7192 | # include <strings.h> |
---|
7193 | #endif |
---|
7194 | #ifdef I_UNISTD |
---|
7195 | # include <unistd.h> /* Needed for NetBSD */ |
---|
7196 | #endif |
---|
7197 | main() |
---|
7198 | { |
---|
7199 | char buf[128], abc[128]; |
---|
7200 | char *b; |
---|
7201 | int len; |
---|
7202 | int off; |
---|
7203 | int align; |
---|
7204 | |
---|
7205 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
---|
7206 | try to store the string in read-only memory. */ |
---|
7207 | memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36); |
---|
7208 | |
---|
7209 | for (align = 7; align >= 0; align--) { |
---|
7210 | for (len = 36; len; len--) { |
---|
7211 | b = buf+align; |
---|
7212 | memcpy(b, abc, len); |
---|
7213 | for (off = 1; off <= len; off++) { |
---|
7214 | memcpy(b+off, b, len); |
---|
7215 | memcpy(b, b+off, len); |
---|
7216 | if (memcmp(b, abc, len)) |
---|
7217 | exit(1); |
---|
7218 | } |
---|
7219 | } |
---|
7220 | } |
---|
7221 | exit(0); |
---|
7222 | } |
---|
7223 | EOCP |
---|
7224 | if $cc $optimize $ccflags $ldflags foo.c \ |
---|
7225 | -o safemcpy $libs >/dev/null 2>&1; then |
---|
7226 | if ./safemcpy 2>/dev/null; then |
---|
7227 | echo "Yes, it can." |
---|
7228 | val="$define" |
---|
7229 | else |
---|
7230 | echo "It can't, sorry." |
---|
7231 | case "$d_memmove" in |
---|
7232 | "$define") echo "But that's Ok since you have memmove()." ;; |
---|
7233 | esac |
---|
7234 | fi |
---|
7235 | else |
---|
7236 | echo "(I can't compile the test program, so we'll assume not...)" |
---|
7237 | case "$d_memmove" in |
---|
7238 | "$define") echo "But that's Ok since you have memmove()." ;; |
---|
7239 | esac |
---|
7240 | fi |
---|
7241 | ;; |
---|
7242 | esac |
---|
7243 | $rm -f foo.* safemcpy core |
---|
7244 | set d_safemcpy |
---|
7245 | eval $setvar |
---|
7246 | |
---|
7247 | : can memcmp be trusted to compare relative magnitude? |
---|
7248 | val="$undef" |
---|
7249 | case "$d_memcmp" in |
---|
7250 | "$define") |
---|
7251 | echo " " |
---|
7252 | echo "Checking to see if your memcmp() can compare relative magnitude..." >&4 |
---|
7253 | $cat >foo.c <<EOCP |
---|
7254 | #$i_memory I_MEMORY |
---|
7255 | #$i_stdlib I_STDLIB |
---|
7256 | #$i_string I_STRING |
---|
7257 | #$i_unistd I_UNISTD |
---|
7258 | EOCP |
---|
7259 | $cat >>foo.c <<'EOCP' |
---|
7260 | #include <stdio.h> |
---|
7261 | |
---|
7262 | #ifdef I_MEMORY |
---|
7263 | # include <memory.h> |
---|
7264 | #endif |
---|
7265 | #ifdef I_STDLIB |
---|
7266 | # include <stdlib.h> |
---|
7267 | #endif |
---|
7268 | #ifdef I_STRING |
---|
7269 | # include <string.h> |
---|
7270 | #else |
---|
7271 | # include <strings.h> |
---|
7272 | #endif |
---|
7273 | #ifdef I_UNISTD |
---|
7274 | # include <unistd.h> /* Needed for NetBSD */ |
---|
7275 | #endif |
---|
7276 | main() |
---|
7277 | { |
---|
7278 | char a = -1; |
---|
7279 | char b = 0; |
---|
7280 | if ((a < b) && memcmp(&a, &b, 1) < 0) |
---|
7281 | exit(1); |
---|
7282 | exit(0); |
---|
7283 | } |
---|
7284 | EOCP |
---|
7285 | if $cc $optimize $ccflags $ldflags foo.c \ |
---|
7286 | -o sanemcmp $libs >/dev/null 2>&1; then |
---|
7287 | if ./sanemcmp 2>/dev/null; then |
---|
7288 | echo "Yes, it can." |
---|
7289 | val="$define" |
---|
7290 | else |
---|
7291 | echo "No, it can't (it uses signed chars)." |
---|
7292 | fi |
---|
7293 | else |
---|
7294 | echo "(I can't compile the test program, so we'll assume not...)" |
---|
7295 | fi |
---|
7296 | ;; |
---|
7297 | esac |
---|
7298 | $rm -f foo.* sanemcmp core |
---|
7299 | set d_sanemcmp |
---|
7300 | eval $setvar |
---|
7301 | |
---|
7302 | : see if select exists |
---|
7303 | set select d_select |
---|
7304 | eval $inlibc |
---|
7305 | |
---|
7306 | : see if semctl exists |
---|
7307 | set semctl d_semctl |
---|
7308 | eval $inlibc |
---|
7309 | |
---|
7310 | : see if semget exists |
---|
7311 | set semget d_semget |
---|
7312 | eval $inlibc |
---|
7313 | |
---|
7314 | : see if semop exists |
---|
7315 | set semop d_semop |
---|
7316 | eval $inlibc |
---|
7317 | |
---|
7318 | : see how much of the 'sem*(2)' library is present. |
---|
7319 | h_sem=true |
---|
7320 | echo " " |
---|
7321 | case "$d_semctl$d_semget$d_semop" in |
---|
7322 | *"$undef"*) h_sem=false;; |
---|
7323 | esac |
---|
7324 | : we could also check for sys/ipc.h ... |
---|
7325 | if $h_sem && $test `./findhdr sys/sem.h`; then |
---|
7326 | echo "You have the full sem*(2) library." >&4 |
---|
7327 | val="$define" |
---|
7328 | else |
---|
7329 | echo "You don't have the full sem*(2) library." >&4 |
---|
7330 | val="$undef" |
---|
7331 | fi |
---|
7332 | set d_sem |
---|
7333 | eval $setvar |
---|
7334 | |
---|
7335 | : see if setegid exists |
---|
7336 | set setegid d_setegid |
---|
7337 | eval $inlibc |
---|
7338 | |
---|
7339 | : see if seteuid exists |
---|
7340 | set seteuid d_seteuid |
---|
7341 | eval $inlibc |
---|
7342 | |
---|
7343 | : see if setlinebuf exists |
---|
7344 | set setlinebuf d_setlinebuf |
---|
7345 | eval $inlibc |
---|
7346 | |
---|
7347 | : see if setlocale exists |
---|
7348 | set setlocale d_setlocale |
---|
7349 | eval $inlibc |
---|
7350 | |
---|
7351 | : see if setpgid exists |
---|
7352 | set setpgid d_setpgid |
---|
7353 | eval $inlibc |
---|
7354 | |
---|
7355 | : see if setpgrp2 exists |
---|
7356 | set setpgrp2 d_setpgrp2 |
---|
7357 | eval $inlibc |
---|
7358 | |
---|
7359 | : see if setpriority exists |
---|
7360 | set setpriority d_setprior |
---|
7361 | eval $inlibc |
---|
7362 | |
---|
7363 | : see if setregid exists |
---|
7364 | set setregid d_setregid |
---|
7365 | eval $inlibc |
---|
7366 | set setresgid d_setresgid |
---|
7367 | eval $inlibc |
---|
7368 | |
---|
7369 | : see if setreuid exists |
---|
7370 | set setreuid d_setreuid |
---|
7371 | eval $inlibc |
---|
7372 | set setresuid d_setresuid |
---|
7373 | eval $inlibc |
---|
7374 | |
---|
7375 | : see if setrgid exists |
---|
7376 | set setrgid d_setrgid |
---|
7377 | eval $inlibc |
---|
7378 | |
---|
7379 | : see if setruid exists |
---|
7380 | set setruid d_setruid |
---|
7381 | eval $inlibc |
---|
7382 | |
---|
7383 | : see if setsid exists |
---|
7384 | set setsid d_setsid |
---|
7385 | eval $inlibc |
---|
7386 | |
---|
7387 | : see if sfio.h is available |
---|
7388 | set sfio.h i_sfio |
---|
7389 | eval $inhdr |
---|
7390 | |
---|
7391 | |
---|
7392 | : see if sfio library is available |
---|
7393 | case "$i_sfio" in |
---|
7394 | $define) |
---|
7395 | val='' |
---|
7396 | set sfreserve val |
---|
7397 | eval $inlibc |
---|
7398 | ;; |
---|
7399 | *) |
---|
7400 | val="$undef" |
---|
7401 | ;; |
---|
7402 | esac |
---|
7403 | : Ok, but do we want to use it. |
---|
7404 | case "$val" in |
---|
7405 | $define) |
---|
7406 | case "$usesfio" in |
---|
7407 | true|$define|[yY]*) dflt='y';; |
---|
7408 | *) dflt='n';; |
---|
7409 | esac |
---|
7410 | echo "$package can use the sfio library, but it is experimental." |
---|
7411 | rp="You seem to have sfio available, do you want to try using it?" |
---|
7412 | . ./myread |
---|
7413 | case "$ans" in |
---|
7414 | y|Y) ;; |
---|
7415 | *) echo "Ok, avoiding sfio this time. I'll use stdio instead." |
---|
7416 | val="$undef" |
---|
7417 | : Remove sfio from list of libraries to use |
---|
7418 | set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` |
---|
7419 | shift |
---|
7420 | libs="$*" |
---|
7421 | echo "libs = $libs" >&4 |
---|
7422 | ;; |
---|
7423 | esac |
---|
7424 | ;; |
---|
7425 | *) case "$usesfio" in |
---|
7426 | true|$define|[yY]*) |
---|
7427 | echo "Sorry, cannot find sfio on this machine" >&4 |
---|
7428 | echo "Ignoring your setting of usesfio=$usesfio" >&4 |
---|
7429 | ;; |
---|
7430 | esac |
---|
7431 | ;; |
---|
7432 | esac |
---|
7433 | set d_sfio |
---|
7434 | eval $setvar |
---|
7435 | case "$d_sfio" in |
---|
7436 | $define) usesfio='true';; |
---|
7437 | *) usesfio='false';; |
---|
7438 | esac |
---|
7439 | |
---|
7440 | : see if shmctl exists |
---|
7441 | set shmctl d_shmctl |
---|
7442 | eval $inlibc |
---|
7443 | |
---|
7444 | : see if shmget exists |
---|
7445 | set shmget d_shmget |
---|
7446 | eval $inlibc |
---|
7447 | |
---|
7448 | : see if shmat exists |
---|
7449 | set shmat d_shmat |
---|
7450 | eval $inlibc |
---|
7451 | : see what shmat returns |
---|
7452 | case "$d_shmat" in |
---|
7453 | "$define") |
---|
7454 | $cat >shmat.c <<'END' |
---|
7455 | #include <sys/shm.h> |
---|
7456 | void *shmat(); |
---|
7457 | END |
---|
7458 | if $cc $ccflags -c shmat.c >/dev/null 2>&1; then |
---|
7459 | shmattype='void *' |
---|
7460 | else |
---|
7461 | shmattype='char *' |
---|
7462 | fi |
---|
7463 | echo "and it returns ($shmattype)." >&4 |
---|
7464 | : see if a prototype for shmat is available |
---|
7465 | xxx=`./findhdr sys/shm.h` |
---|
7466 | $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null |
---|
7467 | if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then |
---|
7468 | val="$define" |
---|
7469 | else |
---|
7470 | val="$undef" |
---|
7471 | fi |
---|
7472 | $rm -f shmat.[co] |
---|
7473 | ;; |
---|
7474 | *) |
---|
7475 | val="$undef" |
---|
7476 | ;; |
---|
7477 | esac |
---|
7478 | set d_shmatprototype |
---|
7479 | eval $setvar |
---|
7480 | |
---|
7481 | : see if shmdt exists |
---|
7482 | set shmdt d_shmdt |
---|
7483 | eval $inlibc |
---|
7484 | |
---|
7485 | : see how much of the 'shm*(2)' library is present. |
---|
7486 | h_shm=true |
---|
7487 | echo " " |
---|
7488 | case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in |
---|
7489 | *"$undef"*) h_shm=false;; |
---|
7490 | esac |
---|
7491 | : we could also check for sys/ipc.h ... |
---|
7492 | if $h_shm && $test `./findhdr sys/shm.h`; then |
---|
7493 | echo "You have the full shm*(2) library." >&4 |
---|
7494 | val="$define" |
---|
7495 | else |
---|
7496 | echo "You don't have the full shm*(2) library." >&4 |
---|
7497 | val="$undef" |
---|
7498 | fi |
---|
7499 | set d_shm |
---|
7500 | eval $setvar |
---|
7501 | |
---|
7502 | echo " " |
---|
7503 | : see if we have sigaction |
---|
7504 | if set sigaction val -f d_sigaction; eval $csym; $val; then |
---|
7505 | echo 'sigaction() found.' >&4 |
---|
7506 | val="$define" |
---|
7507 | else |
---|
7508 | echo 'sigaction NOT found.' >&4 |
---|
7509 | val="$undef" |
---|
7510 | fi |
---|
7511 | |
---|
7512 | $cat > set.c <<'EOP' |
---|
7513 | /* Solaris 2.5_x86 with SunWorks Pro C 3.0.1 doesn't have a complete |
---|
7514 | sigaction structure if compiled with cc -Xc. This compile test |
---|
7515 | will fail then. <doughera@lafcol.lafayette.edu> |
---|
7516 | */ |
---|
7517 | #include <stdio.h> |
---|
7518 | #include <sys/types.h> |
---|
7519 | #include <signal.h> |
---|
7520 | main() |
---|
7521 | { |
---|
7522 | struct sigaction act, oact; |
---|
7523 | } |
---|
7524 | EOP |
---|
7525 | |
---|
7526 | if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then |
---|
7527 | : |
---|
7528 | else |
---|
7529 | echo "But you don't seem to have a useable struct sigaction." >&4 |
---|
7530 | val="$undef" |
---|
7531 | fi |
---|
7532 | set d_sigaction; eval $setvar |
---|
7533 | $rm -f set set.o set.c |
---|
7534 | |
---|
7535 | : see if sigsetjmp exists |
---|
7536 | echo " " |
---|
7537 | case "$d_sigsetjmp" in |
---|
7538 | '') |
---|
7539 | $cat >set.c <<'EOP' |
---|
7540 | #include <setjmp.h> |
---|
7541 | sigjmp_buf env; |
---|
7542 | int set = 1; |
---|
7543 | main() |
---|
7544 | { |
---|
7545 | if (sigsetjmp(env,1)) |
---|
7546 | exit(set); |
---|
7547 | set = 0; |
---|
7548 | siglongjmp(env, 1); |
---|
7549 | exit(1); |
---|
7550 | } |
---|
7551 | EOP |
---|
7552 | if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then |
---|
7553 | if ./set >/dev/null 2>&1; then |
---|
7554 | echo "POSIX sigsetjmp found." >&4 |
---|
7555 | val="$define" |
---|
7556 | else |
---|
7557 | $cat >&4 <<EOM |
---|
7558 | Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!! |
---|
7559 | I'll ignore them. |
---|
7560 | EOM |
---|
7561 | val="$undef" |
---|
7562 | fi |
---|
7563 | else |
---|
7564 | echo "sigsetjmp not found." >&4 |
---|
7565 | val="$undef" |
---|
7566 | fi |
---|
7567 | ;; |
---|
7568 | *) val="$d_sigsetjmp" |
---|
7569 | case "$d_sigsetjmp" in |
---|
7570 | $define) echo "POSIX sigsetjmp found." >&4;; |
---|
7571 | $undef) echo "sigsetjmp not found." >&4;; |
---|
7572 | esac |
---|
7573 | ;; |
---|
7574 | esac |
---|
7575 | set d_sigsetjmp |
---|
7576 | eval $setvar |
---|
7577 | $rm -f set.c set |
---|
7578 | |
---|
7579 | socketlib='' |
---|
7580 | sockethdr='' |
---|
7581 | : see whether socket exists |
---|
7582 | echo " " |
---|
7583 | $echo $n "Hmm... $c" >&4 |
---|
7584 | if set socket val -f d_socket; eval $csym; $val; then |
---|
7585 | echo "Looks like you have Berkeley networking support." >&4 |
---|
7586 | d_socket="$define" |
---|
7587 | if set setsockopt val -f; eval $csym; $val; then |
---|
7588 | d_oldsock="$undef" |
---|
7589 | else |
---|
7590 | echo "...but it uses the old 4.1c interface, rather than 4.2" >&4 |
---|
7591 | d_oldsock="$define" |
---|
7592 | fi |
---|
7593 | else |
---|
7594 | if $contains socklib libc.list >/dev/null 2>&1; then |
---|
7595 | echo "Looks like you have Berkeley networking support." >&4 |
---|
7596 | d_socket="$define" |
---|
7597 | : we will have to assume that it supports the 4.2 BSD interface |
---|
7598 | d_oldsock="$undef" |
---|
7599 | else |
---|
7600 | echo "You don't have Berkeley networking in libc$lib_ext..." >&4 |
---|
7601 | if test -f /usr/lib/libnet$lib_ext; then |
---|
7602 | ( (nm $nm_opt /usr/lib/libnet$lib_ext | eval $nm_extract) || \ |
---|
7603 | ar t /usr/lib/libnet$lib_ext) 2>/dev/null >> libc.list |
---|
7604 | if $contains socket libc.list >/dev/null 2>&1; then |
---|
7605 | echo "...but the Wollongong group seems to have hacked it in." >&4 |
---|
7606 | socketlib="-lnet" |
---|
7607 | sockethdr="-I/usr/netinclude" |
---|
7608 | d_socket="$define" |
---|
7609 | if $contains setsockopt libc.list >/dev/null 2>&1; then |
---|
7610 | d_oldsock="$undef" |
---|
7611 | else |
---|
7612 | echo "...using the old 4.1c interface, rather than 4.2" >&4 |
---|
7613 | d_oldsock="$define" |
---|
7614 | fi |
---|
7615 | else |
---|
7616 | echo "or even in libnet$lib_ext, which is peculiar." >&4 |
---|
7617 | d_socket="$undef" |
---|
7618 | d_oldsock="$undef" |
---|
7619 | fi |
---|
7620 | else |
---|
7621 | echo "or anywhere else I see." >&4 |
---|
7622 | d_socket="$undef" |
---|
7623 | d_oldsock="$undef" |
---|
7624 | fi |
---|
7625 | fi |
---|
7626 | fi |
---|
7627 | |
---|
7628 | : see if socketpair exists |
---|
7629 | set socketpair d_sockpair |
---|
7630 | eval $inlibc |
---|
7631 | |
---|
7632 | : see if stat knows about block sizes |
---|
7633 | echo " " |
---|
7634 | xxx=`./findhdr sys/stat.h` |
---|
7635 | if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then |
---|
7636 | if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then |
---|
7637 | echo "Your stat() knows about block sizes." >&4 |
---|
7638 | val="$define" |
---|
7639 | else |
---|
7640 | echo "Your stat() doesn't know about block sizes." >&4 |
---|
7641 | val="$undef" |
---|
7642 | fi |
---|
7643 | else |
---|
7644 | echo "Your stat() doesn't know about block sizes." >&4 |
---|
7645 | val="$undef" |
---|
7646 | fi |
---|
7647 | set d_statblks |
---|
7648 | eval $setvar |
---|
7649 | |
---|
7650 | : see if _ptr and _cnt from stdio act std |
---|
7651 | echo " " |
---|
7652 | if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then |
---|
7653 | echo "(Looks like you have stdio.h from Linux.)" |
---|
7654 | case "$stdio_ptr" in |
---|
7655 | '') stdio_ptr='((fp)->_IO_read_ptr)' |
---|
7656 | ptr_lval=$define |
---|
7657 | ;; |
---|
7658 | *) ptr_lval=$d_stdio_ptr_lval;; |
---|
7659 | esac |
---|
7660 | case "$stdio_cnt" in |
---|
7661 | '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' |
---|
7662 | cnt_lval=$undef |
---|
7663 | ;; |
---|
7664 | *) cnt_lval=$d_stdio_cnt_lval;; |
---|
7665 | esac |
---|
7666 | case "$stdio_base" in |
---|
7667 | '') stdio_base='((fp)->_IO_read_base)';; |
---|
7668 | esac |
---|
7669 | case "$stdio_bufsiz" in |
---|
7670 | '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; |
---|
7671 | esac |
---|
7672 | else |
---|
7673 | case "$stdio_ptr" in |
---|
7674 | '') stdio_ptr='((fp)->_ptr)' |
---|
7675 | ptr_lval=$define |
---|
7676 | ;; |
---|
7677 | *) ptr_lval=$d_stdio_ptr_lval;; |
---|
7678 | esac |
---|
7679 | case "$stdio_cnt" in |
---|
7680 | '') stdio_cnt='((fp)->_cnt)' |
---|
7681 | cnt_lval=$define |
---|
7682 | ;; |
---|
7683 | *) cnt_lval=$d_stdio_cnt_lval;; |
---|
7684 | esac |
---|
7685 | case "$stdio_base" in |
---|
7686 | '') stdio_base='((fp)->_base)';; |
---|
7687 | esac |
---|
7688 | case "$stdio_bufsiz" in |
---|
7689 | '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; |
---|
7690 | esac |
---|
7691 | fi |
---|
7692 | : test whether _ptr and _cnt really work |
---|
7693 | echo "Checking how std your stdio is..." >&4 |
---|
7694 | $cat >try.c <<EOP |
---|
7695 | #include <stdio.h> |
---|
7696 | #define FILE_ptr(fp) $stdio_ptr |
---|
7697 | #define FILE_cnt(fp) $stdio_cnt |
---|
7698 | main() { |
---|
7699 | FILE *fp = fopen("try.c", "r"); |
---|
7700 | char c = getc(fp); |
---|
7701 | if ( |
---|
7702 | 18 <= FILE_cnt(fp) && |
---|
7703 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 |
---|
7704 | ) |
---|
7705 | exit(0); |
---|
7706 | exit(1); |
---|
7707 | } |
---|
7708 | EOP |
---|
7709 | val="$undef" |
---|
7710 | if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then |
---|
7711 | if ./try; then |
---|
7712 | echo "Your stdio acts pretty std." |
---|
7713 | val="$define" |
---|
7714 | else |
---|
7715 | echo "Your stdio isn't very std." |
---|
7716 | fi |
---|
7717 | else |
---|
7718 | echo "Your stdio doesn't appear very std." |
---|
7719 | fi |
---|
7720 | $rm -f try.c try |
---|
7721 | set d_stdstdio |
---|
7722 | eval $setvar |
---|
7723 | |
---|
7724 | : Can _ptr be used as an lvalue? |
---|
7725 | case "$d_stdstdio$ptr_lval" in |
---|
7726 | $define$define) val=$define ;; |
---|
7727 | *) val=$undef ;; |
---|
7728 | esac |
---|
7729 | set d_stdio_ptr_lval |
---|
7730 | eval $setvar |
---|
7731 | |
---|
7732 | : Can _cnt be used as an lvalue? |
---|
7733 | case "$d_stdstdio$cnt_lval" in |
---|
7734 | $define$define) val=$define ;; |
---|
7735 | *) val=$undef ;; |
---|
7736 | esac |
---|
7737 | set d_stdio_cnt_lval |
---|
7738 | eval $setvar |
---|
7739 | |
---|
7740 | |
---|
7741 | : see if _base is also standard |
---|
7742 | val="$undef" |
---|
7743 | case "$d_stdstdio" in |
---|
7744 | $define) |
---|
7745 | $cat >try.c <<EOP |
---|
7746 | #include <stdio.h> |
---|
7747 | #define FILE_base(fp) $stdio_base |
---|
7748 | #define FILE_bufsiz(fp) $stdio_bufsiz |
---|
7749 | main() { |
---|
7750 | FILE *fp = fopen("try.c", "r"); |
---|
7751 | char c = getc(fp); |
---|
7752 | if ( |
---|
7753 | 19 <= FILE_bufsiz(fp) && |
---|
7754 | strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0 |
---|
7755 | ) |
---|
7756 | exit(0); |
---|
7757 | exit(1); |
---|
7758 | } |
---|
7759 | EOP |
---|
7760 | if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then |
---|
7761 | if ./try; then |
---|
7762 | echo "And its _base field acts std." |
---|
7763 | val="$define" |
---|
7764 | else |
---|
7765 | echo "But its _base field isn't std." |
---|
7766 | fi |
---|
7767 | else |
---|
7768 | echo "However, it seems to be lacking the _base field." |
---|
7769 | fi |
---|
7770 | $rm -f try.c try |
---|
7771 | ;; |
---|
7772 | esac |
---|
7773 | set d_stdiobase |
---|
7774 | eval $setvar |
---|
7775 | |
---|
7776 | : see if strcoll exists |
---|
7777 | set strcoll d_strcoll |
---|
7778 | eval $inlibc |
---|
7779 | |
---|
7780 | : check for structure copying |
---|
7781 | echo " " |
---|
7782 | echo "Checking to see if your C compiler can copy structs..." >&4 |
---|
7783 | $cat >try.c <<'EOCP' |
---|
7784 | main() |
---|
7785 | { |
---|
7786 | struct blurfl { |
---|
7787 | int dyick; |
---|
7788 | } foo, bar; |
---|
7789 | |
---|
7790 | foo = bar; |
---|
7791 | } |
---|
7792 | EOCP |
---|
7793 | if $cc -c try.c >/dev/null 2>&1 ; then |
---|
7794 | val="$define" |
---|
7795 | echo "Yup, it can." |
---|
7796 | else |
---|
7797 | val="$undef" |
---|
7798 | echo "Nope, it can't." |
---|
7799 | fi |
---|
7800 | set d_strctcpy |
---|
7801 | eval $setvar |
---|
7802 | $rm -f try.* |
---|
7803 | |
---|
7804 | : see if strerror and/or sys_errlist[] exist |
---|
7805 | echo " " |
---|
7806 | if set strerror val -f d_strerror; eval $csym; $val; then |
---|
7807 | echo 'strerror() found.' >&4 |
---|
7808 | d_strerror="$define" |
---|
7809 | d_strerrm='strerror(e)' |
---|
7810 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
---|
7811 | echo "(You also have sys_errlist[], so we could roll our own strerror.)" |
---|
7812 | d_syserrlst="$define" |
---|
7813 | else |
---|
7814 | echo "(Since you don't have sys_errlist[], sterror() is welcome.)" |
---|
7815 | d_syserrlst="$undef" |
---|
7816 | fi |
---|
7817 | elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \ |
---|
7818 | $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then |
---|
7819 | echo 'strerror() found in string header.' >&4 |
---|
7820 | d_strerror="$define" |
---|
7821 | d_strerrm='strerror(e)' |
---|
7822 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
---|
7823 | echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)" |
---|
7824 | d_syserrlst="$define" |
---|
7825 | else |
---|
7826 | echo "(You don't appear to have any sys_errlist[], how can this be?)" |
---|
7827 | d_syserrlst="$undef" |
---|
7828 | fi |
---|
7829 | elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
---|
7830 | echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4 |
---|
7831 | d_strerror="$undef" |
---|
7832 | d_syserrlst="$define" |
---|
7833 | d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])' |
---|
7834 | else |
---|
7835 | echo 'strerror() and sys_errlist[] NOT found.' >&4 |
---|
7836 | d_strerror="$undef" |
---|
7837 | d_syserrlst="$undef" |
---|
7838 | d_strerrm='"unknown"' |
---|
7839 | fi |
---|
7840 | |
---|
7841 | : see if strtod exists |
---|
7842 | set strtod d_strtod |
---|
7843 | eval $inlibc |
---|
7844 | |
---|
7845 | : see if strtol exists |
---|
7846 | set strtol d_strtol |
---|
7847 | eval $inlibc |
---|
7848 | |
---|
7849 | : see if strtoul exists |
---|
7850 | set strtoul d_strtoul |
---|
7851 | eval $inlibc |
---|
7852 | |
---|
7853 | : see if strxfrm exists |
---|
7854 | set strxfrm d_strxfrm |
---|
7855 | eval $inlibc |
---|
7856 | |
---|
7857 | : see if symlink exists |
---|
7858 | set symlink d_symlink |
---|
7859 | eval $inlibc |
---|
7860 | |
---|
7861 | : see if syscall exists |
---|
7862 | set syscall d_syscall |
---|
7863 | eval $inlibc |
---|
7864 | |
---|
7865 | : see if sysconf exists |
---|
7866 | set sysconf d_sysconf |
---|
7867 | eval $inlibc |
---|
7868 | |
---|
7869 | : see if system exists |
---|
7870 | set system d_system |
---|
7871 | eval $inlibc |
---|
7872 | |
---|
7873 | : see if tcgetpgrp exists |
---|
7874 | set tcgetpgrp d_tcgetpgrp |
---|
7875 | eval $inlibc |
---|
7876 | |
---|
7877 | : see if tcsetpgrp exists |
---|
7878 | set tcsetpgrp d_tcsetpgrp |
---|
7879 | eval $inlibc |
---|
7880 | |
---|
7881 | : define an is-a-typedef? function |
---|
7882 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; |
---|
7883 | case "$inclist" in |
---|
7884 | "") inclist="sys/types.h";; |
---|
7885 | esac; |
---|
7886 | eval "varval=\$$var"; |
---|
7887 | case "$varval" in |
---|
7888 | "") |
---|
7889 | $rm -f temp.c; |
---|
7890 | for inc in $inclist; do |
---|
7891 | echo "#include <$inc>" >>temp.c; |
---|
7892 | done; |
---|
7893 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; |
---|
7894 | if $contains $type temp.E >/dev/null 2>&1; then |
---|
7895 | eval "$var=\$type"; |
---|
7896 | else |
---|
7897 | eval "$var=\$def"; |
---|
7898 | fi; |
---|
7899 | $rm -f temp.?;; |
---|
7900 | *) eval "$var=\$varval";; |
---|
7901 | esac' |
---|
7902 | |
---|
7903 | : see if this is a sys/times.h system |
---|
7904 | set sys/times.h i_systimes |
---|
7905 | eval $inhdr |
---|
7906 | |
---|
7907 | : see if times exists |
---|
7908 | echo " " |
---|
7909 | if set times val -f d_times; eval $csym; $val; then |
---|
7910 | echo 'times() found.' >&4 |
---|
7911 | d_times="$define" |
---|
7912 | inc='' |
---|
7913 | case "$i_systimes" in |
---|
7914 | "$define") inc='sys/times.h';; |
---|
7915 | esac |
---|
7916 | set clock_t clocktype long stdio.h sys/types.h $inc |
---|
7917 | eval $typedef |
---|
7918 | dflt="$clocktype" |
---|
7919 | echo " " |
---|
7920 | rp="What type is returned by times() on this system?" |
---|
7921 | . ./myread |
---|
7922 | clocktype="$ans" |
---|
7923 | else |
---|
7924 | echo 'times() NOT found, hope that will do.' >&4 |
---|
7925 | d_times="$undef" |
---|
7926 | clocktype='int' |
---|
7927 | fi |
---|
7928 | |
---|
7929 | : see if truncate exists |
---|
7930 | set truncate d_truncate |
---|
7931 | eval $inlibc |
---|
7932 | |
---|
7933 | : see if tzname[] exists |
---|
7934 | echo " " |
---|
7935 | if set tzname val -a d_tzname; eval $csym; $val; then |
---|
7936 | val="$define" |
---|
7937 | echo 'tzname[] found.' >&4 |
---|
7938 | else |
---|
7939 | val="$undef" |
---|
7940 | echo 'tzname[] NOT found.' >&4 |
---|
7941 | fi |
---|
7942 | set d_tzname |
---|
7943 | eval $setvar |
---|
7944 | |
---|
7945 | : see if umask exists |
---|
7946 | set umask d_umask |
---|
7947 | eval $inlibc |
---|
7948 | |
---|
7949 | : see how we will look up host name |
---|
7950 | echo " " |
---|
7951 | if false; then |
---|
7952 | : dummy stub to allow use of elif |
---|
7953 | elif set uname val -f d_uname; eval $csym; $val; then |
---|
7954 | if ./xenix; then |
---|
7955 | $cat <<'EOM' |
---|
7956 | uname() was found, but you're running xenix, and older versions of xenix |
---|
7957 | have a broken uname(). If you don't really know whether your xenix is old |
---|
7958 | enough to have a broken system call, use the default answer. |
---|
7959 | |
---|
7960 | EOM |
---|
7961 | dflt=y |
---|
7962 | case "$d_uname" in |
---|
7963 | "$define") dflt=n;; |
---|
7964 | esac |
---|
7965 | rp='Is your uname() broken?' |
---|
7966 | . ./myread |
---|
7967 | case "$ans" in |
---|
7968 | n*) d_uname="$define"; call=uname;; |
---|
7969 | esac |
---|
7970 | else |
---|
7971 | echo 'uname() found.' >&4 |
---|
7972 | d_uname="$define" |
---|
7973 | call=uname |
---|
7974 | fi |
---|
7975 | fi |
---|
7976 | case "$d_gethname" in |
---|
7977 | '') d_gethname="$undef";; |
---|
7978 | esac |
---|
7979 | case "$d_uname" in |
---|
7980 | '') d_uname="$undef";; |
---|
7981 | esac |
---|
7982 | case "$d_phostname" in |
---|
7983 | '') d_phostname="$undef";; |
---|
7984 | esac |
---|
7985 | |
---|
7986 | : backward compatibility for d_hvfork |
---|
7987 | if test X$d_hvfork != X; then |
---|
7988 | d_vfork="$d_hvfork" |
---|
7989 | d_hvfork='' |
---|
7990 | fi |
---|
7991 | : see if there is a vfork |
---|
7992 | val='' |
---|
7993 | set vfork val |
---|
7994 | eval $inlibc |
---|
7995 | |
---|
7996 | : Ok, but do we want to use it. vfork is reportedly unreliable in |
---|
7997 | : perl on Solaris 2.x, and probably elsewhere. |
---|
7998 | case "$val" in |
---|
7999 | $define) |
---|
8000 | echo " " |
---|
8001 | case "$usevfork" in |
---|
8002 | false) dflt='n';; |
---|
8003 | *) dflt='y';; |
---|
8004 | esac |
---|
8005 | rp="Some systems have problems with vfork(). Do you want to use it?" |
---|
8006 | . ./myread |
---|
8007 | case "$ans" in |
---|
8008 | y|Y) ;; |
---|
8009 | *) |
---|
8010 | echo "Ok, we won't use vfork()." |
---|
8011 | val="$undef" |
---|
8012 | ;; |
---|
8013 | esac |
---|
8014 | ;; |
---|
8015 | esac |
---|
8016 | set d_vfork |
---|
8017 | eval $setvar |
---|
8018 | case "$d_vfork" in |
---|
8019 | $define) usevfork='true';; |
---|
8020 | *) usevfork='false';; |
---|
8021 | esac |
---|
8022 | |
---|
8023 | : see if this is an sysdir system |
---|
8024 | set sys/dir.h i_sysdir |
---|
8025 | eval $inhdr |
---|
8026 | |
---|
8027 | : see if this is an sysndir system |
---|
8028 | set sys/ndir.h i_sysndir |
---|
8029 | eval $inhdr |
---|
8030 | |
---|
8031 | : see if closedir exists |
---|
8032 | set closedir d_closedir |
---|
8033 | eval $inlibc |
---|
8034 | |
---|
8035 | case "$d_closedir" in |
---|
8036 | "$define") |
---|
8037 | echo " " |
---|
8038 | echo "Checking whether closedir() returns a status..." >&4 |
---|
8039 | cat > closedir.c <<EOM |
---|
8040 | #$i_dirent I_DIRENT /**/ |
---|
8041 | #$i_sysdir I_SYS_DIR /**/ |
---|
8042 | #$i_sysndir I_SYS_NDIR /**/ |
---|
8043 | |
---|
8044 | #if defined(I_DIRENT) |
---|
8045 | #include <dirent.h> |
---|
8046 | #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ |
---|
8047 | #include <sys/dir.h> |
---|
8048 | #endif |
---|
8049 | #else |
---|
8050 | #ifdef I_SYS_NDIR |
---|
8051 | #include <sys/ndir.h> |
---|
8052 | #else |
---|
8053 | #ifdef I_SYS_DIR |
---|
8054 | #ifdef hp9000s500 |
---|
8055 | #include <ndir.h> /* may be wrong in the future */ |
---|
8056 | #else |
---|
8057 | #include <sys/dir.h> |
---|
8058 | #endif |
---|
8059 | #endif |
---|
8060 | #endif |
---|
8061 | #endif |
---|
8062 | int main() { return closedir(opendir(".")); } |
---|
8063 | EOM |
---|
8064 | if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then |
---|
8065 | if ./closedir > /dev/null 2>&1 ; then |
---|
8066 | echo "Yes, it does." |
---|
8067 | val="$undef" |
---|
8068 | else |
---|
8069 | echo "No, it doesn't." |
---|
8070 | val="$define" |
---|
8071 | fi |
---|
8072 | else |
---|
8073 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
---|
8074 | val="$define" |
---|
8075 | fi |
---|
8076 | ;; |
---|
8077 | *) |
---|
8078 | val="$undef"; |
---|
8079 | ;; |
---|
8080 | esac |
---|
8081 | set d_void_closedir |
---|
8082 | eval $setvar |
---|
8083 | $rm -f closedir* |
---|
8084 | : check for volatile keyword |
---|
8085 | echo " " |
---|
8086 | echo 'Checking to see if your C compiler knows about "volatile"...' >&4 |
---|
8087 | $cat >try.c <<'EOCP' |
---|
8088 | main() |
---|
8089 | { |
---|
8090 | typedef struct _goo_struct goo_struct; |
---|
8091 | goo_struct * volatile goo = ((goo_struct *)0); |
---|
8092 | struct _goo_struct { |
---|
8093 | long long_int; |
---|
8094 | int reg_int; |
---|
8095 | char char_var; |
---|
8096 | }; |
---|
8097 | typedef unsigned short foo_t; |
---|
8098 | char *volatile foo; |
---|
8099 | volatile int bar; |
---|
8100 | volatile foo_t blech; |
---|
8101 | foo = foo; |
---|
8102 | } |
---|
8103 | EOCP |
---|
8104 | if $cc -c $ccflags try.c >/dev/null 2>&1 ; then |
---|
8105 | val="$define" |
---|
8106 | echo "Yup, it does." |
---|
8107 | else |
---|
8108 | val="$undef" |
---|
8109 | echo "Nope, it doesn't." |
---|
8110 | fi |
---|
8111 | set d_volatile |
---|
8112 | eval $setvar |
---|
8113 | $rm -f try.* |
---|
8114 | |
---|
8115 | : see if there is a wait4 |
---|
8116 | set wait4 d_wait4 |
---|
8117 | eval $inlibc |
---|
8118 | |
---|
8119 | : see if waitpid exists |
---|
8120 | set waitpid d_waitpid |
---|
8121 | eval $inlibc |
---|
8122 | |
---|
8123 | : see if wcstombs exists |
---|
8124 | set wcstombs d_wcstombs |
---|
8125 | eval $inlibc |
---|
8126 | |
---|
8127 | : see if wctomb exists |
---|
8128 | set wctomb d_wctomb |
---|
8129 | eval $inlibc |
---|
8130 | |
---|
8131 | : preserve RCS keywords in files with variable substitution, grrr |
---|
8132 | Date='$Date' |
---|
8133 | Id='$Id' |
---|
8134 | Log='$Log' |
---|
8135 | RCSfile='$RCSfile' |
---|
8136 | Revision='$Revision' |
---|
8137 | |
---|
8138 | : check for alignment requirements |
---|
8139 | echo " " |
---|
8140 | case "$alignbytes" in |
---|
8141 | '') echo "Checking alignment constraints..." >&4 |
---|
8142 | $cat >try.c <<'EOCP' |
---|
8143 | struct foobar { |
---|
8144 | char foo; |
---|
8145 | double bar; |
---|
8146 | } try; |
---|
8147 | main() |
---|
8148 | { |
---|
8149 | printf("%d\n", (char *)&try.bar - (char *)&try.foo); |
---|
8150 | } |
---|
8151 | EOCP |
---|
8152 | if $cc $ccflags try.c -o try >/dev/null 2>&1; then |
---|
8153 | dflt=`./try` |
---|
8154 | else |
---|
8155 | dflt='8' |
---|
8156 | echo "(I can't seem to compile the test program...)" |
---|
8157 | fi |
---|
8158 | ;; |
---|
8159 | *) dflt="$alignbytes" |
---|
8160 | ;; |
---|
8161 | esac |
---|
8162 | rp="Doubles must be aligned on a how-many-byte boundary?" |
---|
8163 | . ./myread |
---|
8164 | alignbytes="$ans" |
---|
8165 | $rm -f try.c try |
---|
8166 | |
---|
8167 | : check for ordering of bytes in a long |
---|
8168 | case "$byteorder" in |
---|
8169 | '') |
---|
8170 | $cat <<'EOM' |
---|
8171 | |
---|
8172 | In the following, larger digits indicate more significance. A big-endian |
---|
8173 | machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A |
---|
8174 | little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other |
---|
8175 | machines may have weird orders like 3412. A Cray will report 87654321. If |
---|
8176 | the test program works the default is probably right. |
---|
8177 | I'm now running the test program... |
---|
8178 | EOM |
---|
8179 | $cat >try.c <<'EOCP' |
---|
8180 | #include <stdio.h> |
---|
8181 | main() |
---|
8182 | { |
---|
8183 | int i; |
---|
8184 | union { |
---|
8185 | unsigned long l; |
---|
8186 | char c[sizeof(long)]; |
---|
8187 | } u; |
---|
8188 | |
---|
8189 | if (sizeof(long) > 4) |
---|
8190 | u.l = (0x08070605L << 32) | 0x04030201L; |
---|
8191 | else |
---|
8192 | u.l = 0x04030201L; |
---|
8193 | for (i = 0; i < sizeof(long); i++) |
---|
8194 | printf("%c", u.c[i]+'0'); |
---|
8195 | printf("\n"); |
---|
8196 | exit(0); |
---|
8197 | } |
---|
8198 | EOCP |
---|
8199 | xxx_prompt=y |
---|
8200 | if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then |
---|
8201 | dflt=`./try` |
---|
8202 | case "$dflt" in |
---|
8203 | [1-4][1-4][1-4][1-4]|12345678|87654321) |
---|
8204 | echo "(The test program ran ok.)" |
---|
8205 | echo "byteorder=$dflt" |
---|
8206 | xxx_prompt=n |
---|
8207 | ;; |
---|
8208 | ????|????????) echo "(The test program ran ok.)" ;; |
---|
8209 | *) echo "(The test program didn't run right for some reason.)" ;; |
---|
8210 | esac |
---|
8211 | else |
---|
8212 | dflt='4321' |
---|
8213 | cat <<'EOM' |
---|
8214 | (I can't seem to compile the test program. Guessing big-endian...) |
---|
8215 | EOM |
---|
8216 | fi |
---|
8217 | case "$xxx_prompt" in |
---|
8218 | y) |
---|
8219 | rp="What is the order of bytes in a long?" |
---|
8220 | . ./myread |
---|
8221 | byteorder="$ans" |
---|
8222 | ;; |
---|
8223 | *) byteorder=$dflt |
---|
8224 | ;; |
---|
8225 | esac |
---|
8226 | ;; |
---|
8227 | esac |
---|
8228 | $rm -f try.c try |
---|
8229 | |
---|
8230 | : how do we catenate cpp tokens here? |
---|
8231 | echo " " |
---|
8232 | echo "Checking to see how your cpp does stuff like catenate tokens..." >&4 |
---|
8233 | $cat >cpp_stuff.c <<'EOCP' |
---|
8234 | #define RCAT(a,b)a/**/b |
---|
8235 | #define ACAT(a,b)a ## b |
---|
8236 | RCAT(Rei,ser) |
---|
8237 | ACAT(Cir,cus) |
---|
8238 | EOCP |
---|
8239 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 |
---|
8240 | if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then |
---|
8241 | echo "Oh! Smells like ANSI's been here." |
---|
8242 | echo "We can catify or stringify, separately or together!" |
---|
8243 | cpp_stuff=42 |
---|
8244 | elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then |
---|
8245 | echo "Ah, yes! The good old days!" |
---|
8246 | echo "However, in the good old days we don't know how to stringify and" |
---|
8247 | echo "catify at the same time." |
---|
8248 | cpp_stuff=1 |
---|
8249 | else |
---|
8250 | $cat >&4 <<EOM |
---|
8251 | Hmm, I don't seem to be able to catenate tokens with your cpp. You're going |
---|
8252 | to have to edit the values of CAT[2-5] in config.h... |
---|
8253 | EOM |
---|
8254 | cpp_stuff="/* Help! How do we handle cpp_stuff? */*/" |
---|
8255 | fi |
---|
8256 | $rm -f cpp_stuff.* |
---|
8257 | |
---|
8258 | : see if this is a db.h system |
---|
8259 | set db.h i_db |
---|
8260 | eval $inhdr |
---|
8261 | |
---|
8262 | case "$i_db" in |
---|
8263 | $define) |
---|
8264 | : Check db version. We can not use version 2. |
---|
8265 | echo " " |
---|
8266 | echo "Checking Berkeley DB version ..." >&4 |
---|
8267 | $cat >try.c <<EOCP |
---|
8268 | #$d_const HASCONST |
---|
8269 | #ifndef HASCONST |
---|
8270 | #define const |
---|
8271 | #endif |
---|
8272 | #include <sys/types.h> |
---|
8273 | #include <stdio.h> |
---|
8274 | #include <db.h> |
---|
8275 | main() |
---|
8276 | { |
---|
8277 | #ifdef DB_VERSION_MAJOR /* DB version >= 2: not yet. */ |
---|
8278 | printf("You have Berkeley DB Version %d.%d\n", |
---|
8279 | DB_VERSION_MAJOR, DB_VERSION_MINOR); |
---|
8280 | printf("Perl currently only supports up to version 1.86.\n"); |
---|
8281 | exit(2); |
---|
8282 | #else |
---|
8283 | #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) |
---|
8284 | exit(0); /* DB version < 2: the coast is clear. */ |
---|
8285 | #else |
---|
8286 | exit(1); /* <db.h> not Berkeley DB? */ |
---|
8287 | #endif |
---|
8288 | #endif |
---|
8289 | } |
---|
8290 | EOCP |
---|
8291 | if $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try; then |
---|
8292 | echo 'Looks OK. (Perl supports up to version 1.86).' >&4 |
---|
8293 | else |
---|
8294 | echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4 |
---|
8295 | i_db=$undef |
---|
8296 | case " $libs " in |
---|
8297 | *"-ldb "*) |
---|
8298 | : Remove db from list of libraries to use |
---|
8299 | echo "Removing unusable -ldb from library list" >&4 |
---|
8300 | set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'` |
---|
8301 | shift |
---|
8302 | libs="$*" |
---|
8303 | echo "libs = $libs" >&4 |
---|
8304 | ;; |
---|
8305 | esac |
---|
8306 | fi |
---|
8307 | $rm -f try.* |
---|
8308 | ;; |
---|
8309 | esac |
---|
8310 | |
---|
8311 | case "$i_db" in |
---|
8312 | define) |
---|
8313 | : Check the return type needed for hash |
---|
8314 | echo " " |
---|
8315 | echo "Checking return type needed for hash for Berkeley DB ..." >&4 |
---|
8316 | $cat >try.c <<EOCP |
---|
8317 | #$d_const HASCONST |
---|
8318 | #ifndef HASCONST |
---|
8319 | #define const |
---|
8320 | #endif |
---|
8321 | #include <sys/types.h> |
---|
8322 | #include <db.h> |
---|
8323 | u_int32_t hash_cb (ptr, size) |
---|
8324 | const void *ptr; |
---|
8325 | size_t size; |
---|
8326 | { |
---|
8327 | } |
---|
8328 | HASHINFO info; |
---|
8329 | main() |
---|
8330 | { |
---|
8331 | info.hash = hash_cb; |
---|
8332 | } |
---|
8333 | EOCP |
---|
8334 | if $cc $ccflags -c try.c >try.out 2>&1 ; then |
---|
8335 | if $contains warning try.out >>/dev/null 2>&1 ; then |
---|
8336 | db_hashtype='int' |
---|
8337 | else |
---|
8338 | db_hashtype='u_int32_t' |
---|
8339 | fi |
---|
8340 | else |
---|
8341 | : XXX Maybe we should just give up here. |
---|
8342 | db_hashtype=u_int32_t |
---|
8343 | echo "Help: I can't seem to compile the db test program." >&4 |
---|
8344 | echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 |
---|
8345 | fi |
---|
8346 | $rm -f try.* |
---|
8347 | echo "Your version of Berkeley DB uses $db_hashtype for hash." |
---|
8348 | ;; |
---|
8349 | *) db_hashtype=u_int32_t |
---|
8350 | ;; |
---|
8351 | esac |
---|
8352 | |
---|
8353 | case "$i_db" in |
---|
8354 | define) |
---|
8355 | : Check the return type needed for prefix |
---|
8356 | echo " " |
---|
8357 | echo "Checking return type needed for prefix for Berkeley DB ..." >&4 |
---|
8358 | cat >try.c <<EOCP |
---|
8359 | #$d_const HASCONST |
---|
8360 | #ifndef HASCONST |
---|
8361 | #define const |
---|
8362 | #endif |
---|
8363 | #include <sys/types.h> |
---|
8364 | #include <db.h> |
---|
8365 | size_t prefix_cb (key1, key2) |
---|
8366 | const DBT *key1; |
---|
8367 | const DBT *key2; |
---|
8368 | { |
---|
8369 | } |
---|
8370 | BTREEINFO info; |
---|
8371 | main() |
---|
8372 | { |
---|
8373 | info.prefix = prefix_cb; |
---|
8374 | } |
---|
8375 | EOCP |
---|
8376 | if $cc $ccflags -c try.c >try.out 2>&1 ; then |
---|
8377 | if $contains warning try.out >>/dev/null 2>&1 ; then |
---|
8378 | db_prefixtype='int' |
---|
8379 | else |
---|
8380 | db_prefixtype='size_t' |
---|
8381 | fi |
---|
8382 | else |
---|
8383 | db_prefixtype='size_t' |
---|
8384 | : XXX Maybe we should just give up here. |
---|
8385 | echo "Help: I can't seem to compile the db test program." >&4 |
---|
8386 | echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 |
---|
8387 | fi |
---|
8388 | $rm -f try.* |
---|
8389 | echo "Your version of Berkeley DB uses $db_prefixtype for prefix." |
---|
8390 | ;; |
---|
8391 | *) db_prefixtype='size_t' |
---|
8392 | ;; |
---|
8393 | esac |
---|
8394 | |
---|
8395 | : check for void type |
---|
8396 | echo " " |
---|
8397 | echo "Checking to see how well your C compiler groks the void type..." >&4 |
---|
8398 | echo " " |
---|
8399 | $cat >&4 <<EOM |
---|
8400 | Support flag bits are: |
---|
8401 | 1: basic void declarations. |
---|
8402 | 2: arrays of pointers to functions returning void. |
---|
8403 | 4: operations between pointers to and addresses of void functions. |
---|
8404 | 8: generic void pointers. |
---|
8405 | EOM |
---|
8406 | echo " " |
---|
8407 | case "$voidflags" in |
---|
8408 | '') |
---|
8409 | $cat >try.c <<'EOCP' |
---|
8410 | #if TRY & 1 |
---|
8411 | void sub() { |
---|
8412 | #else |
---|
8413 | sub() { |
---|
8414 | #endif |
---|
8415 | extern void moo(); /* function returning void */ |
---|
8416 | void (*goo)(); /* ptr to func returning void */ |
---|
8417 | #if TRY & 8 |
---|
8418 | void *hue; /* generic ptr */ |
---|
8419 | #endif |
---|
8420 | #if TRY & 2 |
---|
8421 | void (*foo[10])(); |
---|
8422 | #endif |
---|
8423 | |
---|
8424 | #if TRY & 4 |
---|
8425 | if(goo == moo) { |
---|
8426 | exit(0); |
---|
8427 | } |
---|
8428 | #endif |
---|
8429 | exit(0); |
---|
8430 | } |
---|
8431 | main() { sub(); } |
---|
8432 | EOCP |
---|
8433 | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then |
---|
8434 | voidflags=$defvoidused |
---|
8435 | echo "It appears to support void to the level $package wants ($defvoidused)." |
---|
8436 | if $contains warning .out >/dev/null 2>&1; then |
---|
8437 | echo "However, you might get some warnings that look like this:" |
---|
8438 | $cat .out |
---|
8439 | fi |
---|
8440 | else |
---|
8441 | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 |
---|
8442 | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then |
---|
8443 | echo "It supports 1..." |
---|
8444 | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then |
---|
8445 | echo "It also supports 2..." |
---|
8446 | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then |
---|
8447 | voidflags=7 |
---|
8448 | echo "And it supports 4 but not 8 definitely." |
---|
8449 | else |
---|
8450 | echo "It doesn't support 4..." |
---|
8451 | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then |
---|
8452 | voidflags=11 |
---|
8453 | echo "But it supports 8." |
---|
8454 | else |
---|
8455 | voidflags=3 |
---|
8456 | echo "Neither does it support 8." |
---|
8457 | fi |
---|
8458 | fi |
---|
8459 | else |
---|
8460 | echo "It does not support 2..." |
---|
8461 | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then |
---|
8462 | voidflags=13 |
---|
8463 | echo "But it supports 4 and 8." |
---|
8464 | else |
---|
8465 | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then |
---|
8466 | voidflags=5 |
---|
8467 | echo "And it supports 4 but has not heard about 8." |
---|
8468 | else |
---|
8469 | echo "However it supports 8 but not 4." |
---|
8470 | fi |
---|
8471 | fi |
---|
8472 | fi |
---|
8473 | else |
---|
8474 | echo "There is no support at all for void." |
---|
8475 | voidflags=0 |
---|
8476 | fi |
---|
8477 | fi |
---|
8478 | esac |
---|
8479 | : Only prompt user if support does not match the level we want |
---|
8480 | case "$voidflags" in |
---|
8481 | "$defvoidused") ;; |
---|
8482 | *) |
---|
8483 | dflt="$voidflags"; |
---|
8484 | rp="Your void support flags add up to what?" |
---|
8485 | . ./myread |
---|
8486 | voidflags="$ans" |
---|
8487 | ;; |
---|
8488 | esac |
---|
8489 | $rm -f try.* .out |
---|
8490 | |
---|
8491 | : see what type file positions are declared as in the library |
---|
8492 | set fpos_t fpostype long stdio.h sys/types.h |
---|
8493 | eval $typedef |
---|
8494 | echo " " |
---|
8495 | dflt="$fpostype" |
---|
8496 | rp="What is the type for file position used by fsetpos()?" |
---|
8497 | . ./myread |
---|
8498 | fpostype="$ans" |
---|
8499 | |
---|
8500 | : Store the full pathname to the sed program for use in the C program |
---|
8501 | full_sed=$sed |
---|
8502 | |
---|
8503 | : see what type gids are declared as in the kernel |
---|
8504 | set gid_t gidtype xxx stdio.h sys/types.h |
---|
8505 | eval $typedef |
---|
8506 | case "$gidtype" in |
---|
8507 | xxx) |
---|
8508 | xxx=`./findhdr sys/user.h` |
---|
8509 | set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short |
---|
8510 | case $1 in |
---|
8511 | unsigned) dflt="$1 $2" ;; |
---|
8512 | *) dflt="$1" ;; |
---|
8513 | esac |
---|
8514 | ;; |
---|
8515 | *) dflt="$gidtype";; |
---|
8516 | esac |
---|
8517 | echo " " |
---|
8518 | rp="What is the type for group ids returned by getgid()?" |
---|
8519 | . ./myread |
---|
8520 | gidtype="$ans" |
---|
8521 | |
---|
8522 | : see if getgroups exists |
---|
8523 | set getgroups d_getgrps |
---|
8524 | eval $inlibc |
---|
8525 | |
---|
8526 | : see if setgroups exists |
---|
8527 | set setgroups d_setgrps |
---|
8528 | eval $inlibc |
---|
8529 | |
---|
8530 | : Find type of 2nd arg to 'getgroups()' and 'setgroups()' |
---|
8531 | echo " " |
---|
8532 | case "$d_getgrps$d_setgrps" in |
---|
8533 | *define*) |
---|
8534 | case "$groupstype" in |
---|
8535 | '') dflt="$gidtype" ;; |
---|
8536 | *) dflt="$groupstype" ;; |
---|
8537 | esac |
---|
8538 | $cat <<EOM |
---|
8539 | What is the type of the second argument to getgroups() and setgroups()? |
---|
8540 | Usually this is the same as group ids, $gidtype, but not always. |
---|
8541 | |
---|
8542 | EOM |
---|
8543 | rp='What type is the second argument to getgroups() and setgroups()?' |
---|
8544 | . ./myread |
---|
8545 | groupstype="$ans" |
---|
8546 | ;; |
---|
8547 | *) groupstype="$gidtype";; |
---|
8548 | esac |
---|
8549 | |
---|
8550 | : see what type lseek is declared as in the kernel |
---|
8551 | set off_t lseektype long stdio.h sys/types.h |
---|
8552 | eval $typedef |
---|
8553 | echo " " |
---|
8554 | dflt="$lseektype" |
---|
8555 | rp="What type is lseek's offset on this system declared as?" |
---|
8556 | . ./myread |
---|
8557 | lseektype="$ans" |
---|
8558 | |
---|
8559 | echo " " |
---|
8560 | case "$make" in |
---|
8561 | '') |
---|
8562 | make=`./loc make make $pth` |
---|
8563 | case "$make" in |
---|
8564 | /*) echo make is in $make. ;; |
---|
8565 | ?:[\\/]*) echo make is in $make. ;; |
---|
8566 | *) echo "I don't know where 'make' is, and my life depends on it." >&4 |
---|
8567 | echo "Go find a make program or fix your PATH setting!" >&4 |
---|
8568 | exit 1 |
---|
8569 | ;; |
---|
8570 | esac |
---|
8571 | ;; |
---|
8572 | *) echo make is in $make. ;; |
---|
8573 | esac |
---|
8574 | |
---|
8575 | $echo $n "Checking if your $make program sets \$(MAKE)... $c" >&4 |
---|
8576 | case "$make_set_make" in |
---|
8577 | '') |
---|
8578 | $sed 's/^X //' > testmake.mak << 'EOF' |
---|
8579 | Xall: |
---|
8580 | X @echo 'ac_maketemp="$(MAKE)"' |
---|
8581 | EOF |
---|
8582 | : GNU make sometimes prints "make[1]: Entering...", which would confuse us. |
---|
8583 | case "`$make -f testmake.mak 2>/dev/null`" in |
---|
8584 | *ac_maketemp=*) make_set_make='#' ;; |
---|
8585 | *) make_set_make="MAKE=$make" ;; |
---|
8586 | esac |
---|
8587 | $rm -f testmake.mak |
---|
8588 | ;; |
---|
8589 | esac |
---|
8590 | case "$make_set_make" in |
---|
8591 | '#') echo "Yup, it does." >&4 ;; |
---|
8592 | *) echo "Nope, it doesn't." >&4 ;; |
---|
8593 | esac |
---|
8594 | |
---|
8595 | : see what type is used for mode_t |
---|
8596 | set mode_t modetype int stdio.h sys/types.h |
---|
8597 | eval $typedef |
---|
8598 | dflt="$modetype" |
---|
8599 | echo " " |
---|
8600 | rp="What type is used for file modes?" |
---|
8601 | . ./myread |
---|
8602 | modetype="$ans" |
---|
8603 | |
---|
8604 | : locate the preferred pager for this system |
---|
8605 | case "$pager" in |
---|
8606 | '') |
---|
8607 | dflt='' |
---|
8608 | case "$pg" in |
---|
8609 | /*) dflt=$pg;; |
---|
8610 | esac |
---|
8611 | case "$more" in |
---|
8612 | /*) dflt=$more;; |
---|
8613 | esac |
---|
8614 | case "$less" in |
---|
8615 | /*) dflt=$less;; |
---|
8616 | esac |
---|
8617 | case "$dflt" in |
---|
8618 | '') dflt=/usr/ucb/more;; |
---|
8619 | esac |
---|
8620 | ;; |
---|
8621 | *) dflt="$pager";; |
---|
8622 | esac |
---|
8623 | echo " " |
---|
8624 | fn=f/ |
---|
8625 | rp='What pager is used on your system?' |
---|
8626 | . ./getfile |
---|
8627 | pager="$ans" |
---|
8628 | |
---|
8629 | : Cruising for prototypes |
---|
8630 | echo " " |
---|
8631 | echo "Checking out function prototypes..." >&4 |
---|
8632 | $cat >prototype.c <<'EOCP' |
---|
8633 | main(int argc, char *argv[]) { |
---|
8634 | exit(0);} |
---|
8635 | EOCP |
---|
8636 | if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then |
---|
8637 | echo "Your C compiler appears to support function prototypes." |
---|
8638 | val="$define" |
---|
8639 | else |
---|
8640 | echo "Your C compiler doesn't seem to understand function prototypes." |
---|
8641 | val="$undef" |
---|
8642 | fi |
---|
8643 | set prototype |
---|
8644 | eval $setvar |
---|
8645 | $rm -f prototype* |
---|
8646 | |
---|
8647 | : check for size of random number generator |
---|
8648 | echo " " |
---|
8649 | case "$randbits" in |
---|
8650 | '') |
---|
8651 | echo "Checking to see how many bits your rand function produces..." >&4 |
---|
8652 | $cat >try.c <<EOCP |
---|
8653 | #$i_unistd I_UNISTD |
---|
8654 | #$i_stdlib I_STDLIB |
---|
8655 | #include <stdio.h> |
---|
8656 | #ifdef I_UNISTD |
---|
8657 | # include <unistd.h> |
---|
8658 | #endif |
---|
8659 | #ifdef I_STDLIB |
---|
8660 | # include <stdlib.h> |
---|
8661 | #endif |
---|
8662 | EOCP |
---|
8663 | $cat >>try.c <<'EOCP' |
---|
8664 | main() |
---|
8665 | { |
---|
8666 | register int i; |
---|
8667 | register unsigned long tmp; |
---|
8668 | register unsigned long max = 0L; |
---|
8669 | |
---|
8670 | for (i = 1000; i; i--) { |
---|
8671 | tmp = (unsigned long)rand(); |
---|
8672 | if (tmp > max) max = tmp; |
---|
8673 | } |
---|
8674 | for (i = 0; max; i++) |
---|
8675 | max /= 2; |
---|
8676 | printf("%d\n",i); |
---|
8677 | fflush(stdout); |
---|
8678 | } |
---|
8679 | EOCP |
---|
8680 | if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then |
---|
8681 | dflt=`try` |
---|
8682 | else |
---|
8683 | dflt='?' |
---|
8684 | echo "(I can't seem to compile the test program...)" |
---|
8685 | fi |
---|
8686 | ;; |
---|
8687 | *) |
---|
8688 | dflt="$randbits" |
---|
8689 | ;; |
---|
8690 | esac |
---|
8691 | rp='How many bits does your rand() function produce?' |
---|
8692 | . ./myread |
---|
8693 | randbits="$ans" |
---|
8694 | $rm -f try.c try.o try |
---|
8695 | |
---|
8696 | : see if ar generates random libraries by itself |
---|
8697 | echo " " |
---|
8698 | echo "Checking how to generate random libraries on your machine..." >&4 |
---|
8699 | echo 'int bar1() { return bar2(); }' > bar1.c |
---|
8700 | echo 'int bar2() { return 2; }' > bar2.c |
---|
8701 | $cat > foo.c <<'EOP' |
---|
8702 | main() { printf("%d\n", bar1()); exit(0); } |
---|
8703 | EOP |
---|
8704 | $cc $ccflags -c bar1.c >/dev/null 2>&1 |
---|
8705 | $cc $ccflags -c bar2.c >/dev/null 2>&1 |
---|
8706 | $cc $ccflags -c foo.c >/dev/null 2>&1 |
---|
8707 | ar rc bar$lib_ext bar2.o bar1.o >/dev/null 2>&1 |
---|
8708 | if $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 && |
---|
8709 | ./foobar >/dev/null 2>&1; then |
---|
8710 | echo "ar appears to generate random libraries itself." |
---|
8711 | orderlib=false |
---|
8712 | ranlib=":" |
---|
8713 | elif ar ts bar$lib_ext >/dev/null 2>&1 && |
---|
8714 | $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 && |
---|
8715 | ./foobar >/dev/null 2>&1; then |
---|
8716 | echo "a table of contents needs to be added with 'ar ts'." |
---|
8717 | orderlib=false |
---|
8718 | ranlib="ar ts" |
---|
8719 | else |
---|
8720 | case "$ranlib" in |
---|
8721 | :) ranlib='';; |
---|
8722 | '') |
---|
8723 | ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin` |
---|
8724 | $test -f $ranlib || ranlib='' |
---|
8725 | ;; |
---|
8726 | esac |
---|
8727 | if $test -n "$ranlib"; then |
---|
8728 | echo "your system has '$ranlib'; we'll use that." |
---|
8729 | orderlib=false |
---|
8730 | else |
---|
8731 | echo "your system doesn't seem to support random libraries" |
---|
8732 | echo "so we'll use lorder and tsort to order the libraries." |
---|
8733 | orderlib=true |
---|
8734 | ranlib=":" |
---|
8735 | fi |
---|
8736 | fi |
---|
8737 | $rm -f foo* bar* |
---|
8738 | |
---|
8739 | : see if sys/select.h has to be included |
---|
8740 | set sys/select.h i_sysselct |
---|
8741 | eval $inhdr |
---|
8742 | |
---|
8743 | : see if we should include time.h, sys/time.h, or both |
---|
8744 | echo " " |
---|
8745 | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 |
---|
8746 | $echo $n "I'm now running the test program...$c" |
---|
8747 | $cat >try.c <<'EOCP' |
---|
8748 | #include <sys/types.h> |
---|
8749 | #ifdef I_TIME |
---|
8750 | #include <time.h> |
---|
8751 | #endif |
---|
8752 | #ifdef I_SYSTIME |
---|
8753 | #ifdef SYSTIMEKERNEL |
---|
8754 | #define KERNEL |
---|
8755 | #endif |
---|
8756 | #include <sys/time.h> |
---|
8757 | #endif |
---|
8758 | #ifdef I_SYSSELECT |
---|
8759 | #include <sys/select.h> |
---|
8760 | #endif |
---|
8761 | main() |
---|
8762 | { |
---|
8763 | struct tm foo; |
---|
8764 | #ifdef S_TIMEVAL |
---|
8765 | struct timeval bar; |
---|
8766 | #endif |
---|
8767 | #ifdef S_TIMEZONE |
---|
8768 | struct timezone tzp; |
---|
8769 | #endif |
---|
8770 | if (foo.tm_sec == foo.tm_sec) |
---|
8771 | exit(0); |
---|
8772 | #ifdef S_TIMEVAL |
---|
8773 | if (bar.tv_sec == bar.tv_sec) |
---|
8774 | exit(0); |
---|
8775 | #endif |
---|
8776 | exit(1); |
---|
8777 | } |
---|
8778 | EOCP |
---|
8779 | flags='' |
---|
8780 | for s_timezone in '-DS_TIMEZONE' ''; do |
---|
8781 | sysselect='' |
---|
8782 | for s_timeval in '-DS_TIMEVAL' ''; do |
---|
8783 | for i_systimek in '' '-DSYSTIMEKERNEL'; do |
---|
8784 | for i_time in '' '-DI_TIME'; do |
---|
8785 | for i_systime in '-DI_SYSTIME' ''; do |
---|
8786 | case "$flags" in |
---|
8787 | '') $echo $n ".$c" |
---|
8788 | if $cc $ccflags \ |
---|
8789 | $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \ |
---|
8790 | try.c -o try >/dev/null 2>&1 ; then |
---|
8791 | set X $i_time $i_systime $i_systimek $sysselect $s_timeval |
---|
8792 | shift |
---|
8793 | flags="$*" |
---|
8794 | echo " " |
---|
8795 | $echo $n "Succeeded with $flags$c" |
---|
8796 | fi |
---|
8797 | ;; |
---|
8798 | esac |
---|
8799 | done |
---|
8800 | done |
---|
8801 | done |
---|
8802 | done |
---|
8803 | done |
---|
8804 | timeincl='' |
---|
8805 | echo " " |
---|
8806 | case "$flags" in |
---|
8807 | *SYSTIMEKERNEL*) i_systimek="$define" |
---|
8808 | timeincl=`./findhdr sys/time.h` |
---|
8809 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; |
---|
8810 | *) i_systimek="$undef";; |
---|
8811 | esac |
---|
8812 | case "$flags" in |
---|
8813 | *I_TIME*) i_time="$define" |
---|
8814 | timeincl=`./findhdr time.h`" $timeincl" |
---|
8815 | echo "We'll include <time.h>." >&4;; |
---|
8816 | *) i_time="$undef";; |
---|
8817 | esac |
---|
8818 | case "$flags" in |
---|
8819 | *I_SYSTIME*) i_systime="$define" |
---|
8820 | timeincl=`./findhdr sys/time.h`" $timeincl" |
---|
8821 | echo "We'll include <sys/time.h>." >&4;; |
---|
8822 | *) i_systime="$undef";; |
---|
8823 | esac |
---|
8824 | $rm -f try.c try |
---|
8825 | |
---|
8826 | : check for fd_set items |
---|
8827 | $cat <<EOM |
---|
8828 | |
---|
8829 | Checking to see how well your C compiler handles fd_set and friends ... |
---|
8830 | EOM |
---|
8831 | $cat >fd_set.c <<EOCP |
---|
8832 | #$i_systime I_SYS_TIME |
---|
8833 | #$i_sysselct I_SYS_SELECT |
---|
8834 | #$d_socket HAS_SOCKET |
---|
8835 | #include <sys/types.h> |
---|
8836 | #ifdef HAS_SOCKET |
---|
8837 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ |
---|
8838 | #endif |
---|
8839 | #ifdef I_SYS_TIME |
---|
8840 | #include <sys/time.h> |
---|
8841 | #endif |
---|
8842 | #ifdef I_SYS_SELECT |
---|
8843 | #include <sys/select.h> |
---|
8844 | #endif |
---|
8845 | main() { |
---|
8846 | fd_set fds; |
---|
8847 | |
---|
8848 | #ifdef TRYBITS |
---|
8849 | if(fds.fds_bits); |
---|
8850 | #endif |
---|
8851 | |
---|
8852 | #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) |
---|
8853 | exit(0); |
---|
8854 | #else |
---|
8855 | exit(1); |
---|
8856 | #endif |
---|
8857 | } |
---|
8858 | EOCP |
---|
8859 | if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then |
---|
8860 | d_fds_bits="$define" |
---|
8861 | d_fd_set="$define" |
---|
8862 | echo "Well, your system knows about the normal fd_set typedef..." >&4 |
---|
8863 | if ./fd_set; then |
---|
8864 | echo "and you have the normal fd_set macros (just as I'd expect)." >&4 |
---|
8865 | d_fd_macros="$define" |
---|
8866 | else |
---|
8867 | $cat >&4 <<'EOM' |
---|
8868 | but not the normal fd_set macros! Gaaack! I'll have to cover for you. |
---|
8869 | EOM |
---|
8870 | d_fd_macros="$undef" |
---|
8871 | fi |
---|
8872 | else |
---|
8873 | $cat <<'EOM' |
---|
8874 | Hmm, your compiler has some difficulty with fd_set. Checking further... |
---|
8875 | EOM |
---|
8876 | if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then |
---|
8877 | d_fds_bits="$undef" |
---|
8878 | d_fd_set="$define" |
---|
8879 | echo "Well, your system has some sort of fd_set available..." >&4 |
---|
8880 | if ./fd_set; then |
---|
8881 | echo "and you have the normal fd_set macros." >&4 |
---|
8882 | d_fd_macros="$define" |
---|
8883 | else |
---|
8884 | $cat <<'EOM' |
---|
8885 | but not the normal fd_set macros! Gross! More work for me... |
---|
8886 | EOM |
---|
8887 | d_fd_macros="$undef" |
---|
8888 | fi |
---|
8889 | else |
---|
8890 | echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 |
---|
8891 | d_fd_set="$undef" |
---|
8892 | d_fds_bits="$undef" |
---|
8893 | d_fd_macros="$undef" |
---|
8894 | fi |
---|
8895 | fi |
---|
8896 | $rm -f fd_set* |
---|
8897 | |
---|
8898 | |
---|
8899 | : check for type of arguments to select. This will only really |
---|
8900 | : work if the system supports prototypes and provides one for |
---|
8901 | : select. |
---|
8902 | case "$d_select" in |
---|
8903 | $define) |
---|
8904 | : Make initial guess |
---|
8905 | case "$selecttype" in |
---|
8906 | ''|' ') |
---|
8907 | case "$d_fd_set" in |
---|
8908 | $define) xxx='fd_set *' ;; |
---|
8909 | *) xxx='int *' ;; |
---|
8910 | esac |
---|
8911 | ;; |
---|
8912 | *) xxx="$selecttype" |
---|
8913 | ;; |
---|
8914 | esac |
---|
8915 | : backup guess |
---|
8916 | case "$xxx" in |
---|
8917 | 'fd_set *') yyy='int *' ;; |
---|
8918 | 'int *') yyy='fd_set *' ;; |
---|
8919 | esac |
---|
8920 | |
---|
8921 | $cat <<EOM |
---|
8922 | |
---|
8923 | Checking to see what type of arguments are expected by select(). |
---|
8924 | EOM |
---|
8925 | $cat >try.c <<EOCP |
---|
8926 | #$i_systime I_SYS_TIME |
---|
8927 | #$i_sysselct I_SYS_SELECT |
---|
8928 | #$d_socket HAS_SOCKET |
---|
8929 | #include <sys/types.h> |
---|
8930 | #ifdef HAS_SOCKET |
---|
8931 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ |
---|
8932 | #endif |
---|
8933 | #ifdef I_SYS_TIME |
---|
8934 | #include <sys/time.h> |
---|
8935 | #endif |
---|
8936 | #ifdef I_SYS_SELECT |
---|
8937 | #include <sys/select.h> |
---|
8938 | #endif |
---|
8939 | main() |
---|
8940 | { |
---|
8941 | int width; |
---|
8942 | Select_fd_set_t readfds; |
---|
8943 | Select_fd_set_t writefds; |
---|
8944 | Select_fd_set_t exceptfds; |
---|
8945 | struct timeval timeout; |
---|
8946 | select(width, readfds, writefds, exceptfds, &timeout); |
---|
8947 | exit(0); |
---|
8948 | } |
---|
8949 | EOCP |
---|
8950 | if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then |
---|
8951 | selecttype="$xxx" |
---|
8952 | echo "Your system uses $xxx for the arguments to select." >&4 |
---|
8953 | elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then |
---|
8954 | selecttype="$yyy" |
---|
8955 | echo "Your system uses $yyy for the arguments to select." >&4 |
---|
8956 | else |
---|
8957 | rp='What is the type for the 2nd, 3rd, and 4th arguments to select?' |
---|
8958 | dflt="$xxx" |
---|
8959 | . ./myread |
---|
8960 | selecttype="$ans" |
---|
8961 | fi |
---|
8962 | $rm -f try.[co] |
---|
8963 | ;; |
---|
8964 | *) selecttype='int *' |
---|
8965 | ;; |
---|
8966 | esac |
---|
8967 | |
---|
8968 | : Trace out the files included by signal.h, then look for SIGxxx names. |
---|
8969 | : Remove SIGARRAYSIZE used by HPUX. |
---|
8970 | : Remove SIGTYP void lines used by OS2. |
---|
8971 | xxx=`echo '#include <signal.h>' | |
---|
8972 | $cppstdin $cppminus $cppflags 2>/dev/null | |
---|
8973 | $grep '^[ ]*#.*include' | |
---|
8974 | $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq` |
---|
8975 | : Check this list of files to be sure we have parsed the cpp output ok. |
---|
8976 | : This will also avoid potentially non-existent files, such |
---|
8977 | : as ../foo/bar.h |
---|
8978 | xxxfiles='' |
---|
8979 | for xx in $xxx /dev/null ; do |
---|
8980 | $test -f "$xx" && xxxfiles="$xxxfiles $xx" |
---|
8981 | done |
---|
8982 | : If we have found no files, at least try signal.h |
---|
8983 | case "$xxxfiles" in |
---|
8984 | '') xxxfiles=`./findhdr signal.h` ;; |
---|
8985 | esac |
---|
8986 | xxx=`awk ' |
---|
8987 | $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ { |
---|
8988 | print substr($2, 4, 20) |
---|
8989 | } |
---|
8990 | $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { |
---|
8991 | print substr($3, 4, 20) |
---|
8992 | }' $xxxfiles` |
---|
8993 | : Append some common names just in case the awk scan failed. |
---|
8994 | xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL" |
---|
8995 | xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP" |
---|
8996 | xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM" |
---|
8997 | xxx="$xxx WINCH WIND WINDOW XCPU XFSZ" |
---|
8998 | : generate a few handy files for later |
---|
8999 | $cat > signal.c <<'EOP' |
---|
9000 | #include <sys/types.h> |
---|
9001 | #include <signal.h> |
---|
9002 | int main() { |
---|
9003 | |
---|
9004 | /* Strange style to avoid deeply-nested #if/#else/#endif */ |
---|
9005 | #ifndef NSIG |
---|
9006 | # ifdef _NSIG |
---|
9007 | # define NSIG (_NSIG) |
---|
9008 | # endif |
---|
9009 | #endif |
---|
9010 | |
---|
9011 | #ifndef NSIG |
---|
9012 | # ifdef SIGMAX |
---|
9013 | # define NSIG (SIGMAX+1) |
---|
9014 | # endif |
---|
9015 | #endif |
---|
9016 | |
---|
9017 | #ifndef NSIG |
---|
9018 | # ifdef SIG_MAX |
---|
9019 | # define NSIG (SIG_MAX+1) |
---|
9020 | # endif |
---|
9021 | #endif |
---|
9022 | |
---|
9023 | #ifndef NSIG |
---|
9024 | # ifdef MAXSIG |
---|
9025 | # define NSIG (MAXSIG+1) |
---|
9026 | # endif |
---|
9027 | #endif |
---|
9028 | |
---|
9029 | #ifndef NSIG |
---|
9030 | # ifdef MAX_SIG |
---|
9031 | # define NSIG (MAX_SIG+1) |
---|
9032 | # endif |
---|
9033 | #endif |
---|
9034 | |
---|
9035 | #ifndef NSIG |
---|
9036 | # ifdef SIGARRAYSIZE |
---|
9037 | # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ |
---|
9038 | # endif |
---|
9039 | #endif |
---|
9040 | |
---|
9041 | #ifndef NSIG |
---|
9042 | # ifdef _sys_nsig |
---|
9043 | # define NSIG (_sys_nsig) /* Solaris 2.5 */ |
---|
9044 | # endif |
---|
9045 | #endif |
---|
9046 | |
---|
9047 | /* Default to some arbitrary number that's big enough to get most |
---|
9048 | of the common signals. |
---|
9049 | */ |
---|
9050 | #ifndef NSIG |
---|
9051 | # define NSIG 50 |
---|
9052 | #endif |
---|
9053 | |
---|
9054 | printf("NSIG %d\n", NSIG); |
---|
9055 | |
---|
9056 | EOP |
---|
9057 | echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk ' |
---|
9058 | { |
---|
9059 | printf "#ifdef SIG"; printf $1; printf "\n" |
---|
9060 | printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; |
---|
9061 | printf $1; printf ");\n" |
---|
9062 | printf "#endif\n" |
---|
9063 | } |
---|
9064 | END { |
---|
9065 | printf "}\n"; |
---|
9066 | } |
---|
9067 | ' >>signal.c |
---|
9068 | $cat >signal.awk <<'EOP' |
---|
9069 | BEGIN { ndups = 0 } |
---|
9070 | $1 ~ /^NSIG$/ { nsig = $2 } |
---|
9071 | ($1 !~ /^NSIG$/) && (NF == 2) { |
---|
9072 | if ($2 > maxsig) { maxsig = $2 } |
---|
9073 | if (sig_name[$2]) { |
---|
9074 | dup_name[ndups] = $1 |
---|
9075 | dup_num[ndups] = $2 |
---|
9076 | ndups++ |
---|
9077 | } |
---|
9078 | else { |
---|
9079 | sig_name[$2] = $1 |
---|
9080 | sig_num[$2] = $2 |
---|
9081 | } |
---|
9082 | |
---|
9083 | } |
---|
9084 | END { |
---|
9085 | if (nsig == 0) { nsig = maxsig + 1 } |
---|
9086 | for (n = 1; n < nsig; n++) { |
---|
9087 | if (sig_name[n]) { |
---|
9088 | printf("%s %d\n", sig_name[n], sig_num[n]) |
---|
9089 | } |
---|
9090 | else { |
---|
9091 | printf("NUM%d %d\n", n, n) |
---|
9092 | } |
---|
9093 | } |
---|
9094 | for (n = 0; n < ndups; n++) { |
---|
9095 | printf("%s %d\n", dup_name[n], dup_num[n]) |
---|
9096 | } |
---|
9097 | } |
---|
9098 | EOP |
---|
9099 | $cat >signal_cmd <<EOS |
---|
9100 | $startsh |
---|
9101 | $test -s signal.lst && exit 0 |
---|
9102 | if $cc $ccflags $ldflags signal.c -o signal >/dev/null 2>&1; then |
---|
9103 | ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst |
---|
9104 | else |
---|
9105 | echo "(I can't seem be able to compile the test program -- Guessing)" |
---|
9106 | echo 'kill -l' >signal |
---|
9107 | set X \`csh -f <signal\` |
---|
9108 | $rm -f signal |
---|
9109 | shift |
---|
9110 | case \$# in |
---|
9111 | 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; |
---|
9112 | esac |
---|
9113 | echo \$@ | $tr ' ' '\012' | \ |
---|
9114 | $awk '{ printf \$1; printf " %d\n", ++s; }' >signal.lst |
---|
9115 | fi |
---|
9116 | $rm -f signal.c signal signal.o |
---|
9117 | EOS |
---|
9118 | chmod a+x signal_cmd |
---|
9119 | $eunicefix signal_cmd |
---|
9120 | |
---|
9121 | : generate list of signal names |
---|
9122 | echo " " |
---|
9123 | case "$sig_name" in |
---|
9124 | '') sig_num='' ;; |
---|
9125 | esac |
---|
9126 | case "$sig_num" in |
---|
9127 | '') sig_name='' ;; |
---|
9128 | esac |
---|
9129 | case "$sig_name" in |
---|
9130 | '') |
---|
9131 | echo "Generating a list of signal names and numbers..." >&4 |
---|
9132 | ./signal_cmd |
---|
9133 | sig_name=`$awk '{printf "%s ", $1}' signal.lst` |
---|
9134 | sig_name="ZERO $sig_name" |
---|
9135 | sig_num=`$awk '{printf "%d ", $2}' signal.lst` |
---|
9136 | sig_num="0 $sig_num" |
---|
9137 | ;; |
---|
9138 | esac |
---|
9139 | echo "The following signals are available:" |
---|
9140 | echo " " |
---|
9141 | echo $sig_name | $awk \ |
---|
9142 | 'BEGIN { linelen = 0 } |
---|
9143 | { |
---|
9144 | for (i = 1; i <= NF; i++) { |
---|
9145 | name = "SIG" $i " " |
---|
9146 | linelen = linelen + length(name) |
---|
9147 | if (linelen > 70) { |
---|
9148 | printf "\n" |
---|
9149 | linelen = length(name) |
---|
9150 | } |
---|
9151 | printf "%s", name |
---|
9152 | } |
---|
9153 | printf "\n" |
---|
9154 | }' |
---|
9155 | $rm -f signal signal.c signal.awk signal.lst signal_cmd |
---|
9156 | |
---|
9157 | : see what type is used for size_t |
---|
9158 | set size_t sizetype 'unsigned int' stdio.h sys/types.h |
---|
9159 | eval $typedef |
---|
9160 | dflt="$sizetype" |
---|
9161 | echo " " |
---|
9162 | rp="What type is used for the length parameter for string functions?" |
---|
9163 | . ./myread |
---|
9164 | sizetype="$ans" |
---|
9165 | |
---|
9166 | : see what type is used for signed size_t |
---|
9167 | set ssize_t ssizetype int stdio.h sys/types.h |
---|
9168 | eval $typedef |
---|
9169 | dflt="$ssizetype" |
---|
9170 | $cat > ssize.c <<EOM |
---|
9171 | #include <stdio.h> |
---|
9172 | #include <sys/types.h> |
---|
9173 | #define Size_t $sizetype |
---|
9174 | #define SSize_t $dflt |
---|
9175 | main() |
---|
9176 | { |
---|
9177 | if (sizeof(Size_t) == sizeof(SSize_t)) |
---|
9178 | printf("$dflt\n"); |
---|
9179 | else if (sizeof(Size_t) == sizeof(int)) |
---|
9180 | printf("int\n"); |
---|
9181 | else |
---|
9182 | printf("long\n"); |
---|
9183 | fflush(stdout); |
---|
9184 | exit(0); |
---|
9185 | } |
---|
9186 | EOM |
---|
9187 | echo " " |
---|
9188 | # If $libs contains -lsfio, and sfio is mis-configured, then it |
---|
9189 | # sometimes (apparently) runs and exits with a 0 status, but with no |
---|
9190 | # output!. Thus we check with test -s whether we actually got any |
---|
9191 | # output. I think it has to do with sfio's use of _exit vs. exit, |
---|
9192 | # but I don't know for sure. --Andy Dougherty 1/27/97. |
---|
9193 | if $cc $optimize $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 && |
---|
9194 | ./ssize > ssize.out 2>/dev/null && test -s ssize.out ; then |
---|
9195 | ssizetype=`$cat ssize.out` |
---|
9196 | echo "I'll be using $ssizetype for functions returning a byte count." >&4 |
---|
9197 | else |
---|
9198 | $cat >&4 <<EOM |
---|
9199 | |
---|
9200 | Help! I can't compile and run the ssize_t test program: please enlighten me! |
---|
9201 | (This is probably a misconfiguration in your system or libraries, and |
---|
9202 | you really ought to fix it. Still, I'll try anyway.) |
---|
9203 | |
---|
9204 | I need a type that is the same size as $sizetype, but is guaranteed to |
---|
9205 | be signed. Common values are ssize_t, int and long. |
---|
9206 | |
---|
9207 | EOM |
---|
9208 | rp="What signed type is the same size as $sizetype?" |
---|
9209 | . ./myread |
---|
9210 | ssizetype="$ans" |
---|
9211 | fi |
---|
9212 | $rm -f ssize ssize.[co] ssize.out |
---|
9213 | |
---|
9214 | : see what type of char stdio uses. |
---|
9215 | echo " " |
---|
9216 | if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then |
---|
9217 | echo "Your stdio uses unsigned chars." >&4 |
---|
9218 | stdchar="unsigned char" |
---|
9219 | else |
---|
9220 | echo "Your stdio uses signed chars." >&4 |
---|
9221 | stdchar="char" |
---|
9222 | fi |
---|
9223 | |
---|
9224 | : see if time exists |
---|
9225 | echo " " |
---|
9226 | if set time val -f d_time; eval $csym; $val; then |
---|
9227 | echo 'time() found.' >&4 |
---|
9228 | val="$define" |
---|
9229 | set time_t timetype long stdio.h sys/types.h |
---|
9230 | eval $typedef |
---|
9231 | dflt="$timetype" |
---|
9232 | echo " " |
---|
9233 | rp="What type is returned by time() on this system?" |
---|
9234 | . ./myread |
---|
9235 | timetype="$ans" |
---|
9236 | else |
---|
9237 | echo 'time() not found, hope that will do.' >&4 |
---|
9238 | val="$undef" |
---|
9239 | timetype='int'; |
---|
9240 | fi |
---|
9241 | set d_time |
---|
9242 | eval $setvar |
---|
9243 | |
---|
9244 | : see what type uids are declared as in the kernel |
---|
9245 | set uid_t uidtype xxx stdio.h sys/types.h |
---|
9246 | eval $typedef |
---|
9247 | case "$uidtype" in |
---|
9248 | xxx) |
---|
9249 | xxx=`./findhdr sys/user.h` |
---|
9250 | set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short |
---|
9251 | case $1 in |
---|
9252 | unsigned) dflt="$1 $2" ;; |
---|
9253 | *) dflt="$1" ;; |
---|
9254 | esac |
---|
9255 | ;; |
---|
9256 | *) dflt="$uidtype";; |
---|
9257 | esac |
---|
9258 | echo " " |
---|
9259 | rp="What is the type for user ids returned by getuid()?" |
---|
9260 | . ./myread |
---|
9261 | uidtype="$ans" |
---|
9262 | |
---|
9263 | : see if dbm.h is available |
---|
9264 | : see if dbmclose exists |
---|
9265 | set dbmclose d_dbmclose |
---|
9266 | eval $inlibc |
---|
9267 | |
---|
9268 | case "$d_dbmclose" in |
---|
9269 | $define) |
---|
9270 | set dbm.h i_dbm |
---|
9271 | eval $inhdr |
---|
9272 | case "$i_dbm" in |
---|
9273 | $define) |
---|
9274 | val="$undef" |
---|
9275 | set i_rpcsvcdbm |
---|
9276 | eval $setvar |
---|
9277 | ;; |
---|
9278 | *) set rpcsvc/dbm.h i_rpcsvcdbm |
---|
9279 | eval $inhdr |
---|
9280 | ;; |
---|
9281 | esac |
---|
9282 | ;; |
---|
9283 | *) echo "We won't be including <dbm.h>" |
---|
9284 | val="$undef" |
---|
9285 | set i_dbm |
---|
9286 | eval $setvar |
---|
9287 | val="$undef" |
---|
9288 | set i_rpcsvcdbm |
---|
9289 | eval $setvar |
---|
9290 | ;; |
---|
9291 | esac |
---|
9292 | |
---|
9293 | : see if this is a sys/file.h system |
---|
9294 | val='' |
---|
9295 | set sys/file.h val |
---|
9296 | eval $inhdr |
---|
9297 | |
---|
9298 | : do we need to include sys/file.h ? |
---|
9299 | case "$val" in |
---|
9300 | "$define") |
---|
9301 | echo " " |
---|
9302 | if $h_sysfile; then |
---|
9303 | val="$define" |
---|
9304 | echo "We'll be including <sys/file.h>." >&4 |
---|
9305 | else |
---|
9306 | val="$undef" |
---|
9307 | echo "We won't be including <sys/file.h>." >&4 |
---|
9308 | fi |
---|
9309 | ;; |
---|
9310 | *) |
---|
9311 | h_sysfile=false |
---|
9312 | ;; |
---|
9313 | esac |
---|
9314 | set i_sysfile |
---|
9315 | eval $setvar |
---|
9316 | |
---|
9317 | : see if fcntl.h is there |
---|
9318 | val='' |
---|
9319 | set fcntl.h val |
---|
9320 | eval $inhdr |
---|
9321 | |
---|
9322 | : see if we can include fcntl.h |
---|
9323 | case "$val" in |
---|
9324 | "$define") |
---|
9325 | echo " " |
---|
9326 | if $h_fcntl; then |
---|
9327 | val="$define" |
---|
9328 | echo "We'll be including <fcntl.h>." >&4 |
---|
9329 | else |
---|
9330 | val="$undef" |
---|
9331 | if $h_sysfile; then |
---|
9332 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 |
---|
9333 | else |
---|
9334 | echo "We won't be including <fcntl.h>." >&4 |
---|
9335 | fi |
---|
9336 | fi |
---|
9337 | ;; |
---|
9338 | *) |
---|
9339 | h_fcntl=false |
---|
9340 | val="$undef" |
---|
9341 | ;; |
---|
9342 | esac |
---|
9343 | set i_fcntl |
---|
9344 | eval $setvar |
---|
9345 | |
---|
9346 | : see if this is an grp system |
---|
9347 | set grp.h i_grp |
---|
9348 | eval $inhdr |
---|
9349 | |
---|
9350 | : see if locale.h is available |
---|
9351 | set locale.h i_locale |
---|
9352 | eval $inhdr |
---|
9353 | |
---|
9354 | : see if this is a math.h system |
---|
9355 | set math.h i_math |
---|
9356 | eval $inhdr |
---|
9357 | |
---|
9358 | : see if ndbm.h is available |
---|
9359 | set ndbm.h t_ndbm |
---|
9360 | eval $inhdr |
---|
9361 | case "$t_ndbm" in |
---|
9362 | $define) |
---|
9363 | : see if dbm_open exists |
---|
9364 | set dbm_open d_dbm_open |
---|
9365 | eval $inlibc |
---|
9366 | case "$d_dbm_open" in |
---|
9367 | $undef) |
---|
9368 | t_ndbm="$undef" |
---|
9369 | echo "We won't be including <ndbm.h>" |
---|
9370 | ;; |
---|
9371 | esac |
---|
9372 | ;; |
---|
9373 | esac |
---|
9374 | val="$t_ndbm" |
---|
9375 | set i_ndbm |
---|
9376 | eval $setvar |
---|
9377 | |
---|
9378 | : see if net/errno.h is available |
---|
9379 | val='' |
---|
9380 | set net/errno.h val |
---|
9381 | eval $inhdr |
---|
9382 | |
---|
9383 | : Unfortunately, it causes problems on some systems. Arrgh. |
---|
9384 | case "$val" in |
---|
9385 | $define) |
---|
9386 | cat > try.c <<'EOM' |
---|
9387 | #include <stdio.h> |
---|
9388 | #include <errno.h> |
---|
9389 | #include <net/errno.h> |
---|
9390 | int func() |
---|
9391 | { |
---|
9392 | return ENOTSOCK; |
---|
9393 | } |
---|
9394 | EOM |
---|
9395 | if $cc $ccflags -c try.c >/dev/null 2>&1; then |
---|
9396 | echo "We'll be including <net/errno.h>." >&4 |
---|
9397 | else |
---|
9398 | echo "We won't be including <net/errno.h>." >&4 |
---|
9399 | val="$undef" |
---|
9400 | fi |
---|
9401 | $rm -f try.* try |
---|
9402 | ;; |
---|
9403 | esac |
---|
9404 | set i_neterrno |
---|
9405 | eval $setvar |
---|
9406 | |
---|
9407 | : get C preprocessor symbols handy |
---|
9408 | echo " " |
---|
9409 | $echo $n "Hmm... $c" |
---|
9410 | echo $al | $tr ' ' '\012' >Cppsym.know |
---|
9411 | $cat <<EOSS >Cppsym |
---|
9412 | $startsh |
---|
9413 | case "\$1" in |
---|
9414 | -l) list=true |
---|
9415 | shift |
---|
9416 | ;; |
---|
9417 | esac |
---|
9418 | unknown='' |
---|
9419 | case "\$list\$#" in |
---|
9420 | 1|2) |
---|
9421 | for sym do |
---|
9422 | if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then |
---|
9423 | exit 0 |
---|
9424 | elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then |
---|
9425 | : |
---|
9426 | else |
---|
9427 | unknown="\$unknown \$sym" |
---|
9428 | fi |
---|
9429 | done |
---|
9430 | set X \$unknown |
---|
9431 | shift |
---|
9432 | ;; |
---|
9433 | esac |
---|
9434 | case \$# in |
---|
9435 | 0) exit 1;; |
---|
9436 | esac |
---|
9437 | echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\ |
---|
9438 | #ifdef \1\\ |
---|
9439 | exit 0; _ _ _ _\1\\ \1\\ |
---|
9440 | #endif\\ |
---|
9441 | /' >Cppsym\$\$ |
---|
9442 | echo "exit 1; _ _ _" >>Cppsym\$\$ |
---|
9443 | $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$ |
---|
9444 | case "\$list" in |
---|
9445 | true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;; |
---|
9446 | *) |
---|
9447 | sh Cppsym2\$\$ |
---|
9448 | status=\$? |
---|
9449 | ;; |
---|
9450 | esac |
---|
9451 | $rm -f Cppsym\$\$ Cppsym2\$\$ |
---|
9452 | exit \$status |
---|
9453 | EOSS |
---|
9454 | chmod +x Cppsym |
---|
9455 | $eunicefix Cppsym |
---|
9456 | ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true |
---|
9457 | |
---|
9458 | : now check the C compiler for additional symbols |
---|
9459 | $cat >ccsym <<EOS |
---|
9460 | $startsh |
---|
9461 | $cat >tmp.c <<EOF |
---|
9462 | extern int foo; |
---|
9463 | EOF |
---|
9464 | for i in \`$cc -v -c tmp.c 2>&1\` |
---|
9465 | do |
---|
9466 | case "\$i" in |
---|
9467 | -D*) echo "\$i" | $sed 's/^-D//';; |
---|
9468 | -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';; |
---|
9469 | esac |
---|
9470 | done |
---|
9471 | $rm -f try.c |
---|
9472 | EOS |
---|
9473 | chmod +x ccsym |
---|
9474 | $eunicefix ccsym |
---|
9475 | ./ccsym | $sort | $uniq >ccsym.raw |
---|
9476 | $awk '/\=/ { print $0; next } |
---|
9477 | { print $0"=1" }' ccsym.raw >ccsym.list |
---|
9478 | $awk '{ print $0"=1" }' Cppsym.true >ccsym.true |
---|
9479 | $comm -13 ccsym.true ccsym.list >ccsym.own |
---|
9480 | $comm -12 ccsym.true ccsym.list >ccsym.com |
---|
9481 | $comm -23 ccsym.true ccsym.list >ccsym.cpp |
---|
9482 | also='' |
---|
9483 | symbols='symbols' |
---|
9484 | if $test -z ccsym.raw; then |
---|
9485 | echo "Your C compiler doesn't seem to define any symbol!" >&4 |
---|
9486 | echo " " |
---|
9487 | echo "However, your C preprocessor defines the following ones:" |
---|
9488 | $cat Cppsym.true |
---|
9489 | else |
---|
9490 | if $test -s ccsym.com; then |
---|
9491 | echo "Your C compiler and pre-processor define these symbols:" |
---|
9492 | $sed -e 's/\(.*\)=.*/\1/' ccsym.com |
---|
9493 | also='also ' |
---|
9494 | symbols='ones' |
---|
9495 | $test "$silent" || sleep 1 |
---|
9496 | fi |
---|
9497 | if $test -s ccsym.cpp; then |
---|
9498 | $test "$also" && echo " " |
---|
9499 | echo "Your C pre-processor ${also}defines the following $symbols:" |
---|
9500 | $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp |
---|
9501 | also='further ' |
---|
9502 | $test "$silent" || sleep 1 |
---|
9503 | fi |
---|
9504 | if $test -s ccsym.own; then |
---|
9505 | $test "$also" && echo " " |
---|
9506 | echo "Your C compiler ${also}defines the following cpp variables:" |
---|
9507 | $sed -e 's/\(.*\)=1/\1/' ccsym.own |
---|
9508 | $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true |
---|
9509 | $test "$silent" || sleep 1 |
---|
9510 | fi |
---|
9511 | fi |
---|
9512 | $rm -f ccsym* |
---|
9513 | |
---|
9514 | : see if this is a termio system |
---|
9515 | val="$undef" |
---|
9516 | val2="$undef" |
---|
9517 | val3="$undef" |
---|
9518 | if $test `./findhdr termios.h`; then |
---|
9519 | set tcsetattr i_termios |
---|
9520 | eval $inlibc |
---|
9521 | val3="$i_termios" |
---|
9522 | fi |
---|
9523 | echo " " |
---|
9524 | case "$val3" in |
---|
9525 | "$define") echo "You have POSIX termios.h... good!" >&4;; |
---|
9526 | *) if ./Cppsym pyr; then |
---|
9527 | case "`/bin/universe`" in |
---|
9528 | ucb) if $test `./findhdr sgtty.h`; then |
---|
9529 | val2="$define" |
---|
9530 | echo "<sgtty.h> found." >&4 |
---|
9531 | else |
---|
9532 | echo "System is pyramid with BSD universe." |
---|
9533 | echo "<sgtty.h> not found--you could have problems." >&4 |
---|
9534 | fi;; |
---|
9535 | *) if $test `./findhdr termio.h`; then |
---|
9536 | val="$define" |
---|
9537 | echo "<termio.h> found." >&4 |
---|
9538 | else |
---|
9539 | echo "System is pyramid with USG universe." |
---|
9540 | echo "<termio.h> not found--you could have problems." >&4 |
---|
9541 | fi;; |
---|
9542 | esac |
---|
9543 | elif ./usg; then |
---|
9544 | if $test `./findhdr termio.h`; then |
---|
9545 | echo "<termio.h> found." >&4 |
---|
9546 | val="$define" |
---|
9547 | elif $test `./findhdr sgtty.h`; then |
---|
9548 | echo "<sgtty.h> found." >&4 |
---|
9549 | val2="$define" |
---|
9550 | else |
---|
9551 | echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4 |
---|
9552 | fi |
---|
9553 | else |
---|
9554 | if $test `./findhdr sgtty.h`; then |
---|
9555 | echo "<sgtty.h> found." >&4 |
---|
9556 | val2="$define" |
---|
9557 | elif $test `./findhdr termio.h`; then |
---|
9558 | echo "<termio.h> found." >&4 |
---|
9559 | val="$define" |
---|
9560 | else |
---|
9561 | echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4 |
---|
9562 | fi |
---|
9563 | fi;; |
---|
9564 | esac |
---|
9565 | set i_termio; eval $setvar |
---|
9566 | val=$val2; set i_sgtty; eval $setvar |
---|
9567 | val=$val3; set i_termios; eval $setvar |
---|
9568 | |
---|
9569 | : see if stdarg is available |
---|
9570 | echo " " |
---|
9571 | if $test `./findhdr stdarg.h`; then |
---|
9572 | echo "<stdarg.h> found." >&4 |
---|
9573 | valstd="$define" |
---|
9574 | else |
---|
9575 | echo "<stdarg.h> NOT found." >&4 |
---|
9576 | valstd="$undef" |
---|
9577 | fi |
---|
9578 | |
---|
9579 | : see if varags is available |
---|
9580 | echo " " |
---|
9581 | if $test `./findhdr varargs.h`; then |
---|
9582 | echo "<varargs.h> found." >&4 |
---|
9583 | else |
---|
9584 | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 |
---|
9585 | fi |
---|
9586 | |
---|
9587 | : set up the varargs testing programs |
---|
9588 | $cat > varargs.c <<EOP |
---|
9589 | #ifdef I_STDARG |
---|
9590 | #include <stdarg.h> |
---|
9591 | #endif |
---|
9592 | #ifdef I_VARARGS |
---|
9593 | #include <varargs.h> |
---|
9594 | #endif |
---|
9595 | |
---|
9596 | #ifdef I_STDARG |
---|
9597 | int f(char *p, ...) |
---|
9598 | #else |
---|
9599 | int f(va_alist) |
---|
9600 | va_dcl |
---|
9601 | #endif |
---|
9602 | { |
---|
9603 | va_list ap; |
---|
9604 | #ifndef I_STDARG |
---|
9605 | char *p; |
---|
9606 | #endif |
---|
9607 | #ifdef I_STDARG |
---|
9608 | va_start(ap,p); |
---|
9609 | #else |
---|
9610 | va_start(ap); |
---|
9611 | p = va_arg(ap, char *); |
---|
9612 | #endif |
---|
9613 | va_end(ap); |
---|
9614 | } |
---|
9615 | EOP |
---|
9616 | $cat > varargs <<EOP |
---|
9617 | $startsh |
---|
9618 | if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then |
---|
9619 | echo "true" |
---|
9620 | else |
---|
9621 | echo "false" |
---|
9622 | fi |
---|
9623 | $rm -f varargs.o |
---|
9624 | EOP |
---|
9625 | chmod +x varargs |
---|
9626 | |
---|
9627 | : now check which varargs header should be included |
---|
9628 | echo " " |
---|
9629 | i_varhdr='' |
---|
9630 | case "$valstd" in |
---|
9631 | "$define") |
---|
9632 | if `./varargs I_STDARG`; then |
---|
9633 | val='stdarg.h' |
---|
9634 | elif `./varargs I_VARARGS`; then |
---|
9635 | val='varargs.h' |
---|
9636 | fi |
---|
9637 | ;; |
---|
9638 | *) |
---|
9639 | if `./varargs I_VARARGS`; then |
---|
9640 | val='varargs.h' |
---|
9641 | fi |
---|
9642 | ;; |
---|
9643 | esac |
---|
9644 | case "$val" in |
---|
9645 | '') |
---|
9646 | echo "I could not find the definition for va_dcl... You have problems..." >&4 |
---|
9647 | val="$undef"; set i_stdarg; eval $setvar |
---|
9648 | val="$undef"; set i_varargs; eval $setvar |
---|
9649 | ;; |
---|
9650 | *) |
---|
9651 | set i_varhdr |
---|
9652 | eval $setvar |
---|
9653 | case "$i_varhdr" in |
---|
9654 | stdarg.h) |
---|
9655 | val="$define"; set i_stdarg; eval $setvar |
---|
9656 | val="$undef"; set i_varargs; eval $setvar |
---|
9657 | ;; |
---|
9658 | varargs.h) |
---|
9659 | val="$undef"; set i_stdarg; eval $setvar |
---|
9660 | val="$define"; set i_varargs; eval $setvar |
---|
9661 | ;; |
---|
9662 | esac |
---|
9663 | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; |
---|
9664 | esac |
---|
9665 | $rm -f varargs* |
---|
9666 | |
---|
9667 | : see if stddef is available |
---|
9668 | set stddef.h i_stddef |
---|
9669 | eval $inhdr |
---|
9670 | |
---|
9671 | : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl |
---|
9672 | set sys/filio.h i_sysfilio |
---|
9673 | eval $inhdr |
---|
9674 | echo " " |
---|
9675 | if $test `./findhdr sys/ioctl.h`; then |
---|
9676 | val="$define" |
---|
9677 | echo '<sys/ioctl.h> found.' >&4 |
---|
9678 | else |
---|
9679 | val="$undef" |
---|
9680 | if $test $i_sysfilio = "$define"; then |
---|
9681 | echo '<sys/ioctl.h> NOT found.' >&4 |
---|
9682 | else |
---|
9683 | $test $i_sgtty = "$define" && xxx="sgtty.h" |
---|
9684 | $test $i_termio = "$define" && xxx="termio.h" |
---|
9685 | $test $i_termios = "$define" && xxx="termios.h" |
---|
9686 | echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4 |
---|
9687 | fi |
---|
9688 | fi |
---|
9689 | set i_sysioctl |
---|
9690 | eval $setvar |
---|
9691 | |
---|
9692 | : see if this is a sys/param system |
---|
9693 | set sys/param.h i_sysparam |
---|
9694 | eval $inhdr |
---|
9695 | |
---|
9696 | : see if sys/resource.h has to be included |
---|
9697 | set sys/resource.h i_sysresrc |
---|
9698 | eval $inhdr |
---|
9699 | |
---|
9700 | : see if sys/stat.h is available |
---|
9701 | set sys/stat.h i_sysstat |
---|
9702 | eval $inhdr |
---|
9703 | |
---|
9704 | : see if sys/types.h has to be included |
---|
9705 | set sys/types.h i_systypes |
---|
9706 | eval $inhdr |
---|
9707 | |
---|
9708 | : see if this is a sys/un.h system |
---|
9709 | set sys/un.h i_sysun |
---|
9710 | eval $inhdr |
---|
9711 | |
---|
9712 | : see if this is a syswait system |
---|
9713 | set sys/wait.h i_syswait |
---|
9714 | eval $inhdr |
---|
9715 | |
---|
9716 | : see if this is an utime system |
---|
9717 | set utime.h i_utime |
---|
9718 | eval $inhdr |
---|
9719 | |
---|
9720 | : see if this is a values.h system |
---|
9721 | set values.h i_values |
---|
9722 | eval $inhdr |
---|
9723 | |
---|
9724 | : see if this is a vfork system |
---|
9725 | case "$d_vfork" in |
---|
9726 | "$define") |
---|
9727 | set vfork.h i_vfork |
---|
9728 | eval $inhdr |
---|
9729 | ;; |
---|
9730 | *) |
---|
9731 | i_vfork="$undef" |
---|
9732 | ;; |
---|
9733 | esac |
---|
9734 | |
---|
9735 | : see if gdbm.h is available |
---|
9736 | set gdbm.h t_gdbm |
---|
9737 | eval $inhdr |
---|
9738 | case "$t_gdbm" in |
---|
9739 | $define) |
---|
9740 | : see if gdbm_open exists |
---|
9741 | set gdbm_open d_gdbm_open |
---|
9742 | eval $inlibc |
---|
9743 | case "$d_gdbm_open" in |
---|
9744 | $undef) |
---|
9745 | t_gdbm="$undef" |
---|
9746 | echo "We won't be including <gdbm.h>" |
---|
9747 | ;; |
---|
9748 | esac |
---|
9749 | ;; |
---|
9750 | esac |
---|
9751 | val="$t_gdbm" |
---|
9752 | set i_gdbm |
---|
9753 | eval $setvar |
---|
9754 | |
---|
9755 | echo " " |
---|
9756 | echo "Looking for extensions..." >&4 |
---|
9757 | cd ../ext |
---|
9758 | : If we are using the old config.sh, known_extensions may contain |
---|
9759 | : old or inaccurate or duplicate values. |
---|
9760 | known_extensions='' |
---|
9761 | : We do not use find because it might not be available. |
---|
9762 | : We do not just use MANIFEST because the user may have dropped |
---|
9763 | : some additional extensions into the source tree and expect them |
---|
9764 | : to be built. |
---|
9765 | for xxx in * ; do |
---|
9766 | case "$xxx" in |
---|
9767 | DynaLoader) ;; |
---|
9768 | *) if $test -f $xxx/$xxx.xs; then |
---|
9769 | known_extensions="$known_extensions $xxx" |
---|
9770 | else |
---|
9771 | if $test -d $xxx; then |
---|
9772 | cd $xxx |
---|
9773 | for yyy in * ; do |
---|
9774 | if $test -f $yyy/$yyy.xs; then |
---|
9775 | known_extensions="$known_extensions $xxx/$yyy" |
---|
9776 | fi |
---|
9777 | done |
---|
9778 | cd .. |
---|
9779 | fi |
---|
9780 | fi ;; |
---|
9781 | esac |
---|
9782 | done |
---|
9783 | set X $known_extensions |
---|
9784 | shift |
---|
9785 | known_extensions="$*" |
---|
9786 | cd ../UU |
---|
9787 | |
---|
9788 | : Now see which are supported on this system. |
---|
9789 | avail_ext='' |
---|
9790 | for xxx in $known_extensions ; do |
---|
9791 | case "$xxx" in |
---|
9792 | DB_File) case "$i_db" in |
---|
9793 | $define) avail_ext="$avail_ext $xxx" ;; |
---|
9794 | esac |
---|
9795 | ;; |
---|
9796 | GDBM_File) case "$i_gdbm" in |
---|
9797 | $define) avail_ext="$avail_ext $xxx" ;; |
---|
9798 | esac |
---|
9799 | ;; |
---|
9800 | NDBM_File) case "$i_ndbm" in |
---|
9801 | $define) avail_ext="$avail_ext $xxx" ;; |
---|
9802 | esac |
---|
9803 | ;; |
---|
9804 | ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in |
---|
9805 | *"${define}"*) avail_ext="$avail_ext $xxx" ;; |
---|
9806 | esac |
---|
9807 | ;; |
---|
9808 | POSIX) case "$useposix" in |
---|
9809 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
---|
9810 | esac |
---|
9811 | ;; |
---|
9812 | Opcode) case "$useopcode" in |
---|
9813 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
---|
9814 | esac |
---|
9815 | ;; |
---|
9816 | Socket) case "$d_socket" in |
---|
9817 | $define) avail_ext="$avail_ext $xxx" ;; |
---|
9818 | esac |
---|
9819 | ;; |
---|
9820 | *) avail_ext="$avail_ext $xxx" |
---|
9821 | ;; |
---|
9822 | esac |
---|
9823 | done |
---|
9824 | |
---|
9825 | set X $avail_ext |
---|
9826 | shift |
---|
9827 | avail_ext="$*" |
---|
9828 | |
---|
9829 | case $usedl in |
---|
9830 | $define) |
---|
9831 | $cat <<EOM |
---|
9832 | A number of extensions are supplied with $package. You may choose to |
---|
9833 | compile these extensions for dynamic loading (the default), compile |
---|
9834 | them into the $package executable (static loading), or not include |
---|
9835 | them at all. Answer "none" to include no extensions. |
---|
9836 | |
---|
9837 | EOM |
---|
9838 | case "$dynamic_ext" in |
---|
9839 | '') dflt="$avail_ext" ;; |
---|
9840 | *) dflt="$dynamic_ext" ;; |
---|
9841 | esac |
---|
9842 | case "$dflt" in |
---|
9843 | '') dflt=none;; |
---|
9844 | esac |
---|
9845 | rp="What extensions do you wish to load dynamically?" |
---|
9846 | . ./myread |
---|
9847 | case "$ans" in |
---|
9848 | none) dynamic_ext=' ' ;; |
---|
9849 | *) dynamic_ext="$ans" ;; |
---|
9850 | esac |
---|
9851 | |
---|
9852 | case "$static_ext" in |
---|
9853 | '') |
---|
9854 | : Exclude those already listed in dynamic linking |
---|
9855 | dflt='' |
---|
9856 | for xxx in $avail_ext; do |
---|
9857 | case " $dynamic_ext " in |
---|
9858 | *" $xxx "*) ;; |
---|
9859 | *) dflt="$dflt $xxx" ;; |
---|
9860 | esac |
---|
9861 | done |
---|
9862 | set X $dflt |
---|
9863 | shift |
---|
9864 | dflt="$*" |
---|
9865 | ;; |
---|
9866 | *) dflt="$static_ext" |
---|
9867 | ;; |
---|
9868 | esac |
---|
9869 | |
---|
9870 | case "$dflt" in |
---|
9871 | '') dflt=none;; |
---|
9872 | esac |
---|
9873 | rp="What extensions do you wish to load statically?" |
---|
9874 | . ./myread |
---|
9875 | case "$ans" in |
---|
9876 | none) static_ext=' ' ;; |
---|
9877 | *) static_ext="$ans" ;; |
---|
9878 | esac |
---|
9879 | ;; |
---|
9880 | *) |
---|
9881 | $cat <<EOM |
---|
9882 | A number of extensions are supplied with $package. Answer "none" |
---|
9883 | to include no extensions. |
---|
9884 | |
---|
9885 | EOM |
---|
9886 | case "$static_ext" in |
---|
9887 | '') dflt="$avail_ext" ;; |
---|
9888 | *) dflt="$static_ext" ;; |
---|
9889 | esac |
---|
9890 | |
---|
9891 | case "$dflt" in |
---|
9892 | '') dflt=none;; |
---|
9893 | esac |
---|
9894 | rp="What extensions do you wish to include?" |
---|
9895 | . ./myread |
---|
9896 | case "$ans" in |
---|
9897 | none) static_ext=' ' ;; |
---|
9898 | *) static_ext="$ans" ;; |
---|
9899 | esac |
---|
9900 | ;; |
---|
9901 | esac |
---|
9902 | |
---|
9903 | set X $dynamic_ext $static_ext |
---|
9904 | shift |
---|
9905 | extensions="$*" |
---|
9906 | |
---|
9907 | : Remove build directory name from cppstdin so it can be used from |
---|
9908 | : either the present location or the final installed location. |
---|
9909 | echo " " |
---|
9910 | : Get out of the UU directory to get correct path name. |
---|
9911 | cd .. |
---|
9912 | case "$cppstdin" in |
---|
9913 | `pwd`/cppstdin) |
---|
9914 | echo "Stripping down cppstdin path name" |
---|
9915 | cppstdin=cppstdin |
---|
9916 | ;; |
---|
9917 | esac |
---|
9918 | cd UU |
---|
9919 | |
---|
9920 | : end of configuration questions |
---|
9921 | echo " " |
---|
9922 | echo "End of configuration questions." |
---|
9923 | echo " " |
---|
9924 | |
---|
9925 | : back to where it started |
---|
9926 | if test -d ../UU; then |
---|
9927 | cd .. |
---|
9928 | fi |
---|
9929 | |
---|
9930 | : configuration may be patched via a 'config.over' file |
---|
9931 | if $test -f config.over; then |
---|
9932 | echo " " |
---|
9933 | dflt=y |
---|
9934 | rp='I see a config.over file. Do you wish to load it?' |
---|
9935 | . UU/myread |
---|
9936 | case "$ans" in |
---|
9937 | n*) echo "OK, I'll ignore it.";; |
---|
9938 | *) . ./config.over |
---|
9939 | echo "Configuration override changes have been loaded." |
---|
9940 | ;; |
---|
9941 | esac |
---|
9942 | fi |
---|
9943 | |
---|
9944 | : in case they want portability, strip down executable paths |
---|
9945 | case "$d_portable" in |
---|
9946 | "$define") |
---|
9947 | echo " " |
---|
9948 | echo "Stripping down executable paths..." >&4 |
---|
9949 | for file in $loclist $trylist; do |
---|
9950 | eval $file="\$file" |
---|
9951 | done |
---|
9952 | ;; |
---|
9953 | esac |
---|
9954 | |
---|
9955 | : create config.sh file |
---|
9956 | echo " " |
---|
9957 | echo "Creating config.sh..." >&4 |
---|
9958 | $spitshell <<EOT >config.sh |
---|
9959 | $startsh |
---|
9960 | # |
---|
9961 | # This file was produced by running the Configure script. It holds all |
---|
9962 | # the definitions figured out by Configure. Should you modify any of |
---|
9963 | # these values, do not forget to propagate your changes by running |
---|
9964 | # "Configure -S"; or, equivalently, you may run each .SH file yourself. |
---|
9965 | # |
---|
9966 | |
---|
9967 | # Configuration time: $cf_time |
---|
9968 | # Configured by: $cf_by |
---|
9969 | # Target system: $myuname |
---|
9970 | |
---|
9971 | Author='$Author' |
---|
9972 | Date='$Date' |
---|
9973 | Header='$Header' |
---|
9974 | Id='$Id' |
---|
9975 | Locker='$Locker' |
---|
9976 | Log='$Log' |
---|
9977 | Mcc='$Mcc' |
---|
9978 | RCSfile='$RCSfile' |
---|
9979 | Revision='$Revision' |
---|
9980 | Source='$Source' |
---|
9981 | State='$State' |
---|
9982 | afs='$afs' |
---|
9983 | alignbytes='$alignbytes' |
---|
9984 | aphostname='$aphostname' |
---|
9985 | ar='$ar' |
---|
9986 | archlib='$archlib' |
---|
9987 | archlibexp='$archlibexp' |
---|
9988 | archname='$archname' |
---|
9989 | archobjs='$archobjs' |
---|
9990 | awk='$awk' |
---|
9991 | baserev='$baserev' |
---|
9992 | bash='$bash' |
---|
9993 | bin='$bin' |
---|
9994 | bincompat3='$bincompat3' |
---|
9995 | binexp='$binexp' |
---|
9996 | bison='$bison' |
---|
9997 | byacc='$byacc' |
---|
9998 | byteorder='$byteorder' |
---|
9999 | c='$c' |
---|
10000 | castflags='$castflags' |
---|
10001 | cat='$cat' |
---|
10002 | cc='$cc' |
---|
10003 | cccdlflags='$cccdlflags' |
---|
10004 | ccdlflags='$ccdlflags' |
---|
10005 | ccflags='$ccflags' |
---|
10006 | cf_by='$cf_by' |
---|
10007 | cf_email='$cf_email' |
---|
10008 | cf_time='$cf_time' |
---|
10009 | chgrp='$chgrp' |
---|
10010 | chmod='$chmod' |
---|
10011 | chown='$chown' |
---|
10012 | clocktype='$clocktype' |
---|
10013 | comm='$comm' |
---|
10014 | compress='$compress' |
---|
10015 | contains='$contains' |
---|
10016 | cp='$cp' |
---|
10017 | cpio='$cpio' |
---|
10018 | cpp='$cpp' |
---|
10019 | cpp_stuff='$cpp_stuff' |
---|
10020 | cppflags='$cppflags' |
---|
10021 | cpplast='$cpplast' |
---|
10022 | cppminus='$cppminus' |
---|
10023 | cpprun='$cpprun' |
---|
10024 | cppstdin='$cppstdin' |
---|
10025 | cryptlib='$cryptlib' |
---|
10026 | csh='$csh' |
---|
10027 | d_Gconvert='$d_Gconvert' |
---|
10028 | d_access='$d_access' |
---|
10029 | d_alarm='$d_alarm' |
---|
10030 | d_archlib='$d_archlib' |
---|
10031 | d_attribut='$d_attribut' |
---|
10032 | d_bcmp='$d_bcmp' |
---|
10033 | d_bcopy='$d_bcopy' |
---|
10034 | d_bincompat3='$d_bincompat3' |
---|
10035 | d_bsd='$d_bsd' |
---|
10036 | d_bsdgetpgrp='$d_bsdgetpgrp' |
---|
10037 | d_bsdpgrp='$d_bsdpgrp' |
---|
10038 | d_bsdsetpgrp='$d_bsdsetpgrp' |
---|
10039 | d_bzero='$d_bzero' |
---|
10040 | d_casti32='$d_casti32' |
---|
10041 | d_castneg='$d_castneg' |
---|
10042 | d_charvspr='$d_charvspr' |
---|
10043 | d_chown='$d_chown' |
---|
10044 | d_chroot='$d_chroot' |
---|
10045 | d_chsize='$d_chsize' |
---|
10046 | d_closedir='$d_closedir' |
---|
10047 | d_const='$d_const' |
---|
10048 | d_crypt='$d_crypt' |
---|
10049 | d_csh='$d_csh' |
---|
10050 | d_cuserid='$d_cuserid' |
---|
10051 | d_dbl_dig='$d_dbl_dig' |
---|
10052 | d_difftime='$d_difftime' |
---|
10053 | d_dirnamlen='$d_dirnamlen' |
---|
10054 | d_dlerror='$d_dlerror' |
---|
10055 | d_dlopen='$d_dlopen' |
---|
10056 | d_dlsymun='$d_dlsymun' |
---|
10057 | d_dosuid='$d_dosuid' |
---|
10058 | d_dup2='$d_dup2' |
---|
10059 | d_eofnblk='$d_eofnblk' |
---|
10060 | d_eunice='$d_eunice' |
---|
10061 | d_fchmod='$d_fchmod' |
---|
10062 | d_fchown='$d_fchown' |
---|
10063 | d_fcntl='$d_fcntl' |
---|
10064 | d_fd_macros='$d_fd_macros' |
---|
10065 | d_fd_set='$d_fd_set' |
---|
10066 | d_fds_bits='$d_fds_bits' |
---|
10067 | d_fgetpos='$d_fgetpos' |
---|
10068 | d_flexfnam='$d_flexfnam' |
---|
10069 | d_flock='$d_flock' |
---|
10070 | d_fork='$d_fork' |
---|
10071 | d_fpathconf='$d_fpathconf' |
---|
10072 | d_fsetpos='$d_fsetpos' |
---|
10073 | d_ftime='$d_ftime' |
---|
10074 | d_getgrps='$d_getgrps' |
---|
10075 | d_setgrps='$d_setgrps' |
---|
10076 | d_gethent='$d_gethent' |
---|
10077 | d_gethname='$d_gethname' |
---|
10078 | d_getlogin='$d_getlogin' |
---|
10079 | d_getpgid='$d_getpgid' |
---|
10080 | d_getpgrp2='$d_getpgrp2' |
---|
10081 | d_getpgrp='$d_getpgrp' |
---|
10082 | d_getppid='$d_getppid' |
---|
10083 | d_getprior='$d_getprior' |
---|
10084 | d_gettimeod='$d_gettimeod' |
---|
10085 | d_gnulibc='$d_gnulibc' |
---|
10086 | d_htonl='$d_htonl' |
---|
10087 | d_index='$d_index' |
---|
10088 | d_inetaton='$d_inetaton' |
---|
10089 | d_isascii='$d_isascii' |
---|
10090 | d_killpg='$d_killpg' |
---|
10091 | d_link='$d_link' |
---|
10092 | d_locconv='$d_locconv' |
---|
10093 | d_lockf='$d_lockf' |
---|
10094 | d_lstat='$d_lstat' |
---|
10095 | d_mblen='$d_mblen' |
---|
10096 | d_mbstowcs='$d_mbstowcs' |
---|
10097 | d_mbtowc='$d_mbtowc' |
---|
10098 | d_memcmp='$d_memcmp' |
---|
10099 | d_memcpy='$d_memcpy' |
---|
10100 | d_memmove='$d_memmove' |
---|
10101 | d_memset='$d_memset' |
---|
10102 | d_mkdir='$d_mkdir' |
---|
10103 | d_mkfifo='$d_mkfifo' |
---|
10104 | d_mktime='$d_mktime' |
---|
10105 | d_msg='$d_msg' |
---|
10106 | d_msgctl='$d_msgctl' |
---|
10107 | d_msgget='$d_msgget' |
---|
10108 | d_msgrcv='$d_msgrcv' |
---|
10109 | d_msgsnd='$d_msgsnd' |
---|
10110 | d_mymalloc='$d_mymalloc' |
---|
10111 | d_nice='$d_nice' |
---|
10112 | d_oldarchlib='$d_oldarchlib' |
---|
10113 | d_oldsock='$d_oldsock' |
---|
10114 | d_open3='$d_open3' |
---|
10115 | d_pathconf='$d_pathconf' |
---|
10116 | d_pause='$d_pause' |
---|
10117 | d_phostname='$d_phostname' |
---|
10118 | d_pipe='$d_pipe' |
---|
10119 | d_poll='$d_poll' |
---|
10120 | d_portable='$d_portable' |
---|
10121 | d_pwage='$d_pwage' |
---|
10122 | d_pwchange='$d_pwchange' |
---|
10123 | d_pwclass='$d_pwclass' |
---|
10124 | d_pwcomment='$d_pwcomment' |
---|
10125 | d_pwexpire='$d_pwexpire' |
---|
10126 | d_pwquota='$d_pwquota' |
---|
10127 | d_readdir='$d_readdir' |
---|
10128 | d_readlink='$d_readlink' |
---|
10129 | d_rename='$d_rename' |
---|
10130 | d_rewinddir='$d_rewinddir' |
---|
10131 | d_rmdir='$d_rmdir' |
---|
10132 | d_safebcpy='$d_safebcpy' |
---|
10133 | d_safemcpy='$d_safemcpy' |
---|
10134 | d_sanemcmp='$d_sanemcmp' |
---|
10135 | d_seekdir='$d_seekdir' |
---|
10136 | d_select='$d_select' |
---|
10137 | d_sem='$d_sem' |
---|
10138 | d_semctl='$d_semctl' |
---|
10139 | d_semget='$d_semget' |
---|
10140 | d_semop='$d_semop' |
---|
10141 | d_setegid='$d_setegid' |
---|
10142 | d_seteuid='$d_seteuid' |
---|
10143 | d_setlinebuf='$d_setlinebuf' |
---|
10144 | d_setlocale='$d_setlocale' |
---|
10145 | d_setpgid='$d_setpgid' |
---|
10146 | d_setpgrp2='$d_setpgrp2' |
---|
10147 | d_setpgrp='$d_setpgrp' |
---|
10148 | d_setprior='$d_setprior' |
---|
10149 | d_setregid='$d_setregid' |
---|
10150 | d_setresgid='$d_setresgid' |
---|
10151 | d_setresuid='$d_setresuid' |
---|
10152 | d_setreuid='$d_setreuid' |
---|
10153 | d_setrgid='$d_setrgid' |
---|
10154 | d_setruid='$d_setruid' |
---|
10155 | d_setsid='$d_setsid' |
---|
10156 | d_sfio='$d_sfio' |
---|
10157 | d_shm='$d_shm' |
---|
10158 | d_shmat='$d_shmat' |
---|
10159 | d_shmatprototype='$d_shmatprototype' |
---|
10160 | d_shmctl='$d_shmctl' |
---|
10161 | d_shmdt='$d_shmdt' |
---|
10162 | d_shmget='$d_shmget' |
---|
10163 | d_sigaction='$d_sigaction' |
---|
10164 | d_sigsetjmp='$d_sigsetjmp' |
---|
10165 | d_socket='$d_socket' |
---|
10166 | d_sockpair='$d_sockpair' |
---|
10167 | d_statblks='$d_statblks' |
---|
10168 | d_stdio_cnt_lval='$d_stdio_cnt_lval' |
---|
10169 | d_stdio_ptr_lval='$d_stdio_ptr_lval' |
---|
10170 | d_stdiobase='$d_stdiobase' |
---|
10171 | d_stdstdio='$d_stdstdio' |
---|
10172 | d_strchr='$d_strchr' |
---|
10173 | d_strcoll='$d_strcoll' |
---|
10174 | d_strctcpy='$d_strctcpy' |
---|
10175 | d_strerrm='$d_strerrm' |
---|
10176 | d_strerror='$d_strerror' |
---|
10177 | d_strtod='$d_strtod' |
---|
10178 | d_strtol='$d_strtol' |
---|
10179 | d_strtoul='$d_strtoul' |
---|
10180 | d_strxfrm='$d_strxfrm' |
---|
10181 | d_suidsafe='$d_suidsafe' |
---|
10182 | d_symlink='$d_symlink' |
---|
10183 | d_syscall='$d_syscall' |
---|
10184 | d_sysconf='$d_sysconf' |
---|
10185 | d_sysernlst='$d_sysernlst' |
---|
10186 | d_syserrlst='$d_syserrlst' |
---|
10187 | d_system='$d_system' |
---|
10188 | d_tcgetpgrp='$d_tcgetpgrp' |
---|
10189 | d_tcsetpgrp='$d_tcsetpgrp' |
---|
10190 | d_telldir='$d_telldir' |
---|
10191 | d_time='$d_time' |
---|
10192 | d_times='$d_times' |
---|
10193 | d_truncate='$d_truncate' |
---|
10194 | d_tzname='$d_tzname' |
---|
10195 | d_umask='$d_umask' |
---|
10196 | d_uname='$d_uname' |
---|
10197 | d_vfork='$d_vfork' |
---|
10198 | d_void_closedir='$d_void_closedir' |
---|
10199 | d_voidsig='$d_voidsig' |
---|
10200 | d_voidtty='$d_voidtty' |
---|
10201 | d_volatile='$d_volatile' |
---|
10202 | d_vprintf='$d_vprintf' |
---|
10203 | d_wait4='$d_wait4' |
---|
10204 | d_waitpid='$d_waitpid' |
---|
10205 | d_wcstombs='$d_wcstombs' |
---|
10206 | d_wctomb='$d_wctomb' |
---|
10207 | d_xenix='$d_xenix' |
---|
10208 | date='$date' |
---|
10209 | db_hashtype='$db_hashtype' |
---|
10210 | db_prefixtype='$db_prefixtype' |
---|
10211 | defvoidused='$defvoidused' |
---|
10212 | direntrytype='$direntrytype' |
---|
10213 | dlext='$dlext' |
---|
10214 | dlsrc='$dlsrc' |
---|
10215 | dynamic_ext='$dynamic_ext' |
---|
10216 | eagain='$eagain' |
---|
10217 | echo='$echo' |
---|
10218 | egrep='$egrep' |
---|
10219 | emacs='$emacs' |
---|
10220 | eunicefix='$eunicefix' |
---|
10221 | exe_ext='$exe_ext' |
---|
10222 | expr='$expr' |
---|
10223 | extensions='$extensions' |
---|
10224 | find='$find' |
---|
10225 | firstmakefile='$firstmakefile' |
---|
10226 | flex='$flex' |
---|
10227 | fpostype='$fpostype' |
---|
10228 | freetype='$freetype' |
---|
10229 | full_csh='$full_csh' |
---|
10230 | full_sed='$full_sed' |
---|
10231 | gcc='$gcc' |
---|
10232 | gccversion='$gccversion' |
---|
10233 | gidtype='$gidtype' |
---|
10234 | glibpth='$glibpth' |
---|
10235 | grep='$grep' |
---|
10236 | groupcat='$groupcat' |
---|
10237 | groupstype='$groupstype' |
---|
10238 | gzip='$gzip' |
---|
10239 | h_fcntl='$h_fcntl' |
---|
10240 | h_sysfile='$h_sysfile' |
---|
10241 | hint='$hint' |
---|
10242 | hostcat='$hostcat' |
---|
10243 | huge='$huge' |
---|
10244 | i_bsdioctl='$i_bsdioctl' |
---|
10245 | i_db='$i_db' |
---|
10246 | i_dbm='$i_dbm' |
---|
10247 | i_dirent='$i_dirent' |
---|
10248 | i_dld='$i_dld' |
---|
10249 | i_dlfcn='$i_dlfcn' |
---|
10250 | i_fcntl='$i_fcntl' |
---|
10251 | i_float='$i_float' |
---|
10252 | i_gdbm='$i_gdbm' |
---|
10253 | i_grp='$i_grp' |
---|
10254 | i_limits='$i_limits' |
---|
10255 | i_locale='$i_locale' |
---|
10256 | i_malloc='$i_malloc' |
---|
10257 | i_math='$i_math' |
---|
10258 | i_memory='$i_memory' |
---|
10259 | i_ndbm='$i_ndbm' |
---|
10260 | i_neterrno='$i_neterrno' |
---|
10261 | i_niin='$i_niin' |
---|
10262 | i_pwd='$i_pwd' |
---|
10263 | i_rpcsvcdbm='$i_rpcsvcdbm' |
---|
10264 | i_sfio='$i_sfio' |
---|
10265 | i_sgtty='$i_sgtty' |
---|
10266 | i_stdarg='$i_stdarg' |
---|
10267 | i_stddef='$i_stddef' |
---|
10268 | i_stdlib='$i_stdlib' |
---|
10269 | i_string='$i_string' |
---|
10270 | i_sysdir='$i_sysdir' |
---|
10271 | i_sysfile='$i_sysfile' |
---|
10272 | i_sysfilio='$i_sysfilio' |
---|
10273 | i_sysin='$i_sysin' |
---|
10274 | i_sysioctl='$i_sysioctl' |
---|
10275 | i_sysndir='$i_sysndir' |
---|
10276 | i_sysparam='$i_sysparam' |
---|
10277 | i_sysresrc='$i_sysresrc' |
---|
10278 | i_sysselct='$i_sysselct' |
---|
10279 | i_syssockio='$i_syssockio' |
---|
10280 | i_sysstat='$i_sysstat' |
---|
10281 | i_systime='$i_systime' |
---|
10282 | i_systimek='$i_systimek' |
---|
10283 | i_systimes='$i_systimes' |
---|
10284 | i_systypes='$i_systypes' |
---|
10285 | i_sysun='$i_sysun' |
---|
10286 | i_syswait='$i_syswait' |
---|
10287 | i_termio='$i_termio' |
---|
10288 | i_termios='$i_termios' |
---|
10289 | i_time='$i_time' |
---|
10290 | i_unistd='$i_unistd' |
---|
10291 | i_utime='$i_utime' |
---|
10292 | i_values='$i_values' |
---|
10293 | i_varargs='$i_varargs' |
---|
10294 | i_varhdr='$i_varhdr' |
---|
10295 | i_vfork='$i_vfork' |
---|
10296 | incpath='$incpath' |
---|
10297 | inews='$inews' |
---|
10298 | installarchlib='$installarchlib' |
---|
10299 | installbin='$installbin' |
---|
10300 | installman1dir='$installman1dir' |
---|
10301 | installman3dir='$installman3dir' |
---|
10302 | installprivlib='$installprivlib' |
---|
10303 | installscript='$installscript' |
---|
10304 | installsitearch='$installsitearch' |
---|
10305 | installsitelib='$installsitelib' |
---|
10306 | intsize='$intsize' |
---|
10307 | known_extensions='$known_extensions' |
---|
10308 | ksh='$ksh' |
---|
10309 | large='$large' |
---|
10310 | ld='$ld' |
---|
10311 | lddlflags='$lddlflags' |
---|
10312 | ldflags='$ldflags' |
---|
10313 | less='$less' |
---|
10314 | lib_ext='$lib_ext' |
---|
10315 | libc='$libc' |
---|
10316 | libperl='$libperl' |
---|
10317 | libpth='$libpth' |
---|
10318 | libs='$libs' |
---|
10319 | libswanted='$libswanted' |
---|
10320 | line='$line' |
---|
10321 | lint='$lint' |
---|
10322 | lkflags='$lkflags' |
---|
10323 | ln='$ln' |
---|
10324 | lns='$lns' |
---|
10325 | locincpth='$locincpth' |
---|
10326 | loclibpth='$loclibpth' |
---|
10327 | longsize='$longsize' |
---|
10328 | lp='$lp' |
---|
10329 | lpr='$lpr' |
---|
10330 | ls='$ls' |
---|
10331 | lseektype='$lseektype' |
---|
10332 | mail='$mail' |
---|
10333 | mailx='$mailx' |
---|
10334 | make='$make' |
---|
10335 | make_set_make='$make_set_make' |
---|
10336 | mallocobj='$mallocobj' |
---|
10337 | mallocsrc='$mallocsrc' |
---|
10338 | malloctype='$malloctype' |
---|
10339 | man1dir='$man1dir' |
---|
10340 | man1direxp='$man1direxp' |
---|
10341 | man1ext='$man1ext' |
---|
10342 | man3dir='$man3dir' |
---|
10343 | man3direxp='$man3direxp' |
---|
10344 | man3ext='$man3ext' |
---|
10345 | medium='$medium' |
---|
10346 | mips='$mips' |
---|
10347 | mips_type='$mips_type' |
---|
10348 | mkdir='$mkdir' |
---|
10349 | models='$models' |
---|
10350 | modetype='$modetype' |
---|
10351 | more='$more' |
---|
10352 | mv='$mv' |
---|
10353 | myarchname='$myarchname' |
---|
10354 | mydomain='$mydomain' |
---|
10355 | myhostname='$myhostname' |
---|
10356 | myuname='$myuname' |
---|
10357 | n='$n' |
---|
10358 | nm_opt='$nm_opt' |
---|
10359 | nm_so_opt='$nm_so_opt' |
---|
10360 | nroff='$nroff' |
---|
10361 | o_nonblock='$o_nonblock' |
---|
10362 | obj_ext='$obj_ext' |
---|
10363 | oldarchlib='$oldarchlib' |
---|
10364 | oldarchlibexp='$oldarchlibexp' |
---|
10365 | optimize='$optimize' |
---|
10366 | orderlib='$orderlib' |
---|
10367 | osname='$osname' |
---|
10368 | osvers='$osvers' |
---|
10369 | package='$package' |
---|
10370 | pager='$pager' |
---|
10371 | passcat='$passcat' |
---|
10372 | patchlevel='$patchlevel' |
---|
10373 | |
---|