Commit | Line | Data |
---|---|---|
2304df62 AD |
1 | #! /bin/sh |
2 | # | |
3 | # If these # comments don't work, trim them. Don't worry about any other | |
4 | # shell scripts, Configure will trim # comments from them for you. | |
5 | # | |
6 | # (If you are trying to port this package to a machine without sh, | |
7 | # I would suggest you have a look at the prototypical config_h.SH file | |
8 | # and edit it to reflect your system. Some packages may include samples | |
9 | # of config.h for certain machines, so you might look for one of those.) | |
10 | # | |
11 | # Yes, you may rip this off to use in other distribution packages. This | |
12 | # script belongs to the public domain and cannot be copyrighted. | |
13 | # | |
14 | # (Note: this Configure script was generated automatically. Rather than | |
15 | # working with this copy of Configure, you may wish to get metaconfig. | |
16 | # The dist-3.0 package (which contains metaconfig) was posted in | |
17 | # comp.sources.misc so you may fetch it yourself from your nearest | |
18 | # archive site. Check with Archie if you don't know where that can be.) | |
19 | # | |
20 | ||
8e07c86e | 21 | # $Id: Head.U,v 3.0.1.8 1995/07/25 13:40:02 ram Exp $ |
2304df62 | 22 | # |
24fef2a7 | 23 | # Generated on Sat Feb 1 00:26:40 EST 1997 [metaconfig 3.0 PL60] |
2304df62 AD |
24 | |
25 | cat >/tmp/c1$$ <<EOF | |
26 | ARGGGHHHH!!!!! | |
27 | ||
28 | SCO csh still thinks true is false. Write to SCO today and tell them that next | |
29 | year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-) | |
30 | ||
31 | (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All | |
32 | we'd have to do is go in and swap the && and || tokens, wherever they are.) | |
33 | ||
34 | [End of diatribe. We now return you to your regularly scheduled programming...] | |
35 | EOF | |
36 | cat >/tmp/c2$$ <<EOF | |
37 | ||
38 | OOPS! You naughty creature! You didn't run Configure with sh! | |
39 | I will attempt to remedy the situation by running sh for you... | |
40 | EOF | |
41 | ||
42 | true || cat /tmp/c1$$ /tmp/c2$$ | |
43 | true || exec sh $0 $argv:q | |
44 | ||
45 | (exit $?0) || cat /tmp/c2$$ | |
46 | (exit $?0) || exec sh $0 $argv:q | |
47 | rm -f /tmp/c1$$ /tmp/c2$$ | |
48 | ||
a0d0e21e LW |
49 | : compute my invocation name |
50 | me=$0 | |
51 | case "$0" in | |
52 | */*) | |
53 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` | |
54 | test "$me" || me=$0 | |
55 | ;; | |
56 | esac | |
57 | ||
8e07c86e AD |
58 | : Proper PATH separator |
59 | p_=: | |
60 | : On OS/2 this directory should exist if this is not floppy only system :-] | |
4b40f7a3 | 61 | if test -d c:/. -a -n "$OS2_SHELL"; then |
8e07c86e AD |
62 | p_=\; |
63 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` | |
64 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` | |
65 | fi | |
a0d0e21e LW |
66 | |
67 | : Proper PATH setting | |
68 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' | |
16d20bd9 | 69 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
232e078e | 70 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
16d20bd9 | 71 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
232e078e AD |
72 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
73 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" | |
74 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" | |
75 | paths="$paths /sbin /usr/sbin /usr/libexec" | |
a0d0e21e LW |
76 | |
77 | for p in $paths | |
78 | do | |
8e07c86e AD |
79 | case "$p_$PATH$p_" in |
80 | *$p_$p$p_*) ;; | |
81 | *) test -d $p && PATH=$PATH$p_$p ;; | |
a0d0e21e LW |
82 | esac |
83 | done | |
84 | ||
8e07c86e | 85 | PATH=.$p_$PATH |
2304df62 AD |
86 | export PATH |
87 | ||
c90c0ff4 | 88 | : This should not matter in scripts, but apparently it does, sometimes |
89 | case "$CDPATH" in | |
90 | '') ;; | |
91 | *) CDPATH='' ;; | |
92 | esac | |
3c321fdc | 93 | |
a0d0e21e | 94 | : Sanity checks |
2304df62 | 95 | if test ! -t 0; then |
a0d0e21e | 96 | echo "Say 'sh $me', not 'sh <$me'" |
2304df62 AD |
97 | exit 1 |
98 | fi | |
99 | ||
ff0cee69 | 100 | : Test and see if we are running under ksh, either blatantly or in disguise. |
101 | if (PATH=.; alias -x) >/dev/null 2>&1; then | |
102 | : running under ksh. Is this a good thing? | |
103 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname ; then | |
104 | if test X`/usr/bin/uname -v` = X4 ; then | |
105 | : on AIX 4, /bin/sh is really ksh, and it causes us problems. | |
106 | : Avoid it | |
2304df62 | 107 | cat <<'EOM' |
ff0cee69 | 108 | (Feeding myself to /usr/bin/bsh to avoid AIX 4's /bin/sh.) |
2304df62 | 109 | EOM |
ecfc5424 | 110 | unset ENV |
ff0cee69 | 111 | exec /usr/bin/bsh $0 "$@" |
2304df62 | 112 | fi |
ff0cee69 | 113 | else |
114 | if test ! -f /hp-ux ; then | |
2304df62 | 115 | : Warn them if they use ksh on other systems |
a0d0e21e LW |
116 | cat <<EOM |
117 | (I see you are using the Korn shell. Some ksh's blow up on $me, | |
8ff267be | 118 | especially on older exotic systems. If yours does, try the Bourne |
119 | shell instead.) | |
2304df62 | 120 | EOM |
c90c0ff4 | 121 | unset ENV |
ff0cee69 | 122 | fi |
123 | fi | |
124 | else | |
125 | : Not running under ksh. Maybe we should be? | |
126 | : On HP-UX, large Configure scripts may exercise a bug in /bin/sh | |
127 | if test -f /hp-ux -a -f /bin/ksh; then | |
128 | cat <<'EOM' | |
129 | (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.) | |
130 | EOM | |
131 | unset ENV | |
132 | exec /bin/ksh $0 "$@" | |
133 | fi | |
2304df62 AD |
134 | fi |
135 | ||
136 | : Configure runs within the UU subdirectory | |
137 | test -d UU || mkdir UU | |
8e07c86e | 138 | cd UU && rm -f ./* |
2304df62 | 139 | |
a0d0e21e | 140 | dynamic_ext='' |
2304df62 | 141 | extensions='' |
a0d0e21e LW |
142 | known_extensions='' |
143 | static_ext='' | |
8ff267be | 144 | useopcode='' |
a0d0e21e | 145 | useposix='' |
ecfc5424 | 146 | d_bsd='' |
40a7a20a | 147 | d_eunice='' |
2304df62 AD |
148 | d_xenix='' |
149 | eunicefix='' | |
150 | Mcc='' | |
151 | awk='' | |
152 | bash='' | |
153 | bison='' | |
154 | byacc='' | |
155 | cat='' | |
156 | chgrp='' | |
157 | chmod='' | |
158 | chown='' | |
ecfc5424 | 159 | comm='' |
2304df62 AD |
160 | compress='' |
161 | cp='' | |
162 | cpio='' | |
163 | cpp='' | |
164 | csh='' | |
165 | date='' | |
166 | echo='' | |
167 | egrep='' | |
168 | emacs='' | |
169 | expr='' | |
170 | find='' | |
171 | flex='' | |
172 | gcc='' | |
173 | grep='' | |
8ff267be | 174 | gzip='' |
2304df62 AD |
175 | inews='' |
176 | ksh='' | |
177 | less='' | |
178 | line='' | |
179 | lint='' | |
180 | ln='' | |
181 | lp='' | |
182 | lpr='' | |
183 | ls='' | |
184 | mail='' | |
185 | mailx='' | |
2304df62 AD |
186 | mkdir='' |
187 | more='' | |
188 | mv='' | |
189 | nroff='' | |
190 | perl='' | |
191 | pg='' | |
192 | pmake='' | |
193 | pr='' | |
194 | rm='' | |
195 | rmail='' | |
196 | sed='' | |
197 | sendmail='' | |
2304df62 AD |
198 | shar='' |
199 | sleep='' | |
200 | smail='' | |
201 | sort='' | |
202 | submit='' | |
203 | tail='' | |
204 | tar='' | |
205 | tbl='' | |
206 | test='' | |
207 | touch='' | |
208 | tr='' | |
209 | troff='' | |
210 | uname='' | |
211 | uniq='' | |
dc66995c | 212 | usethreads='' |
2304df62 AD |
213 | uuname='' |
214 | vi='' | |
215 | zcat='' | |
8ff267be | 216 | zip='' |
1aef975c | 217 | full_sed='' |
a0d0e21e | 218 | libswanted='' |
2304df62 AD |
219 | hint='' |
220 | myuname='' | |
85e6fe83 LW |
221 | osname='' |
222 | osvers='' | |
2304df62 AD |
223 | Author='' |
224 | Date='' | |
225 | Header='' | |
226 | Id='' | |
227 | Locker='' | |
228 | Log='' | |
229 | RCSfile='' | |
230 | Revision='' | |
231 | Source='' | |
232 | State='' | |
4633a7c4 LW |
233 | ar='' |
234 | archobjs='' | |
235 | exe_ext='' | |
236 | firstmakefile='' | |
237 | lib_ext='' | |
238 | obj_ext='' | |
239 | path_sep='' | |
2304df62 | 240 | afs='' |
a0d0e21e LW |
241 | alignbytes='' |
242 | archlib='' | |
243 | archlibexp='' | |
a0d0e21e LW |
244 | d_archlib='' |
245 | installarchlib='' | |
40000a8c AD |
246 | archname='' |
247 | myarchname='' | |
ecfc5424 | 248 | baserev='' |
2304df62 AD |
249 | bin='' |
250 | binexp='' | |
251 | installbin='' | |
5f05dabc | 252 | bincompat3='' |
253 | d_bincompat3='' | |
2304df62 AD |
254 | byteorder='' |
255 | cc='' | |
256 | gccversion='' | |
257 | ccflags='' | |
258 | cppflags='' | |
259 | ldflags='' | |
260 | lkflags='' | |
8e07c86e | 261 | locincpth='' |
2304df62 | 262 | optimize='' |
8e07c86e | 263 | cf_email='' |
2304df62 AD |
264 | cf_by='' |
265 | cf_time='' | |
266 | contains='' | |
a0d0e21e | 267 | cpp_stuff='' |
2304df62 AD |
268 | cpplast='' |
269 | cppminus='' | |
270 | cpprun='' | |
271 | cppstdin='' | |
272 | d_access='' | |
a0d0e21e | 273 | d_alarm='' |
ecfc5424 | 274 | d_attribut='' |
2304df62 AD |
275 | d_bcmp='' |
276 | d_bcopy='' | |
277 | d_bzero='' | |
278 | d_casti32='' | |
279 | castflags='' | |
280 | d_castneg='' | |
a0d0e21e LW |
281 | d_chown='' |
282 | d_chroot='' | |
2304df62 | 283 | d_chsize='' |
a0d0e21e LW |
284 | d_closedir='' |
285 | d_void_closedir='' | |
2304df62 AD |
286 | d_const='' |
287 | cryptlib='' | |
288 | d_crypt='' | |
289 | d_csh='' | |
1aef975c | 290 | full_csh='' |
a0d0e21e LW |
291 | d_cuserid='' |
292 | d_dbl_dig='' | |
293 | d_difftime='' | |
294 | d_dlerror='' | |
295 | d_dlopen='' | |
296 | d_dlsymun='' | |
2304df62 | 297 | d_dosuid='' |
a0d0e21e | 298 | d_suidsafe='' |
2304df62 AD |
299 | d_dup2='' |
300 | d_fchmod='' | |
301 | d_fchown='' | |
302 | d_fcntl='' | |
a0d0e21e LW |
303 | d_fd_macros='' |
304 | d_fd_set='' | |
305 | d_fds_bits='' | |
306 | d_fgetpos='' | |
2304df62 AD |
307 | d_flexfnam='' |
308 | d_flock='' | |
a0d0e21e LW |
309 | d_fork='' |
310 | d_fsetpos='' | |
5f05dabc | 311 | d_ftime='' |
312 | d_gettimeod='' | |
a0d0e21e | 313 | d_Gconvert='' |
2304df62 | 314 | d_getgrps='' |
5cd24f17 | 315 | d_setgrps='' |
2304df62 AD |
316 | d_gethent='' |
317 | aphostname='' | |
318 | d_gethname='' | |
319 | d_phostname='' | |
320 | d_uname='' | |
a0d0e21e | 321 | d_getlogin='' |
2afac517 | 322 | d_getpgid='' |
2304df62 | 323 | d_getpgrp2='' |
2afac517 | 324 | d_bsdgetpgrp='' |
2304df62 | 325 | d_getpgrp='' |
a0d0e21e | 326 | d_getppid='' |
2304df62 | 327 | d_getprior='' |
a4f3eea9 | 328 | d_gnulibc='' |
2304df62 | 329 | d_htonl='' |
7e1af8bc | 330 | d_inetaton='' |
2304df62 AD |
331 | d_isascii='' |
332 | d_killpg='' | |
333 | d_link='' | |
a0d0e21e LW |
334 | d_locconv='' |
335 | d_lockf='' | |
2304df62 | 336 | d_lstat='' |
a0d0e21e LW |
337 | d_mblen='' |
338 | d_mbstowcs='' | |
339 | d_mbtowc='' | |
2304df62 AD |
340 | d_memcmp='' |
341 | d_memcpy='' | |
342 | d_memmove='' | |
343 | d_memset='' | |
344 | d_mkdir='' | |
a0d0e21e LW |
345 | d_mkfifo='' |
346 | d_mktime='' | |
2304df62 AD |
347 | d_msg='' |
348 | d_msgctl='' | |
349 | d_msgget='' | |
350 | d_msgrcv='' | |
351 | d_msgsnd='' | |
a0d0e21e | 352 | d_nice='' |
2304df62 | 353 | d_open3='' |
a0d0e21e LW |
354 | d_fpathconf='' |
355 | d_pathconf='' | |
356 | d_pause='' | |
357 | d_pipe='' | |
8e07c86e | 358 | d_poll='' |
2304df62 AD |
359 | d_portable='' |
360 | d_readdir='' | |
85e6fe83 LW |
361 | d_rewinddir='' |
362 | d_seekdir='' | |
363 | d_telldir='' | |
a0d0e21e | 364 | d_readlink='' |
2304df62 AD |
365 | d_rename='' |
366 | d_rmdir='' | |
367 | d_safebcpy='' | |
368 | d_safemcpy='' | |
36477c24 | 369 | d_sanemcmp='' |
2304df62 AD |
370 | d_select='' |
371 | d_sem='' | |
372 | d_semctl='' | |
373 | d_semget='' | |
374 | d_semop='' | |
375 | d_setegid='' | |
376 | d_seteuid='' | |
a0d0e21e | 377 | d_setlinebuf='' |
2304df62 AD |
378 | d_setlocale='' |
379 | d_setpgid='' | |
380 | d_setpgrp2='' | |
381 | d_bsdpgrp='' | |
2afac517 | 382 | d_bsdsetpgrp='' |
2304df62 AD |
383 | d_setpgrp='' |
384 | d_setprior='' | |
385 | d_setregid='' | |
386 | d_setresgid='' | |
387 | d_setresuid='' | |
388 | d_setreuid='' | |
389 | d_setrgid='' | |
390 | d_setruid='' | |
391 | d_setsid='' | |
760ac839 | 392 | d_sfio='' |
8ff267be | 393 | usesfio='' |
2304df62 AD |
394 | d_shm='' |
395 | d_shmat='' | |
a0d0e21e LW |
396 | d_shmatprototype='' |
397 | shmattype='' | |
2304df62 AD |
398 | d_shmctl='' |
399 | d_shmdt='' | |
400 | d_shmget='' | |
2c7991dc | 401 | d_sigaction='' |
8ff267be | 402 | d_sigsetjmp='' |
2304df62 AD |
403 | d_oldsock='' |
404 | d_socket='' | |
405 | d_sockpair='' | |
406 | sockethdr='' | |
407 | socketlib='' | |
408 | d_statblks='' | |
c2960299 AD |
409 | d_stdio_cnt_lval='' |
410 | d_stdio_ptr_lval='' | |
16d20bd9 | 411 | d_stdiobase='' |
2304df62 | 412 | d_stdstdio='' |
16d20bd9 AD |
413 | stdio_base='' |
414 | stdio_bufsiz='' | |
415 | stdio_cnt='' | |
416 | stdio_ptr='' | |
2304df62 AD |
417 | d_index='' |
418 | d_strchr='' | |
a0d0e21e | 419 | d_strcoll='' |
2304df62 AD |
420 | d_strctcpy='' |
421 | d_strerrm='' | |
422 | d_strerror='' | |
423 | d_sysernlst='' | |
424 | d_syserrlst='' | |
a89d8a78 DH |
425 | d_strtod='' |
426 | d_strtol='' | |
427 | d_strtoul='' | |
a0d0e21e | 428 | d_strxfrm='' |
2304df62 AD |
429 | d_symlink='' |
430 | d_syscall='' | |
a0d0e21e | 431 | d_sysconf='' |
2304df62 | 432 | d_system='' |
a0d0e21e LW |
433 | d_tcgetpgrp='' |
434 | d_tcsetpgrp='' | |
85e6fe83 LW |
435 | d_time='' |
436 | timetype='' | |
2304df62 AD |
437 | clocktype='' |
438 | d_times='' | |
439 | d_truncate='' | |
a0d0e21e LW |
440 | d_tzname='' |
441 | d_umask='' | |
2304df62 | 442 | d_vfork='' |
a0d0e21e | 443 | usevfork='' |
2304df62 AD |
444 | d_voidsig='' |
445 | signal_t='' | |
446 | d_volatile='' | |
447 | d_charvspr='' | |
448 | d_vprintf='' | |
449 | d_wait4='' | |
450 | d_waitpid='' | |
a0d0e21e LW |
451 | d_wcstombs='' |
452 | d_wctomb='' | |
453 | dlext='' | |
85e6fe83 LW |
454 | cccdlflags='' |
455 | ccdlflags='' | |
2304df62 | 456 | dlsrc='' |
232e078e | 457 | ld='' |
85e6fe83 | 458 | lddlflags='' |
2304df62 | 459 | usedl='' |
a0d0e21e | 460 | fpostype='' |
2304df62 AD |
461 | gidtype='' |
462 | groupstype='' | |
463 | h_fcntl='' | |
464 | h_sysfile='' | |
ecfc5424 AD |
465 | db_hashtype='' |
466 | db_prefixtype='' | |
a0d0e21e | 467 | i_db='' |
2304df62 | 468 | i_dbm='' |
8e07c86e | 469 | i_rpcsvcdbm='' |
2304df62 | 470 | d_dirnamlen='' |
a0d0e21e | 471 | direntrytype='' |
2304df62 | 472 | i_dirent='' |
a0d0e21e | 473 | i_dld='' |
2304df62 AD |
474 | i_dlfcn='' |
475 | i_fcntl='' | |
a0d0e21e | 476 | i_float='' |
2304df62 AD |
477 | i_gdbm='' |
478 | i_grp='' | |
a0d0e21e | 479 | i_limits='' |
4633a7c4 | 480 | i_locale='' |
a0d0e21e LW |
481 | i_malloc='' |
482 | i_math='' | |
85e6fe83 | 483 | i_memory='' |
2304df62 | 484 | i_ndbm='' |
85e6fe83 | 485 | i_neterrno='' |
2304df62 AD |
486 | i_niin='' |
487 | i_sysin='' | |
488 | d_pwage='' | |
489 | d_pwchange='' | |
490 | d_pwclass='' | |
491 | d_pwcomment='' | |
492 | d_pwexpire='' | |
493 | d_pwquota='' | |
494 | i_pwd='' | |
760ac839 | 495 | i_sfio='' |
2304df62 | 496 | i_stddef='' |
a0d0e21e | 497 | i_stdlib='' |
2304df62 AD |
498 | i_string='' |
499 | strings='' | |
500 | i_sysdir='' | |
501 | i_sysfile='' | |
502 | d_voidtty='' | |
503 | i_bsdioctl='' | |
a0d0e21e | 504 | i_sysfilio='' |
2304df62 AD |
505 | i_sysioctl='' |
506 | i_syssockio='' | |
507 | i_sysndir='' | |
a0d0e21e | 508 | i_sysparam='' |
8ff267be | 509 | i_sysresrc='' |
2304df62 | 510 | i_sysselct='' |
1aef975c | 511 | i_sysstat='' |
a0d0e21e | 512 | i_systimes='' |
fed7345c | 513 | i_systypes='' |
25f94b33 | 514 | i_sysun='' |
8ff267be | 515 | i_syswait='' |
2304df62 AD |
516 | i_sgtty='' |
517 | i_termio='' | |
518 | i_termios='' | |
519 | i_systime='' | |
520 | i_systimek='' | |
521 | i_time='' | |
522 | timeincl='' | |
85e6fe83 | 523 | i_unistd='' |
2304df62 | 524 | i_utime='' |
760ac839 | 525 | i_values='' |
a0d0e21e | 526 | i_stdarg='' |
2304df62 AD |
527 | i_varargs='' |
528 | i_varhdr='' | |
529 | i_vfork='' | |
530 | intsize='' | |
24fef2a7 AD |
531 | longsize='' |
532 | shortsize='' | |
2304df62 | 533 | libc='' |
8ff267be | 534 | libperl='' |
2afac517 | 535 | shrpenv='' |
8ff267be | 536 | useshrplib='' |
a0d0e21e | 537 | glibpth='' |
2304df62 | 538 | libpth='' |
8e07c86e | 539 | loclibpth='' |
2304df62 AD |
540 | plibpth='' |
541 | xlibpth='' | |
542 | libs='' | |
85e6fe83 LW |
543 | lns='' |
544 | lseektype='' | |
8ff267be | 545 | make='' |
546 | make_set_make='' | |
85e6fe83 | 547 | d_mymalloc='' |
94b6baf5 | 548 | freetype='' |
2304df62 AD |
549 | mallocobj='' |
550 | mallocsrc='' | |
551 | malloctype='' | |
552 | usemymalloc='' | |
16d20bd9 AD |
553 | installman1dir='' |
554 | man1dir='' | |
555 | man1direxp='' | |
556 | man1ext='' | |
557 | installman3dir='' | |
558 | man3dir='' | |
559 | man3direxp='' | |
560 | man3ext='' | |
2304df62 AD |
561 | huge='' |
562 | large='' | |
563 | medium='' | |
564 | models='' | |
565 | small='' | |
566 | split='' | |
a0d0e21e | 567 | modetype='' |
2304df62 AD |
568 | mydomain='' |
569 | myhostname='' | |
570 | phostname='' | |
571 | c='' | |
572 | n='' | |
8e07c86e AD |
573 | d_eofnblk='' |
574 | eagain='' | |
575 | o_nonblock='' | |
576 | rd_nodata='' | |
2304df62 AD |
577 | groupcat='' |
578 | hostcat='' | |
579 | passcat='' | |
4633a7c4 LW |
580 | d_oldarchlib='' |
581 | oldarchlib='' | |
582 | oldarchlibexp='' | |
85e6fe83 LW |
583 | orderlib='' |
584 | ranlib='' | |
2304df62 AD |
585 | package='' |
586 | spackage='' | |
2c7991dc | 587 | pager='' |
ecfc5424 | 588 | patchlevel='' |
760ac839 | 589 | subversion='' |
8e07c86e | 590 | perladmin='' |
4633a7c4 | 591 | perlpath='' |
a0d0e21e | 592 | prefix='' |
1aef975c | 593 | prefixexp='' |
2304df62 AD |
594 | installprivlib='' |
595 | privlib='' | |
596 | privlibexp='' | |
597 | prototype='' | |
598 | randbits='' | |
599 | installscript='' | |
600 | scriptdir='' | |
601 | scriptdirexp='' | |
a0d0e21e | 602 | selecttype='' |
8ff267be | 603 | sh='' |
2304df62 | 604 | sig_name='' |
8e07c86e | 605 | sig_num='' |
4633a7c4 LW |
606 | installsitearch='' |
607 | sitearch='' | |
608 | sitearchexp='' | |
25f94b33 AD |
609 | installsitelib='' |
610 | sitelib='' | |
611 | sitelibexp='' | |
a0d0e21e LW |
612 | sizetype='' |
613 | so='' | |
2304df62 AD |
614 | sharpbang='' |
615 | shsharp='' | |
616 | spitshell='' | |
a0d0e21e | 617 | ssizetype='' |
4633a7c4 | 618 | startperl='' |
2304df62 AD |
619 | startsh='' |
620 | stdchar='' | |
621 | sysman='' | |
622 | uidtype='' | |
623 | nm_opt='' | |
40a7a20a | 624 | nm_so_opt='' |
2304df62 AD |
625 | runnm='' |
626 | usenm='' | |
8ff267be | 627 | useperlio='' |
2304df62 AD |
628 | incpath='' |
629 | mips='' | |
630 | mips_type='' | |
631 | usrinc='' | |
632 | defvoidused='' | |
633 | voidflags='' | |
2304df62 AD |
634 | CONFIG='' |
635 | ||
ecfc5424 AD |
636 | define='define' |
637 | undef='undef' | |
638 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' | |
639 | rmlist='' | |
640 | ||
641 | : We must find out about Eunice early | |
642 | eunicefix=':' | |
643 | if test -f /etc/unixtovms; then | |
644 | eunicefix=/etc/unixtovms | |
645 | fi | |
646 | if test -f /etc/unixtovms.exe; then | |
647 | eunicefix=/etc/unixtovms.exe | |
648 | fi | |
649 | ||
650 | : list of known cpp symbols, sorted alphabetically | |
651 | al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2" | |
652 | al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH" | |
653 | al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" | |
654 | al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" | |
655 | al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" | |
656 | al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" | |
657 | al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4" | |
658 | al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" | |
659 | al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" | |
660 | al="$al VMS Xenix286" | |
661 | al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI" | |
662 | al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET" | |
663 | al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" | |
664 | al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" | |
665 | al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" | |
666 | al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" | |
667 | al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" | |
668 | al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" | |
669 | al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" | |
670 | al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" | |
671 | al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" | |
672 | al="$al __SVR4_2__ __UMAXV__" | |
673 | al="$al ____386BSD____ __alpha __alpha__ __amiga" | |
674 | al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" | |
675 | al="$al __host_mips__" | |
676 | al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" | |
677 | al="$al __hp9000s500 __hp9000s700 __hp9000s800" | |
678 | al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" | |
679 | al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" | |
680 | al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" | |
681 | al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" | |
682 | al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" | |
683 | al="$al __mc88100 __mc88100__ __mips __mips__" | |
684 | al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" | |
685 | al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" | |
686 | al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" | |
687 | al="$al _host_mips _mips _unix" | |
688 | al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" | |
689 | al="$al apollo ardent att386 att3b" | |
690 | al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" | |
691 | al="$al cadmus clipper concurrent convex cray ctix" | |
692 | al="$al dmert encore gcos gcx gimpel gould" | |
693 | al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" | |
694 | al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" | |
695 | al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" | |
696 | al="$al i186 i286 i386 i486 i8086" | |
697 | al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" | |
698 | al="$al ksr1 linux luna luna88k m68k m88100 m88k" | |
699 | al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" | |
700 | al="$al mc68040 mc68060 mc68k mc68k32 mc700" | |
701 | al="$al mc88000 mc88100 merlin mert mips mvs n16" | |
702 | al="$al ncl_el ncl_mr" | |
703 | al="$al news1500 news1700 news1800 news1900 news3700" | |
704 | al="$al news700 news800 news900 ns16000 ns32000" | |
705 | al="$al ns32016 ns32332 ns32k nsc32000 os osf" | |
706 | al="$al parisc pc532 pdp11 plexus posix pyr" | |
707 | al="$al riscix riscos scs sequent sgi sinix sony sony_news" | |
708 | al="$al sonyrisc sparc sparclite spectrum stardent stratos" | |
709 | al="$al sun sun3 sun386 svr4 sysV68 sysV88" | |
710 | al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" | |
711 | al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" | |
712 | al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms" | |
713 | al="$al xenix z8000" | |
714 | ||
ecfc5424 AD |
715 | groupstype='' |
716 | i_whoami='' | |
8e07c86e AD |
717 | : default library list |
718 | libswanted='' | |
719 | : set useposix=false in your hint file to disable the POSIX extension. | |
720 | useposix=true | |
8ff267be | 721 | : set useopcode=false in your hint file to disable the Opcode extension. |
722 | useopcode=true | |
40a7a20a | 723 | : Define several unixisms. These can be used in hint files. |
25f94b33 AD |
724 | exe_ext='' |
725 | : Extra object files, if any, needed on this platform. | |
726 | archobjs='' | |
8e07c86e | 727 | : Possible local include directories to search. |
25f94b33 | 728 | : Set locincpth to "" in a hint file to defeat local include searches. |
8e07c86e AD |
729 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" |
730 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" | |
731 | : | |
732 | : no include file wanted by default | |
733 | inclwanted='' | |
734 | ||
ecfc5424 AD |
735 | : change the next line if compiling for Xenix/286 on Xenix/386 |
736 | xlibpth='/usr/lib/386 /lib/386' | |
737 | ||
8e07c86e AD |
738 | : Possible local library directories to search. |
739 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
740 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
741 | ||
ecfc5424 | 742 | : general looking path for locating libraries |
84902520 | 743 | glibpth="/shlib /usr/shlib /usr/lib/pa1.1 /usr/lib/large" |
4b40f7a3 SV |
744 | glibpth="$glibpth /lib /usr/lib $xlibpth" |
745 | glibpth="$glibpth /lib/large /usr/lib/small /lib/small" | |
746 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" | |
ecfc5424 AD |
747 | |
748 | : Private path used by Configure to find libraries. Its value | |
749 | : is prepended to libpth. This variable takes care of special | |
750 | : machines, like the mips. Usually, it should be empty. | |
751 | plibpth='' | |
752 | ||
ecfc5424 AD |
753 | : full support for void wanted by default |
754 | defvoidused=15 | |
755 | ||
ecfc5424 | 756 | : List of libraries we want. |
760ac839 | 757 | libswanted='sfio net socket inet nsl nm ndbm gdbm dbm db malloc dl' |
ecfc5424 AD |
758 | libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" |
759 | libswanted="$libswanted ucb bsd BSD PW x" | |
1aef975c | 760 | : We probably want to search /usr/shlib before most other libraries. |
94b6baf5 | 761 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
ecfc5424 AD |
762 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
763 | glibpth="/usr/shlib $glibpth" | |
764 | : Do not use vfork unless overridden by a hint file. | |
765 | usevfork=false | |
766 | ||
8ff267be | 767 | : Find the basic shell for Bourne shell scripts |
768 | case "$sh" in | |
769 | '') | |
770 | : SYSTYPE is for some older MIPS systems. | |
771 | : I do not know if it is still needed. | |
772 | case "$SYSTYPE" in | |
773 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; | |
774 | *) xxx='/bin/sh';; | |
775 | esac | |
776 | if test -f "$xxx"; then | |
777 | sh="$xxx" | |
778 | else | |
779 | : Build up a list and do a single loop so we can 'break' out. | |
780 | pth=`echo $PATH | sed -e "s/$p_/ /g"` | |
781 | for xxx in sh bash ksh pdksh ash; do | |
782 | for p in $pth; do | |
783 | try="$try ${p}/${xxx}" | |
784 | done | |
785 | done | |
786 | for xxx in $try; do | |
787 | if test -f "$xxx"; then | |
788 | sh="$xxx"; | |
789 | echo "Your Bourne shell appears to be in $sh." | |
790 | break | |
791 | elif test -f "$xxx.exe"; then | |
792 | sh="$xxx"; | |
793 | echo "Hmm. Your Bourne shell appears to be in $sh." | |
794 | break | |
795 | fi | |
796 | done | |
797 | fi | |
798 | ;; | |
799 | esac | |
800 | ||
801 | case "$sh" in | |
802 | '') cat <<EOM >&2 | |
803 | $me: Fatal Error: I can't find a Bourne Shell anywhere. | |
804 | Usually it's in /bin/sh. How did you even get this far? | |
284c50cc | 805 | Please contact me (Chip Salzenberg) at chip@perl.com and |
8ff267be | 806 | we'll try to straigten this all out. |
807 | EOM | |
808 | exit 1 | |
809 | ;; | |
810 | esac | |
811 | ||
760ac839 | 812 | : see if sh knows # comments |
8ff267be | 813 | if `$sh -c '#' >/dev/null 2>&1`; then |
760ac839 LW |
814 | shsharp=true |
815 | spitshell=cat | |
816 | echo " " | |
760ac839 LW |
817 | xcat=/bin/cat |
818 | test -f $xcat || xcat=/usr/bin/cat | |
819 | echo "#!$xcat" >try | |
820 | $eunicefix try | |
821 | chmod +x try | |
822 | ./try > today | |
823 | if test -s today; then | |
760ac839 LW |
824 | sharpbang='#!' |
825 | else | |
826 | echo "#! $xcat" > try | |
827 | $eunicefix try | |
828 | chmod +x try | |
829 | ./try > today | |
830 | if test -s today; then | |
760ac839 LW |
831 | sharpbang='#! ' |
832 | else | |
8ff267be | 833 | echo "Okay, let's see if #! works on this system..." |
760ac839 LW |
834 | echo "It's just a comment." |
835 | sharpbang=': use ' | |
836 | fi | |
837 | fi | |
838 | else | |
8ff267be | 839 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
760ac839 LW |
840 | shsharp=false |
841 | cd .. | |
842 | echo "exec grep -v '^[ ]*#'" >spitshell | |
843 | chmod +x spitshell | |
844 | $eunicefix spitshell | |
845 | spitshell=`pwd`/spitshell | |
846 | cd UU | |
847 | echo "I presume that if # doesn't work, #! won't work either!" | |
848 | sharpbang=': use ' | |
849 | fi | |
850 | rm -f try today | |
851 | ||
852 | : figure out how to guarantee sh startup | |
8ff267be | 853 | case "$startsh" in |
854 | '') startsh=${sharpbang}${sh} ;; | |
855 | *) | |
760ac839 | 856 | esac |
760ac839 LW |
857 | cat >try <<EOSS |
858 | $startsh | |
859 | set abc | |
860 | test "$?abc" != 1 | |
861 | EOSS | |
862 | ||
863 | chmod +x try | |
864 | $eunicefix try | |
865 | if ./try; then | |
8ff267be | 866 | : echo "Yup, it does." |
760ac839 | 867 | else |
8ff267be | 868 | echo "Hmm. '$startsh' didn't work." |
869 | echo "You may have to fix up the shell scripts to make sure sh runs them." | |
760ac839 LW |
870 | fi |
871 | rm -f try | |
872 | ||
2304df62 | 873 | : script used to extract .SH files with variable substitutions |
760ac839 LW |
874 | cat >extract <<EOS |
875 | $startsh | |
876 | EOS | |
877 | cat >>extract <<'EOS' | |
2304df62 AD |
878 | CONFIG=true |
879 | echo "Doing variable substitutions on .SH files..." | |
880 | if test -f MANIFEST; then | |
5f05dabc | 881 | shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'` |
a0d0e21e LW |
882 | : Pick up possible extension manifests. |
883 | for dir in ext/* ; do | |
884 | if test -f $dir/MANIFEST; then | |
5f05dabc | 885 | xxx=`awk '{print $1}' < $dir/MANIFEST | |
a0d0e21e LW |
886 | sed -n "/\.SH$/ s@^@$dir/@p"` |
887 | shlist="$shlist $xxx" | |
888 | fi | |
889 | done | |
890 | set x $shlist | |
2304df62 AD |
891 | else |
892 | echo "(Looking for .SH files under the current directory.)" | |
5f05dabc | 893 | set x `find . -name "*.SH" -print` |
2304df62 AD |
894 | fi |
895 | shift | |
896 | case $# in | |
897 | 0) set x *.SH; shift;; | |
898 | esac | |
899 | if test ! -f $1; then | |
900 | shift | |
901 | fi | |
902 | for file in $*; do | |
903 | case "$file" in | |
904 | */*) | |
905 | dir=`expr X$file : 'X\(.*\)/'` | |
906 | file=`expr X$file : 'X.*/\(.*\)'` | |
907 | (cd $dir && . ./$file) | |
908 | ;; | |
909 | *) | |
910 | . ./$file | |
911 | ;; | |
912 | esac | |
913 | done | |
914 | if test -f config_h.SH; then | |
915 | if test ! -f config.h; then | |
916 | : oops, they left it out of MANIFEST, probably, so do it anyway. | |
917 | . ./config_h.SH | |
918 | fi | |
919 | fi | |
920 | EOS | |
921 | ||
922 | : produce awk script to parse command line options | |
923 | cat >options.awk <<'EOF' | |
924 | BEGIN { | |
16d20bd9 | 925 | optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification |
2304df62 AD |
926 | |
927 | len = length(optstr); | |
928 | for (i = 1; i <= len; i++) { | |
929 | c = substr(optstr, i, 1); | |
930 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; | |
931 | if (a == ":") { | |
932 | arg[c] = 1; | |
933 | i++; | |
934 | } | |
935 | opt[c] = 1; | |
936 | } | |
937 | } | |
938 | { | |
939 | expect = 0; | |
940 | str = $0; | |
941 | if (substr(str, 1, 1) != "-") { | |
942 | printf("'%s'\n", str); | |
943 | next; | |
944 | } | |
945 | len = length($0); | |
946 | for (i = 2; i <= len; i++) { | |
947 | c = substr(str, i, 1); | |
948 | if (!opt[c]) { | |
949 | printf("-%s\n", substr(str, i)); | |
950 | next; | |
951 | } | |
952 | printf("-%s\n", c); | |
953 | if (arg[c]) { | |
954 | if (i < len) | |
955 | printf("'%s'\n", substr(str, i + 1)); | |
956 | else | |
957 | expect = 1; | |
958 | next; | |
959 | } | |
960 | } | |
961 | } | |
962 | END { | |
963 | if (expect) | |
964 | print "?"; | |
965 | } | |
966 | EOF | |
967 | ||
968 | : process the command line options | |
4633a7c4 LW |
969 | set X `for arg in "$@"; do echo "X$arg"; done | |
970 | sed -e s/X// | awk -f options.awk` | |
2304df62 AD |
971 | eval "set $*" |
972 | shift | |
973 | rm -f options.awk | |
974 | ||
975 | : set up default values | |
976 | fastread='' | |
977 | reuseval=false | |
978 | config_sh='' | |
979 | alldone='' | |
980 | error='' | |
981 | silent='' | |
982 | extractsh='' | |
ecfc5424 | 983 | override='' |
16d20bd9 | 984 | knowitall='' |
28757baa | 985 | |
1aef975c | 986 | rm -f optdef.sh |
28757baa | 987 | cat >optdef.sh <<EOS |
988 | $startsh | |
989 | EOS | |
2304df62 AD |
990 | |
991 | : option parsing | |
992 | while test $# -gt 0; do | |
993 | case "$1" in | |
994 | -d) shift; fastread=yes;; | |
995 | -e) shift; alldone=cont;; | |
996 | -f) | |
997 | shift | |
998 | cd .. | |
999 | if test -r "$1"; then | |
1000 | config_sh="$1" | |
1001 | else | |
a0d0e21e | 1002 | echo "$me: cannot read config file $1." >&2 |
2304df62 AD |
1003 | error=true |
1004 | fi | |
1005 | cd UU | |
1006 | shift;; | |
1007 | -h) shift; error=true;; | |
1008 | -r) shift; reuseval=true;; | |
1009 | -s) shift; silent=true;; | |
1010 | -E) shift; alldone=exit;; | |
16d20bd9 | 1011 | -K) shift; knowitall=true;; |
ecfc5424 | 1012 | -O) shift; override=true;; |
2304df62 | 1013 | -S) shift; extractsh=true;; |
a0d0e21e LW |
1014 | -D) |
1015 | shift | |
1016 | case "$1" in | |
1017 | *=) | |
1018 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 | |
1019 | echo "$me: ignoring -D $1" >&2 | |
1020 | ;; | |
ecfc5424 | 1021 | *=*) echo "$1" | \ |
1aef975c AD |
1022 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
1023 | *) echo "$1='define'" >> optdef.sh;; | |
a0d0e21e LW |
1024 | esac |
1025 | shift | |
1026 | ;; | |
1027 | -U) | |
1028 | shift | |
1029 | case "$1" in | |
1aef975c | 1030 | *=) echo "$1" >> optdef.sh;; |
a0d0e21e LW |
1031 | *=*) |
1032 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 | |
1033 | echo "$me: ignoring -U $1" >&2 | |
1034 | ;; | |
1aef975c | 1035 | *) echo "$1='undef'" >> optdef.sh;; |
a0d0e21e LW |
1036 | esac |
1037 | shift | |
1038 | ;; | |
2c7991dc | 1039 | -V) echo "$me generated by metaconfig 3.0 PL60." >&2 |
2304df62 AD |
1040 | exit 0;; |
1041 | --) break;; | |
a0d0e21e | 1042 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
2304df62 AD |
1043 | *) break;; |
1044 | esac | |
1045 | done | |
1046 | ||
1047 | case "$error" in | |
1048 | true) | |
1049 | cat >&2 <<EOM | |
2afac517 | 1050 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
a0d0e21e | 1051 | [-U symbol] [-U symbol=] |
2304df62 AD |
1052 | -d : use defaults for all answers. |
1053 | -e : go on without questioning past the production of config.sh. | |
1054 | -f : specify an alternate default configuration file. | |
1055 | -h : print this help message and exit (with an error status). | |
1056 | -r : reuse C symbols value if possible (skips costly nm extraction). | |
1057 | -s : silent mode, only echoes questions and essential information. | |
a0d0e21e LW |
1058 | -D : define symbol to have some value: |
1059 | -D symbol symbol gets the value 'define' | |
1060 | -D symbol=value symbol gets the value 'value' | |
2304df62 | 1061 | -E : stop at the end of questions, after having produced config.sh. |
16d20bd9 | 1062 | -K : do not use unless you know what you are doing. |
ecfc5424 | 1063 | -O : let -D and -U override definitions from loaded configuration file. |
2304df62 | 1064 | -S : perform variable substitutions on all .SH files (can mix with -f) |
a0d0e21e LW |
1065 | -U : undefine symbol: |
1066 | -U symbol symbol gets the value 'undef' | |
1067 | -U symbol= symbol gets completely empty | |
2304df62 AD |
1068 | -V : print version number and exit (with a zero status). |
1069 | EOM | |
1070 | exit 1 | |
1071 | ;; | |
1072 | esac | |
1073 | ||
1074 | exec 4>&1 | |
1075 | case "$silent" in | |
1076 | true) exec 1>/dev/null;; | |
1077 | esac | |
1078 | ||
ecfc5424 | 1079 | : run the defines and the undefines, if any, but leave the file out there... |
1aef975c AD |
1080 | touch optdef.sh |
1081 | . ./optdef.sh | |
a0d0e21e | 1082 | |
2304df62 AD |
1083 | case "$extractsh" in |
1084 | true) | |
1085 | case "$config_sh" in | |
1086 | '') config_sh='config.sh'; config='./config.sh';; | |
1087 | /*) config="$config_sh";; | |
1088 | *) config="./$config_sh";; | |
1089 | esac | |
1090 | echo " " | |
1091 | echo "Fetching answers from $config_sh..." | |
1092 | cd .. | |
1093 | . $config | |
1aef975c | 1094 | test "$override" && . ./optdef.sh |
2304df62 AD |
1095 | echo " " |
1096 | . ./UU/extract | |
1097 | rm -rf UU | |
1098 | echo "Done." | |
1099 | exit 0 | |
1100 | ;; | |
1101 | esac | |
1102 | ||
1103 | : set package name | |
85e6fe83 | 1104 | package=perl5 |
1aef975c AD |
1105 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
1106 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` | |
1107 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1108 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; | |
1109 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; | |
1110 | esac | |
2304df62 AD |
1111 | |
1112 | : Eunice requires " " instead of "", can you believe it | |
1113 | echo " " | |
1114 | : Here we go... | |
1115 | echo "Beginning of configuration questions for $package." | |
1116 | ||
1aef975c | 1117 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 |
2304df62 | 1118 | |
2304df62 AD |
1119 | : Some greps do not return status, grrr. |
1120 | echo "grimblepritz" >grimble | |
1121 | if grep blurfldyick grimble >/dev/null 2>&1 ; then | |
1122 | contains=contains | |
1123 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then | |
1124 | contains=grep | |
1125 | else | |
1126 | contains=contains | |
1127 | fi | |
1128 | rm -f grimble | |
1129 | : the following should work in any shell | |
1130 | case "$contains" in | |
1131 | contains*) | |
1132 | echo " " | |
1133 | echo "AGH! Grep doesn't return a status. Attempting remedial action." | |
1134 | cat >contains <<'EOSS' | |
1135 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp | |
1136 | EOSS | |
1137 | chmod +x contains | |
1138 | esac | |
1139 | ||
1140 | : first determine how to suppress newline on echo command | |
1141 | echo " " | |
1142 | echo "Checking echo to see how to suppress newlines..." | |
1143 | (echo "hi there\c" ; echo " ") >.echotmp | |
1144 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
1145 | echo "...using -n." | |
1146 | n='-n' | |
1147 | c='' | |
1148 | else | |
1149 | cat <<'EOM' | |
1150 | ...using \c | |
1151 | EOM | |
1152 | n='' | |
1153 | c='\c' | |
1154 | fi | |
1155 | echo $n "The star should be here-->$c" | |
1156 | echo '*' | |
1157 | rm -f .echotmp | |
1158 | ||
1159 | : Now test for existence of everything in MANIFEST | |
1160 | echo " " | |
1161 | if test -f ../MANIFEST; then | |
1162 | echo "First let's make sure your kit is complete. Checking..." >&4 | |
1163 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50 | |
1164 | rm -f missing | |
1165 | for filelist in x??; do | |
1166 | (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing) | |
1167 | done | |
1168 | if test -s missing; then | |
1169 | cat missing >&4 | |
1170 | cat >&4 <<'EOM' | |
1171 | ||
1172 | THIS PACKAGE SEEMS TO BE INCOMPLETE. | |
1173 | ||
1174 | You have the option of continuing the configuration process, despite the | |
1175 | distinct possibility that your kit is damaged, by typing 'y'es. If you | |
1176 | do, don't blame me if something goes wrong. I advise you to type 'n'o | |
284c50cc | 1177 | and contact the author (chip@perl.com). |
2304df62 AD |
1178 | |
1179 | EOM | |
1180 | echo $n "Continue? [n] $c" >&4 | |
1181 | read ans | |
1182 | case "$ans" in | |
1183 | y*) | |
1184 | echo "Continuing..." >&4 | |
1185 | rm -f missing | |
1186 | ;; | |
1187 | *) | |
1188 | echo "ABORTING..." >&4 | |
1189 | kill $$ | |
1190 | ;; | |
1191 | esac | |
1192 | else | |
1193 | echo "Looks good..." >&4 | |
1194 | fi | |
1195 | else | |
1196 | echo "There is no MANIFEST file. I hope your kit is complete !" | |
1197 | fi | |
1198 | rm -f missing x?? | |
1199 | ||
1200 | : compute the number of columns on the terminal for proper question formatting | |
1201 | case "$COLUMNS" in | |
1202 | '') COLUMNS='80';; | |
1203 | esac | |
1204 | ||
1205 | : set up the echo used in my read | |
1206 | myecho="case \"\$xxxm\" in | |
1207 | '') echo $n \"\$rp $c\" >&4;; | |
1208 | *) case \"\$rp\" in | |
1209 | '') echo $n \"[\$xxxm] $c\";; | |
1210 | *) | |
1211 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then | |
1212 | echo \"\$rp\" >&4 | |
1213 | echo $n \"[\$xxxm] $c\" >&4 | |
1214 | else | |
1215 | echo $n \"\$rp [\$xxxm] $c\" >&4 | |
1216 | fi | |
1217 | ;; | |
1218 | esac;; | |
1219 | esac" | |
1220 | ||
1221 | : now set up to do reads with possible shell escape and default assignment | |
1222 | cat <<EOSC >myread | |
28757baa | 1223 | $startsh |
2304df62 AD |
1224 | xxxm=\$dflt |
1225 | $myecho | |
1226 | ans='!' | |
1227 | case "\$fastread" in | |
1228 | yes) case "\$dflt" in | |
1229 | '') ;; | |
1230 | *) ans=''; | |
1231 | case "\$silent-\$rp" in | |
1232 | true-) ;; | |
1233 | *) echo " " >&4;; | |
1234 | esac;; | |
1235 | esac;; | |
1236 | *) case "\$silent" in | |
1237 | true) case "\$rp" in | |
1238 | '') ans='';; | |
1239 | esac;; | |
1240 | esac;; | |
1241 | esac | |
1242 | while expr "X\$ans" : "X!" >/dev/null; do | |
1243 | read answ | |
1244 | set x \$xxxm | |
1245 | shift | |
ff0cee69 | 1246 | aok=''; eval ans="\\"\$answ\\"" && aok=y |
2304df62 AD |
1247 | case "\$answ" in |
1248 | "\$ans") | |
1249 | case "\$ans" in | |
ecfc5424 AD |
1250 | \\&*) |
1251 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` | |
1252 | shift | |
1253 | case "\$1" in | |
1254 | -d) | |
1255 | fastread=yes | |
40a7a20a | 1256 | echo "(OK, I'll run with -d after this question.)" >&4 |
ecfc5424 AD |
1257 | ;; |
1258 | -*) | |
40a7a20a | 1259 | echo "*** Sorry, \$1 not supported yet." >&4 |
ecfc5424 AD |
1260 | ;; |
1261 | esac | |
1262 | $myecho | |
1263 | ans=! | |
1264 | ;; | |
2304df62 AD |
1265 | "!") |
1266 | sh 1>&4 | |
1267 | echo " " | |
1268 | $myecho | |
1269 | ;; | |
1270 | !*) | |
1271 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` | |
1272 | shift | |
1273 | sh 1>&4 -c "\$*" | |
1274 | echo " " | |
1275 | $myecho | |
1276 | ;; | |
1277 | esac;; | |
1278 | *) | |
1279 | case "\$aok" in | |
1280 | y) | |
1281 | echo "*** Substitution done -- please confirm." | |
1282 | xxxm="\$ans" | |
1283 | ans=\`echo $n "\$ans$c" | tr '\012' ' '\` | |
1284 | xxxm="\$ans" | |
1285 | ans=! | |
1286 | ;; | |
1287 | *) | |
1288 | echo "*** Error -- try again." | |
1289 | ans=! | |
1290 | ;; | |
1291 | esac | |
1292 | $myecho | |
1293 | ;; | |
1294 | esac | |
1295 | case "\$ans\$xxxm\$nostick" in | |
1296 | '') | |
1297 | ans=! | |
1298 | $myecho | |
1299 | ;; | |
1300 | esac | |
1301 | done | |
1302 | case "\$ans" in | |
1303 | '') ans="\$xxxm";; | |
1304 | esac | |
1305 | EOSC | |
1306 | ||
1307 | : create .config dir to save info across Configure sessions | |
1308 | test -d ../.config || mkdir ../.config | |
1309 | cat >../.config/README <<EOF | |
1310 | This directory created by Configure to save information that should | |
1311 | persist across sessions. | |
1312 | ||
1313 | You may safely delete it if you wish. | |
1314 | EOF | |
1315 | ||
1316 | : general instructions | |
1317 | needman=true | |
1318 | firsttime=true | |
760ac839 LW |
1319 | user=`(logname) 2>/dev/null` |
1320 | case "$user" in "") | |
1321 | user=`whoami 2>&1` ;; | |
1322 | esac | |
2304df62 AD |
1323 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
1324 | firsttime=false | |
1325 | echo " " | |
1326 | rp='Would you like to see the instructions?' | |
1327 | dflt=n | |
1328 | . ./myread | |
1329 | case "$ans" in | |
1330 | [yY]*) ;; | |
1331 | *) needman=false;; | |
1332 | esac | |
1333 | fi | |
1334 | if $needman; then | |
1335 | cat <<EOH | |
1336 | ||
1337 | This installation shell script will examine your system and ask you questions | |
a0d0e21e | 1338 | to determine how the perl5 package should be installed. If you get |
2304df62 AD |
1339 | stuck on a question, you may use a ! shell escape to start a subshell or |
1340 | execute a command. Many of the questions will have default answers in square | |
1341 | brackets; typing carriage return will give you the default. | |
1342 | ||
1343 | On some of the questions which ask for file or directory names you are allowed | |
1344 | to use the ~name construct to specify the login directory belonging to "name", | |
1345 | even if you don't have a shell which knows about that. Questions where this is | |
1346 | allowed will be marked "(~name ok)". | |
1347 | ||
1348 | EOH | |
1349 | rp='' | |
1350 | dflt='Type carriage return to continue' | |
1351 | . ./myread | |
1352 | cat <<'EOH' | |
1353 | ||
1354 | The prompter used in this script allows you to use shell variables and | |
1355 | backticks in your answers. You may use $1, $2, etc... to refer to the words | |
1356 | in the default answer, as if the default line was a set of arguments given to a | |
1357 | script shell. This means you may also use $* to repeat the whole default line, | |
1358 | so you do not have to re-type everything to add something to the default. | |
1359 | ||
1360 | Everytime there is a substitution, you will have to confirm. If there is an | |
1361 | error (e.g. an unmatched backtick), the default answer will remain unchanged | |
1362 | and you will be prompted again. | |
1363 | ||
1364 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all | |
1365 | the questions and use the computed defaults (or the previous answers if there | |
1366 | was already a config.sh file). Type 'Configure -h' for a list of options. | |
ecfc5424 | 1367 | You may also start interactively and then answer '& -d' at any prompt to turn |
7bac28a0 | 1368 | on the non-interactive behavior for the remainder of the execution. |
2304df62 AD |
1369 | |
1370 | EOH | |
1371 | . ./myread | |
1372 | cat <<EOH | |
1373 | ||
1374 | Much effort has been expended to ensure that this shell script will run on any | |
1375 | Unix system. If despite that it blows up on yours, your best bet is to edit | |
40000a8c AD |
1376 | Configure and run it again. If you can't run Configure for some reason, |
1377 | you'll have to generate a config.sh file by hand. Whatever problems you | |
284c50cc | 1378 | have, let me (chip@perl.com) know how I blew it. |
2304df62 AD |
1379 | |
1380 | This installation script affects things in two ways: | |
1381 | ||
1382 | 1) it may do direct variable substitutions on some of the files included | |
1383 | in this kit. | |
1384 | 2) it builds a config.h file for inclusion in C programs. You may edit | |
1385 | any of these files as the need arises after running this script. | |
1386 | ||
1387 | If you make a mistake on a question, there is no easy way to back up to it | |
1388 | currently. The easiest thing to do is to edit config.sh and rerun all the SH | |
1389 | files. Configure will offer to let you do this before it runs the SH files. | |
1390 | ||
1391 | EOH | |
1392 | dflt='Type carriage return to continue' | |
1393 | . ./myread | |
1394 | case "$firsttime" in | |
1395 | true) echo $user >>../.config/instruct;; | |
1396 | esac | |
1397 | fi | |
1398 | ||
2304df62 AD |
1399 | : find out where common programs are |
1400 | echo " " | |
1401 | echo "Locating common programs..." >&4 | |
1402 | cat <<EOSC >loc | |
1403 | $startsh | |
1404 | case \$# in | |
1405 | 0) exit 1;; | |
1406 | esac | |
1407 | thing=\$1 | |
1408 | shift | |
1409 | dflt=\$1 | |
1410 | shift | |
1411 | for dir in \$*; do | |
1412 | case "\$thing" in | |
1413 | .) | |
1414 | if test -d \$dir/\$thing; then | |
1415 | echo \$dir | |
1416 | exit 0 | |
1417 | fi | |
1418 | ;; | |
1419 | *) | |
a0d0e21e | 1420 | for thisthing in \$dir/\$thing; do |
ecfc5424 | 1421 | : just loop through to pick last item |
a0d0e21e | 1422 | done |
25f94b33 | 1423 | if test -f \$thisthing; then |
a0d0e21e | 1424 | echo \$thisthing |
2304df62 AD |
1425 | exit 0 |
1426 | elif test -f \$dir/\$thing.exe; then | |
1427 | : on Eunice apparently | |
1428 | echo \$dir/\$thing | |
1429 | exit 0 | |
1430 | fi | |
1431 | ;; | |
1432 | esac | |
1433 | done | |
1434 | echo \$dflt | |
1435 | exit 1 | |
1436 | EOSC | |
1437 | chmod +x loc | |
1438 | $eunicefix loc | |
1439 | loclist=" | |
1440 | awk | |
1441 | cat | |
ecfc5424 | 1442 | comm |
2304df62 AD |
1443 | cp |
1444 | echo | |
1445 | expr | |
a0d0e21e | 1446 | find |
2304df62 | 1447 | grep |
a0d0e21e | 1448 | ls |
2304df62 | 1449 | mkdir |
2304df62 AD |
1450 | rm |
1451 | sed | |
1452 | sort | |
85e6fe83 | 1453 | touch |
2304df62 AD |
1454 | tr |
1455 | uniq | |
1456 | " | |
1457 | trylist=" | |
1458 | Mcc | |
2304df62 AD |
1459 | byacc |
1460 | cpp | |
1461 | csh | |
1462 | date | |
1463 | egrep | |
8ff267be | 1464 | gzip |
2c7991dc | 1465 | less |
2304df62 | 1466 | line |
8ff267be | 1467 | ln |
2c7991dc | 1468 | more |
2304df62 AD |
1469 | nroff |
1470 | perl | |
2c7991dc | 1471 | pg |
40a7a20a | 1472 | sendmail |
2304df62 AD |
1473 | test |
1474 | uname | |
8ff267be | 1475 | zip |
2304df62 | 1476 | " |
8e07c86e | 1477 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
1478 | pth="$pth /lib /usr/lib" |
1479 | for file in $loclist; do | |
1480 | xxx=`./loc $file $file $pth` | |
1481 | eval $file=$xxx | |
1482 | eval _$file=$xxx | |
1483 | case "$xxx" in | |
1484 | /*) | |
1485 | echo $file is in $xxx. | |
1486 | ;; | |
8e07c86e AD |
1487 | ?:[\\/]*) |
1488 | echo $file is in $xxx. | |
1489 | ;; | |
2304df62 | 1490 | *) |
25f94b33 AD |
1491 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
1492 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
4633a7c4 | 1493 | exit 1 |
2304df62 AD |
1494 | ;; |
1495 | esac | |
1496 | done | |
1497 | echo " " | |
1498 | echo "Don't worry if any of the following aren't found..." | |
1499 | say=offhand | |
1500 | for file in $trylist; do | |
1501 | xxx=`./loc $file $file $pth` | |
1502 | eval $file=$xxx | |
1503 | eval _$file=$xxx | |
1504 | case "$xxx" in | |
1505 | /*) | |
1506 | echo $file is in $xxx. | |
1507 | ;; | |
8e07c86e AD |
1508 | ?:[\\/]*) |
1509 | echo $file is in $xxx. | |
1510 | ;; | |
2304df62 AD |
1511 | *) |
1512 | echo "I don't see $file out there, $say." | |
1513 | say=either | |
1514 | ;; | |
1515 | esac | |
1516 | done | |
1517 | case "$egrep" in | |
1518 | egrep) | |
1519 | echo "Substituting grep for egrep." | |
1520 | egrep=$grep | |
1521 | ;; | |
1522 | esac | |
8ff267be | 1523 | case "$ln" in |
1524 | ln) | |
1525 | echo "Substituting cp for ln." | |
1526 | ln=$cp | |
1527 | ;; | |
1528 | esac | |
2304df62 AD |
1529 | case "$test" in |
1530 | test) | |
1531 | echo "Hopefully test is built into your sh." | |
1532 | ;; | |
1533 | *) | |
ecfc5424 | 1534 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
2304df62 AD |
1535 | echo "Using the test built into your sh." |
1536 | test=test | |
1537 | _test=test | |
1538 | fi | |
1539 | ;; | |
1540 | esac | |
1541 | case "$echo" in | |
1542 | echo) | |
1543 | echo "Hopefully echo is built into your sh." | |
1544 | ;; | |
1545 | '') ;; | |
1546 | *) | |
1547 | echo " " | |
1548 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
1549 | $echo $n "hi there$c" >foo1 | |
1550 | echo $n "hi there$c" >foo2 | |
1551 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
1552 | echo "They are compatible. In fact, they may be identical." | |
1553 | else | |
1554 | case "$n" in | |
1555 | '-n') n='' c='\c';; | |
1556 | *) n='-n' c='';; | |
1557 | esac | |
1558 | cat <<FOO | |
1559 | They are not compatible! You are probably running ksh on a non-USG system. | |
1560 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
1561 | have echo built in and we may have to run some Bourne shell scripts. That | |
1562 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
1563 | ||
1564 | FOO | |
1565 | $echo $n "The star should be here-->$c" | |
1566 | $echo "*" | |
1567 | fi | |
1568 | $rm -f foo1 foo2 | |
1569 | ;; | |
1570 | esac | |
1571 | ||
a0d0e21e LW |
1572 | : determine whether symbolic links are supported |
1573 | echo " " | |
1574 | $touch blurfl | |
1575 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
1576 | echo "Symbolic links are supported." >&4 | |
1577 | lns="$ln -s" | |
1578 | else | |
1579 | echo "Symbolic links are NOT supported." >&4 | |
1580 | lns="$ln" | |
1581 | fi | |
1582 | $rm -f blurfl sym | |
1583 | ||
ecfc5424 AD |
1584 | : see whether [:lower:] and [:upper:] are supported character classes |
1585 | echo " " | |
1586 | up='[A-Z]' | |
1587 | low='[a-z]' | |
1588 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1589 | ABYZ) | |
1590 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
1591 | up='[:upper:]' | |
1592 | low='[:lower:]' | |
1593 | ;; | |
1594 | *) | |
1595 | echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 | |
1596 | ;; | |
1597 | esac | |
1598 | : set up the translation script tr, must be called with ./tr of course | |
1599 | cat >tr <<EOSC | |
1600 | $startsh | |
1601 | case "\$1\$2" in | |
1602 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
1603 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
1604 | esac | |
1605 | exec $tr "\$@" | |
1606 | EOSC | |
1607 | chmod +x tr | |
1608 | $eunicefix tr | |
1609 | ||
2304df62 AD |
1610 | : Try to determine whether config.sh was made on this system |
1611 | case "$config_sh" in | |
1612 | '') | |
1613 | myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` | |
a0d0e21e | 1614 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
ecfc5424 | 1615 | ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` |
1aef975c | 1616 | newmyuname="$myuname" |
2304df62 | 1617 | dflt=n |
16d20bd9 AD |
1618 | case "$knowitall" in |
1619 | '') | |
1620 | if test -f ../config.sh; then | |
1621 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
1622 | eval "`grep myuname= ../config.sh`" | |
1623 | fi | |
1624 | if test "X$myuname" = "X$newmyuname"; then | |
1625 | dflt=y | |
1626 | fi | |
2304df62 | 1627 | fi |
16d20bd9 AD |
1628 | ;; |
1629 | *) dflt=y;; | |
1630 | esac | |
2304df62 AD |
1631 | |
1632 | : Get old answers from old config file if Configure was run on the | |
1633 | : same system, otherwise use the hints. | |
1634 | hint=default | |
1635 | cd .. | |
1636 | if test -f config.sh; then | |
16d20bd9 AD |
1637 | echo " " |
1638 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
1639 | . UU/myread |
1640 | case "$ans" in | |
1641 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; | |
1642 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
ecfc5424 AD |
1643 | tmp_n="$n" |
1644 | tmp_c="$c" | |
85cad39c | 1645 | tmp_sh="$sh" |
2304df62 AD |
1646 | . ./config.sh |
1647 | cp config.sh UU | |
ecfc5424 AD |
1648 | n="$tmp_n" |
1649 | c="$tmp_c" | |
85cad39c | 1650 | : Older versions did not always set $sh. Catch re-use of such |
1651 | : an old config.sh. | |
1652 | case "$sh" in | |
1653 | '') sh="$tmp_sh" ;; | |
1654 | esac | |
2304df62 AD |
1655 | hint=previous |
1656 | ;; | |
1657 | esac | |
1658 | fi | |
1659 | if test ! -f config.sh; then | |
1660 | $cat <<EOM | |
1661 | ||
1662 | First time through, eh? I have some defaults handy for the following systems: | |
1663 | ||
1664 | EOM | |
1665 | cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4 | |
1666 | dflt='' | |
1667 | : Half the following guesses are probably wrong... If you have better | |
284c50cc | 1668 | : tests or hints, please send them to chip@perl.com |
2304df62 | 1669 | : The metaconfig authors would also appreciate a copy... |
a0d0e21e | 1670 | $test -f /irix && osname=irix |
85e6fe83 LW |
1671 | $test -f /xenix && osname=sco_xenix |
1672 | $test -f /dynix && osname=dynix | |
1673 | $test -f /dnix && osname=dnix | |
5f05dabc | 1674 | $test -f /lynx.os && osname=lynxos |
1675 | $test -f /unicos && osname=unicos && osvers=`$uname -r` | |
7a4c00b4 | 1676 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
85e6fe83 | 1677 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
1678 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
1679 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
1680 | $test -d /usr/apollo/bin && osname=apollo |
1681 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 1682 | $test -d /usr/include/minix && osname=minix |
4633a7c4 LW |
1683 | if $test -d /MachTen; then |
1684 | osname=machten | |
1685 | if $test -x /sbin/version; then | |
1686 | osvers=`/sbin/version | $awk '{print $2}' | | |
1687 | $sed -e 's/[A-Za-z]$//'` | |
1688 | elif $test -x /usr/etc/version; then | |
1689 | osvers=`/usr/etc/version | $awk '{print $2}' | | |
1690 | $sed -e 's/[A-Za-z]$//'` | |
1691 | else | |
1692 | osvers="$2.$3" | |
1693 | fi | |
1694 | fi | |
2304df62 AD |
1695 | if $test -f $uname; then |
1696 | set X $myuname | |
1697 | shift | |
1698 | ||
2304df62 | 1699 | case "$5" in |
85e6fe83 | 1700 | fps*) osname=fps ;; |
2304df62 AD |
1701 | mips*) |
1702 | case "$4" in | |
85e6fe83 LW |
1703 | umips) osname=umips ;; |
1704 | *) osname=mips ;; | |
2304df62 | 1705 | esac;; |
85e6fe83 LW |
1706 | [23]100) osname=mips ;; |
1707 | next*) osname=next ;; | |
ecfc5424 AD |
1708 | i386*) |
1709 | if $test -f /etc/kconfig; then | |
1710 | osname=isc | |
a0d0e21e LW |
1711 | if test "$lns" = "ln -s"; then |
1712 | osvers=4 | |
1713 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
1714 | osvers=3 | |
2304df62 | 1715 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 1716 | osvers=2 |
ecfc5424 AD |
1717 | fi |
1718 | fi | |
1719 | ;; | |
2304df62 AD |
1720 | esac |
1721 | ||
1722 | case "$1" in | |
a0d0e21e LW |
1723 | aix) osname=aix |
1724 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
1725 | case "$tmp" in | |
1aef975c | 1726 | 'not found') osvers="$4"."$3" ;; |
a0d0e21e LW |
1727 | '<3240'|'<>3240') osvers=3.2.0 ;; |
1728 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
1729 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 1730 | *) osvers=$tmp;; |
a0d0e21e LW |
1731 | esac |
1732 | ;; | |
23f87696 SZ |
1733 | *dc.osx) osname=dcosx |
1734 | osvers="$3" | |
1735 | ;; | |
a0d0e21e LW |
1736 | dnix) osname=dnix |
1737 | osvers="$3" | |
1738 | ;; | |
1739 | domainos) osname=apollo | |
1740 | osvers="$3" | |
1741 | ;; | |
1742 | dgux) osname=dgux | |
1743 | osvers="$3" | |
1744 | ;; | |
760ac839 LW |
1745 | dynixptx*) osname=dynixptx |
1746 | osvers="$3" | |
1747 | ;; | |
a0d0e21e LW |
1748 | freebsd) osname=freebsd |
1749 | osvers="$3" ;; | |
1750 | genix) osname=genix ;; | |
1751 | hp*) osname=hpux | |
1752 | case "$3" in | |
1753 | *.08.*) osvers=9 ;; | |
1754 | *.09.*) osvers=9 ;; | |
1755 | *.10.*) osvers=10 ;; | |
ecfc5424 | 1756 | *) osvers="$3" ;; |
a0d0e21e LW |
1757 | esac |
1758 | ;; | |
a78b0d02 | 1759 | irix*) osname=irix |
a0d0e21e LW |
1760 | case "$3" in |
1761 | 4*) osvers=4 ;; | |
1762 | 5*) osvers=5 ;; | |
ecfc5424 | 1763 | *) osvers="$3" ;; |
a0d0e21e LW |
1764 | esac |
1765 | ;; | |
1766 | linux) osname=linux | |
1767 | case "$3" in | |
a0d0e21e LW |
1768 | *) osvers="$3" ;; |
1769 | esac | |
1770 | ;; | |
1771 | netbsd*) osname=netbsd | |
ecfc5424 AD |
1772 | osvers="$3" |
1773 | ;; | |
4e81affe MM |
1774 | news-os) osvers="$3" |
1775 | case "$3" in | |
1776 | 4*) osname=newsos4 ;; | |
1777 | *) osname=newsos ;; | |
1778 | esac | |
1779 | ;; | |
a0d0e21e LW |
1780 | bsd386) osname=bsd386 |
1781 | osvers=`$uname -r` | |
1782 | ;; | |
ae3afa4e TH |
1783 | powerux | power_ux | powermax_os | powermaxos | \ |
1784 | powerunix | power_unix) osname=powerux | |
1785 | osvers="$3" | |
1786 | ;; | |
a0d0e21e LW |
1787 | next*) osname=next ;; |
1788 | solaris) osname=solaris | |
1789 | case "$3" in | |
1790 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 1791 | *) osvers="$3" ;; |
a0d0e21e LW |
1792 | esac |
1793 | ;; | |
85e6fe83 LW |
1794 | sunos) osname=sunos |
1795 | case "$3" in | |
85e6fe83 LW |
1796 | 5*) osname=solaris |
1797 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 1798 | *) osvers="$3" ;; |
2304df62 AD |
1799 | esac |
1800 | ;; | |
a0d0e21e | 1801 | titanos) osname=titanos |
85e6fe83 | 1802 | case "$3" in |
a0d0e21e LW |
1803 | 1*) osvers=1 ;; |
1804 | 2*) osvers=2 ;; | |
1805 | 3*) osvers=3 ;; | |
1806 | 4*) osvers=4 ;; | |
ecfc5424 | 1807 | *) osvers="$3" ;; |
2304df62 AD |
1808 | esac |
1809 | ;; | |
85e6fe83 | 1810 | ultrix) osname=ultrix |
ecfc5424 | 1811 | osvers="$3" |
2304df62 | 1812 | ;; |
28757baa | 1813 | osf1|mls+) case "$5" in |
fed7345c AD |
1814 | alpha) |
1815 | osname=dec_osf | |
1816 | osvers=`echo "$3" | sed 's/^[vt]//'` | |
ecfc5424 AD |
1817 | ;; |
1818 | hp*) osname=hp_osf1 ;; | |
1819 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
1820 | esac |
1821 | ;; | |
a0d0e21e LW |
1822 | uts) osname=uts |
1823 | osvers="$3" | |
1824 | ;; | |
ff68c719 | 1825 | qnx) osname=qnx |
1826 | osvers="$4" | |
1827 | ;; | |
85e6fe83 | 1828 | $2) case "$osname" in |
2304df62 | 1829 | *isc*) ;; |
a0d0e21e | 1830 | *freebsd*) ;; |
5f05dabc | 1831 | svr*) |
a0d0e21e LW |
1832 | : svr4.x or possibly later |
1833 | case "svr$3" in | |
1834 | ${osname}*) | |
1835 | osname=svr$3 | |
1836 | osvers=$4 | |
1837 | ;; | |
1838 | esac | |
1839 | case "$osname" in | |
1840 | svr4.0) | |
1841 | : Check for ESIX | |
1842 | if test -f /stand/boot ; then | |
1843 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
1844 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
1845 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
1846 | if test -n "$isesix"; then | |
a0d0e21e LW |
1847 | osname=esix4 |
1848 | fi | |
1849 | fi | |
1850 | fi | |
1851 | ;; | |
1852 | esac | |
1853 | ;; | |
2304df62 | 1854 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
1855 | osname=sco |
1856 | set `echo $3 | $sed 's/\./ /g'` $4 | |
2304df62 | 1857 | if $test -f sco_$1_$2_$3.sh; then |
85e6fe83 | 1858 | osvers=$1.$2.$3 |
2304df62 | 1859 | elif $test -f sco_$1_$2.sh; then |
85e6fe83 | 1860 | osvers=$1.$2 |
2304df62 | 1861 | elif $test -f sco_$1.sh; then |
85e6fe83 | 1862 | osvers=$1 |
2304df62 | 1863 | fi |
a0d0e21e LW |
1864 | else |
1865 | case "$osname" in | |
1866 | '') : Still unknown. Probably a generic Sys V. | |
1867 | osname="sysv" | |
1868 | osvers="$3" | |
1869 | ;; | |
1870 | esac | |
2304df62 AD |
1871 | fi |
1872 | ;; | |
1873 | esac | |
1874 | ;; | |
a0d0e21e LW |
1875 | *) case "$osname" in |
1876 | '') : Still unknown. Probably a generic BSD. | |
1877 | osname="$1" | |
1878 | osvers="$3" | |
1879 | ;; | |
1880 | esac | |
1881 | ;; | |
2304df62 AD |
1882 | esac |
1883 | else | |
4e81affe | 1884 | if test -f /vmunix -a -f newsos4.sh; then |
ecfc5424 | 1885 | (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1 |
2304df62 | 1886 | if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then |
4e81affe | 1887 | osname=newsos4 |
2304df62 AD |
1888 | fi |
1889 | $rm -f ../UU/kernel.what | |
8e07c86e AD |
1890 | elif test -d c:/.; then |
1891 | set X $myuname | |
1892 | osname=os2 | |
1893 | osvers="$5" | |
2304df62 AD |
1894 | fi |
1895 | fi | |
85e6fe83 | 1896 | |
a0d0e21e LW |
1897 | : Now look for a hint file osname_osvers, unless one has been |
1898 | : specified already. | |
1899 | case "$hintfile" in | |
1900 | ''|' ') | |
ecfc5424 | 1901 | file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` |
a0d0e21e | 1902 | : Also try without trailing minor version numbers. |
ecfc5424 AD |
1903 | xfile=`echo $file | $sed -e 's@_[^_]*$@@'` |
1904 | xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` | |
1905 | xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` | |
1906 | xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` | |
a0d0e21e LW |
1907 | case "$file" in |
1908 | '') dflt=none ;; | |
1909 | *) case "$osvers" in | |
1910 | '') dflt=$file | |
1911 | ;; | |
1912 | *) if $test -f $file.sh ; then | |
1913 | dflt=$file | |
1914 | elif $test -f $xfile.sh ; then | |
1915 | dflt=$xfile | |
1916 | elif $test -f $xxfile.sh ; then | |
1917 | dflt=$xxfile | |
1918 | elif $test -f $xxxfile.sh ; then | |
1919 | dflt=$xxxfile | |
1920 | elif $test -f $xxxxfile.sh ; then | |
1921 | dflt=$xxxxfile | |
1922 | elif $test -f "${osname}.sh" ; then | |
1923 | dflt="${osname}" | |
1924 | else | |
1925 | dflt=none | |
1926 | fi | |
1927 | ;; | |
1928 | esac | |
85e6fe83 LW |
1929 | ;; |
1930 | esac | |
1931 | ;; | |
a0d0e21e | 1932 | *) |
ecfc5424 | 1933 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 1934 | ;; |
2304df62 | 1935 | esac |
1aef975c | 1936 | |
2304df62 AD |
1937 | $cat <<EOM |
1938 | ||
1939 | You may give one or more space-separated answers, or "none" if appropriate. | |
1940 | If your OS version has no hints, DO NOT give a wrong version -- say "none". | |
1941 | ||
1942 | EOM | |
1943 | rp="Which of these apply, if any?" | |
1944 | . ../UU/myread | |
85e6fe83 LW |
1945 | tans=$ans |
1946 | for file in $tans; do | |
2304df62 AD |
1947 | if $test -f $file.sh; then |
1948 | . ./$file.sh | |
1949 | $cat $file.sh >> ../UU/config.sh | |
85e6fe83 | 1950 | elif $test X$tans = X -o X$tans = Xnone ; then |
2304df62 AD |
1951 | : nothing |
1952 | else | |
85e6fe83 LW |
1953 | : Give one chance to correct a possible typo. |
1954 | echo "$file.sh does not exist" | |
1955 | dflt=$file | |
1956 | rp="hint to use instead?" | |
1957 | . ../UU/myread | |
1958 | for file in $ans; do | |
1959 | if $test -f "$file.sh"; then | |
1960 | . ./$file.sh | |
1961 | $cat $file.sh >> ../UU/config.sh | |
1962 | elif $test X$ans = X -o X$ans = Xnone ; then | |
1963 | : nothing | |
1964 | else | |
1965 | echo "$file.sh does not exist -- ignored." | |
1966 | fi | |
1967 | done | |
2304df62 AD |
1968 | fi |
1969 | done | |
85e6fe83 | 1970 | |
2304df62 | 1971 | hint=recommended |
85e6fe83 LW |
1972 | : Remember our hint file for later. |
1973 | if $test -f "$file.sh" ; then | |
a0d0e21e | 1974 | hintfile="$file" |
85e6fe83 | 1975 | else |
a0d0e21e | 1976 | hintfile='' |
85e6fe83 LW |
1977 | fi |
1978 | ||
2304df62 AD |
1979 | cd .. |
1980 | fi | |
1981 | cd UU | |
1982 | ;; | |
1983 | *) | |
1984 | echo " " | |
1985 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
1986 | tmp_n="$n" |
1987 | tmp_c="$c" | |
2304df62 AD |
1988 | cd .. |
1989 | cp $config_sh config.sh 2>/dev/null | |
a78b0d02 | 1990 | chmod +w config.sh |
2304df62 AD |
1991 | . ./config.sh |
1992 | cd UU | |
1993 | cp ../config.sh . | |
ecfc5424 AD |
1994 | n="$tmp_n" |
1995 | c="$tmp_c" | |
2304df62 AD |
1996 | hint=previous |
1997 | ;; | |
1998 | esac | |
1aef975c AD |
1999 | test "$override" && . ./optdef.sh |
2000 | myuname="$newmyuname" | |
2304df62 AD |
2001 | |
2002 | : Restore computed paths | |
2003 | for file in $loclist $trylist; do | |
2004 | eval $file="\$_$file" | |
2005 | done | |
2006 | ||
85e6fe83 | 2007 | cat << EOM |
a0d0e21e | 2008 | |
85e6fe83 | 2009 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
2010 | The default value is probably right if the name rings a bell. Otherwise, |
2011 | since spelling matters for me, either accept the default or answer "none" | |
2012 | to leave it blank. | |
a0d0e21e | 2013 | |
85e6fe83 | 2014 | EOM |
85e6fe83 | 2015 | case "$osname" in |
a0d0e21e | 2016 | ''|' ') |
85e6fe83 | 2017 | case "$hintfile" in |
a0d0e21e | 2018 | ''|' '|none) dflt=none ;; |
ecfc5424 | 2019 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
2020 | esac |
2021 | ;; | |
2022 | *) dflt="$osname" ;; | |
2023 | esac | |
2024 | rp="Operating system name?" | |
2025 | . ./myread | |
2026 | case "$ans" in | |
ecfc5424 AD |
2027 | none) osname='' ;; |
2028 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 2029 | esac |
8ff267be | 2030 | echo " " |
2031 | case "$osvers" in | |
2032 | ''|' ') | |
2033 | case "$hintfile" in | |
2034 | ''|' '|none) dflt=none ;; | |
2035 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` | |
2036 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` | |
2037 | case "$dflt" in | |
2038 | ''|' ') dflt=none ;; | |
2039 | esac | |
2040 | ;; | |
2041 | esac | |
2042 | ;; | |
2043 | *) dflt="$osvers" ;; | |
2044 | esac | |
2045 | rp="Operating system version?" | |
2046 | . ./myread | |
2047 | case "$ans" in | |
2048 | none) osvers='' ;; | |
2049 | *) osvers="$ans" ;; | |
2050 | esac | |
2051 | ||
760ac839 LW |
2052 | |
2053 | ||
2304df62 | 2054 | : who configured the system |
7792a3d7 | 2055 | cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1` |
8ff267be | 2056 | cf_by=`(logname) 2>/dev/null` |
2057 | case "$cf_by" in "") | |
2058 | cf_by=`(whoami) 2>/dev/null` | |
2059 | case "$cf_by" in "") | |
2060 | cf_by=unknown ;; | |
2061 | esac ;; | |
2062 | esac | |
2304df62 | 2063 | |
4633a7c4 | 2064 | : determine the architecture name |
2304df62 | 2065 | echo " " |
4633a7c4 LW |
2066 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
2067 | tarch=`arch`"-$osname" | |
2068 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
2069 | if uname -m > tmparch 2>&1 ; then | |
7e1af8bc | 2070 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ |
5f05dabc | 2071 | -e 's/$/'"-$osname/" tmparch` |
4633a7c4 LW |
2072 | else |
2073 | tarch="$osname" | |
2074 | fi | |
2075 | $rm -f tmparch | |
2076 | else | |
2077 | tarch="$osname" | |
2078 | fi | |
2079 | case "$myarchname" in | |
2080 | ''|"$tarch") ;; | |
2081 | *) | |
2082 | echo "(Your architecture name used to be $myarchname.)" | |
2083 | archname='' | |
2304df62 AD |
2084 | ;; |
2085 | esac | |
4633a7c4 LW |
2086 | case "$archname" in |
2087 | '') dflt="$tarch";; | |
2088 | *) dflt="$archname";; | |
2089 | esac | |
2090 | rp='What is your architecture name' | |
2091 | . ./myread | |
dc66995c MB |
2092 | case "$usethreads" in |
2093 | $define) archname="$ans-thread" | |
2094 | echo "usethreads selected... architecture name is now $archname." >&4 | |
2095 | ;; | |
2096 | *) archname="$ans" ;; | |
2097 | esac | |
4633a7c4 LW |
2098 | myarchname="$tarch" |
2099 | ||
2100 | : is AFS running? | |
2101 | echo " " | |
2afac517 | 2102 | case "$afs" in |
2103 | $define|true) afs=true ;; | |
2104 | $undef|false) afs=false ;; | |
2105 | *) if test -d /afs; then | |
2106 | afs=true | |
2107 | else | |
2108 | afs=false | |
2109 | fi | |
2110 | ;; | |
2111 | esac | |
2112 | if $afs; then | |
4633a7c4 | 2113 | echo "AFS may be running... I'll be extra cautious then..." >&4 |
2304df62 | 2114 | else |
4633a7c4 | 2115 | echo "AFS does not seem to be running..." >&4 |
2304df62 AD |
2116 | fi |
2117 | ||
4633a7c4 LW |
2118 | : decide how portable to be. Allow command line overrides. |
2119 | case "$d_portable" in | |
2120 | "$undef") ;; | |
2121 | *) d_portable="$define" ;; | |
2304df62 | 2122 | esac |
2304df62 | 2123 | |
4633a7c4 LW |
2124 | : set up shell script to do ~ expansion |
2125 | cat >filexp <<EOSS | |
2126 | $startsh | |
2127 | : expand filename | |
2128 | case "\$1" in | |
2129 | ~/*|~) | |
2130 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
2304df62 | 2131 | ;; |
4633a7c4 LW |
2132 | ~*) |
2133 | if $test -f /bin/csh; then | |
2134 | /bin/csh -f -c "glob \$1" | |
2135 | failed=\$? | |
2136 | echo "" | |
2137 | exit \$failed | |
2138 | else | |
2139 | name=\`$expr x\$1 : '..\([^/]*\)'\` | |
2140 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
2141 | if $test ! -d "\$dir"; then | |
2142 | me=\`basename \$0\` | |
2143 | echo "\$me: can't locate home directory for: \$name" >&2 | |
2144 | exit 1 | |
2145 | fi | |
2146 | case "\$1" in | |
2147 | */*) | |
2148 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
2149 | ;; | |
2150 | *) | |
2151 | echo \$dir | |
2152 | ;; | |
2304df62 | 2153 | esac |
4633a7c4 | 2154 | fi |
2304df62 AD |
2155 | ;; |
2156 | *) | |
4633a7c4 | 2157 | echo \$1 |
2304df62 AD |
2158 | ;; |
2159 | esac | |
4633a7c4 LW |
2160 | EOSS |
2161 | chmod +x filexp | |
2162 | $eunicefix filexp | |
2304df62 AD |
2163 | |
2164 | : now set up to get a file name | |
28757baa | 2165 | cat <<EOS >getfile |
2166 | $startsh | |
2167 | EOS | |
2168 | cat <<'EOSC' >>getfile | |
2304df62 AD |
2169 | tilde='' |
2170 | fullpath='' | |
2171 | already='' | |
2172 | skip='' | |
2173 | none_ok='' | |
2174 | exp_file='' | |
a0d0e21e | 2175 | nopath_ok='' |
2304df62 AD |
2176 | orig_rp="$rp" |
2177 | orig_dflt="$dflt" | |
2178 | ||
2179 | case "$fn" in | |
ecfc5424 AD |
2180 | *\(*) |
2181 | expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok | |
2182 | fn=`echo $fn | sed 's/(.*)//'` | |
2183 | ;; | |
2184 | esac | |
2185 | ||
2186 | case "$fn" in | |
a0d0e21e LW |
2187 | *:*) |
2188 | loc_file=`expr $fn : '.*:\(.*\)'` | |
2189 | fn=`expr $fn : '\(.*\):.*'` | |
2190 | ;; | |
2191 | esac | |
2192 | ||
2193 | case "$fn" in | |
2304df62 AD |
2194 | *~*) tilde=true;; |
2195 | esac | |
2196 | case "$fn" in | |
2197 | */*) fullpath=true;; | |
2198 | esac | |
2199 | case "$fn" in | |
2200 | *+*) skip=true;; | |
2201 | esac | |
2202 | case "$fn" in | |
2203 | *n*) none_ok=true;; | |
2204 | esac | |
2205 | case "$fn" in | |
2206 | *e*) exp_file=true;; | |
2207 | esac | |
a0d0e21e LW |
2208 | case "$fn" in |
2209 | *p*) nopath_ok=true;; | |
2210 | esac | |
2304df62 AD |
2211 | |
2212 | case "$fn" in | |
2213 | *f*) type='File';; | |
2214 | *d*) type='Directory';; | |
a0d0e21e | 2215 | *l*) type='Locate';; |
2304df62 AD |
2216 | esac |
2217 | ||
2218 | what="$type" | |
2219 | case "$what" in | |
2220 | Locate) what='File';; | |
2221 | esac | |
2222 | ||
2223 | case "$exp_file" in | |
2224 | '') | |
2225 | case "$d_portable" in | |
2226 | "$define") ;; | |
2227 | *) exp_file=true;; | |
2228 | esac | |
2229 | ;; | |
2230 | esac | |
2231 | ||
2232 | cd .. | |
2233 | while test "$type"; do | |
2234 | redo='' | |
2235 | rp="$orig_rp" | |
2236 | dflt="$orig_dflt" | |
2237 | case "$tilde" in | |
2238 | true) rp="$rp (~name ok)";; | |
2239 | esac | |
2240 | . UU/myread | |
ecfc5424 AD |
2241 | if test -f UU/getfile.ok && \ |
2242 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
2243 | then | |
2244 | value="$ans" | |
2245 | ansexp="$ans" | |
2246 | break | |
2247 | fi | |
2304df62 AD |
2248 | case "$ans" in |
2249 | none) | |
2250 | value='' | |
2251 | ansexp='' | |
2252 | case "$none_ok" in | |
2253 | true) type='';; | |
2254 | esac | |
2255 | ;; | |
2256 | *) | |
2257 | case "$tilde" in | |
2258 | '') value="$ans" | |
2259 | ansexp="$ans";; | |
2260 | *) | |
2261 | value=`UU/filexp $ans` | |
2262 | case $? in | |
2263 | 0) | |
2264 | if test "$ans" != "$value"; then | |
ecfc5424 | 2265 | echo "(That expands to $value on this system.)" |
2304df62 AD |
2266 | fi |
2267 | ;; | |
2268 | *) value="$ans";; | |
2269 | esac | |
2270 | ansexp="$value" | |
2271 | case "$exp_file" in | |
2272 | '') value="$ans";; | |
2273 | esac | |
2274 | ;; | |
2275 | esac | |
2276 | case "$fullpath" in | |
2277 | true) | |
2278 | case "$ansexp" in | |
2279 | /*) value="$ansexp" ;; | |
2280 | *) | |
2281 | redo=true | |
2282 | case "$already" in | |
2283 | true) | |
2284 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
2285 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
2286 | ;; | |
2287 | *) | |
2288 | echo "Please give a full path name, starting with slash." >&4 | |
2289 | case "$tilde" in | |
2290 | true) | |
2291 | echo "Note that using ~name is ok provided it expands well." >&4 | |
2292 | already=true | |
2293 | ;; | |
2294 | esac | |
2295 | esac | |
2296 | ;; | |
2297 | esac | |
2298 | ;; | |
2299 | esac | |
2300 | case "$redo" in | |
2301 | '') | |
2302 | case "$type" in | |
2303 | File) | |
2304 | if test -f "$ansexp"; then | |
2305 | type='' | |
2306 | elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 | |
2307 | then | |
2308 | echo "($value is not a plain file, but that's ok.)" | |
2309 | type='' | |
2310 | fi | |
2311 | ;; | |
2312 | Directory) | |
2313 | if test -d "$ansexp"; then | |
2314 | type='' | |
2315 | fi | |
2316 | ;; | |
2317 | Locate) | |
40000a8c | 2318 | if test -d "$ansexp"; then |
a0d0e21e LW |
2319 | echo "(Looking for $loc_file in directory $value.)" |
2320 | value="$value/$loc_file" | |
40000a8c | 2321 | ansexp="$ansexp/$loc_file" |
2304df62 | 2322 | fi |
40000a8c | 2323 | if test -f "$ansexp"; then |
2304df62 AD |
2324 | type='' |
2325 | fi | |
a0d0e21e LW |
2326 | case "$nopath_ok" in |
2327 | true) case "$value" in | |
2328 | */*) ;; | |
2329 | *) echo "Assuming $value will be in people's path." | |
2330 | type='' | |
2331 | ;; | |
2332 | esac | |
2333 | ;; | |
2334 | esac | |
2304df62 AD |
2335 | ;; |
2336 | esac | |
2337 | ||
2338 | case "$skip" in | |
2339 | true) type=''; | |
2340 | esac | |
2341 | ||
2342 | case "$type" in | |
2343 | '') ;; | |
2344 | *) | |
2345 | if test "$fastread" = yes; then | |
2346 | dflt=y | |
2347 | else | |
2348 | dflt=n | |
2349 | fi | |
2350 | rp="$what $value doesn't exist. Use that name anyway?" | |
2351 | . UU/myread | |
2352 | dflt='' | |
2353 | case "$ans" in | |
2354 | y*) type='';; | |
2355 | *) echo " ";; | |
2356 | esac | |
2357 | ;; | |
2358 | esac | |
2359 | ;; | |
2360 | esac | |
2361 | ;; | |
2362 | esac | |
2363 | done | |
2364 | cd UU | |
2365 | ans="$value" | |
2366 | rp="$orig_rp" | |
2367 | dflt="$orig_dflt" | |
ecfc5424 | 2368 | rm -f getfile.ok |
2304df62 AD |
2369 | EOSC |
2370 | ||
4633a7c4 LW |
2371 | : determine root of directory hierarchy where package will be installed. |
2372 | case "$prefix" in | |
2373 | '') | |
2374 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
8e07c86e | 2375 | ;; |
4633a7c4 LW |
2376 | *) |
2377 | dflt="$prefix" | |
8e07c86e AD |
2378 | ;; |
2379 | esac | |
4633a7c4 | 2380 | $cat <<EOM |
2304df62 | 2381 | |
4633a7c4 LW |
2382 | By default, $package will be installed in $dflt/bin, manual |
2383 | pages under $dflt/man, etc..., i.e. with $dflt as prefix for | |
2384 | all installation directories. Typically set to /usr/local, but you | |
2385 | may choose /usr if you wish to install $package among your system | |
2386 | binaries. If you wish to have binaries under /bin but manual pages | |
2387 | under /usr/local/man, that's ok: you will be prompted separately | |
2388 | for each of the installation directories, the prefix being only used | |
2389 | to set the defaults. | |
8e07c86e AD |
2390 | |
2391 | EOM | |
2392 | fn=d~ | |
2393 | rp='Installation prefix to use?' | |
2394 | . ./getfile | |
2395 | oldprefix='' | |
2396 | case "$prefix" in | |
a0d0e21e | 2397 | '') ;; |
8e07c86e AD |
2398 | *) |
2399 | case "$ans" in | |
2400 | "$prefix") ;; | |
2401 | *) oldprefix="$prefix";; | |
2402 | esac | |
2403 | ;; | |
a0d0e21e | 2404 | esac |
8e07c86e AD |
2405 | prefix="$ans" |
2406 | prefixexp="$ansexp" | |
a0d0e21e | 2407 | |
8e07c86e AD |
2408 | : set the prefixit variable, to compute a suitable default value |
2409 | prefixit='case "$3" in | |
2410 | ""|none) | |
2411 | case "$oldprefix" in | |
2412 | "") eval "$1=\"\$$2\"";; | |
2413 | *) | |
2414 | case "$3" in | |
2415 | "") eval "$1=";; | |
2416 | none) | |
2417 | eval "tp=\"\$$2\""; | |
2418 | case "$tp" in | |
2419 | ""|" ") eval "$1=\"\$$2\"";; | |
2420 | *) eval "$1=";; | |
2421 | esac;; | |
2422 | esac;; | |
2423 | esac;; | |
2424 | *) | |
2425 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; | |
2426 | case "$tp" in | |
2427 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; | |
2428 | /*-$oldprefix/*|\~*-$oldprefix/*) | |
2429 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; | |
2430 | *) eval "$1=\"\$$2\"";; | |
2431 | esac;; | |
2432 | esac' | |
a0d0e21e | 2433 | |
4633a7c4 LW |
2434 | : determine where private library files go |
2435 | : Usual default is /usr/local/lib/perl5. Also allow things like | |
2436 | : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant. | |
2437 | case "$prefix" in | |
2438 | *perl*) set dflt privlib lib ;; | |
2439 | *) set dflt privlib lib/$package ;; | |
2440 | esac | |
8e07c86e | 2441 | eval $prefixit |
4633a7c4 LW |
2442 | $cat <<EOM |
2443 | ||
2444 | There are some auxiliary files for $package that need to be put into a | |
2445 | private library directory that is accessible by everyone. | |
2446 | ||
2447 | EOM | |
2448 | fn=d~+ | |
2449 | rp='Pathname where the private library files will reside?' | |
8e07c86e | 2450 | . ./getfile |
4633a7c4 LW |
2451 | if $test "X$privlibexp" != "X$ansexp"; then |
2452 | installprivlib='' | |
8e07c86e | 2453 | fi |
4633a7c4 LW |
2454 | privlib="$ans" |
2455 | privlibexp="$ansexp" | |
8e07c86e AD |
2456 | if $afs; then |
2457 | $cat <<EOM | |
2304df62 | 2458 | |
8e07c86e | 2459 | Since you are running AFS, I need to distinguish the directory in which |
4633a7c4 | 2460 | private files reside from the directory in which they are installed (and from |
8e07c86e | 2461 | which they are presumably copied to the former directory by occult means). |
a0d0e21e | 2462 | |
8e07c86e | 2463 | EOM |
4633a7c4 LW |
2464 | case "$installprivlib" in |
2465 | '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2466 | *) dflt="$installprivlib";; | |
8e07c86e AD |
2467 | esac |
2468 | fn=de~ | |
4633a7c4 | 2469 | rp='Where will private files be installed?' |
8e07c86e | 2470 | . ./getfile |
4633a7c4 | 2471 | installprivlib="$ans" |
8e07c86e | 2472 | else |
4633a7c4 LW |
2473 | installprivlib="$privlibexp" |
2474 | fi | |
2475 | ||
2476 | : set the base revision | |
774d564b | 2477 | baserev=5.0 |
4633a7c4 LW |
2478 | |
2479 | : get the patchlevel | |
2480 | echo " " | |
2481 | echo "Getting the current patchlevel..." >&4 | |
2482 | if $test -r ../patchlevel.h;then | |
760ac839 LW |
2483 | patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h` |
2484 | subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h` | |
4633a7c4 LW |
2485 | else |
2486 | patchlevel=0 | |
f55a7265 | 2487 | subversion=0 |
8e07c86e | 2488 | fi |
5f05dabc | 2489 | $echo $n "(You have $package" $c |
2490 | case "$package" in | |
2491 | "*$baserev") ;; | |
2492 | *) $echo $n " $baserev" $c ;; | |
2493 | esac | |
2494 | $echo $n " patchlevel $patchlevel" $c | |
36477c24 | 2495 | test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c |
2496 | echo ".)" | |
2304df62 | 2497 | |
8e07c86e AD |
2498 | : set the prefixup variable, to restore leading tilda escape |
2499 | prefixup='case "$prefixexp" in | |
2500 | "$prefix") ;; | |
2501 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; | |
2502 | esac' | |
2503 | ||
4633a7c4 LW |
2504 | : determine where public architecture dependent libraries go |
2505 | set archlib archlib | |
8e07c86e | 2506 | eval $prefixit |
4633a7c4 | 2507 | case "$archlib" in |
8e07c86e | 2508 | '') |
774d564b | 2509 | case "$privlib" in |
2510 | '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` | |
2511 | set dflt | |
2512 | eval $prefixup | |
8e07c86e | 2513 | ;; |
774d564b | 2514 | *) if test 0 -eq "$subversion"; then |
2515 | version=`LC_ALL=C; export LC_ALL; \ | |
2516 | echo $baserev $patchlevel | \ | |
2517 | $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'` | |
2518 | else | |
2519 | version=`LC_ALL=C; export LC_ALL; \ | |
2520 | echo $baserev $patchlevel $subversion | \ | |
2521 | $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'` | |
2522 | fi | |
aa7e9289 | 2523 | dflt="$privlib/$archname/$version" |
774d564b | 2524 | ;; |
2525 | esac | |
2526 | ;; | |
2527 | *) | |
2528 | dflt="$archlib" | |
2529 | ;; | |
8e07c86e | 2530 | esac |
4633a7c4 LW |
2531 | cat <<EOM |
2532 | ||
2533 | $spackage contains architecture-dependent library files. If you are | |
2534 | sharing libraries in a heterogeneous environment, you might store | |
2535 | these files in a separate location. Otherwise, you can just include | |
2536 | them with the rest of the public library files. | |
2537 | ||
8e07c86e | 2538 | EOM |
4633a7c4 LW |
2539 | fn=d+~ |
2540 | rp='Where do you want to put the public architecture-dependent libraries?' | |
8e07c86e | 2541 | . ./getfile |
4633a7c4 LW |
2542 | archlib="$ans" |
2543 | archlibexp="$ansexp" | |
2544 | ||
8e07c86e AD |
2545 | if $afs; then |
2546 | $cat <<EOM | |
2547 | ||
7bac28a0 | 2548 | Since you are running AFS, I need to distinguish the directory in |
2549 | which architecture-dependent library files reside from the directory | |
2550 | in which they are installed (and from which they are presumably copied | |
2551 | to the former directory by occult means). | |
8e07c86e AD |
2552 | |
2553 | EOM | |
4633a7c4 LW |
2554 | case "$installarchlib" in |
2555 | '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2556 | *) dflt="$installarchlib";; | |
8e07c86e AD |
2557 | esac |
2558 | fn=de~ | |
4633a7c4 | 2559 | rp='Where will architecture-dependent library files be installed?' |
8e07c86e | 2560 | . ./getfile |
4633a7c4 | 2561 | installarchlib="$ans" |
8e07c86e | 2562 | else |
4633a7c4 LW |
2563 | installarchlib="$archlibexp" |
2564 | fi | |
2565 | if $test X"$archlib" = X"$privlib"; then | |
2566 | d_archlib="$undef" | |
2567 | else | |
2568 | d_archlib="$define" | |
8e07c86e AD |
2569 | fi |
2570 | ||
40a7a20a | 2571 | : set up the script used to warn in case of inconsistency |
28757baa | 2572 | cat <<EOS >whoa |
2573 | $startsh | |
2574 | EOS | |
2575 | cat <<'EOSC' >>whoa | |
40a7a20a | 2576 | dflt=y |
2577 | echo " " | |
2578 | echo "*** WHOA THERE!!! ***" >&4 | |
2579 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
2580 | rp=" Keep the $hint value?" | |
2581 | . ./myread | |
2582 | case "$ans" in | |
2583 | y) td=$was; tu=$was;; | |
2584 | esac | |
2585 | EOSC | |
2586 | ||
2587 | : function used to set $1 to $val | |
2588 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
2589 | case "$val$was" in | |
2590 | $define$undef) . ./whoa; eval "$var=\$td";; | |
2591 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
2592 | *) eval "$var=$val";; | |
2593 | esac' | |
2594 | ||
5f05dabc | 2595 | $cat <<EOM |
2596 | ||
2597 | Perl 5.004 can be compiled for binary compatibility with 5.003. | |
2598 | If you decide to do so, you will be able to continue using any | |
2599 | extensions that were compiled for Perl 5.003. However, binary | |
2600 | compatibility forces Perl to expose some of its internal symbols | |
2601 | in the same way that 5.003 did. So you may have symbol conflicts | |
2602 | if you embed a binary-compatible Perl in other programs. | |
2603 | ||
2604 | EOM | |
2605 | case "$d_bincompat3" in | |
2606 | "$undef") dflt=n ;; | |
2607 | *) dflt=y ;; | |
2608 | esac | |
2609 | rp='Binary compatibility with Perl 5.003?' | |
2610 | . ./myread | |
2611 | case "$ans" in | |
2612 | y*) val="$define" ;; | |
2613 | *) val="$undef" ;; | |
2614 | esac | |
2615 | set d_bincompat3 | |
2616 | eval $setvar | |
2617 | case "$d_bincompat3" in | |
2618 | "$define") bincompat3=y ;; | |
2619 | *) bincompat3=n ;; | |
2620 | esac | |
2621 | ||
40a7a20a | 2622 | : make some quick guesses about what we are up against |
2623 | echo " " | |
2624 | $echo $n "Hmm... $c" | |
2625 | echo exit 1 >bsd | |
2626 | echo exit 1 >usg | |
2627 | echo exit 1 >v7 | |
2628 | echo exit 1 >osf1 | |
2629 | echo exit 1 >eunice | |
2630 | echo exit 1 >xenix | |
2631 | echo exit 1 >venix | |
8ff267be | 2632 | echo exit 1 >os2 |
40a7a20a | 2633 | d_bsd="$undef" |
2634 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null | |
2635 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
2636 | then | |
2637 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
2638 | echo exit 0 >osf1 | |
2639 | elif test `echo abc | tr a-z A-Z` = Abc ; then | |
2640 | xxx=`./loc addbib blurfl $pth` | |
2641 | if $test -f $xxx; then | |
2642 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
2643 | echo exit 0 >bsd | |
2644 | echo exit 0 >usg | |
2645 | else | |
2646 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2647 | echo "Looks kind of like an extended USG system, but we'll see..." | |
2648 | else | |
2649 | echo "Looks kind of like a USG system, but we'll see..." | |
2650 | fi | |
2651 | echo exit 0 >usg | |
2652 | fi | |
2653 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2654 | echo "Looks kind of like a BSD system, but we'll see..." | |
2655 | d_bsd="$define" | |
2656 | echo exit 0 >bsd | |
2657 | else | |
2658 | echo "Looks kind of like a Version 7 system, but we'll see..." | |
2659 | echo exit 0 >v7 | |
2660 | fi | |
2661 | case "$eunicefix" in | |
2662 | *unixtovms*) | |
2663 | $cat <<'EOI' | |
2664 | There is, however, a strange, musty smell in the air that reminds me of | |
2665 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
2666 | EOI | |
2667 | echo exit 0 >eunice | |
2668 | d_eunice="$define" | |
2669 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
2670 | ;; | |
2671 | *) | |
2672 | echo " " | |
2673 | echo "Congratulations. You aren't running Eunice." | |
2674 | d_eunice="$undef" | |
2675 | ;; | |
2676 | esac | |
8ff267be | 2677 | : Detect OS2. The p_ variable is set above in the Head.U unit. |
2678 | case "$p_" in | |
2679 | :) ;; | |
2680 | *) | |
2681 | $cat <<'EOI' | |
2682 | I have the feeling something is not exactly right, however...don't tell me... | |
2683 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! | |
2684 | EOI | |
2685 | echo exit 0 >os2 | |
2686 | ;; | |
2687 | esac | |
40a7a20a | 2688 | if test -f /xenix; then |
2689 | echo "Actually, this looks more like a XENIX system..." | |
2690 | echo exit 0 >xenix | |
2691 | d_xenix="$define" | |
2692 | else | |
2693 | echo " " | |
2694 | echo "It's not Xenix..." | |
2695 | d_xenix="$undef" | |
2696 | fi | |
2697 | chmod +x xenix | |
2698 | $eunicefix xenix | |
2699 | if test -f /venix; then | |
2700 | echo "Actually, this looks more like a VENIX system..." | |
2701 | echo exit 0 >venix | |
2702 | else | |
2703 | echo " " | |
2704 | if ./xenix; then | |
2705 | : null | |
2706 | else | |
2707 | echo "Nor is it Venix..." | |
2708 | fi | |
2709 | fi | |
8ff267be | 2710 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 |
2711 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 | |
40a7a20a | 2712 | $rm -f foo |
2713 | ||
2714 | : see if setuid scripts can be secure | |
2715 | $cat <<EOM | |
2716 | ||
2717 | Some kernels have a bug that prevents setuid #! scripts from being | |
2718 | secure. Some sites have disabled setuid #! scripts because of this. | |
2719 | ||
2720 | First let's decide if your kernel supports secure setuid #! scripts. | |
2721 | (If setuid #! scripts would be secure but have been disabled anyway, | |
2722 | don't say that they are secure if asked.) | |
2723 | ||
2724 | EOM | |
2725 | ||
2726 | val="$undef" | |
2727 | if $test -d /dev/fd; then | |
2728 | echo "#!$ls" >reflect | |
2729 | chmod +x,u+s reflect | |
2730 | ./reflect >flect 2>&1 | |
2731 | if $contains "/dev/fd" flect >/dev/null; then | |
2732 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 | |
2733 | val="$define" | |
2734 | else | |
2735 | $cat <<EOM | |
2736 | If you are not sure if they are secure, I can check but I'll need a | |
2737 | username and password different from the one you are using right now. | |
2738 | If you don't have such a username or don't want me to test, simply | |
2739 | enter 'none'. | |
2740 | ||
2741 | EOM | |
2742 | rp='Other username to test security of setuid scripts with?' | |
2743 | dflt='none' | |
2744 | . ./myread | |
2745 | case "$ans" in | |
2746 | n|none) | |
2747 | case "$d_suidsafe" in | |
2748 | '') echo "I'll assume setuid scripts are *not* secure." >&4 | |
2749 | dflt=n;; | |
2750 | "$undef") | |
2751 | echo "Well, the $hint value is *not* secure." >&4 | |
2752 | dflt=n;; | |
2753 | *) echo "Well, the $hint value *is* secure." >&4 | |
2754 | dflt=y;; | |
2755 | esac | |
2756 | ;; | |
2757 | *) | |
2758 | $rm -f reflect flect | |
2759 | echo "#!$ls" >reflect | |
2760 | chmod +x,u+s reflect | |
2761 | echo >flect | |
2762 | chmod a+w flect | |
2763 | echo '"su" will (probably) prompt you for '"$ans's password." | |
2764 | su $ans -c './reflect >flect' | |
2765 | if $contains "/dev/fd" flect >/dev/null; then | |
2766 | echo "Okay, it looks like setuid scripts are secure." >&4 | |
2767 | dflt=y | |
2768 | else | |
2769 | echo "I don't think setuid scripts are secure." >&4 | |
2770 | dflt=n | |
2771 | fi | |
2772 | ;; | |
2773 | esac | |
2774 | rp='Does your kernel have *secure* setuid scripts?' | |
2775 | . ./myread | |
2776 | case "$ans" in | |
2777 | [yY]*) val="$define";; | |
2778 | *) val="$undef";; | |
2779 | esac | |
2780 | fi | |
2781 | else | |
2782 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 | |
760ac839 | 2783 | echo "(That's for file descriptors, not floppy disks.)" |
40a7a20a | 2784 | val="$undef" |
2785 | fi | |
2786 | set d_suidsafe | |
2787 | eval $setvar | |
2788 | ||
2789 | $rm -f reflect flect | |
2790 | ||
2791 | : now see if they want to do setuid emulation | |
2792 | echo " " | |
2793 | val="$undef" | |
2794 | case "$d_suidsafe" in | |
2795 | "$define") | |
2796 | val="$undef" | |
2797 | echo "No need to emulate SUID scripts since they are secure here." >& 4 | |
2798 | ;; | |
2799 | *) | |
2800 | $cat <<EOM | |
2801 | Some systems have disabled setuid scripts, especially systems where | |
2802 | setuid scripts cannot be secure. On systems where setuid scripts have | |
2803 | been disabled, the setuid/setgid bits on scripts are currently | |
2804 | useless. It is possible for $package to detect those bits and emulate | |
2805 | setuid/setgid in a secure fashion. This emulation will only work if | |
2806 | setuid scripts have been disabled in your kernel. | |
2807 | ||
2808 | EOM | |
2809 | case "$d_dosuid" in | |
2810 | "$define") dflt=y ;; | |
2811 | *) dflt=n ;; | |
2812 | esac | |
2813 | rp="Do you want to do setuid/setgid emulation?" | |
2814 | . ./myread | |
2815 | case "$ans" in | |
2816 | [yY]*) val="$define";; | |
2817 | *) val="$undef";; | |
2818 | esac | |
2819 | ;; | |
2820 | esac | |
2821 | set d_dosuid | |
2822 | eval $setvar | |
2823 | ||
37120919 AD |
2824 | : determine where site specific libraries go. |
2825 | set sitelib sitelib | |
2826 | eval $prefixit | |
2827 | case "$sitelib" in | |
2828 | '') dflt="$privlib/site_perl" ;; | |
2829 | *) dflt="$sitelib" ;; | |
2830 | esac | |
2831 | $cat <<EOM | |
2832 | ||
2833 | The installation process will also create a directory for | |
2834 | site-specific extensions and modules. Some users find it convenient | |
2835 | to place all local files in this directory rather than in the main | |
2836 | distribution directory. | |
2837 | ||
2838 | EOM | |
2839 | fn=d~+ | |
2840 | rp='Pathname for the site-specific library files?' | |
2841 | . ./getfile | |
2842 | if $test "X$sitelibexp" != "X$ansexp"; then | |
2843 | installsitelib='' | |
2844 | fi | |
2845 | sitelib="$ans" | |
2846 | sitelibexp="$ansexp" | |
2847 | if $afs; then | |
2848 | $cat <<EOM | |
2849 | ||
7bac28a0 | 2850 | Since you are running AFS, I need to distinguish the directory in |
2851 | which site-specific files reside from the directory in which they are | |
2852 | installed (and from which they are presumably copied to the former | |
2853 | directory by occult means). | |
37120919 AD |
2854 | |
2855 | EOM | |
2856 | case "$installsitelib" in | |
2857 | '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;; | |
2858 | *) dflt="$installsitelib";; | |
2859 | esac | |
2860 | fn=de~ | |
7bac28a0 | 2861 | rp='Where will site-specific files be installed?' |
37120919 AD |
2862 | . ./getfile |
2863 | installsitelib="$ans" | |
2864 | else | |
2865 | installsitelib="$sitelibexp" | |
2866 | fi | |
4633a7c4 | 2867 | |
37120919 AD |
2868 | : determine where site specific architecture-dependent libraries go. |
2869 | xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'` | |
2870 | : xxx is usuually lib/site_perl/archname. | |
2871 | set sitearch sitearch none | |
8e07c86e | 2872 | eval $prefixit |
37120919 AD |
2873 | case "$sitearch" in |
2874 | '') dflt="$sitelib/$archname" ;; | |
2875 | *) dflt="$sitearch" ;; | |
2876 | esac | |
8e07c86e AD |
2877 | $cat <<EOM |
2878 | ||
4633a7c4 LW |
2879 | The installation process will also create a directory for |
2880 | architecture-dependent site-specific extensions and modules. | |
8e07c86e AD |
2881 | |
2882 | EOM | |
4633a7c4 LW |
2883 | fn=nd~+ |
2884 | rp='Pathname for the site-specific architecture-dependent library files?' | |
8e07c86e | 2885 | . ./getfile |
4633a7c4 LW |
2886 | if $test "X$sitearchexp" != "X$ansexp"; then |
2887 | installsitearch='' | |
8e07c86e | 2888 | fi |
4633a7c4 LW |
2889 | sitearch="$ans" |
2890 | sitearchexp="$ansexp" | |
8e07c86e AD |
2891 | if $afs; then |
2892 | $cat <<EOM | |
2893 | ||
7bac28a0 | 2894 | Since you are running AFS, I need to distinguish the directory in |
2895 | which site-specific architecture-dependent library files reside from | |
2896 | the directory in which they are installed (and from which they are | |
2897 | presumably copied to the former directory by occult means). | |
8e07c86e AD |
2898 | |
2899 | EOM | |
4633a7c4 LW |
2900 | case "$installsitearch" in |
2901 | '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;; | |
2902 | *) dflt="$installsitearch";; | |
8e07c86e AD |
2903 | esac |
2904 | fn=de~ | |
7bac28a0 | 2905 | rp='Where will site-specific architecture-dependent files be installed?' |
8e07c86e | 2906 | . ./getfile |
4633a7c4 | 2907 | installsitearch="$ans" |
8e07c86e | 2908 | else |
4633a7c4 | 2909 | installsitearch="$sitearchexp" |
8e07c86e AD |
2910 | fi |
2911 | ||
4633a7c4 LW |
2912 | : determine where old public architecture dependent libraries might be |
2913 | case "$oldarchlib" in | |
2914 | '') case "$privlib" in | |
2915 | '') ;; | |
2916 | *) dflt="$privlib/$archname" | |
8e07c86e | 2917 | ;; |
8e07c86e AD |
2918 | esac |
2919 | ;; | |
4633a7c4 LW |
2920 | *) dflt="$oldarchlib" |
2921 | ;; | |
8e07c86e | 2922 | esac |
4633a7c4 LW |
2923 | if $test ! -d "$dflt/auto"; then |
2924 | dflt=none | |
2925 | fi | |
8e07c86e AD |
2926 | cat <<EOM |
2927 | ||
760ac839 | 2928 | In 5.001, Perl stored architecture-dependent library files in a directory |
4633a7c4 LW |
2929 | with a name such as $privlib/$archname, |
2930 | and this directory contained files from the standard extensions and | |
2931 | files from any additional extensions you might have added. Starting | |
2932 | with version 5.002, all the architecture-dependent standard extensions | |
760ac839 LW |
2933 | will go into a version-specific directory such as |
2934 | $archlib, | |
4633a7c4 LW |
2935 | while locally-added extensions will go into |
2936 | $sitearch. | |
2937 | ||
2938 | If you wish Perl to continue to search the old architecture-dependent | |
2939 | library for your local extensions, give the path to that directory. | |
2940 | If you do not wish to use your old architecture-dependent library | |
2941 | files, answer 'none'. | |
8e07c86e AD |
2942 | |
2943 | EOM | |
4633a7c4 LW |
2944 | fn=dn~ |
2945 | rp='Directory for your old 5.001 architecture-dependent libraries?' | |
8e07c86e | 2946 | . ./getfile |
4633a7c4 LW |
2947 | oldarchlib="$ans" |
2948 | oldarchlibexp="$ansexp" | |
2949 | case "$oldarchlib" in | |
2950 | ''|' ') val="$undef" ;; | |
2951 | *) val="$define" ;; | |
2952 | esac | |
2953 | set d_oldarchlib | |
2954 | eval $setvar | |
8e07c86e | 2955 | |
4633a7c4 LW |
2956 | : determine where public executables go |
2957 | echo " " | |
2958 | set dflt bin bin | |
2959 | eval $prefixit | |
2960 | fn=d~ | |
2961 | rp='Pathname where the public executables will reside?' | |
2962 | . ./getfile | |
2963 | if $test "X$ansexp" != "X$binexp"; then | |
2964 | installbin='' | |
2965 | fi | |
2966 | bin="$ans" | |
2967 | binexp="$ansexp" | |
8e07c86e AD |
2968 | if $afs; then |
2969 | $cat <<EOM | |
2970 | ||
2971 | Since you are running AFS, I need to distinguish the directory in which | |
4633a7c4 | 2972 | executables reside from the directory in which they are installed (and from |
8e07c86e AD |
2973 | which they are presumably copied to the former directory by occult means). |
2974 | ||
2975 | EOM | |
4633a7c4 LW |
2976 | case "$installbin" in |
2977 | '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;; | |
2978 | *) dflt="$installbin";; | |
8e07c86e AD |
2979 | esac |
2980 | fn=de~ | |
4633a7c4 | 2981 | rp='Where will public executables be installed?' |
8e07c86e | 2982 | . ./getfile |
4633a7c4 | 2983 | installbin="$ans" |
8e07c86e | 2984 | else |
4633a7c4 | 2985 | installbin="$binexp" |
8e07c86e AD |
2986 | fi |
2987 | ||
2c7991dc | 2988 | : determine where manual pages are on this system |
2989 | echo " " | |
2990 | case "$sysman" in | |
2991 | '') | |
2992 | syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' | |
2993 | syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" | |
2994 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" | |
2995 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
2996 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" | |
2997 | sysman=`./loc . /usr/man/man1 $syspath` | |
2998 | ;; | |
2999 | esac | |
3000 | if $test -d "$sysman"; then | |
3001 | echo "System manual is in $sysman." >&4 | |
3002 | else | |
3003 | echo "Could not find manual pages in source form." >&4 | |
3004 | fi | |
3005 | ||
2afac517 | 3006 | : see what memory models we can support |
3007 | case "$models" in | |
3008 | '') | |
3009 | $cat >pdp11.c <<'EOP' | |
3010 | main() { | |
3011 | #ifdef pdp11 | |
3012 | exit(0); | |
3013 | #else | |
3014 | exit(1); | |
3015 | #endif | |
3016 | } | |
3017 | EOP | |
c90c0ff4 | 3018 | (cc -o pdp11 pdp11.c) >/dev/null 2>&1 |
3019 | if $test -f pdp11 && ./pdp11 2>/dev/null; then | |
2afac517 | 3020 | dflt='unsplit split' |
3021 | else | |
3022 | tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` | |
3023 | case "$tans" in | |
3024 | X) dflt='none';; | |
3025 | *) if $test -d /lib/small || $test -d /usr/lib/small; then | |
3026 | dflt='small' | |
3027 | else | |
3028 | dflt='' | |
3029 | fi | |
3030 | if $test -d /lib/medium || $test -d /usr/lib/medium; then | |
3031 | dflt="$dflt medium" | |
3032 | fi | |
3033 | if $test -d /lib/large || $test -d /usr/lib/large; then | |
3034 | dflt="$dflt large" | |
3035 | fi | |
3036 | if $test -d /lib/huge || $test -d /usr/lib/huge; then | |
3037 | dflt="$dflt huge" | |
3038 | fi | |
3039 | esac | |
3040 | fi;; | |
3041 | *) dflt="$models";; | |
3042 | esac | |
8e07c86e | 3043 | $cat <<EOM |
2afac517 | 3044 | |
3045 | Some systems have different model sizes. On most systems they are called | |
3046 | small, medium, large, and huge. On the PDP11 they are called unsplit and | |
3047 | split. If your system doesn't support different memory models, say "none". | |
3048 | If you wish to force everything to one memory model, say "none" here and | |
3049 | put the appropriate flags later when it asks you for other cc and ld flags. | |
3050 | Venix systems may wish to put "none" and let the compiler figure things out. | |
3051 | (In the following question multiple model names should be space separated.) | |
8e07c86e | 3052 | |
8e07c86e | 3053 | EOM |
2afac517 | 3054 | rp="Which memory models are supported?" |
3055 | . ./myread | |
3056 | models="$ans" | |
3057 | ||
3058 | case "$models" in | |
3059 | none) | |
3060 | small='' | |
3061 | medium='' | |
3062 | large='' | |
3063 | huge='' | |
3064 | unsplit='' | |
3065 | split='' | |
2c7991dc | 3066 | ;; |
2afac517 | 3067 | *split) |
3068 | case "$split" in | |
3069 | '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \ | |
3070 | $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then | |
3071 | dflt='-i' | |
3072 | else | |
3073 | dflt='none' | |
3074 | fi;; | |
3075 | *) dflt="$split";; | |
3076 | esac | |
3077 | rp="What flag indicates separate I and D space?" | |
3078 | . ./myread | |
3079 | tans="$ans" | |
3080 | case "$tans" in | |
3081 | none) tans='';; | |
3082 | esac | |
3083 | split="$tans" | |
3084 | unsplit='';; | |
3085 | *large*|*small*|*medium*|*huge*) | |
3086 | case "$models" in | |
3087 | *large*) | |
3088 | case "$large" in | |
3089 | '') dflt='-Ml';; | |
3090 | *) dflt="$large";; | |
3091 | esac | |
3092 | rp="What flag indicates large model?" | |
3093 | . ./myread | |
3094 | tans="$ans" | |
3095 | case "$tans" in | |
3096 | none) tans=''; | |
3097 | esac | |
3098 | large="$tans";; | |
3099 | *) large='';; | |
3100 | esac | |
3101 | case "$models" in | |
3102 | *huge*) case "$huge" in | |
3103 | '') dflt='-Mh';; | |
3104 | *) dflt="$huge";; | |
3105 | esac | |
3106 | rp="What flag indicates huge model?" | |
3107 | . ./myread | |
3108 | tans="$ans" | |
3109 | case "$tans" in | |
3110 | none) tans=''; | |
3111 | esac | |
3112 | huge="$tans";; | |
3113 | *) huge="$large";; | |
3114 | esac | |
3115 | case "$models" in | |
3116 | *medium*) case "$medium" in | |
3117 | '') dflt='-Mm';; | |
3118 | *) dflt="$medium";; | |
3119 | esac | |
3120 | rp="What flag indicates medium model?" | |
3121 | . ./myread | |
3122 | tans="$ans" | |
3123 | case "$tans" in | |
3124 | none) tans=''; | |
3125 | esac | |
3126 | medium="$tans";; | |
3127 | *) medium="$large";; | |
3128 | esac | |
3129 | case "$models" in | |
3130 | *small*) case "$small" in | |
3131 | '') dflt='none';; | |
3132 | *) dflt="$small";; | |
3133 | esac | |
3134 | rp="What flag indicates small model?" | |
3135 | . ./myread | |
3136 | tans="$ans" | |
3137 | case "$tans" in | |
3138 | none) tans=''; | |
3139 | esac | |
3140 | small="$tans";; | |
3141 | *) small='';; | |
25f94b33 | 3142 | esac |
8e07c86e | 3143 | ;; |
2afac517 | 3144 | *) |
3145 | echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 | |
8e07c86e AD |
3146 | ;; |
3147 | esac | |
8e07c86e | 3148 | |
2afac517 | 3149 | : see if we need a special compiler |
3150 | echo " " | |
3151 | if ./usg; then | |
3152 | case "$cc" in | |
3153 | '') case "$Mcc" in | |
3154 | /*) dflt='Mcc';; | |
3155 | *) case "$large" in | |
3156 | -M*) dflt='cc';; | |
3157 | *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then | |
3158 | if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then | |
3159 | dflt='cc' | |
3160 | else | |
3161 | dflt='cc -M' | |
3162 | fi | |
3163 | else | |
3164 | dflt='cc' | |
3165 | fi;; | |
3166 | esac;; | |
3167 | esac;; | |
3168 | *) dflt="$cc";; | |
3169 | esac | |
3170 | $cat <<'EOM' | |
3171 | On some systems the default C compiler will not resolve multiple global | |
3172 | references that happen to have the same name. On some such systems the "Mcc" | |
3173 | command may be used to force these to be resolved. On other systems a "cc -M" | |
3174 | command is required. (Note that the -M flag on other systems indicates a | |
3175 | memory model to use!) If you have the Gnu C compiler, you might wish to use | |
3176 | that instead. | |
8e07c86e AD |
3177 | |
3178 | EOM | |
2afac517 | 3179 | rp="What command will force resolution on this system?" |
3180 | . ./myread | |
3181 | cc="$ans" | |
8e07c86e | 3182 | else |
2afac517 | 3183 | case "$cc" in |
3184 | '') dflt=cc;; | |
3185 | *) dflt="$cc";; | |
3186 | esac | |
3187 | rp="Use which C compiler?" | |
3188 | . ./myread | |
3189 | cc="$ans" | |
8e07c86e | 3190 | fi |
2afac517 | 3191 | echo " " |
3192 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
3193 | $cat >gccvers.c <<EOM | |
3194 | #include <stdio.h> | |
3195 | int main() { | |
3196 | #ifdef __GNUC__ | |
3197 | #ifdef __VERSION__ | |
3198 | printf("%s\n", __VERSION__); | |
3199 | #else | |
3200 | printf("%s\n", "1"); | |
3201 | #endif | |
3202 | #endif | |
3203 | exit(0); | |
3204 | } | |
3205 | EOM | |
3206 | if $cc -o gccvers gccvers.c >/dev/null 2>&1; then | |
3207 | gccversion=`./gccvers` | |
3208 | case "$gccversion" in | |
3209 | '') echo "You are not using GNU cc." ;; | |
3210 | *) echo "You are using GNU cc $gccversion." ;; | |
3211 | esac | |
3212 | else | |
3213 | echo " " | |
3214 | echo "*** WHOA THERE!!! ***" >&4 | |
3215 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
3216 | case "$knowitall" in | |
3217 | '') | |
3218 | echo " You'd better start hunting for one and let me know about it." >&4 | |
3219 | exit 1 | |
2c7991dc | 3220 | ;; |
8e07c86e | 3221 | esac |
2afac517 | 3222 | fi |
3223 | $rm -f gccvers* | |
3224 | case "$gccversion" in | |
3225 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
8e07c86e AD |
3226 | esac |
3227 | ||
2afac517 | 3228 | : What should the include directory be ? |
8e07c86e | 3229 | echo " " |
2afac517 | 3230 | $echo $n "Hmm... $c" |
3231 | dflt='/usr/include' | |
3232 | incpath='' | |
3233 | mips_type='' | |
3234 | if $test -f /bin/mips && /bin/mips; then | |
3235 | echo "Looks like a MIPS system..." | |
3236 | $cat >usr.c <<'EOCP' | |
3237 | #ifdef SYSTYPE_BSD43 | |
3238 | /bsd43 | |
3239 | #endif | |
3240 | EOCP | |
3241 | if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then | |
3242 | dflt='/bsd43/usr/include' | |
3243 | incpath='/bsd43' | |
3244 | mips_type='BSD 4.3' | |
8e07c86e | 3245 | else |
2afac517 | 3246 | mips_type='System V' |
8e07c86e | 3247 | fi |
2afac517 | 3248 | $rm -f usr.c usr.out |
3249 | echo "and you're compiling with the $mips_type compiler and libraries." | |
3250 | xxx_prompt=y | |
3251 | echo "exit 0" >mips | |
8e07c86e | 3252 | else |
2afac517 | 3253 | echo "Doesn't look like a MIPS system." |
3254 | xxx_prompt=n | |
3255 | echo "exit 1" >mips | |
3256 | fi | |
3257 | chmod +x mips | |
3258 | $eunicefix mips | |
3259 | echo " " | |
3260 | case "$usrinc" in | |
3261 | '') ;; | |
3262 | *) dflt="$usrinc";; | |
3263 | esac | |
3264 | case "$xxx_prompt" in | |
3265 | y) fn=d/ | |
3266 | rp='Where are the include files you want to use?' | |
3267 | . ./getfile | |
3268 | usrinc="$ans" | |
3269 | ;; | |
3270 | *) usrinc="$dflt" | |
3271 | ;; | |
3272 | esac | |
8e07c86e | 3273 | |
2afac517 | 3274 | : Set private lib path |
3275 | case "$plibpth" in | |
3276 | '') if ./mips; then | |
3277 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
3278 | fi;; | |
3279 | esac | |
3280 | case "$libpth" in | |
3281 | ' ') dlist='';; | |
3282 | '') dlist="$loclibpth $plibpth $glibpth";; | |
3283 | *) dlist="$libpth";; | |
3284 | esac | |
8e07c86e | 3285 | |
2afac517 | 3286 | : Now check and see which directories actually exist, avoiding duplicates |
3287 | libpth='' | |
3288 | for xxx in $dlist | |
3289 | do | |
3290 | if $test -d $xxx; then | |
3291 | case " $libpth " in | |
3292 | *" $xxx "*) ;; | |
3293 | *) libpth="$libpth $xxx";; | |
3294 | esac | |
3295 | fi | |
3296 | done | |
3297 | $cat <<'EOM' | |
8e07c86e | 3298 | |
2afac517 | 3299 | Some systems have incompatible or broken versions of libraries. Among |
3300 | the directories listed in the question below, please remove any you | |
3301 | know not to be holding relevant libraries, and add any that are needed. | |
3302 | Say "none" for none. | |
8e07c86e | 3303 | |
8e07c86e | 3304 | EOM |
2afac517 | 3305 | case "$libpth" in |
3306 | '') dflt='none';; | |
3307 | *) | |
3308 | set X $libpth | |
3309 | shift | |
3310 | dflt=${1+"$@"} | |
4633a7c4 | 3311 | ;; |
8e07c86e | 3312 | esac |
2afac517 | 3313 | rp="Directories to use for library searches?" |
3314 | . ./myread | |
3315 | case "$ans" in | |
3316 | none) libpth=' ';; | |
3317 | *) libpth="$ans";; | |
3318 | esac | |
8e07c86e | 3319 | |
5f05dabc | 3320 | : Define several unixisms. Hints files or command line options |
3321 | : can be used to override them. | |
3322 | case "$ar" in | |
3323 | '') ar='ar';; | |
3324 | esac | |
3325 | case "$lib_ext" in | |
3326 | '') lib_ext='.a';; | |
3327 | esac | |
3328 | case "$obj_ext" in | |
3329 | '') obj_ext='.o';; | |
3330 | esac | |
3331 | case "$path_sep" in | |
3332 | '') path_sep=':';; | |
3333 | esac | |
3334 | : Which makefile gets called first. This is used by make depend. | |
3335 | case "$firstmakefile" in | |
3336 | '') firstmakefile='makefile';; | |
3337 | esac | |
3338 | ||
2afac517 | 3339 | : compute shared library extension |
3340 | case "$so" in | |
3341 | '') | |
3342 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
3343 | dflt='sl' | |
3344 | else | |
3345 | dflt='so' | |
3346 | fi | |
3347 | ;; | |
3348 | *) dflt="$so";; | |
8e07c86e | 3349 | esac |
2afac517 | 3350 | $cat <<EOM |
8e07c86e | 3351 | |
2afac517 | 3352 | On some systems, shared libraries may be available. Answer 'none' if |
3353 | you want to suppress searching of shared libraries for the remaining | |
3354 | of this configuration. | |
8e07c86e AD |
3355 | |
3356 | EOM | |
2afac517 | 3357 | rp='What is the file extension used for shared libraries?' |
3358 | . ./myread | |
3359 | so="$ans" | |
8e07c86e | 3360 | |
2afac517 | 3361 | : Looking for optional libraries |
3362 | echo " " | |
3363 | echo "Checking for optional libraries..." >&4 | |
3364 | case "$libs" in | |
3365 | ' '|'') dflt='';; | |
3366 | *) dflt="$libs";; | |
8e07c86e | 3367 | esac |
2afac517 | 3368 | case "$libswanted" in |
3369 | '') libswanted='c_s';; | |
3370 | esac | |
3371 | for thislib in $libswanted; do | |
3372 | ||
3373 | if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then | |
3374 | echo "Found -l$thislib (shared)." | |
3375 | case " $dflt " in | |
3376 | *"-l$thislib "*);; | |
3377 | *) dflt="$dflt -l$thislib";; | |
4633a7c4 | 3378 | esac |
2afac517 | 3379 | elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then |
3380 | echo "Found -l$thislib (shared)." | |
3381 | case " $dflt " in | |
3382 | *"-l$thislib "*);; | |
3383 | *) dflt="$dflt -l$thislib";; | |
3384 | esac | |
5f05dabc | 3385 | elif xxx=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$xxx"; then |
2afac517 | 3386 | echo "Found -l$thislib." |
3387 | case " $dflt " in | |
3388 | *"-l$thislib "*);; | |
3389 | *) dflt="$dflt -l$thislib";; | |
3390 | esac | |
5f05dabc | 3391 | elif xxx=`./loc $thislib$lib_ext X $libpth`; $test -f "$xxx"; then |
2afac517 | 3392 | echo "Found -l$thislib." |
3393 | case " $dflt " in | |
3394 | *"-l$thislib "*);; | |
3395 | *) dflt="$dflt -l$thislib";; | |
3396 | esac | |
5f05dabc | 3397 | elif xxx=`./loc lib${thislib}_s$lib_ext X $libpth`; $test -f "$xxx"; then |
2afac517 | 3398 | echo "Found -l${thislib}_s." |
3399 | case " $dflt " in | |
3400 | *"-l$thislib "*);; | |
3401 | *) dflt="$dflt -l${thislib}_s";; | |
3402 | esac | |
5f05dabc | 3403 | elif xxx=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$xxx"; then |
2afac517 | 3404 | echo "Found -l$thislib." |
3405 | case " $dflt " in | |
3406 | *"-l$thislib "*);; | |
3407 | *) dflt="$dflt -l$thislib";; | |
3408 | esac | |
3409 | else | |
3410 | echo "No -l$thislib." | |
3411 | fi | |
3412 | done | |
3413 | set X $dflt | |
3414 | shift | |
3415 | dflt="$*" | |
3416 | case "$libs" in | |
3417 | '') dflt="$dflt";; | |
3418 | *) dflt="$libs";; | |
3419 | esac | |
3420 | case "$dflt" in | |
3421 | ' '|'') dflt='none';; | |
8e07c86e | 3422 | esac |
2afac517 | 3423 | |
4633a7c4 LW |
3424 | $cat <<EOM |
3425 | ||
2afac517 | 3426 | Some versions of Unix support shared libraries, which make executables smaller |
3427 | but make load time slightly longer. | |
8e07c86e | 3428 | |
2afac517 | 3429 | On some systems, mostly System V Release 3's, the shared library is included |
3430 | by putting the option "-lc_s" as the last thing on the cc command line when | |
3431 | linking. Other systems use shared libraries by default. There may be other | |
3432 | libraries needed to compile $package on your machine as well. If your system | |
3433 | needs the "-lc_s" option, include it here. Include any other special libraries | |
3434 | here as well. Say "none" for none. | |
4633a7c4 | 3435 | EOM |
2afac517 | 3436 | |
3437 | echo " " | |
3438 | rp="Any additional libraries?" | |
8e07c86e | 3439 | . ./myread |
2afac517 | 3440 | case "$ans" in |
3441 | none) libs=' ';; | |
3442 | *) libs="$ans";; | |
3443 | esac | |
8e07c86e | 3444 | |
4633a7c4 | 3445 | : see how we invoke the C preprocessor |
2304df62 | 3446 | echo " " |
4633a7c4 LW |
3447 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 |
3448 | cat <<'EOT' >testcpp.c | |
3449 | #define ABC abc | |
3450 | #define XYZ xyz | |
3451 | ABC.XYZ | |
3452 | EOT | |
3453 | cd .. | |
3454 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
3455 | chmod 755 cppstdin | |
3456 | wrapper=`pwd`/cppstdin | |
3457 | ok='false' | |
3458 | cd UU | |
3459 | ||
3460 | if $test "X$cppstdin" != "X" && \ | |
3461 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
3462 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3463 | then | |
3464 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
3465 | case "$cpprun" in | |
3466 | '') echo "But let's see if we can live without a wrapper..." ;; | |
3467 | *) | |
3468 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
3469 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3470 | then | |
3471 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" | |
3472 | ok='true' | |
a0d0e21e | 3473 | else |
4633a7c4 | 3474 | echo "(However, $cpprun $cpplast does not work, let's see...)" |
2304df62 | 3475 | fi |
2304df62 | 3476 | ;; |
2304df62 | 3477 | esac |
4633a7c4 LW |
3478 | else |
3479 | case "$cppstdin" in | |
3480 | '') ;; | |
3481 | *) | |
3482 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
3483 | ;; | |
3484 | esac | |
3485 | fi | |
3486 | ||
3487 | if $ok; then | |
3488 | : nothing | |
3489 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
3490 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
3491 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3492 | echo "Yup, it does." | |
3493 | x_cpp="$cc -E" | |
3494 | x_minus=''; | |
3495 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
3496 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
3497 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3498 | echo "Yup, it does." | |
3499 | x_cpp="$cc -E" | |
3500 | x_minus='-'; | |
3501 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
3502 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
3503 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3504 | echo "Yipee, that works!" | |
3505 | x_cpp="$cc -P" | |
3506 | x_minus=''; | |
3507 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
3508 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
3509 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3510 | echo "At long last!" | |
3511 | x_cpp="$cc -P" | |
3512 | x_minus='-'; | |
3513 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
3514 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
3515 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3516 | echo "It works!" | |
3517 | x_cpp="$cpp" | |
3518 | x_minus=''; | |
3519 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
3520 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
3521 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3522 | echo "Hooray, it works! I was beginning to wonder." | |
3523 | x_cpp="$cpp" | |
3524 | x_minus='-'; | |
3525 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
3526 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3527 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3528 | x_cpp="$wrapper" | |
3529 | x_minus='' | |
3530 | echo "Eureka!" | |
3531 | else | |
3532 | dflt='' | |
3533 | rp="No dice. I can't find a C preprocessor. Name one:" | |
3534 | . ./myread | |
3535 | x_cpp="$ans" | |
3536 | x_minus='' | |
3537 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
3538 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3539 | echo "OK, that will do." >&4 | |
3540 | else | |
3541 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
3542 | exit 1 | |
3543 | fi | |
3544 | fi | |
3545 | ||
3546 | case "$ok" in | |
3547 | false) | |
3548 | cppstdin="$x_cpp" | |
3549 | cppminus="$x_minus" | |
3550 | cpprun="$x_cpp" | |
3551 | cpplast="$x_minus" | |
3552 | set X $x_cpp | |
3553 | shift | |
3554 | case "$1" in | |
3555 | "$cpp") | |
3556 | echo "Perhaps can we force $cc -E using a wrapper..." | |
3557 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3558 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3559 | then | |
3560 | echo "Yup, we can." | |
3561 | cppstdin="$wrapper" | |
3562 | cppminus=''; | |
3563 | else | |
3564 | echo "Nope, we'll have to live without it..." | |
3565 | fi | |
3566 | ;; | |
3567 | esac | |
3568 | case "$cpprun" in | |
3569 | "$wrapper") | |
3570 | cpprun='' | |
3571 | cpplast='' | |
3572 | ;; | |
3573 | esac | |
3574 | ;; | |
3575 | esac | |
3576 | ||
3577 | case "$cppstdin" in | |
3578 | "$wrapper") ;; | |
3579 | *) $rm -f $wrapper;; | |
3580 | esac | |
3581 | $rm -f testcpp.c testcpp.out | |
3582 | ||
2afac517 | 3583 | : determine optimize, if desired, or use for debug flag also |
3584 | case "$optimize" in | |
2ae324a7 | 3585 | ' '|$undef) dflt='none';; |
2afac517 | 3586 | '') dflt='-O';; |
3587 | *) dflt="$optimize";; | |
4633a7c4 | 3588 | esac |
2afac517 | 3589 | $cat <<EOH |
4633a7c4 | 3590 | |
760ac839 | 3591 | Some C compilers have problems with their optimizers. By default, $package |
4633a7c4 LW |
3592 | compiles with the -O flag to use the optimizer. Alternately, you might want |
3593 | to use the symbolic debugger, which uses the -g flag (on traditional Unix | |
3594 | systems). Either flag can be specified here. To use neither flag, specify | |
3595 | the word "none". | |
3596 | ||
3597 | EOH | |
3598 | rp="What optimizer/debugger flag should be used?" | |
3599 | . ./myread | |
3600 | optimize="$ans" | |
3601 | case "$optimize" in | |
3602 | 'none') optimize=" ";; | |
3603 | esac | |
3604 | ||
3605 | dflt='' | |
25f94b33 AD |
3606 | : We will not override a previous value, but we might want to |
3607 | : augment a hint file | |
3608 | case "$hint" in | |
3609 | none|recommended) | |
4633a7c4 LW |
3610 | case "$gccversion" in |
3611 | 1*) dflt='-fpcc-struct-return' ;; | |
3612 | esac | |
3613 | case "$optimize" in | |
3614 | *-g*) dflt="$dflt -DDEBUGGING";; | |
3615 | esac | |
3616 | case "$gccversion" in | |
3617 | 2*) if test -d /etc/conf/kconfig.d && | |
3618 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
3619 | then | |
3620 | dflt="$dflt -posix" | |
3621 | fi | |
3622 | ;; | |
3623 | esac | |
3624 | ;; | |
3625 | esac | |
3626 | ||
a4f3eea9 | 3627 | case "$mips_type" in |
3628 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
3629 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
3630 | esac | |
3631 | for thisincl in $inclwanted; do | |
3632 | if $test -d $thisincl; then | |
3633 | if $test x$thisincl != x$usrinc; then | |
3634 | case "$dflt" in | |
3635 | *$thisincl*);; | |
3636 | *) dflt="$dflt -I$thisincl";; | |
3637 | esac | |
3638 | fi | |
3639 | fi | |
3640 | done | |
3641 | ||
3642 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then | |
3643 | xxx=true; | |
3644 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
3645 | xxx=true; | |
3646 | else | |
3647 | xxx=false; | |
3648 | fi; | |
3649 | if $xxx; then | |
3650 | case "$dflt" in | |
3651 | *$2*);; | |
3652 | *) dflt="$dflt -D$2";; | |
3653 | esac; | |
3654 | fi' | |
3655 | ||
3656 | if ./osf1; then | |
3657 | set signal.h __LANGUAGE_C__; eval $inctest | |
3658 | else | |
3659 | set signal.h LANGUAGE_C; eval $inctest | |
3660 | fi | |
a4f3eea9 | 3661 | |
3662 | case "$hint" in | |
3663 | none|recommended) dflt="$ccflags $dflt" ;; | |
3664 | *) dflt="$ccflags";; | |
3665 | esac | |
3666 | ||
3667 | case "$dflt" in | |
3668 | ''|' ') dflt=none;; | |
3669 | esac | |
3670 | $cat <<EOH | |
3671 | ||
3672 | Your C compiler may want other flags. For this question you should include | |
3673 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
3674 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
3675 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
3676 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE, | |
3677 | -DHIDEMYMALLOC or -DCRIPPLED_CC. | |
3678 | ||
3679 | To use no flags, specify the word "none". | |
3680 | ||
3681 | EOH | |
3682 | set X $dflt | |
3683 | shift | |
3684 | dflt=${1+"$@"} | |
3685 | rp="Any additional cc flags?" | |
3686 | . ./myread | |
3687 | case "$ans" in | |
3688 | none) ccflags='';; | |
3689 | *) ccflags="$ans";; | |
3690 | esac | |
3691 | ||
3692 | : the following weeds options from ccflags that are of no interest to cpp | |
3693 | cppflags="$ccflags" | |
3694 | case "$gccversion" in | |
3695 | 1*) cppflags="$cppflags -D__GNUC__" | |
3696 | esac | |
3697 | case "$mips_type" in | |
3698 | '');; | |
3699 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
3700 | esac | |
3701 | case "$cppflags" in | |
3702 | '');; | |
3703 | *) | |
3704 | echo " " | |
3705 | echo "Let me guess what the preprocessor flags are..." >&4 | |
3706 | set X $cppflags | |
3707 | shift | |
3708 | cppflags='' | |
3709 | $cat >cpp.c <<'EOM' | |
3710 | #define BLURFL foo | |
3711 | ||
3712 | BLURFL xx LFRULB | |
3713 | EOM | |
3714 | previous='' | |
3715 | for flag in $* | |
3716 | do | |
3717 | case "$flag" in | |
3718 | -*) ftry="$flag";; | |
3719 | *) ftry="$previous $flag";; | |
3720 | esac | |
7bac28a0 | 3721 | if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \ |
a4f3eea9 | 3722 | >cpp1.out 2>/dev/null && \ |
3723 | $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \ | |
3724 | >cpp2.out 2>/dev/null && \ | |
3725 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
3726 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
3727 | then | |
3728 | cppflags="$cppflags $ftry" | |
3729 | previous='' | |
3730 | else | |
3731 | previous="$flag" | |
3732 | fi | |
3733 | done | |
3734 | set X $cppflags | |
3735 | shift | |
3736 | cppflags=${1+"$@"} | |
3737 | case "$cppflags" in | |
3738 | *-*) echo "They appear to be: $cppflags";; | |
3739 | esac | |
3740 | $rm -f cpp.c cpp?.out | |
3741 | ;; | |
3742 | esac | |
3743 | ||
3744 | : flags used in final linking phase | |
3745 | ||
3746 | case "$ldflags" in | |
3747 | '') if ./venix; then | |
3748 | dflt='-i -z' | |
3749 | else | |
3750 | dflt='' | |
3751 | fi | |
3752 | case "$ccflags" in | |
3753 | *-posix*) dflt="$dflt -posix" ;; | |
3754 | esac | |
3755 | ;; | |
3756 | *) dflt="$ldflags";; | |
3757 | esac | |
3758 | ||
3759 | : Try to guess additional flags to pick up local libraries. | |
3760 | for thislibdir in $libpth; do | |
3761 | case " $loclibpth " in | |
3762 | *" $thislibdir "*) | |
3763 | case "$dflt " in | |
3764 | *"-L$thislibdir "*) ;; | |
3765 | *) dflt="$dflt -L$thislibdir" ;; | |
3766 | esac | |
3767 | ;; | |
3768 | esac | |
3769 | done | |
3770 | ||
3771 | case "$dflt" in | |
3772 | '') dflt='none' ;; | |
3773 | esac | |
3774 | ||
3775 | $cat <<EOH | |
3776 | ||
3777 | Your C linker may need flags. For this question you should | |
3778 | include -L/whatever and any other flags used by the C linker, but you | |
3779 | should NOT include libraries like -lwhatever. | |
3780 | ||
3781 | Make sure you include the appropriate -L/path flags if your C linker | |
3782 | does not normally search all of the directories you specified above, | |
3783 | namely | |
3784 | $libpth | |
3785 | To use no flags, specify the word "none". | |
3786 | ||
3787 | EOH | |
3788 | ||
3789 | rp="Any additional ld flags (NOT including libraries)?" | |
3790 | . ./myread | |
3791 | case "$ans" in | |
3792 | none) ldflags='';; | |
3793 | *) ldflags="$ans";; | |
3794 | esac | |
3795 | rmlist="$rmlist pdp11" | |
3796 | ||
3797 | : coherency check | |
3798 | echo " " | |
1e422769 | 3799 | echo "Checking your choice of C compiler, libs, and flags for coherency..." >&4 |
3800 | set X $cc $optimize $ccflags $ldflags -o try try.c $libs | |
a4f3eea9 | 3801 | shift |
3802 | $cat >try.msg <<EOM | |
3803 | I've tried to compile and run a simple program with: | |
3804 | ||
3805 | $* | |
3806 | ./try | |
3807 | ||
3808 | and I got the following output: | |
3809 | ||
3810 | EOM | |
3811 | $cat > try.c <<'EOF' | |
3812 | #include <stdio.h> | |
3813 | main() { exit(0); } | |
3814 | EOF | |
3815 | dflt=y | |
1e422769 | 3816 | if sh -c "$cc $optimize $ccflags -o try try.c $ldflags $libs" >>try.msg 2>&1; then |
a4f3eea9 | 3817 | if sh -c './try' >>try.msg 2>&1; then |
3818 | dflt=n | |
3819 | else | |
3820 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
90248788 | 3821 | rp="You have a problem. Shall I abort Configure (and explain the problem)" |
a4f3eea9 | 3822 | dflt=y |
3823 | fi | |
3824 | else | |
3825 | echo "I can't compile the test program." >>try.msg | |
90248788 | 3826 | rp="You have a BIG problem. Shall I abort Configure (and explain the problem)" |
a4f3eea9 | 3827 | dflt=y |
3828 | fi | |
3829 | case "$dflt" in | |
3830 | y) | |
97286747 | 3831 | $cat try.msg >&4 |
a4f3eea9 | 3832 | case "$knowitall" in |
3833 | '') | |
3834 | echo "(The supplied flags might be incorrect with this C compiler.)" | |
3835 | ;; | |
3836 | *) dflt=n;; | |
3837 | esac | |
3838 | echo " " | |
3839 | . ./myread | |
3840 | case "$ans" in | |
3841 | n*|N*) ;; | |
3842 | *) echo "Ok. Stopping Configure." >&4 | |
3843 | exit 1 | |
3844 | ;; | |
3845 | esac | |
3846 | ;; | |
3847 | n) echo "OK, that should do.";; | |
3848 | esac | |
3849 | $rm -f try try.* core | |
3850 | ||
3851 | echo " " | |
3852 | echo "Checking for GNU C Library..." >&4 | |
3853 | cat >gnulibc.c <<EOM | |
3854 | int | |
3855 | main() | |
3856 | { | |
3857 | return __libc_main(); | |
3858 | } | |
3859 | EOM | |
3860 | if $cc $ccflags $ldflags -o gnulibc gnulibc.c $libs >/dev/null 2>&1 && \ | |
3861 | ./gnulibc | $contains '^GNU C Library' >/dev/null 2>&1; then | |
3862 | val="$define" | |
3863 | echo "You are using the GNU C Library" | |
4633a7c4 | 3864 | else |
a4f3eea9 | 3865 | val="$undef" |
3866 | echo "You are not using the GNU C Library" | |
4633a7c4 | 3867 | fi |
a4f3eea9 | 3868 | $rm -f gnulibc* |
3869 | set d_gnulibc | |
3870 | eval $setvar | |
25f94b33 | 3871 | |
a4f3eea9 | 3872 | : see if nm is to be used to determine whether a symbol is defined or not |
3873 | case "$usenm" in | |
3874 | '') | |
3875 | case "$d_gnulibc" in | |
3876 | $define) | |
3877 | dflt=n | |
3878 | ;; | |
3879 | *) | |
3880 | dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` | |
3881 | if $test $dflt -gt 20; then | |
3882 | dflt=y | |
3883 | else | |
3884 | dflt=n | |
3885 | fi | |
3886 | ;; | |
3887 | esac | |
3888 | ;; | |
3889 | *) | |
3890 | case "$usenm" in | |
3891 | true) dflt=y;; | |
3892 | *) dflt=n;; | |
3893 | esac | |
3894 | ;; | |
25f94b33 | 3895 | esac |
a4f3eea9 | 3896 | $cat <<EOM |
4633a7c4 | 3897 | |
a4f3eea9 | 3898 | I can use 'nm' to extract the symbols from your C libraries. This is a time |
3899 | consuming task which may generate huge output on the disk (up to 3 megabytes) | |
3900 | but that should make the symbols extraction faster. The alternative is to skip | |
3901 | the 'nm' extraction part and to compile a small test program instead to | |
3902 | determine whether each symbol is present. If you have a fast C compiler and/or | |
3903 | if your 'nm' output cannot be parsed, this may be the best solution. | |
3904 | You shouldn't let me use 'nm' if you have the GNU C Library. | |
4633a7c4 | 3905 | |
a4f3eea9 | 3906 | EOM |
3907 | rp='Shall I use nm to extract C symbols from the libraries?' | |
4633a7c4 LW |
3908 | . ./myread |
3909 | case "$ans" in | |
a4f3eea9 | 3910 | n|N) usenm=false;; |
3911 | *) usenm=true;; | |
4633a7c4 LW |
3912 | esac |
3913 | ||
a4f3eea9 | 3914 | runnm=$usenm |
3915 | case "$reuseval" in | |
3916 | true) runnm=false;; | |
4633a7c4 | 3917 | esac |
a4f3eea9 | 3918 | |
3919 | : nm options which may be necessary | |
3920 | case "$nm_opt" in | |
3921 | '') if $test -f /mach_boot; then | |
1e422769 | 3922 | nm_opt='' # Mach |
a4f3eea9 | 3923 | elif $test -d /usr/ccs/lib; then |
1e422769 | 3924 | nm_opt='-p' # Solaris (and SunOS?) |
a4f3eea9 | 3925 | elif $test -f /dgux; then |
1e422769 | 3926 | nm_opt='-p' # DG-UX |
2ae324a7 | 3927 | elif $test -f /lib64/rld; then |
1e422769 | 3928 | nm_opt='-p' # 64-bit Irix |
a4f3eea9 | 3929 | else |
3930 | nm_opt='' | |
3931 | fi;; | |
4633a7c4 | 3932 | esac |
4633a7c4 | 3933 | |
a4f3eea9 | 3934 | : nm options which may be necessary for shared libraries but illegal |
3935 | : for archive libraries. Thank you, Linux. | |
3936 | case "$nm_so_opt" in | |
3937 | '') case "$myuname" in | |
3938 | *linux*) | |
3939 | if nm --help | $grep 'dynamic' > /dev/null 2>&1; then | |
3940 | nm_so_opt='--dynamic' | |
4633a7c4 | 3941 | fi |
a4f3eea9 | 3942 | ;; |
4633a7c4 | 3943 | esac |
4633a7c4 LW |
3944 | ;; |
3945 | esac | |
3946 | ||
a4f3eea9 | 3947 | case "$runnm" in |
3948 | true) | |
3949 | : get list of predefined functions in a handy place | |
3950 | echo " " | |
3951 | case "$libc" in | |
3952 | '') libc=unknown | |
3953 | case "$libs" in | |
5f05dabc | 3954 | *-lc_s*) libc=`./loc libc_s$lib_ext $libc $libpth` |
a4f3eea9 | 3955 | esac |
3956 | ;; | |
3957 | esac | |
3958 | libnames=''; | |
3959 | case "$libs" in | |
3960 | '') ;; | |
3961 | *) for thislib in $libs; do | |
3962 | case "$thislib" in | |
3963 | -lc|-lc_s) | |
3964 | : Handle C library specially below. | |
3965 | ;; | |
3966 | -l*) | |
3967 | thislib=`echo $thislib | $sed -e 's/^-l//'` | |
3968 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then | |
3969 | : | |
3970 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then | |
3971 | : | |
5f05dabc | 3972 | elif try=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$try"; then |
a4f3eea9 | 3973 | : |
d97d40b5 IZ |
3974 | elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then |
3975 | : | |
a4f3eea9 | 3976 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then |
3977 | : | |
3978 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then | |
3979 | : | |
5f05dabc | 3980 | elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then |
a4f3eea9 | 3981 | : |
3982 | else | |
3983 | try='' | |
3984 | fi | |
3985 | libnames="$libnames $try" | |
3986 | ;; | |
3987 | *) libnames="$libnames $thislib" ;; | |
3988 | esac | |
3989 | done | |
3990 | ;; | |
3991 | esac | |
3992 | xxx=normal | |
3993 | case "$libc" in | |
3994 | unknown) | |
3995 | set /lib/libc.$so | |
3996 | for xxx in $libpth; do | |
3997 | $test -r $1 || set $xxx/libc.$so | |
3998 | : The messy sed command sorts on library version numbers. | |
3999 | $test -r $1 || \ | |
4000 | set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \ | |
4001 | tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e ' | |
4002 | h | |
4003 | s/[0-9][0-9]*/0000&/g | |
4004 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g | |
4005 | G | |
4006 | s/\n/ /' | \ | |
4007 | sort | $sed -e 's/^.* //'` | |
4008 | eval set \$$# | |
4009 | done | |
4010 | $test -r $1 || set /usr/ccs/lib/libc.$so | |
5f05dabc | 4011 | $test -r $1 || set /lib/libsys_s$lib_ext |
a4f3eea9 | 4012 | ;; |
4013 | *) | |
4014 | set blurfl | |
4015 | ;; | |
4016 | esac | |
4017 | if $test -r "$1"; then | |
4018 | echo "Your (shared) C library seems to be in $1." | |
4019 | libc="$1" | |
4020 | elif $test -r /lib/libc && $test -r /lib/clib; then | |
4021 | echo "Your C library seems to be in both /lib/clib and /lib/libc." | |
4022 | xxx=apollo | |
4023 | libc='/lib/clib /lib/libc' | |
4024 | if $test -r /lib/syslib; then | |
4025 | echo "(Your math library is in /lib/syslib.)" | |
4026 | libc="$libc /lib/syslib" | |
4027 | fi | |
4028 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
4029 | echo "Your C library seems to be in $libc, as you said before." | |
5f05dabc | 4030 | elif $test -r $incpath/usr/lib/libc$lib_ext; then |
4031 | libc=$incpath/usr/lib/libc$lib_ext; | |
a4f3eea9 | 4032 | echo "Your C library seems to be in $libc. That's fine." |
5f05dabc | 4033 | elif $test -r /lib/libc$lib_ext; then |
4034 | libc=/lib/libc$lib_ext; | |
a4f3eea9 | 4035 | echo "Your C library seems to be in $libc. You're normal." |
4036 | else | |
5f05dabc | 4037 | if tans=`./loc libc$lib_ext blurfl/dyick $libpth`; $test -r "$tans"; then |
a4f3eea9 | 4038 | : |
4039 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then | |
4040 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` | |
4041 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then | |
4042 | : | |
5f05dabc | 4043 | elif tans=`./loc Slibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then |
a4f3eea9 | 4044 | : |
5f05dabc | 4045 | elif tans=`./loc Mlibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then |
a4f3eea9 | 4046 | : |
4633a7c4 | 4047 | else |
5f05dabc | 4048 | tans=`./loc Llibc$lib_ext blurfl/dyick $xlibpth` |
4633a7c4 | 4049 | fi |
a4f3eea9 | 4050 | if $test -r "$tans"; then |
4051 | echo "Your C library seems to be in $tans, of all places." | |
4052 | libc=$tans | |
4053 | else | |
4054 | libc='blurfl' | |
4055 | fi | |
4056 | fi | |
4057 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
4058 | dflt="$libc" | |
4059 | cat <<EOM | |
4633a7c4 | 4060 | |
a4f3eea9 | 4061 | If the guess above is wrong (which it might be if you're using a strange |
4062 | compiler, or your machine supports multiple models), you can override it here. | |
4633a7c4 | 4063 | |
a4f3eea9 | 4064 | EOM |
4065 | else | |
4066 | dflt='' | |
4067 | echo $libpth | tr ' ' '\012' | sort | uniq > libpath | |
4068 | cat >&4 <<EOM | |
4069 | I can't seem to find your C library. I've looked in the following places: | |
4633a7c4 | 4070 | |
a4f3eea9 | 4071 | EOM |
4072 | $sed 's/^/ /' libpath | |
4073 | cat <<EOM | |
4633a7c4 | 4074 | |
a4f3eea9 | 4075 | None of these seems to contain your C library. I need to get its name... |
4633a7c4 | 4076 | |
a4f3eea9 | 4077 | EOM |
4078 | fi | |
4079 | fn=f | |
4080 | rp='Where is your C library?' | |
4081 | . ./getfile | |
4082 | libc="$ans" | |
4633a7c4 | 4083 | |
4633a7c4 | 4084 | echo " " |
a4f3eea9 | 4085 | echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames |
4086 | set X `cat libnames` | |
4633a7c4 | 4087 | shift |
a4f3eea9 | 4088 | xxx=files |
4089 | case $# in 1) xxx=file; esac | |
4090 | echo "Extracting names from the following $xxx for later perusal:" >&4 | |
4091 | echo " " | |
4092 | $sed 's/^/ /' libnames >&4 | |
4093 | echo " " | |
4094 | $echo $n "This may take a while...$c" >&4 | |
4633a7c4 | 4095 | |
a4f3eea9 | 4096 | : Linux may need the special Dynamic option to nm for shared libraries. |
4097 | : In general, this is stored in the nm_so_opt variable. | |
4098 | : Unfortunately, that option may be fatal on non-shared libraries. | |
4099 | for nm_libs_ext in $*; do | |
4100 | case $nm_libs_ext in | |
4101 | *$so*) nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;; | |
4102 | *) nm $nm_opt $nm_libs_ext 2>/dev/null ;; | |
4103 | esac | |
4104 | done > libc.tmp | |
4633a7c4 | 4105 | |
a4f3eea9 | 4106 | $echo $n ".$c" |
4107 | $grep fprintf libc.tmp > libc.ptf | |
4108 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' | |
4109 | xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4' | |
4110 | xxx='[ADTSIW]' | |
4111 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//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.*/\1/p'";\ | |
4116 | eval $xscan;\ | |
4117 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4118 | eval $xrun | |
4119 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ | |
4120 | eval $xscan;\ | |
4121 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4122 | eval $xrun | |
4123 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ | |
4124 | eval $xscan;\ | |
4125 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4126 | eval $xrun | |
4127 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ | |
4128 | eval $xscan;\ | |
4129 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4130 | eval $xrun | |
4131 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ | |
4132 | eval $xscan;\ | |
4133 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4134 | eval $xrun | |
4135 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ | |
4136 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ | |
4137 | eval $xscan;\ | |
4138 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4139 | eval $xrun | |
4140 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ | |
4141 | eval $xscan;\ | |
4142 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4143 | eval $xrun | |
4144 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ | |
4145 | eval $xscan;\ | |
4146 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4147 | eval $xrun | |
1e422769 | 4148 | elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\ |
4149 | eval $xscan;\ | |
4150 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4151 | eval $xrun | |
a4f3eea9 | 4152 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
4153 | eval $xscan;\ | |
4154 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4155 | eval $xrun | |
4156 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ | |
4157 | eval $xscan;\ | |
4158 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4159 | eval $xrun | |
44a8e56a | 4160 | elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\ |
4161 | eval $xscan;\ | |
4162 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4163 | eval $xrun | |
a4f3eea9 | 4164 | else |
4165 | nm -p $* 2>/dev/null >libc.tmp | |
4166 | $grep fprintf libc.tmp > libc.ptf | |
4167 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ | |
4168 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 | |
4169 | then | |
4170 | nm_opt='-p' | |
4171 | eval $xrun | |
4633a7c4 | 4172 | else |
a4f3eea9 | 4173 | echo " " |
4174 | echo "nm didn't seem to work right. Trying ar instead..." >&4 | |
4175 | com='' | |
4176 | if ar t $libc > libc.tmp; then | |
4177 | for thisname in $libnames; do | |
4178 | ar t $thisname >>libc.tmp | |
4179 | done | |
4180 | $sed -e 's/\.o$//' < libc.tmp > libc.list | |
4181 | echo "Ok." >&4 | |
4182 | else | |
4183 | echo "ar didn't seem to work right." >&4 | |
4184 | echo "Maybe this is a Cray...trying bld instead..." >&4 | |
4185 | if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list | |
4186 | then | |
4187 | for thisname in $libnames; do | |
4188 | bld t $libnames | \ | |
4189 | $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list | |
4190 | ar t $thisname >>libc.tmp | |
4191 | done | |
4192 | echo "Ok." >&4 | |
4193 | else | |
4194 | echo "That didn't work either. Giving up." >&4 | |
4195 | exit 1 | |
4196 | fi | |
4197 | fi | |
4633a7c4 | 4198 | fi |
4633a7c4 | 4199 | fi |
a4f3eea9 | 4200 | nm_extract="$com" |
4201 | if $test -f /lib/syscalls.exp; then | |
4633a7c4 | 4202 | echo " " |
a4f3eea9 | 4203 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 |
4204 | $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list | |
4205 | fi | |
4206 | ;; | |
4207 | esac | |
4208 | $rm -f libnames libpath | |
4209 | ||
2afac517 | 4210 | : determine filename position in cpp output |
4633a7c4 | 4211 | echo " " |
2afac517 | 4212 | echo "Computing filename position in cpp output for #include directives..." >&4 |
4213 | echo '#include <stdio.h>' > foo.c | |
4214 | $cat >fieldn <<EOF | |
4215 | $startsh | |
4216 | $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \ | |
4217 | $grep '^[ ]*#.*stdio\.h' | \ | |
4218 | while read cline; do | |
4219 | pos=1 | |
4220 | set \$cline | |
4221 | while $test \$# -gt 0; do | |
4222 | if $test -r \`echo \$1 | $tr -d '"'\`; then | |
4223 | echo "\$pos" | |
4224 | exit 0 | |
4225 | fi | |
4226 | shift | |
4227 | pos=\`expr \$pos + 1\` | |
4228 | done | |
4633a7c4 | 4229 | done |
2afac517 | 4230 | EOF |
4231 | chmod +x fieldn | |
4232 | fieldn=`./fieldn` | |
4233 | $rm -f foo.c fieldn | |
4234 | case $fieldn in | |
4235 | '') pos='???';; | |
4236 | 1) pos=first;; | |
4237 | 2) pos=second;; | |
4238 | 3) pos=third;; | |
4239 | *) pos="${fieldn}th";; | |
4633a7c4 | 4240 | esac |
2afac517 | 4241 | echo "Your cpp writes the filename in the $pos field of the line." |
4633a7c4 | 4242 | |
2afac517 | 4243 | : locate header file |
4244 | $cat >findhdr <<EOF | |
4245 | $startsh | |
4246 | wanted=\$1 | |
4247 | name='' | |
4248 | if test -f $usrinc/\$wanted; then | |
4249 | echo "$usrinc/\$wanted" | |
4250 | exit 0 | |
4251 | fi | |
4252 | awkprg='{ print \$$fieldn }' | |
4253 | echo "#include <\$wanted>" > foo\$\$.c | |
4254 | $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ | |
4255 | $grep "^[ ]*#.*\$wanted" | \ | |
4256 | while read cline; do | |
4257 | name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` | |
4258 | case "\$name" in | |
4259 | */\$wanted) echo "\$name"; exit 0;; | |
4260 | *) name='';; | |
4261 | esac; | |
4262 | done; | |
4263 | $rm -f foo\$\$.c; | |
4264 | case "\$name" in | |
4265 | '') exit 1;; | |
4633a7c4 | 4266 | esac |
2afac517 | 4267 | EOF |
4268 | chmod +x findhdr | |
4633a7c4 | 4269 | |
2afac517 | 4270 | : define an alternate in-header-list? function |
4271 | inhdr='echo " "; td=$define; tu=$undef; yyy=$@; | |
4272 | cont=true; xxf="echo \"<\$1> found.\" >&4"; | |
4273 | case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";; | |
4274 | *) xxnf="echo \"<\$1> NOT found, ...\" >&4";; | |
4275 | esac; | |
4276 | case $# in 4) instead=instead;; *) instead="at last";; esac; | |
4277 | while $test "$cont"; do | |
4278 | xxx=`./findhdr $1` | |
4279 | var=$2; eval "was=\$$2"; | |
4280 | if $test "$xxx" && $test -r "$xxx"; | |
4281 | then eval $xxf; | |
4282 | eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td"; | |
4283 | cont=""; | |
4284 | else eval $xxnf; | |
4285 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi; | |
4286 | set $yyy; shift; shift; yyy=$@; | |
4287 | case $# in 0) cont="";; | |
4288 | 2) xxf="echo \"but I found <\$1> $instead.\" >&4"; | |
4289 | xxnf="echo \"and I did not find <\$1> either.\" >&4";; | |
4290 | *) xxf="echo \"but I found <\$1\> instead.\" >&4"; | |
4291 | xxnf="echo \"there is no <\$1>, ...\" >&4";; | |
4292 | esac; | |
4293 | done; | |
4294 | while $test "$yyy"; | |
4295 | do set $yyy; var=$2; eval "was=\$$2"; | |
4296 | eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; | |
4297 | set $yyy; shift; shift; yyy=$@; | |
4298 | done' | |
4633a7c4 | 4299 | |
2afac517 | 4300 | : see if dld is available |
4301 | set dld.h i_dld | |
4302 | eval $inhdr | |
4633a7c4 | 4303 | |
2afac517 | 4304 | : is a C symbol defined? |
4305 | csym='tlook=$1; | |
4306 | case "$3" in | |
4307 | -v) tf=libc.tmp; tc=""; tdc="";; | |
4308 | -a) tf=libc.tmp; tc="[0]"; tdc="[]";; | |
4309 | *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; | |
4310 | esac; | |
4311 | tx=yes; | |
4312 | case "$reuseval-$4" in | |
4313 | true-) ;; | |
4314 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; | |
4315 | esac; | |
4316 | case "$tx" in | |
4317 | yes) | |
4318 | case "$runnm" in | |
4319 | true) | |
4320 | if $contains $tlook $tf >/dev/null 2>&1; | |
4321 | then tval=true; | |
4322 | else tval=false; | |
4323 | fi;; | |
4324 | *) | |
4325 | echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; | |
4326 | if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; | |
4327 | then tval=true; | |
4328 | else tval=false; | |
4329 | fi; | |
4330 | $rm -f t t.c;; | |
4331 | esac;; | |
4332 | *) | |
4333 | case "$tval" in | |
4334 | $define) tval=true;; | |
4335 | *) tval=false;; | |
4336 | esac;; | |
4337 | esac; | |
4338 | eval "$2=$tval"' | |
4633a7c4 | 4339 | |
2afac517 | 4340 | : define an is-in-libc? function |
4341 | inlibc='echo " "; td=$define; tu=$undef; | |
4342 | sym=$1; var=$2; eval "was=\$$2"; | |
4343 | tx=yes; | |
4344 | case "$reuseval$was" in | |
4345 | true) ;; | |
4346 | true*) tx=no;; | |
4347 | esac; | |
4348 | case "$tx" in | |
4349 | yes) | |
4350 | set $sym tres -f; | |
4351 | eval $csym; | |
4352 | case "$tres" in | |
4353 | true) | |
4354 | echo "$sym() found." >&4; | |
4355 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; | |
4356 | *) | |
4357 | echo "$sym() NOT found." >&4; | |
4358 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; | |
4359 | esac;; | |
4360 | *) | |
4361 | case "$was" in | |
4362 | $define) echo "$sym() found." >&4;; | |
4363 | *) echo "$sym() NOT found." >&4;; | |
4364 | esac;; | |
4365 | esac' | |
4633a7c4 | 4366 | |
2afac517 | 4367 | : see if dlopen exists |
4368 | xxx_runnm="$runnm" | |
4369 | runnm=false | |
4370 | set dlopen d_dlopen | |
4371 | eval $inlibc | |
4372 | runnm="$xxx_runnm" | |
40a7a20a | 4373 | |
2afac517 | 4374 | : determine which dynamic loading, if any, to compile in |
4633a7c4 | 4375 | echo " " |
2afac517 | 4376 | dldir="ext/DynaLoader" |
4377 | case "$usedl" in | |
4378 | $define|y|true) | |
4379 | dflt='y' | |
4380 | usedl="$define" | |
4381 | ;; | |
4382 | $undef|n|false) | |
4383 | dflt='n' | |
4384 | usedl="$undef" | |
4385 | ;; | |
4386 | *) | |
4387 | dflt='n' | |
4388 | case "$d_dlopen" in | |
4389 | $define) dflt='y' ;; | |
4390 | esac | |
4391 | case "$i_dld" in | |
4392 | $define) dflt='y' ;; | |
4633a7c4 | 4393 | esac |
2afac517 | 4394 | : Does a dl_xxx.xs file exist for this operating system |
4395 | $test -f ../$dldir/dl_${osname}.xs && dflt='y' | |
4633a7c4 LW |
4396 | ;; |
4397 | esac | |
2afac517 | 4398 | rp="Do you wish to use dynamic loading?" |
4399 | . ./myread | |
4400 | usedl="$ans" | |
4401 | case "$ans" in | |
4402 | y*) usedl="$define" | |
4403 | case "$dlsrc" in | |
4404 | '') | |
4405 | if $test -f ../$dldir/dl_${osname}.xs ; then | |
4406 | dflt="$dldir/dl_${osname}.xs" | |
4407 | elif $test "$d_dlopen" = "$define" ; then | |
4408 | dflt="$dldir/dl_dlopen.xs" | |
4409 | elif $test "$i_dld" = "$define" ; then | |
4410 | dflt="$dldir/dl_dld.xs" | |
4633a7c4 | 4411 | else |
2afac517 | 4412 | dflt='' |
4633a7c4 | 4413 | fi |
4633a7c4 | 4414 | ;; |
2afac517 | 4415 | *) dflt="$dldir/$dlsrc" |
4416 | ;; | |
4633a7c4 | 4417 | esac |
2afac517 | 4418 | echo "The following dynamic loading files are available:" |
4419 | : Can not go over to $dldir because getfile has path hard-coded in. | |
4420 | cd ..; ls -C $dldir/dl*.xs; cd UU | |
4421 | rp="Source file to use for dynamic loading" | |
4422 | fn="fne" | |
4423 | . ./getfile | |
4424 | usedl="$define" | |
4425 | : emulate basename | |
4426 | dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'` | |
2304df62 | 4427 | |
2afac517 | 4428 | $cat << EOM |
2304df62 | 4429 | |
2afac517 | 4430 | Some systems may require passing special flags to $cc -c to |
4431 | compile modules that will be used to create a shared library. | |
4432 | To use no flags, say "none". | |
2304df62 AD |
4433 | |
4434 | EOM | |
2afac517 | 4435 | case "$cccdlflags" in |
4436 | '') case "$gccversion" in | |
4437 | '') case "$osname" in | |
4438 | hpux) dflt='+z' ;; | |
4439 | next) dflt='none' ;; | |
8cc95fdb | 4440 | svr4*|esix*) dflt='-Kpic' ;; |
4441 | irix*) dflt='-KPIC' ;; | |
4442 | solaris) case "$ccflags" in | |
4443 | *-DDEBUGGING*) dflt='-KPIC' ;; | |
4444 | *) dflt='-Kpic' ;; | |
4445 | esac ;; | |
2afac517 | 4446 | sunos) dflt='-pic' ;; |
4447 | *) dflt='none' ;; | |
4448 | esac ;; | |
81d89818 HF |
4449 | *) case "$osname/$ccflags" in |
4450 | solaris/*-DDEBUGGING*) dflt='-fPIC' ;; | |
4451 | *) dflt='-fpic' ;; | |
4452 | esac ;; | |
2afac517 | 4453 | esac ;; |
4454 | *) dflt="$cccdlflags" ;; | |
4455 | esac | |
4456 | rp="Any special flags to pass to $cc -c to compile shared library modules?" | |
4457 | . ./myread | |
4458 | case "$ans" in | |
4459 | none) cccdlflags=' ' ;; | |
4460 | *) cccdlflags="$ans" ;; | |
4461 | esac | |
2304df62 | 4462 | |
2afac517 | 4463 | cat << EOM |
ecfc5424 | 4464 | |
2afac517 | 4465 | Some systems use ld to create libraries that can be dynamically loaded, |
4466 | while other systems (such as those using ELF) use $cc. | |
a0f45b59 | 4467 | |
2afac517 | 4468 | EOM |
4469 | case "$ld" in | |
4470 | '') $cat >try.c <<'EOM' | |
4471 | /* Test for whether ELF binaries are produced */ | |
4472 | #include <fcntl.h> | |
4473 | #include <stdlib.h> | |
4474 | main() { | |
4475 | char b[4]; | |
4476 | int i = open("a.out",O_RDONLY); | |
4477 | if(i == -1) | |
4478 | exit(1); /* fail */ | |
4479 | if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') | |
4480 | exit(0); /* succeed (yes, it's ELF) */ | |
2304df62 | 4481 | else |
2afac517 | 4482 | exit(1); /* fail */ |
4483 | } | |
4484 | EOM | |
4485 | if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then | |
4486 | cat <<EOM | |
4487 | You appear to have ELF support. I'll use $cc to build dynamic libraries. | |
4488 | EOM | |
4489 | dflt="$cc" | |
2304df62 | 4490 | else |
2afac517 | 4491 | echo "I'll use ld to build dynamic libraries." |
4492 | dflt='ld' | |
2304df62 | 4493 | fi |
2afac517 | 4494 | rm -f try.c a.out |
4495 | ;; | |
4496 | *) dflt="$ld" | |
4497 | ;; | |
4498 | esac | |
4499 | ||
4500 | rp="What command should be used to create dynamic libraries?" | |
4501 | . ./myread | |
4502 | ld="$ans" | |
4503 | ||
4504 | cat << EOM | |
4505 | ||
4506 | Some systems may require passing special flags to $ld to create a | |
4507 | library that can be dynamically loaded. If your ld flags include | |
4508 | -L/other/path options to locate libraries outside your loader's normal | |
4509 | search path, you may need to specify those -L options here as well. To | |
4510 | use no flags, say "none". | |
4511 | ||
4512 | EOM | |
4513 | case "$lddlflags" in | |
4514 | '') case "$osname" in | |
4515 | hpux) dflt='-b' ;; | |
4516 | linux|irix*) dflt='-shared' ;; | |
4517 | next) dflt='none' ;; | |
4518 | solaris) dflt='-G' ;; | |
4519 | sunos) dflt='-assert nodefinitions' ;; | |
4520 | svr4*|esix*) dflt="-G $ldflags" ;; | |
4521 | *) dflt='none' ;; | |
4522 | esac | |
4523 | ;; | |
4524 | *) dflt="$lddlflags" ;; | |
4525 | esac | |
4526 | ||
4527 | : Try to guess additional flags to pick up local libraries. | |
4528 | for thisflag in $ldflags; do | |
4529 | case "$thisflag" in | |
4530 | -L*) | |
4531 | case " $dflt " in | |
4532 | *" $thisflag "*) ;; | |
4533 | *) dflt="$dflt $thisflag" ;; | |
4534 | esac | |
4535 | ;; | |
4536 | esac | |
4537 | done | |
4538 | ||
4539 | case "$dflt" in | |
4540 | '') dflt='none' ;; | |
4541 | esac | |
4542 | ||
4543 | rp="Any special flags to pass to $ld to create a dynamically loaded library?" | |
4544 | . ./myread | |
4545 | case "$ans" in | |
4546 | none) lddlflags=' ' ;; | |
4547 | *) lddlflags="$ans" ;; | |
4548 | esac | |
4549 | ||
4550 | cat <<EOM | |
4551 | ||
4552 | Some systems may require passing special flags to $cc to indicate that | |
4553 | the resulting executable will use dynamic linking. To use no flags, | |
4554 | say "none". | |
4555 | ||
4556 | EOM | |
4557 | case "$ccdlflags" in | |
4558 | '') case "$osname" in | |
4559 | hpux) dflt='-Wl,-E' ;; | |
4560 | linux) dflt='-rdynamic' ;; | |
4561 | next) dflt='none' ;; | |
4562 | sunos) dflt='none' ;; | |
4563 | *) dflt='none' ;; | |
4564 | esac ;; | |
4565 | *) dflt="$ccdlflags" ;; | |
4566 | esac | |
4567 | rp="Any special flags to pass to $cc to use dynamic loading?" | |
4568 | . ./myread | |
4569 | case "$ans" in | |
4570 | none) ccdlflags=' ' ;; | |
4571 | *) ccdlflags="$ans" ;; | |
4572 | esac | |
4573 | ;; | |
4574 | *) usedl="$undef" | |
4575 | ld='ld' | |
4576 | dlsrc='dl_none.xs' | |
4577 | lddlflags='' | |
4578 | ccdlflags='' | |
4579 | ;; | |
4580 | esac | |
4581 | ||
4582 | also='' | |
4583 | case "$usedl" in | |
4584 | $undef) | |
4585 | # No dynamic loading being used, so don't bother even to prompt. | |
4586 | useshrplib='false' | |
4587 | ;; | |
4588 | *) case "$useshrplib" in | |
4589 | '') case "$osname" in | |
2ae324a7 | 4590 | svr4*|dgux|dynixptx|esix|powerux) |
3e3baf6d | 4591 | dflt=y |
2afac517 | 4592 | also='Building a shared libperl is required for dynamic loading to work on your system.' |
4593 | ;; | |
4594 | next*) | |
4595 | case "$osvers" in | |
3e3baf6d | 4596 | 4*) dflt=y |
2afac517 | 4597 | also='Building a shared libperl is needed for MAB support.' |
4598 | ;; | |
3e3baf6d | 4599 | *) dflt=n |
2afac517 | 4600 | ;; |
4601 | esac | |
4602 | ;; | |
4603 | sunos) | |
3e3baf6d | 4604 | dflt=n |
2afac517 | 4605 | also='Building a shared libperl will definitely not work on SunOS 4.' |
4606 | ;; | |
3e3baf6d | 4607 | *) dflt=n |
2afac517 | 4608 | ;; |
4609 | esac | |
4610 | ;; | |
4611 | $define|true|[Yy]*) | |
3e3baf6d | 4612 | dflt=y |
2afac517 | 4613 | ;; |
3e3baf6d | 4614 | *) dflt=n |
2afac517 | 4615 | ;; |
4616 | esac | |
4617 | $cat << EOM | |
4618 | ||
4619 | The perl executable is normally obtained by linking perlmain.c with | |
4620 | libperl${lib_ext}, any static extensions (usually just DynaLoader), and | |
4621 | any other libraries needed on this system (such as -lm, etc.). Since | |
4622 | your system supports dynamic loading, it is probably possible to build | |
4623 | a shared libperl.$so. If you will have more than one executable linked | |
4624 | to libperl.$so, this will significantly reduce the size of each | |
4625 | executable, but it may have a noticeable affect on performance. The | |
4626 | default is probably sensible for your system. | |
4627 | $also | |
4628 | ||
4629 | EOM | |
4630 | rp="Build a shared libperl.$so (y/n)" | |
4631 | . ./myread | |
4632 | case "$ans" in | |
4633 | true|$define|[Yy]*) | |
4634 | useshrplib='true' | |
4635 | # Why does next4 have to be so different? | |
4636 | case "${osname}${osvers}" in | |
4637 | next4*) xxx='DYLD_LIBRARY_PATH' ;; | |
4638 | *) xxx='LD_LIBRARY_PATH' ;; | |
4639 | esac | |
4640 | $cat <<EOM >&4 | |
4641 | ||
4642 | To build perl, you must add the current working directory to your | |
4643 | $xxx environtment variable before running make. You can do | |
4644 | this with | |
4645 | $xxx=\`pwd\`; export $xxx | |
4646 | for Bourne-style shells, or | |
4647 | setenv $xxx \`pwd\` | |
4648 | for Csh-style shells. You *MUST* do this before running make. | |
4649 | ||
4650 | EOM | |
4651 | ;; | |
4652 | *) useshrplib='false' ;; | |
4653 | esac | |
4654 | ;; | |
4655 | esac | |
4656 | ||
4657 | case "$useshrplib" in | |
4658 | true) | |
4659 | case "$libperl" in | |
4660 | '') | |
4661 | # Figure out a good name for libperl.so. Since it gets stored in | |
4662 | # a version-specific architecture-dependent library, the version | |
4663 | # number isn't really that important, except for making cc/ld happy. | |
4664 | # | |
4665 | # A name such as libperl.so.3.1 | |
4666 | majmin="libperl.$so.$patchlevel.$subversion" | |
4667 | # A name such as libperl.so.301 | |
4668 | majonly=`echo $patchlevel $subversion | | |
4669 | $awk '{printf "%d%02d", $1, $2}'` | |
4670 | majonly=libperl.$so.$majonly | |
4671 | # I'd prefer to keep the os-specific stuff here to a minimum, and | |
4672 | # rely on figuring it out from the naming of libc. | |
4673 | case "${osname}${osvers}" in | |
4674 | next4*) | |
4675 | dflt=libperl.5.$so | |
4676 | # XXX How handle the --version stuff for MAB? | |
4677 | ;; | |
4678 | linux*) # ld won't link with a bare -lperl otherwise. | |
4679 | dflt=libperl.$so | |
4680 | ;; | |
4681 | *) # Try to guess based on whether libc has major.minor. | |
4682 | case "$libc" in | |
4683 | *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; | |
4684 | *libc.$so.[0-9]*) dflt=$majonly ;; | |
4685 | *) dflt=libperl.$so ;; | |
4686 | esac | |
4687 | ;; | |
4688 | esac | |
4689 | ;; | |
4690 | *) dflt=$libperl | |
4691 | ;; | |
4692 | esac | |
4693 | cat << EOM | |
4694 | ||
4695 | I need to select a good name for the shared libperl. If your system uses | |
4696 | library names with major and minor numbers, then you might want something | |
4697 | like $majmin. Alternatively, if your system uses a single version | |
4698 | number for shared libraries, then you might want to use $majonly. | |
4699 | Or, your system might be quite happy with a simple libperl.$so. | |
4700 | ||
4701 | Since the shared libperl will get installed into a version-specific | |
4702 | architecture-dependent directory, the version number of the shared perl | |
4703 | library probably isn't important, so the default should be o.k. | |
4704 | ||
4705 | EOM | |
4706 | rp='What name do you want to give to the shared libperl?' | |
4707 | . ./myread | |
4708 | libperl=$ans | |
4709 | echo "Ok, I'll use $libperl" | |
4710 | ;; | |
4711 | *) | |
4712 | libperl="libperl${lib_ext}" | |
4713 | ;; | |
4714 | esac | |
4715 | ||
4716 | # Detect old use of shrpdir via undocumented Configure -Dshrpdir | |
4717 | case "$shrpdir" in | |
4718 | '') ;; | |
4719 | *) $cat >&4 <<EOM | |
4720 | WARNING: Use of the shrpdir variable for the installation location of | |
4721 | the shared $libperl is not supported. It was never documented and | |
284c50cc MDLR |
4722 | will not work in this version. Let me (chip@perl.com) know of any |
4723 | problems this may cause. | |
2afac517 | 4724 | |
4725 | EOM | |
4726 | case "$shrpdir" in | |
4727 | "$archlibexp/CORE") | |
4728 | $cat >&4 <<EOM | |
4729 | But your current setting of $shrpdir is | |
4730 | the default anyway, so it's harmless. | |
4731 | EOM | |
4732 | ;; | |
4733 | *) | |
4734 | $cat >&4 <<EOM | |
4735 | Further, your current attempted setting of $shrpdir | |
4736 | conflicts with the value of $archlibexp/CORE | |
4737 | that installperl will use. | |
4738 | EOM | |
4739 | ;; | |
4740 | esac | |
4741 | ;; | |
4742 | esac | |
4743 | ||
4744 | # How will the perl executable find the installed shared $libperl? | |
4745 | # Add $xxx to ccdlflags. | |
4746 | # If we can't figure out a command-line option, use $shrpenv to | |
4747 | # set env LD_RUN_PATH. The main perl makefile uses this. | |
4748 | shrpdir=$archlibexp/CORE | |
4749 | xxx='' | |
4750 | tmp_shrpenv='' | |
4751 | if "$useshrplib"; then | |
4752 | case "$osname" in | |
3c321fdc | 4753 | aix) |
4754 | # We'll set it in Makefile.SH... | |
4755 | ;; | |
2afac517 | 4756 | solaris|netbsd) |
4757 | xxx="-R $shrpdir" | |
4758 | ;; | |
28757baa | 4759 | freebsd) |
44a8e56a | 4760 | xxx="-Wl,-R$shrpdir" |
28757baa | 4761 | ;; |
b971f6e4 | 4762 | linux|irix*|dec_osf) |
2afac517 | 4763 | xxx="-Wl,-rpath,$shrpdir" |
4764 | ;; | |
7bac28a0 | 4765 | next) |
4766 | # next doesn't like the default... | |
4767 | ;; | |
2afac517 | 4768 | *) |
4769 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" | |
4770 | ;; | |
4771 | esac | |
4772 | case "$xxx" in | |
4773 | '') ;; | |
b971f6e4 | 4774 | *) |
4775 | # Only add $xxx if it isn't already in ccdlflags. | |
4776 | case " $ccdlflags " in | |
4777 | *" $xxx "*) ;; | |
4778 | *) ccdlflags="$ccdlflags $xxx" | |
4779 | cat <<EOM >&4 | |
2afac517 | 4780 | |
4781 | Adding $xxx to the flags | |
4782 | passed to $ld so that the perl executable will find the | |
4783 | installed shared $libperl. | |
4784 | ||
4785 | EOM | |
b971f6e4 | 4786 | ;; |
4787 | esac | |
2afac517 | 4788 | ;; |
4789 | esac | |
4790 | fi | |
4791 | # Respect a hint or command-line value. | |
4792 | case "$shrpenv" in | |
4793 | '') shrpenv="$tmp_shrpenv" ;; | |
4794 | esac | |
4795 | ||
4796 | : determine where manual pages go | |
4797 | set man1dir man1dir none | |
4798 | eval $prefixit | |
4799 | $cat <<EOM | |
4800 | ||
4801 | $spackage has manual pages available in source form. | |
4802 | EOM | |
4803 | case "$nroff" in | |
4804 | nroff) | |
4805 | echo "However, you don't have nroff, so they're probably useless to you." | |
4806 | case "$man1dir" in | |
4807 | '') man1dir="none";; | |
4808 | esac;; | |
4809 | esac | |
4810 | echo "If you don't want the manual sources installed, answer 'none'." | |
4811 | case "$man1dir" in | |
4812 | ' ') dflt=none | |
4813 | ;; | |
4814 | '') | |
4815 | lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1" | |
4816 | lookpath="$lookpath $prefixexp/man/p_man/man1" | |
4817 | lookpath="$lookpath $prefixexp/man/u_man/man1" | |
4818 | lookpath="$lookpath $prefixexp/man/man.1" | |
4819 | : If prefix contains 'perl' then we want to keep the man pages | |
4820 | : under the prefix directory. Otherwise, look in a variety of | |
4821 | : other possible places. This is debatable, but probably a | |
4822 | : good compromise. Well, apparently not. | |
4823 | : Experience has shown people expect man1dir to be under prefix, | |
4824 | : so we now always put it there. Users who want other behavior | |
4825 | : can answer interactively or use a command line option. | |
4826 | : Does user have System V-style man paths. | |
4827 | case "$sysman" in | |
4828 | */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;; | |
4829 | *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;; | |
4830 | esac | |
4831 | set dflt | |
4832 | eval $prefixup | |
4833 | ;; | |
4834 | *) dflt="$man1dir" | |
4835 | ;; | |
4836 | esac | |
4837 | echo " " | |
4838 | fn=dn+~ | |
4839 | rp="Where do the main $spackage manual pages (source) go?" | |
4840 | . ./getfile | |
4841 | if $test "X$man1direxp" != "X$ansexp"; then | |
4842 | installman1dir='' | |
4843 | fi | |
4844 | man1dir="$ans" | |
4845 | man1direxp="$ansexp" | |
4846 | case "$man1dir" in | |
4847 | '') man1dir=' ' | |
4848 | installman1dir='';; | |
4849 | esac | |
4850 | if $afs; then | |
4851 | $cat <<EOM | |
4852 | ||
4853 | Since you are running AFS, I need to distinguish the directory in which | |
4854 | manual pages reside from the directory in which they are installed (and from | |
4855 | which they are presumably copied to the former directory by occult means). | |
4856 | ||
4857 | EOM | |
4858 | case "$installman1dir" in | |
4859 | '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;; | |
4860 | *) dflt="$installman1dir";; | |
4861 | esac | |
4862 | fn=de~ | |
4863 | rp='Where will man pages be installed?' | |
4864 | . ./getfile | |
4865 | installman1dir="$ans" | |
4866 | else | |
4867 | installman1dir="$man1direxp" | |
4868 | fi | |
4869 | ||
4870 | : What suffix to use on installed man pages | |
4871 | ||
4872 | case "$man1dir" in | |
4873 | ' ') | |
4874 | man1ext='0' | |
4875 | ;; | |
4876 | *) | |
4877 | rp="What suffix should be used for the main $spackage man pages?" | |
4878 | case "$man1ext" in | |
4879 | '') case "$man1dir" in | |
4880 | *1) dflt=1 ;; | |
4881 | *1p) dflt=1p ;; | |
4882 | *1pm) dflt=1pm ;; | |
4883 | *l) dflt=l;; | |
4884 | *n) dflt=n;; | |
4885 | *o) dflt=o;; | |
4886 | *p) dflt=p;; | |
4887 | *C) dflt=C;; | |
4888 | *L) dflt=L;; | |
4889 | *L1) dflt=L1;; | |
4890 | *) dflt=1;; | |
4891 | esac | |
4892 | ;; | |
4893 | *) dflt="$man1ext";; | |
4894 | esac | |
4895 | . ./myread | |
4896 | man1ext="$ans" | |
4897 | ;; | |
4898 | esac | |
4899 | ||
4900 | : see if we can have long filenames | |
4901 | echo " " | |
4902 | rmlist="$rmlist /tmp/cf$$" | |
4903 | $test -d /tmp/cf$$ || mkdir /tmp/cf$$ | |
4904 | first=123456789abcdef | |
4905 | second=/tmp/cf$$/$first | |
4906 | $rm -f $first $second | |
4907 | if (echo hi >$first) 2>/dev/null; then | |
4908 | if $test -f 123456789abcde; then | |
4909 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
4910 | val="$undef" | |
4911 | else | |
4912 | if (echo hi >$second) 2>/dev/null; then | |
4913 | if $test -f /tmp/cf$$/123456789abcde; then | |
4914 | $cat <<'EOM' | |
4915 | That's peculiar... You can have filenames longer than 14 characters, but only | |
4916 | on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems | |
4917 | I shall consider your system cannot support long filenames at all. | |
4918 | EOM | |
4919 | val="$undef" | |
4920 | else | |
4921 | echo 'You can have filenames longer than 14 characters.' >&4 | |
4922 | val="$define" | |
4923 | fi | |
4924 | else | |
4925 | $cat <<'EOM' | |
4926 | How confusing! Some of your filesystems are sane enough to allow filenames | |
4927 | longer than 14 characters but some others like /tmp can't even think about them. | |
4928 | So, for now on, I shall assume your kernel does not allow them at all. | |
4929 | EOM | |
4930 | val="$undef" | |
4931 | fi | |
4932 | fi | |
4933 | else | |
4934 | $cat <<'EOM' | |
4935 | You can't have filenames longer than 14 chars. You can't even think about them! | |
4936 | EOM | |
4937 | val="$undef" | |
4938 | fi | |
4939 | set d_flexfnam | |
4940 | eval $setvar | |
4941 | $rm -rf /tmp/cf$$ 123456789abcde* | |
4942 | ||
4943 | : determine where library module manual pages go | |
4944 | set man3dir man3dir none | |
4945 | eval $prefixit | |
4946 | $cat <<EOM | |
4947 | ||
4948 | $spackage has manual pages for many of the library modules. | |
4949 | EOM | |
4950 | ||
4951 | case "$nroff" in | |
4952 | nroff) | |
4953 | $cat <<'EOM' | |
4954 | However, you don't have nroff, so they're probably useless to you. | |
4955 | You can use the supplied perldoc script instead. | |
4956 | EOM | |
4957 | case "$man3dir" in | |
4958 | '') man3dir="none";; | |
4959 | esac;; | |
4960 | esac | |
4961 | ||
4962 | case "$d_flexfnam" in | |
4963 | undef) | |
4964 | $cat <<'EOM' | |
4965 | However, your system can't handle the long file names like File::Basename.3. | |
4966 | You can use the supplied perldoc script instead. | |
4967 | EOM | |
4968 | case "$man3dir" in | |
4969 | '') man3dir="none";; | |
4970 | esac;; | |
4971 | esac | |
4972 | ||
4973 | echo "If you don't want the manual sources installed, answer 'none'." | |
4974 | : We dont use /usr/local/man/man3 because some man programs will | |
4975 | : only show the /usr/local/man/man3 contents, and not the system ones, | |
4976 | : thus man less will show the perl module less.pm, but not the system | |
4977 | : less command. We might also conflict with TCL man pages. | |
4978 | : However, something like /opt/perl/man/man3 is fine. | |
4979 | case "$man3dir" in | |
4980 | '') case "$prefix" in | |
4981 | *perl*) dflt=`echo $man1dir | | |
4982 | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;; | |
4983 | *) dflt="$privlib/man/man3" ;; | |
4984 | esac | |
4985 | ;; | |
4986 | ' ') dflt=none;; | |
4987 | *) dflt="$man3dir" ;; | |
4988 | esac | |
4989 | echo " " | |
4990 | ||
4991 | fn=dn+~ | |
4992 | rp="Where do the $spackage library man pages (source) go?" | |
4993 | . ./getfile | |
4994 | if test "X$man3direxp" != "X$ansexp"; then | |
4995 | installman3dir='' | |
4996 | fi | |
4997 | ||
4998 | man3dir="$ans" | |
4999 | man3direxp="$ansexp" | |
5000 | case "$man3dir" in | |
5001 | '') man3dir=' ' | |
5002 | installman3dir='';; | |
5003 | esac | |
5004 | if $afs; then | |
5005 | $cat <<EOM | |
5006 | ||
5007 | Since you are running AFS, I need to distinguish the directory in which | |
5008 | manual pages reside from the directory in which they are installed (and from | |
5009 | which they are presumably copied to the former directory by occult means). | |
5010 | ||
5011 | EOM | |
5012 | case "$installman3dir" in | |
5013 | '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;; | |
5014 | *) dflt="$installman3dir";; | |
5015 | esac | |
5016 | fn=de~ | |
5017 | rp='Where will man pages be installed?' | |
5018 | . ./getfile | |
5019 | installman3dir="$ans" | |
5020 | else | |
5021 | installman3dir="$man3direxp" | |
5022 | fi | |
5023 | ||
5024 | : What suffix to use on installed man pages | |
5025 | ||
5026 | case "$man3dir" in | |
5027 | ' ') | |
5028 | man3ext='0' | |
5029 | ;; | |
5030 | *) | |
5031 | rp="What suffix should be used for the $spackage library man pages?" | |
5032 | case "$man3ext" in | |
5033 | '') case "$man3dir" in | |
5034 | *3) dflt=3 ;; | |
5035 | *3p) dflt=3p ;; | |
5036 | *3pm) dflt=3pm ;; | |
5037 | *l) dflt=l;; | |
5038 | *n) dflt=n;; | |
5039 | *o) dflt=o;; | |
5040 | *p) dflt=p;; | |
5041 | *C) dflt=C;; | |
5042 | *L) dflt=L;; | |
5043 | *L3) dflt=L3;; | |
5044 | *) dflt=3;; | |
5045 | esac | |
5046 | ;; | |
5047 | *) dflt="$man3ext";; | |
5048 | esac | |
5049 | . ./myread | |
5050 | man3ext="$ans" | |
5051 | ;; | |
5052 | esac | |
5053 | ||
5054 | : see if we have to deal with yellow pages, now NIS. | |
5055 | if $test -d /usr/etc/yp || $test -d /etc/yp; then | |
5056 | if $test -f /usr/etc/nibindd; then | |
5057 | echo " " | |
5058 | echo "I'm fairly confident you're on a NeXT." | |
5059 | echo " " | |
5060 | rp='Do you get the hosts file via NetInfo?' | |
5061 | dflt=y | |
5062 | case "$hostcat" in | |
5063 | nidump*) ;; | |
5064 | '') ;; | |
5065 | *) dflt=n;; | |
5066 | esac | |
5067 | . ./myread | |
5068 | case "$ans" in | |
5069 | y*) hostcat='nidump hosts .';; | |
5070 | *) case "$hostcat" in | |
5071 | nidump*) hostcat='';; | |
5072 | esac | |
5073 | ;; | |
5074 | esac | |
5075 | fi | |
5076 | case "$hostcat" in | |
5077 | nidump*) ;; | |
5078 | *) | |
5079 | case "$hostcat" in | |
5080 | *ypcat*) dflt=y;; | |
5081 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
5082 | dflt=y | |
5083 | else | |
5084 | dflt=n | |
5085 | fi;; | |
5086 | *) dflt=n;; | |
5087 | esac | |
5088 | echo " " | |
5089 | rp='Are you getting the hosts file via yellow pages?' | |
5090 | . ./myread | |
5091 | case "$ans" in | |
5092 | y*) hostcat='ypcat hosts';; | |
5093 | *) hostcat='cat /etc/hosts';; | |
5094 | esac | |
5095 | ;; | |
5096 | esac | |
5097 | fi | |
5098 | ||
5099 | : now get the host name | |
5100 | echo " " | |
5101 | echo "Figuring out host name..." >&4 | |
5102 | case "$myhostname" in | |
5103 | '') cont=true | |
5104 | echo 'Maybe "hostname" will work...' | |
5105 | if tans=`sh -c hostname 2>&1` ; then | |
5106 | myhostname=$tans | |
5107 | phostname=hostname | |
5108 | cont='' | |
5109 | fi | |
5110 | ;; | |
5111 | *) cont='';; | |
5112 | esac | |
5113 | if $test "$cont"; then | |
5114 | if ./xenix; then | |
5115 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' | |
5116 | if tans=`cat /etc/systemid 2>&1` ; then | |
5117 | myhostname=$tans | |
5118 | phostname='cat /etc/systemid' | |
5119 | echo "Whadyaknow. Xenix always was a bit strange..." | |
5120 | cont='' | |
5121 | fi | |
5122 | elif $test -r /etc/systemid; then | |
5123 | echo "(What is a non-Xenix system doing with /etc/systemid?)" | |
5124 | fi | |
5125 | fi | |
5126 | if $test "$cont"; then | |
5127 | echo 'No, maybe "uuname -l" will work...' | |
5128 | if tans=`sh -c 'uuname -l' 2>&1` ; then | |
5129 | myhostname=$tans | |
5130 | phostname='uuname -l' | |
5131 | else | |
5132 | echo 'Strange. Maybe "uname -n" will work...' | |
5133 | if tans=`sh -c 'uname -n' 2>&1` ; then | |
5134 | myhostname=$tans | |
5135 | phostname='uname -n' | |
5136 | else | |
5137 | echo 'Oh well, maybe I can mine it out of whoami.h...' | |
5138 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then | |
5139 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` | |
5140 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" | |
5141 | else | |
5142 | case "$myhostname" in | |
5143 | '') echo "Does this machine have an identity crisis or something?" | |
5144 | phostname='';; | |
5145 | *) | |
5146 | echo "Well, you said $myhostname before..." | |
5147 | phostname='echo $myhostname';; | |
5148 | esac | |
5149 | fi | |
5150 | fi | |
5151 | fi | |
5152 | fi | |
5153 | : you do not want to know about this | |
5154 | set $myhostname | |
5155 | myhostname=$1 | |
5156 | ||
5157 | : verify guess | |
5158 | if $test "$myhostname" ; then | |
5159 | dflt=y | |
5160 | rp='Your host name appears to be "'$myhostname'".'" Right?" | |
5161 | . ./myread | |
5162 | case "$ans" in | |
5163 | y*) ;; | |
5164 | *) myhostname='';; | |
5165 | esac | |
5166 | fi | |
5167 | ||
5168 | : bad guess or no guess | |
5169 | while $test "X$myhostname" = X ; do | |
5170 | dflt='' | |
5171 | rp="Please type the (one word) name of your host:" | |
5172 | . ./myread | |
5173 | myhostname="$ans" | |
5174 | done | |
5175 | ||
5176 | : translate upper to lower if necessary | |
5177 | case "$myhostname" in | |
5178 | *[A-Z]*) | |
5179 | echo "(Normalizing case in your host name)" | |
5180 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` | |
5181 | ;; | |
5182 | esac | |
5183 | ||
5184 | case "$myhostname" in | |
5185 | *.*) | |
5186 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` | |
5187 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` | |
5188 | echo "(Trimming domain name from host name--host name is now $myhostname)" | |
5189 | ;; | |
5190 | *) case "$mydomain" in | |
5191 | '') | |
5192 | { | |
5193 | : If we use NIS, try ypmatch. | |
5194 | : Is there some reason why this was not done before? | |
5195 | test "X$hostcat" = "Xypcat hosts" && | |
5196 | ypmatch "$myhostname" hosts 2>/dev/null |\ | |
5197 | $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \ | |
5198 | $test -s hosts | |
5199 | } || { | |
5200 | : Extract only the relevant hosts, reducing file size, | |
5201 | : remove comments, insert trailing space for later use. | |
5202 | $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ / | |
5203 | /[ ]$myhostname[ . ]/p" > hosts | |
5204 | } | |
5205 | tmp_re="[ . ]" | |
5206 | $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } | |
5207 | END { print sum }" hosts` = x1 || tmp_re="[ ]" | |
5208 | dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ | |
5209 | hosts | $sort | $uniq | \ | |
5210 | $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` | |
5211 | case `$echo X$dflt` in | |
5212 | X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" | |
5213 | dflt=. | |
5214 | ;; | |
5215 | X.) echo "(You do not have fully-qualified names in /etc/hosts)" | |
5216 | ;; | |
5217 | esac | |
5218 | case "$dflt" in | |
5219 | .) | |
5220 | tans=`./loc resolv.conf X /etc /usr/etc` | |
5221 | if $test -f "$tans"; then | |
5222 | echo "(Attempting domain name extraction from $tans)" | |
5223 | : Why was there an Egrep here, when Sed works? | |
5224 | : Look for either a search or a domain directive. | |
a6006777 | 5225 | dflt=.`$sed -n -e 's/ / /g' \ |
28757baa | 5226 | -e 's/^search *\([^ ]*\).*/\1/p' $tans \ |
a6006777 | 5227 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
2afac517 | 5228 | case "$dflt" in |
a6006777 | 5229 | .) dflt=.`$sed -n -e 's/ / /g' \ |
28757baa | 5230 | -e 's/^domain *\([^ ]*\).*/\1/p' $tans \ |
a6006777 | 5231 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` |
774d564b | 5232 | ;; |
2afac517 | 5233 | esac |
5234 | fi | |
5235 | ;; | |
5236 | esac | |
5237 | case "$dflt" in | |
5238 | .) echo "(No help from resolv.conf either -- attempting clever guess)" | |
5239 | dflt=.`sh -c domainname 2>/dev/null` | |
5240 | case "$dflt" in | |
5241 | '') dflt='.';; | |
5242 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; | |
5243 | esac | |
5244 | ;; | |
5245 | esac | |
5246 | case "$dflt" in | |
5247 | .) echo "(Lost all hope -- silly guess then)" | |
5248 | dflt='.uucp' | |
5249 | ;; | |
5250 | esac | |
5251 | $rm -f hosts | |
5252 | ;; | |
5253 | *) dflt="$mydomain";; | |
5254 | esac;; | |
5255 | esac | |
5256 | echo " " | |
5257 | rp="What is your domain name?" | |
5258 | . ./myread | |
5259 | tans="$ans" | |
5260 | case "$ans" in | |
5261 | '') ;; | |
5262 | .*) ;; | |
5263 | *) tans=".$tans";; | |
5264 | esac | |
5265 | mydomain="$tans" | |
5266 | ||
5267 | : translate upper to lower if necessary | |
5268 | case "$mydomain" in | |
5269 | *[A-Z]*) | |
5270 | echo "(Normalizing case in your domain name)" | |
5271 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` | |
5272 | ;; | |
5273 | esac | |
5274 | ||
5275 | : a little sanity check here | |
5276 | case "$phostname" in | |
5277 | '') ;; | |
5278 | *) | |
5279 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in | |
5280 | $myhostname$mydomain|$myhostname) ;; | |
5281 | *) | |
5282 | case "$phostname" in | |
5283 | sed*) | |
5284 | echo "(That doesn't agree with your whoami.h file, by the way.)" | |
5285 | ;; | |
5286 | *) | |
5287 | echo "(That doesn't agree with your $phostname command, by the way.)" | |
5288 | ;; | |
5289 | esac | |
5290 | ;; | |
5291 | esac | |
5292 | ;; | |
5293 | esac | |
5294 | ||
5295 | $cat <<EOM | |
5296 | ||
5297 | I need to get your e-mail address in Internet format if possible, i.e. | |
5298 | something like user@host.domain. Please answer accurately since I have | |
5299 | no easy means to double check it. The default value provided below | |
5300 | is most probably close to the reality but may not be valid from outside | |
5301 | your organization... | |
5302 | ||
5303 | EOM | |
5304 | cont=x | |
5305 | while test "$cont"; do | |
5306 | case "$cf_email" in | |
5307 | '') dflt="$cf_by@$myhostname$mydomain";; | |
5308 | *) dflt="$cf_email";; | |
5309 | esac | |
5310 | rp='What is your e-mail address?' | |
5311 | . ./myread | |
5312 | cf_email="$ans" | |
5313 | case "$cf_email" in | |
5314 | *@*.*) cont='' ;; | |
5315 | *) | |
5316 | rp='Address does not look like an Internet one. Use it anyway?' | |
5317 | case "$fastread" in | |
5318 | yes) dflt=y ;; | |
5319 | *) dflt=n ;; | |
5320 | esac | |
5321 | . ./myread | |
5322 | case "$ans" in | |
5323 | y*) cont='' ;; | |
5324 | *) echo " " ;; | |
5325 | esac | |
5326 | ;; | |
5327 | esac | |
5328 | done | |
5329 | ||
5330 | $cat <<EOM | |
5331 | ||
5332 | If you or somebody else will be maintaining perl at your site, please | |
5333 | fill in the correct e-mail address here so that they may be contacted | |
5334 | if necessary. Currently, the "perlbug" program included with perl | |
5335 | will send mail to this address in addition to perlbug@perl.com. You may | |
5336 | enter "none" for no administrator. | |
5337 | ||
5338 | EOM | |
5339 | case "$perladmin" in | |
5340 | '') dflt="$cf_email";; | |
5341 | *) dflt="$perladmin";; | |
5342 | esac | |
5343 | rp='Perl administrator e-mail address' | |
5344 | . ./myread | |
5345 | perladmin="$ans" | |
5346 | ||
5f05dabc | 5347 | : figure out how to guarantee perl startup |
5348 | case "$startperl" in | |
5349 | '') | |
5350 | case "$sharpbang" in | |
5351 | *!) | |
5352 | $cat <<EOH | |
5353 | ||
5354 | I can use the #! construct to start perl on your system. This will | |
5355 | make startup of perl scripts faster, but may cause problems if you | |
5356 | want to share those scripts and perl is not in a standard place | |
5357 | ($binexp/perl) on all your platforms. The alternative is to force | |
5358 | a shell by starting the script with a single ':' character. | |
5359 | ||
5360 | EOH | |
5361 | dflt="$binexp/perl" | |
5362 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' | |
5363 | . ./myread | |
5364 | case "$ans" in | |
68dc0745 | 5365 | none) startperl=": # use perl";; |
5366 | *) startperl="#!$ans" | |
3e3baf6d | 5367 | if $test 30 -lt `echo "$ans" | wc -c`; then |
68dc0745 | 5368 | $cat >&4 <<EOM |
5369 | ||
5370 | WARNING: Some systems limit the #! command to 32 characters. | |
5371 | If you experience difficulty running Perl scripts with #!, try | |
5372 | installing Perl in a directory with a shorter pathname. | |
5373 | ||
5374 | EOM | |
5375 | fi ;; | |
5f05dabc | 5376 | esac |
5377 | ;; | |
5378 | *) startperl=": # use perl" | |
5379 | ;; | |
5380 | esac | |
5381 | ;; | |
5382 | esac | |
5383 | echo "I'll use $startperl to start perl scripts." | |
5384 | ||
5385 | : figure best path for perl in scripts | |
5386 | case "$perlpath" in | |
5387 | '') | |
5388 | perlpath="$binexp/perl" | |
5389 | case "$startperl" in | |
5390 | *!*) ;; | |
5391 | *) | |
5392 | $cat <<EOH | |
5393 | ||
5394 | I will use the "eval 'exec'" idiom to start Perl on your system. | |
5395 | I can use the full path of your Perl binary for this purpose, but | |
5396 | doing so may cause problems if you want to share those scripts and | |
5397 | Perl is not always in a standard place ($binexp/perl). | |
5398 | ||
5399 | EOH | |
5400 | dflt="$binexp/perl" | |
5401 | rp="What path shall I use in \"eval 'exec'\"?" | |
5402 | . ./myread | |
5403 | perlpath="$ans" | |
5404 | ;; | |
5405 | esac | |
5406 | ;; | |
5407 | esac | |
5408 | case "$startperl" in | |
5409 | *!*) ;; | |
5410 | *) echo "I'll use $perlpath in \"eval 'exec'\"" ;; | |
5411 | esac | |
5412 | ||
2afac517 | 5413 | : determine where public executable scripts go |
5414 | set scriptdir scriptdir | |
5415 | eval $prefixit | |
5416 | case "$scriptdir" in | |
5417 | '') | |
5418 | dflt="$bin" | |
5419 | : guess some guesses | |
5420 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
5421 | $test -d /usr/share/bin && dflt=/usr/share/bin | |
5422 | $test -d /usr/local/script && dflt=/usr/local/script | |
5423 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
5424 | set dflt | |
5425 | eval $prefixup | |
5426 | ;; | |
5427 | *) dflt="$scriptdir" | |
5428 | ;; | |
5429 | esac | |
5430 | $cat <<EOM | |
5431 | ||
5432 | Some installations have a separate directory just for executable scripts so | |
5433 | that they can mount it across multiple architectures but keep the scripts in | |
5434 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
5435 | Or you might just lump your scripts in with all your other executables. | |
5436 | ||
5437 | EOM | |
5438 | fn=d~ | |
5439 | rp='Where do you keep publicly executable scripts?' | |
5440 | . ./getfile | |
5441 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
5442 | installscript='' | |
5443 | fi | |
5444 | scriptdir="$ans" | |
5445 | scriptdirexp="$ansexp" | |
5446 | if $afs; then | |
5447 | $cat <<EOM | |
5448 | ||
5449 | Since you are running AFS, I need to distinguish the directory in which | |
5450 | scripts reside from the directory in which they are installed (and from | |
5451 | which they are presumably copied to the former directory by occult means). | |
5452 | ||
5453 | EOM | |
5454 | case "$installscript" in | |
5455 | '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;; | |
5456 | *) dflt="$installscript";; | |
5457 | esac | |
5458 | fn=de~ | |
5459 | rp='Where will public scripts be installed?' | |
5460 | . ./getfile | |
5461 | installscript="$ans" | |
5462 | else | |
5463 | installscript="$scriptdirexp" | |
2304df62 | 5464 | fi |
2afac517 | 5465 | |
2afac517 | 5466 | cat <<EOM |
5467 | ||
5468 | Previous version of $package used the standard IO mechanisms as defined in | |
5469 | <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO | |
5470 | mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still | |
5471 | the default and is the only supported mechanism. This abstraction | |
5472 | layer can use AT&T's sfio (if you already have sfio installed) or | |
5473 | fall back on standard IO. This PerlIO abstraction layer is | |
5474 | experimental and may cause problems with some extension modules. | |
5475 | ||
5476 | If this doesn't make any sense to you, just accept the default 'n'. | |
5477 | EOM | |
5478 | case "$useperlio" in | |
5479 | $define|true|[yY]*) dflt='y';; | |
5480 | *) dflt='n';; | |
5481 | esac | |
5482 | rp='Use the experimental PerlIO abstraction layer?' | |
5483 | . ./myread | |
5484 | case "$ans" in | |
5485 | y|Y) | |
5486 | val="$define" | |
5487 | ;; | |
5488 | *) | |
5489 | echo "Ok, doing things the stdio way" | |
5490 | val="$undef" | |
5491 | ;; | |
5492 | esac | |
5493 | set useperlio | |
5494 | eval $setvar | |
2304df62 | 5495 | |
8e07c86e AD |
5496 | : Check how to convert floats to strings. |
5497 | echo " " | |
5498 | echo "Checking for an efficient way to convert floats to strings." | |
5499 | $cat >try.c <<'EOP' | |
5500 | #ifdef TRY_gconvert | |
5501 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) | |
8ff267be | 5502 | char *myname = "gconvert"; |
8e07c86e AD |
5503 | #endif |
5504 | #ifdef TRY_gcvt | |
5505 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) | |
8ff267be | 5506 | char *myname = "gcvt"; |
8e07c86e AD |
5507 | #endif |
5508 | #ifdef TRY_sprintf | |
5509 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) | |
8ff267be | 5510 | char *myname = "sprintf"; |
8e07c86e | 5511 | #endif |
8ff267be | 5512 | |
5513 | #include <stdio.h> | |
5514 | ||
5515 | int | |
5516 | checkit(expect, got) | |
5517 | char *expect; | |
5518 | char *got; | |
5519 | { | |
5520 | if (strcmp(expect, got)) { | |
5521 | printf("%s oddity: Expected %s, got %s\n", | |
5522 | myname, expect, got); | |
5523 | exit(1); | |
5524 | } | |
5525 | } | |
5526 | ||
5527 | int | |
5528 | main() | |
5529 | { | |
ecfc5424 | 5530 | char buf[64]; |
8ff267be | 5531 | buf[63] = '\0'; |
5532 | ||
5533 | /* This must be 1st test on (which?) platform */ | |
5534 | /* Alan Burlison <AlanBurlsin@unn.unisys.com> */ | |
5535 | Gconvert(0.1, 8, 0, buf); | |
5536 | checkit("0.1", buf); | |
5537 | ||
8e07c86e | 5538 | Gconvert(1.0, 8, 0, buf); |
8ff267be | 5539 | checkit("1", buf); |
5540 | ||
8e07c86e | 5541 | Gconvert(0.0, 8, 0, buf); |
8ff267be | 5542 | checkit("0", buf); |
5543 | ||
8e07c86e | 5544 | Gconvert(-1.0, 8, 0, buf); |
8ff267be | 5545 | checkit("-1", buf); |
5546 | ||
5547 | /* Some Linux gcvt's give 1.e+5 here. */ | |
5548 | Gconvert(100000.0, 8, 0, buf); | |
5549 | checkit("100000", buf); | |
5550 | ||
5551 | /* Some Linux gcvt's give -1.e+5 here. */ | |
5552 | Gconvert(-100000.0, 8, 0, buf); | |
5553 | checkit("-100000", buf); | |
5554 | ||
ecfc5424 | 5555 | exit(0); |
a0d0e21e LW |
5556 | } |
5557 | EOP | |
8e07c86e AD |
5558 | case "$d_Gconvert" in |
5559 | gconvert*) xxx_list='gconvert gcvt sprintf' ;; | |
5560 | gcvt*) xxx_list='gcvt gconvert sprintf' ;; | |
5561 | sprintf*) xxx_list='sprintf gconvert gcvt' ;; | |
5562 | *) xxx_list='gconvert gcvt sprintf' ;; | |
5563 | esac | |
5564 | ||
5565 | for xxx_convert in $xxx_list; do | |
5566 | echo "Trying $xxx_convert" | |
5567 | $rm -f try try.o | |
5568 | if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \ | |
5569 | try.c $libs > /dev/null 2>&1 ; then | |
5570 | echo "$xxx_convert" found. >&4 | |
5571 | if ./try; then | |
8e07c86e AD |
5572 | echo "I'll use $xxx_convert to convert floats into a string." >&4 |
5573 | break; | |
2304df62 | 5574 | else |
8ff267be | 5575 | echo "...But $xxx_convert didn't work as I expected." |
2304df62 | 5576 | fi |
8e07c86e AD |
5577 | else |
5578 | echo "$xxx_convert NOT found." >&4 | |
5579 | fi | |
5580 | done | |
5581 | ||
5582 | case "$xxx_convert" in | |
5583 | gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;; | |
5584 | gcvt) d_Gconvert='gcvt((x),(n),(b))' ;; | |
5585 | *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;; | |
2304df62 AD |
5586 | esac |
5587 | ||
a0d0e21e LW |
5588 | : Initialize h_fcntl |
5589 | h_fcntl=false | |
5590 | ||
5591 | : Initialize h_sysfile | |
5592 | h_sysfile=false | |
2304df62 | 5593 | |
2304df62 AD |
5594 | : access call always available on UNIX |
5595 | set access d_access | |
5596 | eval $inlibc | |
5597 | ||
5598 | : locate the flags for 'access()' | |
5599 | case "$d_access" in | |
5600 | "$define") | |
5601 | echo " " | |
5602 | $cat >access.c <<'EOCP' | |
5603 | #include <sys/types.h> | |
5604 | #ifdef I_FCNTL | |
5605 | #include <fcntl.h> | |
5606 | #endif | |
5607 | #ifdef I_SYS_FILE | |
5608 | #include <sys/file.h> | |
5609 | #endif | |
5610 | #ifdef I_UNISTD | |
5611 | #include <unistd.h> | |
5612 | #endif | |
5613 | main() { | |
5614 | exit(R_OK); | |
5615 | } | |
8e07c86e AD |
5616 | EOCP |
5617 | : check sys/file.h first, no particular reason here | |
5618 | if $test `./findhdr sys/file.h` && \ | |
5619 | $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then | |
5620 | h_sysfile=true; | |
5621 | echo "<sys/file.h> defines the *_OK access constants." >&4 | |
5622 | elif $test `./findhdr fcntl.h` && \ | |
5623 | $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then | |
5624 | h_fcntl=true; | |
5625 | echo "<fcntl.h> defines the *_OK access constants." >&4 | |
5626 | elif $test `./findhdr unistd.h` && \ | |
5627 | $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then | |
5628 | echo "<unistd.h> defines the *_OK access constants." >&4 | |
5629 | else | |
5630 | echo "I can't find the four *_OK access constants--I'll use mine." >&4 | |
5631 | fi | |
5632 | ;; | |
5633 | esac | |
5634 | $rm -f access* | |
a0d0e21e | 5635 | |
8e07c86e AD |
5636 | : see if alarm exists |
5637 | set alarm d_alarm | |
5638 | eval $inlibc | |
2304df62 | 5639 | |
ecfc5424 | 5640 | : Look for GNU-cc style attribute checking |
2304df62 | 5641 | echo " " |
a0d0e21e LW |
5642 | echo "Checking whether your compiler can handle __attribute__ ..." >&4 |
5643 | $cat >attrib.c <<'EOCP' | |
1aef975c | 5644 | #include <stdio.h> |
ecfc5424 | 5645 | void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn)); |
a0d0e21e LW |
5646 | EOCP |
5647 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then | |
5648 | if $contains 'warning' attrib.out >/dev/null 2>&1; then | |
ecfc5424 | 5649 | echo "Your C compiler doesn't fully support __attribute__." |
a0d0e21e LW |
5650 | val="$undef" |
5651 | else | |
ecfc5424 | 5652 | echo "Your C compiler supports __attribute__." |
a0d0e21e LW |
5653 | val="$define" |
5654 | fi | |
5655 | else | |
ecfc5424 | 5656 | echo "Your C compiler doesn't seem to understand __attribute__ at all." |
a0d0e21e LW |
5657 | val="$undef" |
5658 | fi | |
ecfc5424 | 5659 | set d_attribut |
a0d0e21e LW |
5660 | eval $setvar |
5661 | $rm -f attrib* | |
5662 | ||
5663 | : see if bcmp exists | |
5664 | set bcmp d_bcmp | |
5665 | eval $inlibc | |
5666 | ||
5667 | : see if bcopy exists | |
5668 | set bcopy d_bcopy | |
5669 | eval $inlibc | |
5670 | ||
2afac517 | 5671 | : see if this is a unistd.h system |
5672 | set unistd.h i_unistd | |
5673 | eval $inhdr | |
5674 | ||
5675 | : see if getpgrp exists | |
5676 | set getpgrp d_getpgrp | |
5677 | eval $inlibc | |
5678 | ||
5679 | echo "Checking to see which flavor of getpgrp is in use . . . " | |
5680 | case "$d_getpgrp" in | |
5681 | "$define") | |
5682 | echo " " | |
5683 | $cat >set.c <<EOP | |
5684 | #$i_unistd I_UNISTD | |
5685 | #include <sys/types.h> | |
5686 | #ifdef I_UNISTD | |
5687 | # include <unistd.h> | |
5688 | #endif | |
5689 | main() | |
5690 | { | |
5691 | if (getuid() == 0) { | |
5692 | printf("(I see you are running Configure as super-user...)\n"); | |
5693 | setuid(1); | |
5694 | } | |
5695 | #ifdef TRY_BSD_PGRP | |
5696 | if (getpgrp(1) == 0) | |
5697 | exit(0); | |
5698 | #else | |
5699 | if (getpgrp() > 0) | |
5700 | exit(0); | |
5701 | #endif | |
5702 | exit(1); | |
5703 | } | |
5704 | EOP | |
5705 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
5706 | echo "You have to use getpgrp(pid) instead of getpgrp()." >&4 | |
5707 | val="$define" | |
5708 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
5709 | echo "You have to use getpgrp() instead of getpgrp(pid)." >&4 | |
5710 | val="$undef" | |
5711 | else | |
5712 | echo "I can't seem to compile and run the test program." | |
5713 | if ./usg; then | |
5714 | xxx="a USG one, i.e. you use getpgrp()." | |
5715 | else | |
5716 | # SVR4 systems can appear rather BSD-ish. | |
5717 | case "$i_unistd" in | |
5718 | $undef) | |
5719 | xxx="a BSD one, i.e. you use getpgrp(pid)." | |
5720 | val="$define" | |
5721 | ;; | |
5722 | $define) | |
5723 | xxx="probably a USG one, i.e. you use getpgrp()." | |
5724 | val="$undef" | |
5725 | ;; | |
5726 | esac | |
5727 | fi | |
5728 | echo "Assuming your getpgrp is $xxx" >&4 | |
5729 | fi | |
5730 | ;; | |
5731 | *) val="$undef";; | |
5732 | esac | |
5733 | set d_bsdgetpgrp | |
5734 | eval $setvar | |
5735 | $rm -f set set.c | |
5736 | ||
a0d0e21e LW |
5737 | : see if setpgrp exists |
5738 | set setpgrp d_setpgrp | |
5739 | eval $inlibc | |
5740 | ||
2afac517 | 5741 | echo "Checking to see which flavor of setpgrp is in use . . . " |
a0d0e21e LW |
5742 | case "$d_setpgrp" in |
5743 | "$define") | |
5744 | echo " " | |
5745 | $cat >set.c <<EOP | |
2afac517 | 5746 | #$i_unistd I_UNISTD |
5747 | #include <sys/types.h> | |
5748 | #ifdef I_UNISTD | |
5749 | # include <unistd.h> | |
5750 | #endif | |
a0d0e21e LW |
5751 | main() |
5752 | { | |
5753 | if (getuid() == 0) { | |
5754 | printf("(I see you are running Configure as super-user...)\n"); | |
5755 | setuid(1); | |
5756 | } | |
2afac517 | 5757 | #ifdef TRY_BSD_PGRP |
a0d0e21e | 5758 | if (-1 == setpgrp(1, 1)) |
2afac517 | 5759 | exit(0); |
5760 | #else | |
5761 | if (setpgrp() != -1) | |
5762 | exit(0); | |
5763 | #endif | |
5764 | exit(1); | |
a0d0e21e LW |
5765 | } |
5766 | EOP | |
2afac517 | 5767 | if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then |
5768 | echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4 | |
5769 | val="$define" | |
5770 | elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then | |
5771 | echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4 | |
5772 | val="$undef" | |
a0d0e21e | 5773 | else |
2afac517 | 5774 | echo "I can't seem to compile and run the test program." |
ecfc5424 | 5775 | if ./usg; then |
2afac517 | 5776 | xxx="a USG one, i.e. you use setpgrp()." |
a0d0e21e | 5777 | else |
2afac517 | 5778 | # SVR4 systems can appear rather BSD-ish. |
5779 | case "$i_unistd" in | |
5780 | $undef) | |
5781 | xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)." | |
5782 | val="$define" | |
5783 | ;; | |
5784 | $define) | |
5785 | xxx="probably a USG one, i.e. you use setpgrp()." | |
5786 | val="$undef" | |
5787 | ;; | |
5788 | esac | |
a0d0e21e | 5789 | fi |
2afac517 | 5790 | echo "Assuming your setpgrp is $xxx" >&4 |
a0d0e21e LW |
5791 | fi |
5792 | ;; | |
5793 | *) val="$undef";; | |
5794 | esac | |
2afac517 | 5795 | set d_bsdsetpgrp |
a0d0e21e | 5796 | eval $setvar |
2afac517 | 5797 | d_bsdpgrp=$d_bsdsetpgrp |
a0d0e21e | 5798 | $rm -f set set.c |
a0d0e21e LW |
5799 | : see if bzero exists |
5800 | set bzero d_bzero | |
5801 | eval $inlibc | |
5802 | ||
24fef2a7 | 5803 | : check for lengths of integral types |
a0d0e21e LW |
5804 | echo " " |
5805 | case "$intsize" in | |
5806 | '') | |
5807 | echo "Checking to see how big your integers are..." >&4 | |
24fef2a7 | 5808 | $cat >intsize.c <<'EOCP' |
a0d0e21e LW |
5809 | #include <stdio.h> |
5810 | main() | |
5811 | { | |
24fef2a7 AD |
5812 | printf("intsize=%d;\n", sizeof(int)); |
5813 | printf("longsize=%d;\n", sizeof(long)); | |
5814 | printf("shortsize=%d;\n", sizeof(short)); | |
5815 | fflush(stdout); | |
8e07c86e | 5816 | exit(0); |
a0d0e21e LW |
5817 | } |
5818 | EOCP | |
24fef2a7 AD |
5819 | # If $libs contains -lsfio, and sfio is mis-configured, then it |
5820 | # sometimes (apparently) runs and exits with a 0 status, but with no | |
5821 | # output!. Thus we check with test -s whether we actually got any | |
5822 | # output. I think it has to do with sfio's use of _exit vs. exit, | |
5823 | # but I don't know for sure. --Andy Dougherty 1/27/97. | |
5824 | if $cc $optimize $ccflags $ldflags -o intsize intsize.c $libs >/dev/null 2>&1 && | |
5825 | ./intsize > intsize.out 2>/dev/null && test -s intsize.out ; then | |
5826 | eval `$cat intsize.out` | |
8e07c86e | 5827 | echo "Your integers are $intsize bytes long." |
24fef2a7 AD |
5828 | echo "Your long integers are $longsize bytes long." |
5829 | echo "Your short integers are $shortsize bytes long." | |
a0d0e21e | 5830 | else |
24fef2a7 AD |
5831 | $cat >&4 <<EOM |
5832 | ||
5833 | Help! I can't compile and run the intsize test program: please enlighten me! | |
5834 | (This is probably a misconfiguration in your system or libraries, and | |
5835 | you really ought to fix it. Still, I'll try anyway.) | |
5836 | ||
5837 | EOM | |
5838 | dflt=4 | |
8e07c86e AD |
5839 | rp="What is the size of an integer (in bytes)?" |
5840 | . ./myread | |
5841 | intsize="$ans" | |
24fef2a7 AD |
5842 | dflt=$intsize |
5843 | rp="What is the size of a long integer (in bytes)?" | |
5844 | . ./myread | |
5845 | longsize="$ans" | |
5846 | dflt=2 | |
5847 | rp="What is the size of a short integer (in bytes)?" | |
5848 | . ./myread | |
5849 | shortsize="$ans" | |
a0d0e21e LW |
5850 | fi |
5851 | ;; | |
a0d0e21e | 5852 | esac |
24fef2a7 | 5853 | $rm -f intsize intsize.[co] intsize.out |
a0d0e21e | 5854 | |
ecfc5424 | 5855 | : see if signal is declared as pointer to function returning int or void |
a0d0e21e | 5856 | echo " " |
ecfc5424 AD |
5857 | xxx=`./findhdr signal.h` |
5858 | $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null | |
5859 | if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
5860 | echo "You have int (*signal())() instead of void." >&4 | |
5861 | val="$undef" | |
5862 | elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then | |
5863 | echo "You have void (*signal())() instead of int." >&4 | |
5864 | val="$define" | |
5865 | elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then | |
5866 | echo "You have int (*signal())() instead of void." >&4 | |
5867 | val="$undef" | |
a0d0e21e | 5868 | else |
ecfc5424 AD |
5869 | case "$d_voidsig" in |
5870 | '') | |
5871 | echo "I can't determine whether signal handler returns void or int..." >&4 | |
5872 | dflt=void | |
5873 | rp="What type does your signal handler return?" | |
5874 | . ./myread | |
5875 | case "$ans" in | |
5876 | v*) val="$define";; | |
5877 | *) val="$undef";; | |
5878 | esac;; | |
5879 | "$define") | |
5880 | echo "As you already told me, signal handler returns void." >&4;; | |
5881 | *) | |
5882 | echo "As you already told me, signal handler returns int." >&4;; | |
5883 | esac | |
5884 | fi | |
5885 | set d_voidsig | |
5886 | eval $setvar | |
5887 | case "$d_voidsig" in | |
5888 | "$define") signal_t="void";; | |
5889 | *) signal_t="int";; | |
5890 | esac | |
5891 | $rm -f $$.tmp | |
5892 | ||
5893 | : check for ability to cast large floats to 32-bit ints. | |
5894 | echo " " | |
5895 | echo 'Checking whether your C compiler can cast large floats to int32.' >&4 | |
5896 | if $test "$intsize" -eq 4; then | |
5897 | xxx=int | |
5898 | else | |
5899 | xxx=long | |
5900 | fi | |
5901 | $cat >try.c <<EOCP | |
5902 | #include <sys/types.h> | |
5903 | #include <signal.h> | |
5904 | $signal_t blech() { exit(3); } | |
5905 | main() | |
2304df62 | 5906 | { |
a0d0e21e | 5907 | $xxx i32; |
2304df62 AD |
5908 | double f; |
5909 | int result = 0; | |
5910 | signal(SIGFPE, blech); | |
5911 | ||
5912 | f = (double) 0x7fffffff; | |
5913 | f = 10 * f; | |
a0d0e21e | 5914 | i32 = ($xxx) f; |
2304df62 | 5915 | |
a0d0e21e | 5916 | if (i32 != ($xxx) f) |
2304df62 AD |
5917 | result |= 1; |
5918 | exit(result); | |
5919 | } | |
5920 | EOCP | |
5921 | if $cc -o try $ccflags try.c >/dev/null 2>&1; then | |
5922 | ./try | |
5923 | yyy=$? | |
5924 | else | |
a0d0e21e | 5925 | echo "(I can't seem to compile the test program--assuming it can't)" |
2304df62 AD |
5926 | yyy=1 |
5927 | fi | |
5928 | case "$yyy" in | |
5929 | 0) val="$define" | |
5930 | echo "Yup, it can." | |
5931 | ;; | |
5932 | *) val="$undef" | |
5933 | echo "Nope, it can't." | |
5934 | ;; | |
5935 | esac | |
5936 | set d_casti32 | |
5937 | eval $setvar | |
85e6fe83 | 5938 | $rm -f try try.* |
a0d0e21e | 5939 | |
2304df62 AD |
5940 | : check for ability to cast negative floats to unsigned |
5941 | echo " " | |
5942 | echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4 | |
ecfc5424 AD |
5943 | $cat >try.c <<EOCP |
5944 | #include <sys/types.h> | |
2304df62 | 5945 | #include <signal.h> |
232e078e AD |
5946 | $signal_t blech() { exit(7); } |
5947 | $signal_t blech_in_list() { exit(4); } | |
5948 | unsigned long dummy_long(p) unsigned long p; { return p; } | |
5949 | unsigned int dummy_int(p) unsigned int p; { return p; } | |
5950 | unsigned short dummy_short(p) unsigned short p; { return p; } | |
2304df62 AD |
5951 | main() |
5952 | { | |
232e078e | 5953 | double f = -123.; |
2304df62 AD |
5954 | unsigned long along; |
5955 | unsigned int aint; | |
5956 | unsigned short ashort; | |
5957 | int result = 0; | |
5958 | ||
5959 | signal(SIGFPE, blech); | |
5960 | along = (unsigned long)f; | |
5961 | aint = (unsigned int)f; | |
5962 | ashort = (unsigned short)f; | |
5963 | if (along != (unsigned long)-123) | |
5964 | result |= 1; | |
5965 | if (aint != (unsigned int)-123) | |
5966 | result |= 1; | |
5967 | if (ashort != (unsigned short)-123) | |
5968 | result |= 1; | |
5969 | f = (double)0x40000000; | |
5970 | f = f + f; | |
5971 | along = 0; | |
5972 | along = (unsigned long)f; | |
5973 | if (along != 0x80000000) | |
5974 | result |= 2; | |
5975 | f -= 1.; | |
5976 | along = 0; | |
5977 | along = (unsigned long)f; | |
5978 | if (along != 0x7fffffff) | |
5979 | result |= 1; | |
5980 | f += 2.; | |
5981 | along = 0; | |
5982 | along = (unsigned long)f; | |
5983 | if (along != 0x80000001) | |
5984 | result |= 2; | |
232e078e AD |
5985 | if (result) |
5986 | exit(result); | |
5987 | signal(SIGFPE, blech_in_list); | |
5988 | f = 123.; | |
5989 | along = dummy_long((unsigned long)f); | |
5990 | aint = dummy_int((unsigned int)f); | |
5991 | ashort = dummy_short((unsigned short)f); | |
5992 | if (along != (unsigned long)123) | |
5993 | result |= 4; | |
5994 | if (aint != (unsigned int)123) | |
5995 | result |= 4; | |
5996 | if (ashort != (unsigned short)123) | |
5997 | result |= 4; | |
2304df62 AD |
5998 | exit(result); |
5999 | ||
6000 | } | |
6001 | EOCP | |
6002 | if $cc -o try $ccflags try.c >/dev/null 2>&1; then | |
6003 | ./try | |
6004 | castflags=$? | |
6005 | else | |
ecfc5424 | 6006 | echo "(I can't seem to compile the test program--assuming it can't)" |
232e078e | 6007 | castflags=7 |
2304df62 AD |
6008 | fi |
6009 | case "$castflags" in | |
6010 | 0) val="$define" | |
6011 | echo "Yup, it can." | |
6012 | ;; | |
6013 | *) val="$undef" | |
6014 | echo "Nope, it can't." | |
6015 | ;; | |
6016 | esac | |
6017 | set d_castneg | |
6018 | eval $setvar | |
6019 | $rm -f try.* | |
6020 | ||
2304df62 AD |
6021 | : see if vprintf exists |
6022 | echo " " | |
6023 | if set vprintf val -f d_vprintf; eval $csym; $val; then | |
6024 | echo 'vprintf() found.' >&4 | |
6025 | val="$define" | |
6026 | $cat >vprintf.c <<'EOF' | |
6027 | #include <varargs.h> | |
6028 | ||
6029 | main() { xxx("foo"); } | |
6030 | ||
6031 | xxx(va_alist) | |
6032 | va_dcl | |
6033 | { | |
6034 | va_list args; | |
6035 | char buf[10]; | |
6036 | ||
6037 | va_start(args); | |
6038 | exit((unsigned long)vsprintf(buf,"%s",args) > 10L); | |
6039 | } | |
6040 | EOF | |
6041 | if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then | |
6042 | echo "Your vsprintf() returns (int)." >&4 | |
6043 | val2="$undef" | |
6044 | else | |
6045 | echo "Your vsprintf() returns (char*)." >&4 | |
6046 | val2="$define" | |
6047 | fi | |
6048 | else | |
6049 | echo 'vprintf() NOT found.' >&4 | |
6050 | val="$undef" | |
6051 | val2="$undef" | |
6052 | fi | |
6053 | set d_vprintf | |
6054 | eval $setvar | |
6055 | val=$val2 | |
6056 | set d_charvspr | |
6057 | eval $setvar | |
6058 | ||
a0d0e21e LW |
6059 | : see if chown exists |
6060 | set chown d_chown | |
6061 | eval $inlibc | |
6062 | ||
6063 | : see if chroot exists | |
6064 | set chroot d_chroot | |
6065 | eval $inlibc | |
6066 | ||
2304df62 AD |
6067 | : see if chsize exists |
6068 | set chsize d_chsize | |
6069 | eval $inlibc | |
6070 | ||
6071 | : check for const keyword | |
6072 | echo " " | |
6073 | echo 'Checking to see if your C compiler knows about "const"...' >&4 | |
6074 | $cat >const.c <<'EOCP' | |
6075 | typedef struct spug { int drokk; } spug; | |
6076 | main() | |
6077 | { | |
6078 | const char *foo; | |
6079 | const spug y; | |
6080 | } | |
6081 | EOCP | |
6082 | if $cc -c $ccflags const.c >/dev/null 2>&1 ; then | |
6083 | val="$define" | |
6084 | echo "Yup, it does." | |
6085 | else | |
6086 | val="$undef" | |
6087 | echo "Nope, it doesn't." | |
6088 | fi | |
6089 | set d_const | |
6090 | eval $setvar | |
6091 | ||
6092 | : see if crypt exists | |
6093 | echo " " | |
6094 | if set crypt val -f d_crypt; eval $csym; $val; then | |
6095 | echo 'crypt() found.' >&4 | |
6096 | val="$define" | |
6097 | cryptlib='' | |
6098 | else | |
5f05dabc | 6099 | cryptlib=`./loc Slibcrypt$lib_ext "" $xlibpth` |
2304df62 | 6100 | if $test -z "$cryptlib"; then |
5f05dabc | 6101 | cryptlib=`./loc Mlibcrypt$lib_ext "" $xlibpth` |
2304df62 AD |
6102 | else |
6103 | cryptlib=-lcrypt | |
6104 | fi | |
6105 | if $test -z "$cryptlib"; then | |
5f05dabc | 6106 | cryptlib=`./loc Llibcrypt$lib_ext "" $xlibpth` |
2304df62 AD |
6107 | else |
6108 | cryptlib=-lcrypt | |
6109 | fi | |
6110 | if $test -z "$cryptlib"; then | |
5f05dabc | 6111 | cryptlib=`./loc libcrypt$lib_ext "" $libpth` |
2304df62 AD |
6112 | else |
6113 | cryptlib=-lcrypt | |
6114 | fi | |
6115 | if $test -z "$cryptlib"; then | |
6116 | echo 'crypt() NOT found.' >&4 | |
6117 | val="$undef" | |
6118 | else | |
6119 | val="$define" | |
6120 | fi | |
6121 | fi | |
6122 | set d_crypt | |
6123 | eval $setvar | |
6124 | ||
6125 | : get csh whereabouts | |
6126 | case "$csh" in | |
ba7b5225 | 6127 | 'csh') val="$undef" ;; |
ba7b5225 | 6128 | *) val="$define" ;; |
2304df62 AD |
6129 | esac |
6130 | set d_csh | |
6131 | eval $setvar | |
46fc3d4c | 6132 | : Respect a hint or command line value for full_csh. |
6133 | case "$full_csh" in | |
6134 | '') full_csh=$csh ;; | |
6135 | esac | |
2304df62 | 6136 | |
a0d0e21e LW |
6137 | : see if cuserid exists |
6138 | set cuserid d_cuserid | |
2304df62 AD |
6139 | eval $inlibc |
6140 | ||
a0d0e21e LW |
6141 | : see if this is a limits.h system |
6142 | set limits.h i_limits | |
85e6fe83 LW |
6143 | eval $inhdr |
6144 | ||
a0d0e21e LW |
6145 | : see if this is a float.h system |
6146 | set float.h i_float | |
6147 | eval $inhdr | |
6148 | ||
6149 | : See if number of significant digits in a double precision number is known | |
6150 | echo " " | |
6151 | $cat >dbl_dig.c <<EOM | |
6152 | #$i_limits I_LIMITS | |
6153 | #$i_float I_FLOAT | |
6154 | #ifdef I_LIMITS | |
6155 | #include <limits.h> | |
85e6fe83 | 6156 | #endif |
a0d0e21e LW |
6157 | #ifdef I_FLOAT |
6158 | #include <float.h> | |
6159 | #endif | |
6160 | #ifdef DBL_DIG | |
6161 | printf("Contains DBL_DIG"); | |
85e6fe83 | 6162 | #endif |
85e6fe83 | 6163 | EOM |
a0d0e21e LW |
6164 | $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null |
6165 | if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then | |
6166 | echo "DBL_DIG found." >&4 | |
6167 | val="$define" | |
2304df62 | 6168 | else |
a0d0e21e LW |
6169 | echo "DBL_DIG NOT found." >&4 |
6170 | val="$undef" | |
2304df62 | 6171 | fi |
a0d0e21e LW |
6172 | $rm -f dbl_dig.? |
6173 | set d_dbl_dig | |
2304df62 | 6174 | eval $setvar |
2304df62 | 6175 | |
a0d0e21e LW |
6176 | : see if difftime exists |
6177 | set difftime d_difftime | |
2304df62 AD |
6178 | eval $inlibc |
6179 | ||
a0d0e21e LW |
6180 | : see if this is a dirent system |
6181 | echo " " | |
6182 | if xinc=`./findhdr dirent.h`; $test "$xinc"; then | |
6183 | val="$define" | |
6184 | echo "<dirent.h> found." >&4 | |
6185 | else | |
6186 | val="$undef" | |
6187 | if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then | |
6188 | echo "<sys/dir.h> found." >&4 | |
6189 | echo " " | |
6190 | else | |
6191 | xinc=`./findhdr sys/ndir.h` | |
6192 | fi | |
6193 | echo "<dirent.h> NOT found." >&4 | |
6194 | fi | |
6195 | set i_dirent | |
6196 | eval $setvar | |
6197 | ||
6198 | : Look for type of directory structure. | |
6199 | echo " " | |
6200 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
6201 | ||
6202 | case "$direntrytype" in | |
6203 | ''|' ') | |
6204 | case "$i_dirent" in | |
6205 | $define) guess1='struct dirent' ;; | |
6206 | *) guess1='struct direct' ;; | |
2afac517 | 6207 | esac |
6208 | ;; | |
6209 | *) guess1="$direntrytype" | |
6210 | ;; | |
8e07c86e AD |
6211 | esac |
6212 | ||
2afac517 | 6213 | case "$guess1" in |
6214 | 'struct dirent') guess2='struct direct' ;; | |
6215 | *) guess2='struct dirent' ;; | |
6216 | esac | |
6217 | ||
6218 | if $contains "$guess1" try.c >/dev/null 2>&1; then | |
6219 | direntrytype="$guess1" | |
6220 | echo "Your directory entries are $direntrytype." >&4 | |
6221 | elif $contains "$guess2" try.c >/dev/null 2>&1; then | |
6222 | direntrytype="$guess2" | |
6223 | echo "Your directory entries seem to be $direntrytype." >&4 | |
6224 | else | |
6225 | echo "I don't recognize your system's directory entries." >&4 | |
6226 | rp="What type is used for directory entries on this system?" | |
6227 | dflt="$guess1" | |
6228 | . ./myread | |
6229 | direntrytype="$ans" | |
6230 | fi | |
6231 | $rm -f try.c | |
a0d0e21e | 6232 | |
a0d0e21e | 6233 | |
2afac517 | 6234 | : see if the directory entry stores field length |
6235 | echo " " | |
6236 | $cppstdin $cppflags $cppminus < "$xinc" > try.c | |
6237 | if $contains 'd_namlen' try.c >/dev/null 2>&1; then | |
6238 | echo "Good, your directory entry keeps length information in d_namlen." >&4 | |
6239 | val="$define" | |
6240 | else | |
6241 | echo "Your directory entry does not know about the d_namlen field." >&4 | |
6242 | val="$undef" | |
6243 | fi | |
6244 | set d_dirnamlen | |
6245 | eval $setvar | |
6246 | $rm -f try.c | |
a0d0e21e | 6247 | |
2afac517 | 6248 | : see if dlerror exists |
6249 | xxx_runnm="$runnm" | |
6250 | runnm=false | |
6251 | set dlerror d_dlerror | |
6252 | eval $inlibc | |
6253 | runnm="$xxx_runnm" | |
a0d0e21e LW |
6254 | |
6255 | : see if dlfcn is available | |
6256 | set dlfcn.h i_dlfcn | |
6257 | eval $inhdr | |
6258 | ||
6259 | case "$usedl" in | |
6260 | $define|y|true) | |
6261 | $cat << EOM | |
6262 | ||
6263 | On a few systems, the dynamically loaded modules that perl generates and uses | |
6264 | will need a different extension then shared libs. The default will probably | |
6265 | be appropriate. | |
6266 | ||
6267 | EOM | |
6268 | case "$dlext" in | |
6269 | '') dflt="$so" ;; | |
6270 | *) dflt="$dlext" ;; | |
6271 | esac | |
6272 | rp='What is the extension of dynamically loaded modules' | |
6273 | . ./myread | |
6274 | dlext="$ans" | |
6275 | ;; | |
6276 | *) | |
6277 | dlext="none" | |
6278 | ;; | |
6279 | esac | |
6280 | ||
6281 | : Check if dlsym need a leading underscore | |
6282 | echo " " | |
6283 | val="$undef" | |
6284 | ||
6285 | case "$dlsrc" in | |
6286 | dl_dlopen.xs) | |
6287 | echo "Checking whether your dlsym() needs a leading underscore ..." >&4 | |
6288 | $cat >dyna.c <<'EOM' | |
6289 | fred () { } | |
6290 | EOM | |
6291 | ||
6292 | $cat >fred.c<<EOM | |
6293 | ||
6294 | #include <stdio.h> | |
6295 | #$i_dlfcn I_DLFCN | |
6296 | #ifdef I_DLFCN | |
6297 | #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */ | |
6298 | #else | |
6299 | #include <sys/types.h> | |
6300 | #include <nlist.h> | |
6301 | #include <link.h> | |
6302 | #endif | |
6303 | ||
6304 | extern int fred() ; | |
6305 | ||
6306 | main() | |
6307 | { | |
6308 | void * handle ; | |
6309 | void * symbol ; | |
6310 | #ifndef RTLD_LAZY | |
6311 | int mode = 1 ; | |
6312 | #else | |
6313 | int mode = RTLD_LAZY ; | |
6314 | #endif | |
6315 | handle = dlopen("./dyna.$dlext", mode) ; | |
6316 | if (handle == NULL) { | |
5f05dabc | 6317 | printf ("1\n") ; |
6318 | fflush (stdout) ; | |
6319 | exit(0); | |
a0d0e21e LW |
6320 | } |
6321 | symbol = dlsym(handle, "fred") ; | |
6322 | if (symbol == NULL) { | |
5f05dabc | 6323 | /* try putting a leading underscore */ |
6324 | symbol = dlsym(handle, "_fred") ; | |
6325 | if (symbol == NULL) { | |
6326 | printf ("2\n") ; | |
6327 | fflush (stdout) ; | |
6328 | exit(0); | |
6329 | } | |
6330 | printf ("3\n") ; | |
a0d0e21e LW |
6331 | } |
6332 | else | |
5f05dabc | 6333 | printf ("4\n") ; |
36477c24 | 6334 | fflush (stdout) ; |
6335 | exit(0); | |
a0d0e21e LW |
6336 | } |
6337 | EOM | |
760ac839 | 6338 | : Call the object file tmp-dyna.o in case dlext=o. |
a0d0e21e | 6339 | if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && |
8ff267be | 6340 | mv dyna${obj_ext} tmp-dyna${obj_ext} > /dev/null 2>&1 && |
6341 | $ld $lddlflags -o dyna.$dlext tmp-dyna${obj_ext} > /dev/null 2>&1 && | |
a0d0e21e LW |
6342 | $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then |
6343 | xxx=`./fred` | |
6344 | case $xxx in | |
6345 | 1) echo "Test program failed using dlopen." >&4 | |
6346 | echo "Perhaps you should not use dynamic loading." >&4;; | |
6347 | 2) echo "Test program failed using dlsym." >&4 | |
6348 | echo "Perhaps you should not use dynamic loading." >&4;; | |
6349 | 3) echo "dlsym needs a leading underscore" >&4 | |
6350 | val="$define" ;; | |
6351 | 4) echo "dlsym doesn't need a leading underscore." >&4;; | |
6352 | esac | |
6353 | else | |
6354 | echo "I can't compile and run the test program." >&4 | |
6355 | fi | |
6356 | ;; | |
6357 | esac | |
6358 | ||
a78b0d02 | 6359 | $rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.? |
a0d0e21e LW |
6360 | |
6361 | set d_dlsymun | |
6362 | eval $setvar | |
6363 | ||
a0d0e21e LW |
6364 | : see if dup2 exists |
6365 | set dup2 d_dup2 | |
6366 | eval $inlibc | |
6367 | ||
8e07c86e AD |
6368 | : Locate the flags for 'open()' |
6369 | echo " " | |
6370 | $cat >open3.c <<'EOCP' | |
6371 | #include <sys/types.h> | |
6372 | #ifdef I_FCNTL | |
6373 | #include <fcntl.h> | |
6374 | #endif | |
6375 | #ifdef I_SYS_FILE | |
6376 | #include <sys/file.h> | |
6377 | #endif | |
6378 | main() { | |
6379 | if(O_RDONLY); | |
6380 | #ifdef O_TRUNC | |
6381 | exit(0); | |
6382 | #else | |
6383 | exit(1); | |
6384 | #endif | |
6385 | } | |
6386 | EOCP | |
6387 | : check sys/file.h first to get FREAD on Sun | |
6388 | if $test `./findhdr sys/file.h` && \ | |
90248788 | 6389 | $cc $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then |
8e07c86e AD |
6390 | h_sysfile=true; |
6391 | echo "<sys/file.h> defines the O_* constants..." >&4 | |
6392 | if ./open3; then | |
6393 | echo "and you have the 3 argument form of open()." >&4 | |
6394 | val="$define" | |
6395 | else | |
6396 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
6397 | val="$undef" | |
6398 | fi | |
6399 | elif $test `./findhdr fcntl.h` && \ | |
90248788 | 6400 | $cc $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then |
8e07c86e AD |
6401 | h_fcntl=true; |
6402 | echo "<fcntl.h> defines the O_* constants..." >&4 | |
6403 | if ./open3; then | |
6404 | echo "and you have the 3 argument form of open()." >&4 | |
6405 | val="$define" | |
6406 | else | |
6407 | echo "but not the 3 argument form of open(). Oh, well." >&4 | |
6408 | val="$undef" | |
6409 | fi | |
6410 | else | |
6411 | val="$undef" | |
6412 | echo "I can't find the O_* constant definitions! You got problems." >&4 | |
6413 | fi | |
6414 | set d_open3 | |
6415 | eval $setvar | |
6416 | $rm -f open3* | |
6417 | ||
6418 | : check for non-blocking I/O stuff | |
6419 | case "$h_sysfile" in | |
6420 | true) echo "#include <sys/file.h>" > head.c;; | |
6421 | *) | |
6422 | case "$h_fcntl" in | |
6423 | true) echo "#include <fcntl.h>" > head.c;; | |
6424 | *) echo "#include <sys/fcntl.h>" > head.c;; | |
6425 | esac | |
6426 | ;; | |
6427 | esac | |
6428 | echo " " | |
6429 | echo "Figuring out the flag used by open() for non-blocking I/O..." >&4 | |
6430 | case "$o_nonblock" in | |
6431 | '') | |
6432 | $cat head.c > try.c | |
6433 | $cat >>try.c <<'EOCP' | |
6434 | main() { | |
6435 | #ifdef O_NONBLOCK | |
6436 | printf("O_NONBLOCK\n"); | |
6437 | exit(0); | |
6438 | #endif | |
6439 | #ifdef O_NDELAY | |
6440 | printf("O_NDELAY\n"); | |
6441 | exit(0); | |
6442 | #endif | |
6443 | #ifdef FNDELAY | |
6444 | printf("FNDELAY\n"); | |
6445 | exit(0); | |
6446 | #endif | |
6447 | exit(0); | |
6448 | } | |
6449 | EOCP | |
6450 | if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then | |
6451 | o_nonblock=`./try` | |
6452 | case "$o_nonblock" in | |
6453 | '') echo "I can't figure it out, assuming O_NONBLOCK will do.";; | |
6454 | *) echo "Seems like we can use $o_nonblock.";; | |
6455 | esac | |
6456 | else | |
6457 | echo "(I can't compile the test program; pray O_NONBLOCK is right!)" | |
6458 | fi | |
6459 | ;; | |
6460 | *) echo "Using $hint value $o_nonblock.";; | |
6461 | esac | |
6462 | $rm -f try try.* .out core | |
6463 | ||
6464 | echo " " | |
6465 | echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4 | |
6466 | case "$eagain" in | |
6467 | '') | |
6468 | $cat head.c > try.c | |
6469 | $cat >>try.c <<EOCP | |
6470 | #include <errno.h> | |
6471 | #include <sys/types.h> | |
6472 | #include <signal.h> | |
4633a7c4 | 6473 | #define MY_O_NONBLOCK $o_nonblock |
8e07c86e AD |
6474 | extern int errno; |
6475 | $signal_t blech(x) int x; { exit(3); } | |
4633a7c4 LW |
6476 | EOCP |
6477 | $cat >> try.c <<'EOCP' | |
8e07c86e AD |
6478 | main() |
6479 | { | |
6480 | int pd[2]; | |
6481 | int pu[2]; | |
6482 | char buf[1]; | |
6483 | char string[100]; | |
6484 | ||
6485 | pipe(pd); /* Down: child -> parent */ | |
6486 | pipe(pu); /* Up: parent -> child */ | |
6487 | if (0 != fork()) { | |
6488 | int ret; | |
6489 | close(pd[1]); /* Parent reads from pd[0] */ | |
6490 | close(pu[0]); /* Parent writes (blocking) to pu[1] */ | |
4633a7c4 | 6491 | if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK)) |
8e07c86e AD |
6492 | exit(1); |
6493 | signal(SIGALRM, blech); | |
6494 | alarm(5); | |
6495 | if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */ | |
6496 | exit(2); | |
6497 | sprintf(string, "%d\n", ret); | |
6498 | write(2, string, strlen(string)); | |
6499 | alarm(0); | |
6500 | #ifdef EAGAIN | |
6501 | if (errno == EAGAIN) { | |
6502 | printf("EAGAIN\n"); | |
6503 | goto ok; | |
6504 | } | |
6505 | #endif | |
6506 | #ifdef EWOULDBLOCK | |
6507 | if (errno == EWOULDBLOCK) | |
6508 | printf("EWOULDBLOCK\n"); | |
6509 | #endif | |
6510 | ok: | |
6511 | write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */ | |
6512 | sleep(2); /* Give it time to close our pipe */ | |
6513 | alarm(5); | |
6514 | ret = read(pd[0], buf, 1); /* Should read EOF */ | |
6515 | alarm(0); | |
6516 | sprintf(string, "%d\n", ret); | |
6517 | write(3, string, strlen(string)); | |
6518 | exit(0); | |
6519 | } | |
6520 | ||
6521 | close(pd[0]); /* We write to pd[1] */ | |
6522 | close(pu[1]); /* We read from pu[0] */ | |
6523 | read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */ | |
6524 | close(pd[1]); /* Pipe pd is now fully closed! */ | |
6525 | exit(0); /* Bye bye, thank you for playing! */ | |
6526 | } | |
6527 | EOCP | |
25f94b33 | 6528 | if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then |
774d564b | 6529 | echo "$startsh" >mtry |
40a7a20a | 6530 | echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry |
8e07c86e AD |
6531 | chmod +x mtry |
6532 | ./mtry >/dev/null 2>&1 | |
6533 | case $? in | |
6534 | 0) eagain=`$cat try.out`;; | |
6535 | 1) echo "Could not perform non-blocking setting!";; | |
6536 | 2) echo "I did a successful read() for something that was not there!";; | |
6537 | 3) echo "Hmm... non-blocking I/O does not seem to be working!";; | |
6538 | *) echo "Something terribly wrong happened during testing.";; | |
6539 | esac | |
6540 | rd_nodata=`$cat try.ret` | |
6541 | echo "A read() system call with no data present returns $rd_nodata." | |
6542 | case "$rd_nodata" in | |
6543 | 0|-1) ;; | |
6544 | *) | |
6545 | echo "(That's peculiar, fixing that to be -1.)" | |
6546 | rd_nodata=-1 | |
6547 | ;; | |
6548 | esac | |
6549 | case "$eagain" in | |
6550 | '') | |
6551 | echo "Forcing errno EAGAIN on read() with no data available." | |
6552 | eagain=EAGAIN | |
6553 | ;; | |
6554 | *) | |
6555 | echo "Your read() sets errno to $eagain when no data is available." | |
6556 | ;; | |
6557 | esac | |
6558 | status=`$cat try.err` | |
6559 | case "$status" in | |
6560 | 0) echo "And it correctly returns 0 to signal EOF.";; | |
6561 | -1) echo "But it also returns -1 to signal EOF, so be careful!";; | |
6562 | *) echo "However, your read() returns '$status' on EOF??";; | |
6563 | esac | |
6564 | val="$define" | |
28757baa | 6565 | if test "$status" = "$rd_nodata"; then |
8e07c86e AD |
6566 | echo "WARNING: you can't distinguish between EOF and no data!" |
6567 | val="$undef" | |
6568 | fi | |
6569 | else | |
6570 | echo "I can't compile the test program--assuming errno EAGAIN will do." | |
6571 | eagain=EAGAIN | |
6572 | fi | |
6573 | set d_eofnblk | |
6574 | eval $setvar | |
6575 | ;; | |
6576 | *) | |
6577 | echo "Using $hint value $eagain." | |
6578 | echo "Your read() returns $rd_nodata when no data is present." | |
6579 | case "$d_eofnblk" in | |
6580 | "$define") echo "And you can see EOF because read() returns 0.";; | |
6581 | "$undef") echo "But you can't see EOF status from read() returned value.";; | |
6582 | *) | |
6583 | echo "(Assuming you can't see EOF status from read anyway.)" | |
6584 | d_eofnblk=$undef | |
6585 | ;; | |
6586 | esac | |
6587 | ;; | |
6588 | esac | |
6589 | $rm -f try try.* .out core head.c mtry | |
6590 | ||
a0d0e21e LW |
6591 | : see if fchmod exists |
6592 | set fchmod d_fchmod | |
6593 | eval $inlibc | |
6594 | ||
6595 | : see if fchown exists | |
6596 | set fchown d_fchown | |
6597 | eval $inlibc | |
6598 | ||
6599 | : see if this is an fcntl system | |
6600 | set fcntl d_fcntl | |
6601 | eval $inlibc | |
6602 | ||
6603 | : see if fgetpos exists | |
6604 | set fgetpos d_fgetpos | |
6605 | eval $inlibc | |
6606 | ||
a0d0e21e LW |
6607 | : see if flock exists |
6608 | set flock d_flock | |
6609 | eval $inlibc | |
6610 | ||
a0d0e21e LW |
6611 | : see if fork exists |
6612 | set fork d_fork | |
6613 | eval $inlibc | |
6614 | ||
6615 | : see if pathconf exists | |
6616 | set pathconf d_pathconf | |
6617 | eval $inlibc | |
6618 | ||
6619 | : see if fpathconf exists | |
6620 | set fpathconf d_fpathconf | |
6621 | eval $inlibc | |
6622 | ||
6623 | : see if fsetpos exists | |
6624 | set fsetpos d_fsetpos | |
6625 | eval $inlibc | |
6626 | ||
6627 | : see if gethostent exists | |
6628 | set gethostent d_gethent | |
6629 | eval $inlibc | |
6630 | ||
6631 | : see if getlogin exists | |
6632 | set getlogin d_getlogin | |
6633 | eval $inlibc | |
6634 | ||
2afac517 | 6635 | : see if getpgid exists |
6636 | set getpgid d_getpgid | |
a0d0e21e LW |
6637 | eval $inlibc |
6638 | ||
6639 | : see if getpgrp2 exists | |
6640 | set getpgrp2 d_getpgrp2 | |
6641 | eval $inlibc | |
6642 | ||
6643 | : see if getppid exists | |
6644 | set getppid d_getppid | |
6645 | eval $inlibc | |
6646 | ||
6647 | : see if getpriority exists | |
6648 | set getpriority d_getprior | |
6649 | eval $inlibc | |
6650 | ||
5f05dabc | 6651 | : see if gettimeofday or ftime exists |
6652 | set gettimeofday d_gettimeod | |
6653 | eval $inlibc | |
6654 | case "$d_gettimeod" in | |
6655 | "$undef") | |
6656 | set ftime d_ftime | |
6657 | eval $inlibc | |
6658 | ;; | |
6659 | *) | |
6660 | val="$undef"; set d_ftime; eval $setvar | |
6661 | ;; | |
6662 | esac | |
6663 | case "$d_gettimeod$d_ftime" in | |
6664 | "$undef$undef") | |
6665 | echo " " | |
6666 | echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4 | |
6667 | ;; | |
6668 | esac | |
6669 | ||
a0d0e21e LW |
6670 | : see if this is a netinet/in.h or sys/in.h system |
6671 | set netinet/in.h i_niin sys/in.h i_sysin | |
6672 | eval $inhdr | |
6673 | ||
6674 | : see if htonl --and friends-- exists | |
6675 | val='' | |
6676 | set htonl val | |
6677 | eval $inlibc | |
6678 | ||
6679 | : Maybe they are macros. | |
6680 | case "$val" in | |
6681 | $undef) | |
6682 | $cat >htonl.c <<EOM | |
6683 | #include <stdio.h> | |
6684 | #include <sys/types.h> | |
6685 | #$i_niin I_NETINET_IN | |
6686 | #$i_sysin I_SYS_IN | |
6687 | #ifdef I_NETINET_IN | |
6688 | #include <netinet/in.h> | |
6689 | #endif | |
6690 | #ifdef I_SYS_IN | |
6691 | #include <sys/in.h> | |
6692 | #endif | |
6693 | #ifdef htonl | |
6694 | printf("Defined as a macro."); | |
6695 | #endif | |
6696 | EOM | |
6697 | $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null | |
6698 | if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then | |
6699 | val="$define" | |
6700 | echo "But it seems to be defined as a macro." >&4 | |
6701 | fi | |
6702 | $rm -f htonl.? | |
6703 | ;; | |
6704 | esac | |
6705 | set d_htonl | |
6706 | eval $setvar | |
6707 | ||
6708 | : see which of string.h or strings.h is needed | |
6709 | echo " " | |
6710 | strings=`./findhdr string.h` | |
6711 | if $test "$strings" && $test -r "$strings"; then | |
6712 | echo "Using <string.h> instead of <strings.h>." >&4 | |
6713 | val="$define" | |
6714 | else | |
6715 | val="$undef" | |
6716 | strings=`./findhdr strings.h` | |
6717 | if $test "$strings" && $test -r "$strings"; then | |
6718 | echo "Using <strings.h> instead of <string.h>." >&4 | |
6719 | else | |
6720 | echo "No string header found -- You'll surely have problems." >&4 | |
6721 | fi | |
6722 | fi | |
6723 | set i_string | |
6724 | eval $setvar | |
6725 | case "$i_string" in | |
6726 | "$undef") strings=`./findhdr strings.h`;; | |
6727 | *) strings=`./findhdr string.h`;; | |
6728 | esac | |
6729 | ||
6730 | : index or strchr | |
6731 | echo " " | |
6732 | if set index val -f; eval $csym; $val; then | |
6733 | if set strchr val -f d_strchr; eval $csym; $val; then | |
6734 | if $contains strchr "$strings" >/dev/null 2>&1 ; then | |
6735 | val="$define" | |
6736 | vali="$undef" | |
6737 | echo "strchr() found." >&4 | |
6738 | else | |
6739 | val="$undef" | |
6740 | vali="$define" | |
6741 | echo "index() found." >&4 | |
6742 | fi | |
6743 | else | |
6744 | val="$undef" | |
6745 | vali="$define" | |
6746 | echo "index() found." >&4 | |
6747 | fi | |
6748 | else | |
6749 | if set strchr val -f d_strchr; eval $csym; $val; then | |
6750 | val="$define" | |
6751 | vali="$undef" | |
6752 | echo "strchr() found." >&4 | |
6753 | else | |
6754 | echo "No index() or strchr() found!" >&4 | |
6755 | val="$undef" | |
6756 | vali="$undef" | |
6757 | fi | |
6758 | fi | |
6759 | set d_strchr; eval $setvar | |
6760 | val="$vali" | |
6761 | set d_index; eval $setvar | |
6762 | ||
7e1af8bc | 6763 | : check whether inet_aton exists |
6764 | set inet_aton d_inetaton | |
6765 | eval $inlibc | |
6766 | ||
a0d0e21e LW |
6767 | : Look for isascii |
6768 | echo " " | |
6769 | $cat >isascii.c <<'EOCP' | |
6770 | #include <stdio.h> | |
6771 | #include <ctype.h> | |
6772 | main() { | |
6773 | int c = 'A'; | |
6774 | if (isascii(c)) | |
6775 | exit(0); | |
6776 | else | |
6777 | exit(1); | |
6778 | } | |
6779 | EOCP | |
6780 | if $cc $ccflags $ldflags -o isascii isascii.c $libs >/dev/null 2>&1 ; then | |
6781 | echo "isascii() found." >&4 | |
6782 | val="$define" | |
6783 | else | |
6784 | echo "isascii() NOT found." >&4 | |
6785 | val="$undef" | |
6786 | fi | |
6787 | set d_isascii | |
6788 | eval $setvar | |
6789 | $rm -f isascii* | |
6790 | ||
6791 | : see if killpg exists | |
6792 | set killpg d_killpg | |
6793 | eval $inlibc | |
6794 | ||
6795 | : see if link exists | |
6796 | set link d_link | |
6797 | eval $inlibc | |
6798 | ||
a0d0e21e LW |
6799 | : see if localeconv exists |
6800 | set localeconv d_locconv | |
6801 | eval $inlibc | |
6802 | ||
6803 | : see if lockf exists | |
6804 | set lockf d_lockf | |
6805 | eval $inlibc | |
6806 | ||
6807 | : see if lstat exists | |
6808 | set lstat d_lstat | |
6809 | eval $inlibc | |
6810 | ||
6811 | : see if mblen exists | |
6812 | set mblen d_mblen | |
6813 | eval $inlibc | |
6814 | ||
6815 | : see if mbstowcs exists | |
6816 | set mbstowcs d_mbstowcs | |
6817 | eval $inlibc | |
6818 | ||
6819 | : see if mbtowc exists | |
6820 | set mbtowc d_mbtowc | |
6821 | eval $inlibc | |
6822 | ||
6823 | : see if memcmp exists | |
6824 | set memcmp d_memcmp | |
6825 | eval $inlibc | |
6826 | ||
6827 | : see if memcpy exists | |
6828 | set memcpy d_memcpy | |
6829 | eval $inlibc | |
6830 | ||
6831 | : see if memmove exists | |
6832 | set memmove d_memmove | |
2304df62 AD |
6833 | eval $inlibc |
6834 | ||
6835 | : see if memset exists | |
6836 | set memset d_memset | |
6837 | eval $inlibc | |
6838 | ||
6839 | : see if mkdir exists | |
6840 | set mkdir d_mkdir | |
6841 | eval $inlibc | |
6842 | ||
a0d0e21e LW |
6843 | : see if mkfifo exists |
6844 | set mkfifo d_mkfifo | |
6845 | eval $inlibc | |
6846 | ||
6847 | : see if mktime exists | |
6848 | set mktime d_mktime | |
6849 | eval $inlibc | |
6850 | ||
2304df62 AD |
6851 | : see if msgctl exists |
6852 | set msgctl d_msgctl | |
6853 | eval $inlibc | |
6854 | ||
6855 | : see if msgget exists | |
6856 | set msgget d_msgget | |
6857 | eval $inlibc | |
6858 | ||
6859 | : see if msgsnd exists | |
6860 | set msgsnd d_msgsnd | |
6861 | eval $inlibc | |
6862 | ||
6863 | : see if msgrcv exists | |
6864 | set msgrcv d_msgrcv | |
6865 | eval $inlibc | |
6866 | ||
6867 | : see how much of the 'msg*(2)' library is present. | |
6868 | h_msg=true | |
6869 | echo " " | |
6870 | case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in | |
6871 | *"$undef"*) h_msg=false;; | |
6872 | esac | |
6873 | : we could also check for sys/ipc.h ... | |
6874 | if $h_msg && $test `./findhdr sys/msg.h`; then | |
6875 | echo "You have the full msg*(2) library." >&4 | |
6876 | val="$define" | |
6877 | else | |
6878 | echo "You don't have the full msg*(2) library." >&4 | |
6879 | val="$undef" | |
6880 | fi | |
6881 | set d_msg | |
6882 | eval $setvar | |
6883 | ||
a0d0e21e LW |
6884 | : see if this is a malloc.h system |
6885 | set malloc.h i_malloc | |
6886 | eval $inhdr | |
6887 | ||
94b6baf5 AD |
6888 | : see if stdlib is available |
6889 | set stdlib.h i_stdlib | |
6890 | eval $inhdr | |
6891 | ||
85e6fe83 | 6892 | : determine which malloc to compile in |
85e6fe83 LW |
6893 | echo " " |
6894 | case "$usemymalloc" in | |
a0d0e21e LW |
6895 | ''|y*|true) dflt='y' ;; |
6896 | n*|false) dflt='n' ;; | |
6897 | *) dflt="$usemymalloc" ;; | |
85e6fe83 LW |
6898 | esac |
6899 | rp="Do you wish to attempt to use the malloc that comes with $package?" | |
6900 | . ./myread | |
6901 | usemymalloc="$ans" | |
6902 | case "$ans" in | |
a0d0e21e LW |
6903 | y*|true) |
6904 | usemymalloc='y' | |
6905 | mallocsrc='malloc.c' | |
6906 | mallocobj='malloc.o' | |
6907 | d_mymalloc="$define" | |
6908 | case "$libs" in | |
6909 | *-lmalloc*) | |
6910 | : Remove malloc from list of libraries to use | |
6911 | echo "Removing unneeded -lmalloc from library list" >&4 | |
6912 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` | |
6913 | shift | |
6914 | libs="$*" | |
6915 | echo "libs = $libs" >&4 | |
6916 | ;; | |
6917 | esac | |
6918 | ;; | |
6919 | *) | |
6920 | usemymalloc='n' | |
6921 | mallocsrc='' | |
6922 | mallocobj='' | |
6923 | d_mymalloc="$undef" | |
6924 | ;; | |
85e6fe83 LW |
6925 | esac |
6926 | ||
94b6baf5 | 6927 | : compute the return types of malloc and free |
85e6fe83 | 6928 | echo " " |
94b6baf5 | 6929 | $cat >malloc.c <<END |
a0d0e21e | 6930 | #$i_malloc I_MALLOC |
94b6baf5 | 6931 | #$i_stdlib I_STDLIB |
a0d0e21e LW |
6932 | #include <stdio.h> |
6933 | #include <sys/types.h> | |
6934 | #ifdef I_MALLOC | |
85e6fe83 | 6935 | #include <malloc.h> |
a0d0e21e | 6936 | #endif |
94b6baf5 AD |
6937 | #ifdef I_STDLIB |
6938 | #include <stdlib.h> | |
6939 | #endif | |
6940 | #ifdef TRY_MALLOC | |
85e6fe83 | 6941 | void *malloc(); |
94b6baf5 AD |
6942 | #endif |
6943 | #ifdef TRY_FREE | |
6944 | void free(); | |
6945 | #endif | |
85e6fe83 | 6946 | END |
94b6baf5 AD |
6947 | case "$malloctype" in |
6948 | '') | |
6949 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then | |
85e6fe83 LW |
6950 | malloctype='void *' |
6951 | else | |
6952 | malloctype='char *' | |
6953 | fi | |
85e6fe83 LW |
6954 | ;; |
6955 | esac | |
6956 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 | |
6957 | ||
94b6baf5 AD |
6958 | case "$freetype" in |
6959 | '') | |
6960 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then | |
6961 | freetype='void' | |
6962 | else | |
6963 | freetype='int' | |
6964 | fi | |
6965 | ;; | |
8e07c86e AD |
6966 | esac |
6967 | echo "Your system uses $freetype free(), it would seem." >&4 | |
6968 | $rm -f malloc.[co] | |
6969 | : see if nice exists | |
6970 | set nice d_nice | |
6971 | eval $inlibc | |
2304df62 | 6972 | |
a0d0e21e LW |
6973 | : see if pause exists |
6974 | set pause d_pause | |
6975 | eval $inlibc | |
6976 | ||
6977 | : see if pipe exists | |
6978 | set pipe d_pipe | |
6979 | eval $inlibc | |
6980 | ||
8e07c86e AD |
6981 | : see if poll exists |
6982 | set poll d_poll | |
6983 | eval $inlibc | |
6984 | ||
4aa0a1f7 AD |
6985 | : see if this is a pwd.h system |
6986 | set pwd.h i_pwd | |
6987 | eval $inhdr | |
6988 | ||
6989 | case "$i_pwd" in | |
6990 | $define) | |
6991 | xxx=`./findhdr pwd.h` | |
85e6fe83 | 6992 | $cppstdin $cppflags $cppminus < $xxx >$$.h |
4aa0a1f7 | 6993 | |
2304df62 | 6994 | if $contains 'pw_quota' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 6995 | val="$define" |
2304df62 | 6996 | else |
4aa0a1f7 | 6997 | val="$undef" |
2304df62 | 6998 | fi |
4aa0a1f7 AD |
6999 | set d_pwquota |
7000 | eval $setvar | |
7001 | ||
2304df62 | 7002 | if $contains 'pw_age' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7003 | val="$define" |
2304df62 | 7004 | else |
4aa0a1f7 | 7005 | val="$undef" |
2304df62 | 7006 | fi |
4aa0a1f7 AD |
7007 | set d_pwage |
7008 | eval $setvar | |
7009 | ||
2304df62 | 7010 | if $contains 'pw_change' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7011 | val="$define" |
2304df62 | 7012 | else |
4aa0a1f7 | 7013 | val="$undef" |
2304df62 | 7014 | fi |
4aa0a1f7 AD |
7015 | set d_pwchange |
7016 | eval $setvar | |
7017 | ||
2304df62 | 7018 | if $contains 'pw_class' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7019 | val="$define" |
2304df62 | 7020 | else |
4aa0a1f7 | 7021 | val="$undef" |
2304df62 | 7022 | fi |
4aa0a1f7 AD |
7023 | set d_pwclass |
7024 | eval $setvar | |
7025 | ||
2304df62 | 7026 | if $contains 'pw_expire' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7027 | val="$define" |
2304df62 | 7028 | else |
4aa0a1f7 | 7029 | val="$undef" |
2304df62 | 7030 | fi |
4aa0a1f7 AD |
7031 | set d_pwexpire |
7032 | eval $setvar | |
7033 | ||
2304df62 | 7034 | if $contains 'pw_comment' $$.h >/dev/null 2>&1; then |
4aa0a1f7 | 7035 | val="$define" |
2304df62 | 7036 | else |
4aa0a1f7 | 7037 | val="$undef" |
2304df62 | 7038 | fi |
4aa0a1f7 AD |
7039 | set d_pwcomment |
7040 | eval $setvar | |
7041 | ||
2304df62 | 7042 | $rm -f $$.h |
4aa0a1f7 AD |
7043 | ;; |
7044 | *) | |
7045 | val="$undef"; | |
7046 | set d_pwquota; eval $setvar | |
7047 | set d_pwage; eval $setvar | |
7048 | set d_pwchange; eval $setvar | |
7049 | set d_pwclass; eval $setvar | |
7050 | set d_pwexpire; eval $setvar | |
7051 | set d_pwcomment; eval $setvar | |
7052 | ;; | |
7053 | esac | |
2304df62 | 7054 | |
85e6fe83 | 7055 | : see if readdir and friends exist |
2304df62 AD |
7056 | set readdir d_readdir |
7057 | eval $inlibc | |
85e6fe83 LW |
7058 | set seekdir d_seekdir |
7059 | eval $inlibc | |
7060 | set telldir d_telldir | |
7061 | eval $inlibc | |
7062 | set rewinddir d_rewinddir | |
7063 | eval $inlibc | |
2304df62 | 7064 | |
a0d0e21e LW |
7065 | : see if readlink exists |
7066 | set readlink d_readlink | |
7067 | eval $inlibc | |
7068 | ||
2304df62 AD |
7069 | : see if rename exists |
7070 | set rename d_rename | |
7071 | eval $inlibc | |
7072 | ||
7073 | : see if rmdir exists | |
7074 | set rmdir d_rmdir | |
7075 | eval $inlibc | |
7076 | ||
8ff267be | 7077 | : see if memory.h is available. |
7078 | val='' | |
7079 | set memory.h val | |
7080 | eval $inhdr | |
7081 | ||
7082 | : See if it conflicts with string.h | |
7083 | case "$val" in | |
7084 | $define) | |
7085 | case "$strings" in | |
7086 | '') ;; | |
7087 | *) | |
7088 | $cppstdin $cppflags $cppminus < $strings > mem.h | |
7089 | if $contains 'memcpy' mem.h >/dev/null 2>&1; then | |
7090 | echo " " | |
7091 | echo "We won't be including <memory.h>." | |
7092 | val="$undef" | |
7093 | fi | |
7094 | $rm -f mem.h | |
7095 | ;; | |
7096 | esac | |
7097 | esac | |
7098 | set i_memory | |
7099 | eval $setvar | |
7100 | ||
2304df62 AD |
7101 | : can bcopy handle overlapping blocks? |
7102 | val="$undef" | |
7103 | case "$d_bcopy" in | |
7104 | "$define") | |
7105 | echo " " | |
7106 | echo "Checking to see if your bcopy() can do overlapping copies..." >&4 | |
8ff267be | 7107 | $cat >foo.c <<EOCP |
7108 | #$i_memory I_MEMORY | |
7109 | #$i_stdlib I_STDLIB | |
7110 | #$i_string I_STRING | |
7111 | #$i_unistd I_UNISTD | |
7112 | EOCP | |
7113 | $cat >>foo.c <<'EOCP' | |
7114 | #include <stdio.h> | |
7115 | ||
7116 | #ifdef I_MEMORY | |
7117 | # include <memory.h> | |
7118 | #endif | |
7119 | #ifdef I_STDLIB | |
7120 | # include <stdlib.h> | |
7121 | #endif | |
7122 | #ifdef I_STRING | |
7123 | # include <string.h> | |
7124 | #else | |
7125 | # include <strings.h> | |
7126 | #endif | |
7127 | #ifdef I_UNISTD | |
7128 | # include <unistd.h> /* Needed for NetBSD */ | |
7129 | #endif | |
2304df62 AD |
7130 | main() |
7131 | { | |
85e6fe83 LW |
7132 | char buf[128], abc[128]; |
7133 | char *b; | |
7134 | int len; | |
7135 | int off; | |
7136 | int align; | |
a0d0e21e | 7137 | |
8ff267be | 7138 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
7139 | try to store the string in read-only memory. */ | |
85e6fe83 | 7140 | bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36); |
2304df62 AD |
7141 | |
7142 | for (align = 7; align >= 0; align--) { | |
7143 | for (len = 36; len; len--) { | |
7144 | b = buf+align; | |
85e6fe83 | 7145 | bcopy(abc, b, len); |
2304df62 AD |
7146 | for (off = 1; off <= len; off++) { |
7147 | bcopy(b, b+off, len); | |
7148 | bcopy(b+off, b, len); | |
85e6fe83 | 7149 | if (bcmp(b, abc, len)) |
2304df62 AD |
7150 | exit(1); |
7151 | } | |
7152 | } | |
7153 | } | |
7154 | exit(0); | |
7155 | } | |
7156 | EOCP | |
774d564b | 7157 | if $cc $optimize $ccflags $ldflags foo.c \ |
7158 | -o safebcpy $libs >/dev/null 2>&1; then | |
2304df62 AD |
7159 | if ./safebcpy 2>/dev/null; then |
7160 | echo "Yes, it can." | |
7161 | val="$define" | |
7162 | else | |
7163 | echo "It can't, sorry." | |
8ff267be | 7164 | case "$d_memmove" in |
7165 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7166 | esac | |
2304df62 AD |
7167 | fi |
7168 | else | |
7169 | echo "(I can't compile the test program, so we'll assume not...)" | |
8ff267be | 7170 | case "$d_memmove" in |
7171 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7172 | esac | |
2304df62 AD |
7173 | fi |
7174 | ;; | |
7175 | esac | |
7176 | $rm -f foo.* safebcpy core | |
7177 | set d_safebcpy | |
7178 | eval $setvar | |
7179 | ||
7180 | : can memcpy handle overlapping blocks? | |
7181 | val="$undef" | |
7182 | case "$d_memcpy" in | |
7183 | "$define") | |
7184 | echo " " | |
7185 | echo "Checking to see if your memcpy() can do overlapping copies..." >&4 | |
8ff267be | 7186 | $cat >foo.c <<EOCP |
7187 | #$i_memory I_MEMORY | |
7188 | #$i_stdlib I_STDLIB | |
7189 | #$i_string I_STRING | |
7190 | #$i_unistd I_UNISTD | |
7191 | EOCP | |
7192 | $cat >>foo.c <<'EOCP' | |
7193 | #include <stdio.h> | |
7194 | ||
7195 | #ifdef I_MEMORY | |
7196 | # include <memory.h> | |
7197 | #endif | |
7198 | #ifdef I_STDLIB | |
7199 | # include <stdlib.h> | |
7200 | #endif | |
7201 | #ifdef I_STRING | |
7202 | # include <string.h> | |
7203 | #else | |
7204 | # include <strings.h> | |
7205 | #endif | |
7206 | #ifdef I_UNISTD | |
7207 | # include <unistd.h> /* Needed for NetBSD */ | |
7208 | #endif | |
2304df62 AD |
7209 | main() |
7210 | { | |
85e6fe83 LW |
7211 | char buf[128], abc[128]; |
7212 | char *b; | |
7213 | int len; | |
7214 | int off; | |
7215 | int align; | |
7216 | ||
8ff267be | 7217 | /* Copy "abcde..." string to char abc[] so that gcc doesn't |
7218 | try to store the string in read-only memory. */ | |
85e6fe83 | 7219 | memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36); |
2304df62 AD |
7220 | |
7221 | for (align = 7; align >= 0; align--) { | |
7222 | for (len = 36; len; len--) { | |
7223 | b = buf+align; | |
232e078e | 7224 | memcpy(b, abc, len); |
2304df62 | 7225 | for (off = 1; off <= len; off++) { |
2304df62 | 7226 | memcpy(b+off, b, len); |
232e078e | 7227 | memcpy(b, b+off, len); |
85e6fe83 | 7228 | if (memcmp(b, abc, len)) |
2304df62 AD |
7229 | exit(1); |
7230 | } | |
7231 | } | |
7232 | } | |
7233 | exit(0); | |
7234 | } | |
7235 | EOCP | |
774d564b | 7236 | if $cc $optimize $ccflags $ldflags foo.c \ |
7237 | -o safemcpy $libs >/dev/null 2>&1; then | |
2304df62 AD |
7238 | if ./safemcpy 2>/dev/null; then |
7239 | echo "Yes, it can." | |
7240 | val="$define" | |
7241 | else | |
7242 | echo "It can't, sorry." | |
8ff267be | 7243 | case "$d_memmove" in |
7244 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7245 | esac | |
2304df62 AD |
7246 | fi |
7247 | else | |
7248 | echo "(I can't compile the test program, so we'll assume not...)" | |
8ff267be | 7249 | case "$d_memmove" in |
7250 | "$define") echo "But that's Ok since you have memmove()." ;; | |
7251 | esac | |
2304df62 AD |
7252 | fi |
7253 | ;; | |
7254 | esac | |
7255 | $rm -f foo.* safemcpy core | |
7256 | set d_safemcpy | |
7257 | eval $setvar | |
7258 | ||
36477c24 | 7259 | : can memcmp be trusted to compare relative magnitude? |
7260 | val="$undef" | |
7261 | case "$d_memcmp" in | |
7262 | "$define") | |
7263 | echo " " | |
5f05dabc | 7264 | echo "Checking to see if your memcmp() can compare relative magnitude..." >&4 |
36477c24 | 7265 | $cat >foo.c <<EOCP |
7266 | #$i_memory I_MEMORY | |
7267 | #$i_stdlib I_STDLIB | |
7268 | #$i_string I_STRING | |
7269 | #$i_unistd I_UNISTD | |
7270 | EOCP | |
7271 | $cat >>foo.c <<'EOCP' | |
7272 | #include <stdio.h> | |
7273 | ||
7274 | #ifdef I_MEMORY | |
7275 | # include <memory.h> | |
7276 | #endif | |
7277 | #ifdef I_STDLIB | |
7278 | # include <stdlib.h> | |
7279 | #endif | |
7280 | #ifdef I_STRING | |
7281 | # include <string.h> | |
7282 | #else | |
7283 | # include <strings.h> | |
7284 | #endif | |
7285 | #ifdef I_UNISTD | |
7286 | # include <unistd.h> /* Needed for NetBSD */ | |
7287 | #endif | |
7288 | main() | |
7289 | { | |
7290 | char a = -1; | |
7291 | char b = 0; | |
7292 | if ((a < b) && memcmp(&a, &b, 1) < 0) | |
7293 | exit(1); | |
7294 | exit(0); | |
7295 | } | |
7296 | EOCP | |
774d564b | 7297 | if $cc $optimize $ccflags $ldflags foo.c \ |
7298 | -o sanemcmp $libs >/dev/null 2>&1; then | |
36477c24 | 7299 | if ./sanemcmp 2>/dev/null; then |
7300 | echo "Yes, it can." | |
7301 | val="$define" | |
7302 | else | |
7303 | echo "No, it can't (it uses signed chars)." | |
7304 | fi | |
7305 | else | |
7306 | echo "(I can't compile the test program, so we'll assume not...)" | |
7307 | fi | |
7308 | ;; | |
7309 | esac | |
7310 | $rm -f foo.* sanemcmp core | |
7311 | set d_sanemcmp | |
7312 | eval $setvar | |
7313 | ||
2304df62 AD |
7314 | : see if select exists |
7315 | set select d_select | |
7316 | eval $inlibc | |
7317 | ||
7318 | : see if semctl exists | |
7319 | set semctl d_semctl | |
7320 | eval $inlibc | |
7321 | ||
7322 | : see if semget exists | |
7323 | set semget d_semget | |
7324 | eval $inlibc | |
7325 | ||
7326 | : see if semop exists | |
7327 | set semop d_semop | |
7328 | eval $inlibc | |
7329 | ||
7330 | : see how much of the 'sem*(2)' library is present. | |
7331 | h_sem=true | |
7332 | echo " " | |
7333 | case "$d_semctl$d_semget$d_semop" in | |
7334 | *"$undef"*) h_sem=false;; | |
7335 | esac | |
7336 | : we could also check for sys/ipc.h ... | |
7337 | if $h_sem && $test `./findhdr sys/sem.h`; then | |
7338 | echo "You have the full sem*(2) library." >&4 | |
7339 | val="$define" | |
7340 | else | |
7341 | echo "You don't have the full sem*(2) library." >&4 | |
7342 | val="$undef" | |
7343 | fi | |
7344 | set d_sem | |
7345 | eval $setvar | |
7346 | ||
7347 | : see if setegid exists | |
7348 | set setegid d_setegid | |
7349 | eval $inlibc | |
7350 | ||
7351 | : see if seteuid exists | |
7352 | set seteuid d_seteuid | |
7353 | eval $inlibc | |
7354 | ||
a0d0e21e LW |
7355 | : see if setlinebuf exists |
7356 | set setlinebuf d_setlinebuf | |
7357 | eval $inlibc | |
7358 | ||
2304df62 AD |
7359 | : see if setlocale exists |
7360 | set setlocale d_setlocale | |
7361 | eval $inlibc | |
a0d0e21e | 7362 | |
2304df62 AD |
7363 | : see if setpgid exists |
7364 | set setpgid d_setpgid | |
7365 | eval $inlibc | |
7366 | ||
2304df62 AD |
7367 | : see if setpgrp2 exists |
7368 | set setpgrp2 d_setpgrp2 | |
7369 | eval $inlibc | |
7370 | ||
7371 | : see if setpriority exists | |
7372 | set setpriority d_setprior | |
7373 | eval $inlibc | |
7374 | ||
7375 | : see if setregid exists | |
7376 | set setregid d_setregid | |
7377 | eval $inlibc | |
7378 | set setresgid d_setresgid | |
7379 | eval $inlibc | |
7380 | ||
7381 | : see if setreuid exists | |
7382 | set setreuid d_setreuid | |
7383 | eval $inlibc | |
7384 | set setresuid d_setresuid | |
7385 | eval $inlibc | |
7386 | ||
7387 | : see if setrgid exists | |
7388 | set setrgid d_setrgid | |
7389 | eval $inlibc | |
7390 | ||
7391 | : see if setruid exists | |
7392 | set setruid d_setruid | |
7393 | eval $inlibc | |
7394 | ||
7395 | : see if setsid exists | |
7396 | set setsid d_setsid | |
7397 | eval $inlibc | |
7398 | ||
760ac839 LW |
7399 | : see if sfio.h is available |
7400 | set sfio.h i_sfio | |
7401 | eval $inhdr | |
7402 | ||
7403 | ||
8ff267be | 7404 | : see if sfio library is available |
760ac839 LW |
7405 | case "$i_sfio" in |
7406 | $define) | |
7407 | val='' | |
7408 | set sfreserve val | |
7409 | eval $inlibc | |
7410 | ;; | |
7411 | *) | |
7412 | val="$undef" | |
7413 | ;; | |
7414 | esac | |
8ff267be | 7415 | : Ok, but do we want to use it. |
760ac839 LW |
7416 | case "$val" in |
7417 | $define) | |
7418 | case "$usesfio" in | |
8ff267be | 7419 | true|$define|[yY]*) dflt='y';; |
760ac839 LW |
7420 | *) dflt='n';; |
7421 | esac | |
8ff267be | 7422 | echo "$package can use the sfio library, but it is experimental." |
760ac839 LW |
7423 | rp="You seem to have sfio available, do you want to try using it?" |
7424 | . ./myread | |
7425 | case "$ans" in | |
8ff267be | 7426 | y|Y) ;; |
7427 | *) echo "Ok, avoiding sfio this time. I'll use stdio instead." | |
760ac839 | 7428 | val="$undef" |
ff0cee69 | 7429 | : Remove sfio from list of libraries to use |
7430 | set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'` | |
7431 | shift | |
7432 | libs="$*" | |
7433 | echo "libs = $libs" >&4 | |
760ac839 LW |
7434 | ;; |
7435 | esac | |
7436 | ;; | |
8ff267be | 7437 | *) case "$usesfio" in |
7438 | true|$define|[yY]*) | |
7439 | echo "Sorry, cannot find sfio on this machine" >&4 | |
7440 | echo "Ignoring your setting of usesfio=$usesfio" >&4 | |
760ac839 LW |
7441 | ;; |
7442 | esac | |
7443 | ;; | |
7444 | esac | |
8ff267be | 7445 | set d_sfio |
7446 | eval $setvar | |
760ac839 LW |
7447 | case "$d_sfio" in |
7448 | $define) usesfio='true';; | |
7449 | *) usesfio='false';; | |
7450 | esac | |
7451 | ||
2304df62 AD |
7452 | : see if shmctl exists |
7453 | set shmctl d_shmctl | |
7454 | eval $inlibc | |
7455 | ||
7456 | : see if shmget exists | |
7457 | set shmget d_shmget | |
7458 | eval $inlibc | |
7459 | ||
a0d0e21e LW |
7460 | : see if shmat exists |
7461 | set shmat d_shmat | |
7462 | eval $inlibc | |
7463 | : see what shmat returns | |
7464 | case "$d_shmat" in | |
7465 | "$define") | |
7466 | $cat >shmat.c <<'END' | |
7467 | #include <sys/shm.h> | |
7468 | void *shmat(); | |
7469 | END | |
7470 | if $cc $ccflags -c shmat.c >/dev/null 2>&1; then | |
7471 | shmattype='void *' | |
7472 | else | |
7473 | shmattype='char *' | |
7474 | fi | |
7475 | echo "and it returns ($shmattype)." >&4 | |
7476 | : see if a prototype for shmat is available | |
e50aee73 AD |
7477 | xxx=`./findhdr sys/shm.h` |
7478 | $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null | |
a0d0e21e LW |
7479 | if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then |
7480 | val="$define" | |
7481 | else | |
7482 | val="$undef" | |
7483 | fi | |
7484 | $rm -f shmat.[co] | |
7485 | ;; | |
7486 | *) | |
7487 | val="$undef" | |
7488 | ;; | |
7489 | esac | |
7490 | set d_shmatprototype | |
7491 | eval $setvar | |
7492 | ||
7493 | : see if shmdt exists | |
7494 | set shmdt d_shmdt | |
7495 | eval $inlibc | |
7496 | ||
7497 | : see how much of the 'shm*(2)' library is present. | |
7498 | h_shm=true | |
7499 | echo " " | |
7500 | case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in | |
7501 | *"$undef"*) h_shm=false;; | |
7502 | esac | |
7503 | : we could also check for sys/ipc.h ... | |
7504 | if $h_shm && $test `./findhdr sys/shm.h`; then | |
7505 | echo "You have the full shm*(2) library." >&4 | |
7506 | val="$define" | |
7507 | else | |
7508 | echo "You don't have the full shm*(2) library." >&4 | |
7509 | val="$undef" | |
7510 | fi | |
7511 | set d_shm | |
7512 | eval $setvar | |
7513 | ||
2c7991dc | 7514 | echo " " |
8ff267be | 7515 | : see if we have sigaction |
7516 | if set sigaction val -f d_sigaction; eval $csym; $val; then | |
7517 | echo 'sigaction() found.' >&4 | |
7518 | val="$define" | |
2c7991dc | 7519 | else |
8ff267be | 7520 | echo 'sigaction NOT found.' >&4 |
7521 | val="$undef" | |
2c7991dc | 7522 | fi |
7523 | ||
8ff267be | 7524 | $cat > set.c <<'EOP' |
7525 | /* Solaris 2.5_x86 with SunWorks Pro C 3.0.1 doesn't have a complete | |
7526 | sigaction structure if compiled with cc -Xc. This compile test | |
7527 | will fail then. <doughera@lafcol.lafayette.edu> | |
7528 | */ | |
7529 | #include <stdio.h> | |
7530 | #include <sys/types.h> | |
7531 | #include <signal.h> | |
7532 | main() | |
7533 | { | |
7534 | struct sigaction act, oact; | |
7535 | } | |
7536 | EOP | |
7537 | ||
7538 | if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then | |
7539 | : | |
7540 | else | |
7541 | echo "But you don't seem to have a useable struct sigaction." >&4 | |
7542 | val="$undef" | |
7543 | fi | |
7544 | set d_sigaction; eval $setvar | |
7545 | $rm -f set set.o set.c | |
2c7991dc | 7546 | |
a5f75d66 AD |
7547 | : see if sigsetjmp exists |
7548 | echo " " | |
7549 | case "$d_sigsetjmp" in | |
7550 | '') | |
760ac839 | 7551 | $cat >set.c <<'EOP' |
a5f75d66 AD |
7552 | #include <setjmp.h> |
7553 | sigjmp_buf env; | |
7554 | int set = 1; | |
7555 | main() | |
7556 | { | |
7557 | if (sigsetjmp(env,1)) | |
7558 | exit(set); | |
7559 | set = 0; | |
7560 | siglongjmp(env, 1); | |
7561 | exit(1); | |
7562 | } | |
7563 | EOP | |
760ac839 | 7564 | if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then |
a5f75d66 AD |
7565 | if ./set >/dev/null 2>&1; then |
7566 | echo "POSIX sigsetjmp found." >&4 | |
7567 | val="$define" | |
7568 | else | |
760ac839 | 7569 | $cat >&4 <<EOM |
a5f75d66 | 7570 | Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!! |
760ac839 | 7571 | I'll ignore them. |
a5f75d66 AD |
7572 | EOM |
7573 | val="$undef" | |
7574 | fi | |
7575 | else | |
760ac839 | 7576 | echo "sigsetjmp not found." >&4 |
a5f75d66 AD |
7577 | val="$undef" |
7578 | fi | |
7579 | ;; | |
7580 | *) val="$d_sigsetjmp" | |
7581 | case "$d_sigsetjmp" in | |
7582 | $define) echo "POSIX sigsetjmp found." >&4;; | |
760ac839 | 7583 | $undef) echo "sigsetjmp not found." >&4;; |
a5f75d66 AD |
7584 | esac |
7585 | ;; | |
7586 | esac | |
7587 | set d_sigsetjmp | |
7588 | eval $setvar | |
7589 | $rm -f set.c set | |
7590 | ||
a0d0e21e LW |
7591 | socketlib='' |
7592 | sockethdr='' | |
7593 | : see whether socket exists | |
7594 | echo " " | |
7595 | $echo $n "Hmm... $c" >&4 | |
7596 | if set socket val -f d_socket; eval $csym; $val; then | |
7597 | echo "Looks like you have Berkeley networking support." >&4 | |
7598 | d_socket="$define" | |
7599 | if set setsockopt val -f; eval $csym; $val; then | |
7600 | d_oldsock="$undef" | |
7601 | else | |
7602 | echo "...but it uses the old 4.1c interface, rather than 4.2" >&4 | |
7603 | d_oldsock="$define" | |
7604 | fi | |
7605 | else | |
7606 | if $contains socklib libc.list >/dev/null 2>&1; then | |
7607 | echo "Looks like you have Berkeley networking support." >&4 | |
7608 | d_socket="$define" | |
7609 | : we will have to assume that it supports the 4.2 BSD interface | |
7610 | d_oldsock="$undef" | |
7611 | else | |
5f05dabc | 7612 | echo "You don't have Berkeley networking in libc$lib_ext..." >&4 |
7613 | if test -f /usr/lib/libnet$lib_ext; then | |
7614 | ( (nm $nm_opt /usr/lib/libnet$lib_ext | eval $nm_extract) || \ | |
7615 | ar t /usr/lib/libnet$lib_ext) 2>/dev/null >> libc.list | |
a0d0e21e LW |
7616 | if $contains socket libc.list >/dev/null 2>&1; then |
7617 | echo "...but the Wollongong group seems to have hacked it in." >&4 | |
7618 | socketlib="-lnet" | |
7619 | sockethdr="-I/usr/netinclude" | |
7620 | d_socket="$define" | |
7621 | if $contains setsockopt libc.list >/dev/null 2>&1; then | |
7622 | d_oldsock="$undef" | |
7623 | else | |
7624 | echo "...using the old 4.1c interface, rather than 4.2" >&4 | |
7625 | d_oldsock="$define" | |
7626 | fi | |
7627 | else | |
5f05dabc | 7628 | echo "or even in libnet$lib_ext, which is peculiar." >&4 |
a0d0e21e LW |
7629 | d_socket="$undef" |
7630 | d_oldsock="$undef" | |
7631 | fi | |
7632 | else | |
7633 | echo "or anywhere else I see." >&4 | |
7634 | d_socket="$undef" | |
7635 | d_oldsock="$undef" | |
7636 | fi | |
7637 | fi | |
7638 | fi | |
7639 | ||
7640 | : see if socketpair exists | |
7641 | set socketpair d_sockpair | |
2304df62 AD |
7642 | eval $inlibc |
7643 | ||
2304df62 AD |
7644 | : see if stat knows about block sizes |
7645 | echo " " | |
7646 | xxx=`./findhdr sys/stat.h` | |
7647 | if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then | |
7648 | if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then | |
7649 | echo "Your stat() knows about block sizes." >&4 | |
7650 | val="$define" | |
7651 | else | |
7652 | echo "Your stat() doesn't know about block sizes." >&4 | |
7653 | val="$undef" | |
7654 | fi | |
7655 | else | |
7656 | echo "Your stat() doesn't know about block sizes." >&4 | |
7657 | val="$undef" | |
7658 | fi | |
7659 | set d_statblks | |
7660 | eval $setvar | |
7661 | ||
16d20bd9 AD |
7662 | : see if _ptr and _cnt from stdio act std |
7663 | echo " " | |
7664 | if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then | |
7665 | echo "(Looks like you have stdio.h from Linux.)" | |
7666 | case "$stdio_ptr" in | |
c2960299 AD |
7667 | '') stdio_ptr='((fp)->_IO_read_ptr)' |
7668 | ptr_lval=$define | |
7669 | ;; | |
8e07c86e | 7670 | *) ptr_lval=$d_stdio_ptr_lval;; |
16d20bd9 AD |
7671 | esac |
7672 | case "$stdio_cnt" in | |
c2960299 AD |
7673 | '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' |
7674 | cnt_lval=$undef | |
7675 | ;; | |
8e07c86e | 7676 | *) cnt_lval=$d_stdio_cnt_lval;; |
16d20bd9 AD |
7677 | esac |
7678 | case "$stdio_base" in | |
7679 | '') stdio_base='((fp)->_IO_read_base)';; | |
7680 | esac | |
7681 | case "$stdio_bufsiz" in | |
c2960299 | 7682 | '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';; |
16d20bd9 AD |
7683 | esac |
7684 | else | |
7685 | case "$stdio_ptr" in | |
c2960299 AD |
7686 | '') stdio_ptr='((fp)->_ptr)' |
7687 | ptr_lval=$define | |
7688 | ;; | |
8e07c86e | 7689 | *) ptr_lval=$d_stdio_ptr_lval;; |
16d20bd9 AD |
7690 | esac |
7691 | case "$stdio_cnt" in | |
c2960299 AD |
7692 | '') stdio_cnt='((fp)->_cnt)' |
7693 | cnt_lval=$define | |
7694 | ;; | |
8e07c86e | 7695 | *) cnt_lval=$d_stdio_cnt_lval;; |
16d20bd9 AD |
7696 | esac |
7697 | case "$stdio_base" in | |
7698 | '') stdio_base='((fp)->_base)';; | |
7699 | esac | |
7700 | case "$stdio_bufsiz" in | |
7701 | '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';; | |
7702 | esac | |
7703 | fi | |
7704 | : test whether _ptr and _cnt really work | |
7705 | echo "Checking how std your stdio is..." >&4 | |
7706 | $cat >try.c <<EOP | |
7707 | #include <stdio.h> | |
7708 | #define FILE_ptr(fp) $stdio_ptr | |
7709 | #define FILE_cnt(fp) $stdio_cnt | |
8ff267be | 7710 | main() { |
16d20bd9 AD |
7711 | FILE *fp = fopen("try.c", "r"); |
7712 | char c = getc(fp); | |
7713 | if ( | |
7714 | 18 <= FILE_cnt(fp) && | |
7715 | strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0 | |
7716 | ) | |
7717 | exit(0); | |
7718 | exit(1); | |
7719 | } | |
7720 | EOP | |
7721 | val="$undef" | |
7722 | if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then | |
7723 | if ./try; then | |
7724 | echo "Your stdio acts pretty std." | |
7725 | val="$define" | |
7726 | else | |
7727 | echo "Your stdio isn't very std." | |
7728 | fi | |
7729 | else | |
7730 | echo "Your stdio doesn't appear very std." | |
7731 | fi | |
7732 | $rm -f try.c try | |
7733 | set d_stdstdio | |
7734 | eval $setvar | |
7735 | ||
8e07c86e | 7736 | : Can _ptr be used as an lvalue? |
e50aee73 AD |
7737 | case "$d_stdstdio$ptr_lval" in |
7738 | $define$define) val=$define ;; | |
c2960299 AD |
7739 | *) val=$undef ;; |
7740 | esac | |
7741 | set d_stdio_ptr_lval | |
7742 | eval $setvar | |
7743 | ||
8e07c86e | 7744 | : Can _cnt be used as an lvalue? |
e50aee73 AD |
7745 | case "$d_stdstdio$cnt_lval" in |
7746 | $define$define) val=$define ;; | |
c2960299 AD |
7747 | *) val=$undef ;; |
7748 | esac | |
7749 | set d_stdio_cnt_lval | |
7750 | eval $setvar | |
7751 | ||
8ff267be | 7752 | |
16d20bd9 AD |
7753 | : see if _base is also standard |
7754 | val="$undef" | |
7755 | case "$d_stdstdio" in | |
7756 | $define) | |
7757 | $cat >try.c <<EOP | |
7758 | #include <stdio.h> | |
7759 | #define FILE_base(fp) $stdio_base | |
7760 | #define FILE_bufsiz(fp) $stdio_bufsiz | |
8ff267be | 7761 | main() { |
16d20bd9 AD |
7762 | FILE *fp = fopen("try.c", "r"); |
7763 | char c = getc(fp); | |
7764 | if ( | |
7765 | 19 <= FILE_bufsiz(fp) && | |
7766 | strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0 | |
7767 | ) | |
7768 | exit(0); | |
7769 | exit(1); | |
7770 | } | |
7771 | EOP | |
7772 | if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then | |
7773 | if ./try; then | |
8ff267be | 7774 | echo "And its _base field acts std." |
16d20bd9 AD |
7775 | val="$define" |
7776 | else | |
7777 | echo "But its _base field isn't std." | |
7778 | fi | |
7779 | else | |
7780 | echo "However, it seems to be lacking the _base field." | |
7781 | fi | |
7782 | $rm -f try.c try | |
7783 | ;; | |
7784 | esac | |
7785 | set d_stdiobase | |
7786 | eval $setvar | |
7787 | ||
a0d0e21e LW |
7788 | : see if strcoll exists |
7789 | set strcoll d_strcoll | |
7790 | eval $inlibc | |
2304df62 AD |
7791 | |
7792 | : check for structure copying | |
7793 | echo " " | |
7794 | echo "Checking to see if your C compiler can copy structs..." >&4 | |
7795 | $cat >try.c <<'EOCP' | |
7796 | main() | |
7797 | { | |
7798 | struct blurfl { | |
7799 | int dyick; | |
7800 | } foo, bar; | |
7801 | ||
7802 | foo = bar; | |
7803 | } | |
7804 | EOCP | |
7805 | if $cc -c try.c >/dev/null 2>&1 ; then | |
7806 | val="$define" | |
7807 | echo "Yup, it can." | |
7808 | else | |
7809 | val="$undef" | |
7810 | echo "Nope, it can't." | |
7811 | fi | |
7812 | set d_strctcpy | |
7813 | eval $setvar | |
7814 | $rm -f try.* | |
7815 | ||
7816 | : see if strerror and/or sys_errlist[] exist | |
7817 | echo " " | |
7818 | if set strerror val -f d_strerror; eval $csym; $val; then | |
7819 | echo 'strerror() found.' >&4 | |
7820 | d_strerror="$define" | |
a0d0e21e | 7821 | d_strerrm='strerror(e)' |
2304df62 AD |
7822 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
7823 | echo "(You also have sys_errlist[], so we could roll our own strerror.)" | |
7824 | d_syserrlst="$define" | |
7825 | else | |
7826 | echo "(Since you don't have sys_errlist[], sterror() is welcome.)" | |
7827 | d_syserrlst="$undef" | |
7828 | fi | |
7829 | elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \ | |
7830 | $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then | |
7831 | echo 'strerror() found in string header.' >&4 | |
7832 | d_strerror="$define" | |
a0d0e21e | 7833 | d_strerrm='strerror(e)' |
2304df62 AD |
7834 | if set sys_errlist val -a d_syserrlst; eval $csym; $val; then |
7835 | echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)" | |
7836 | d_syserrlst="$define" | |
7837 | else | |
7838 | echo "(You don't appear to have any sys_errlist[], how can this be?)" | |
7839 | d_syserrlst="$undef" | |
7840 | fi | |
7841 | elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then | |
7842 | echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4 | |
7843 | d_strerror="$undef" | |
7844 | d_syserrlst="$define" | |
a0d0e21e | 7845 | d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])' |
2304df62 AD |
7846 | else |
7847 | echo 'strerror() and sys_errlist[] NOT found.' >&4 | |
7848 | d_strerror="$undef" | |
7849 | d_syserrlst="$undef" | |
a0d0e21e | 7850 | d_strerrm='"unknown"' |
2304df62 AD |
7851 | fi |
7852 | ||
a89d8a78 DH |
7853 | : see if strtod exists |
7854 | set strtod d_strtod | |
7855 | eval $inlibc | |
7856 | ||
7857 | : see if strtol exists | |
7858 | set strtol d_strtol | |
7859 | eval $inlibc | |
7860 | ||
7861 | : see if strtoul exists | |
7862 | set strtoul d_strtoul | |
7863 | eval $inlibc | |
7864 | ||
a0d0e21e LW |
7865 | : see if strxfrm exists |
7866 | set strxfrm d_strxfrm | |
7867 | eval $inlibc | |
7868 | ||
2304df62 AD |
7869 | : see if symlink exists |
7870 | set symlink d_symlink | |
7871 | eval $inlibc | |
7872 | ||
7873 | : see if syscall exists | |
7874 | set syscall d_syscall | |
7875 | eval $inlibc | |
7876 | ||
a0d0e21e LW |
7877 | : see if sysconf exists |
7878 | set sysconf d_sysconf | |
7879 | eval $inlibc | |
7880 | ||
2304df62 AD |
7881 | : see if system exists |
7882 | set system d_system | |
7883 | eval $inlibc | |
7884 | ||
a0d0e21e LW |
7885 | : see if tcgetpgrp exists |
7886 | set tcgetpgrp d_tcgetpgrp | |
7887 | eval $inlibc | |
7888 | ||
2c7991dc | 7889 | : see if tcsetpgrp exists |
7890 | set tcsetpgrp d_tcsetpgrp | |
7891 | eval $inlibc | |
4633a7c4 | 7892 | |
2c7991dc | 7893 | : define an is-a-typedef? function |
7894 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
7895 | case "$inclist" in | |
7896 | "") inclist="sys/types.h";; | |
7897 | esac; | |
7898 | eval "varval=\$$var"; | |
7899 | case "$varval" in | |
7900 | "") | |
7901 | $rm -f temp.c; | |
7902 | for inc in $inclist; do | |
7903 | echo "#include <$inc>" >>temp.c; | |
7904 | done; | |
7905 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
7906 | if $contains $type temp.E >/dev/null 2>&1; then | |
7907 | eval "$var=\$type"; | |
7908 | else | |
7909 | eval "$var=\$def"; | |
7910 | fi; | |
7911 | $rm -f temp.?;; | |
7912 | *) eval "$var=\$varval";; | |
7913 | esac' | |
4633a7c4 | 7914 | |
2c7991dc | 7915 | : see if this is a sys/times.h system |
7916 | set sys/times.h i_systimes | |
7917 | eval $inhdr | |
4633a7c4 | 7918 | |
2c7991dc | 7919 | : see if times exists |
4633a7c4 | 7920 | echo " " |
2c7991dc | 7921 | if set times val -f d_times; eval $csym; $val; then |
7922 | echo 'times() found.' >&4 | |
7923 | d_times="$define" | |
7924 | inc='' | |
7925 | case "$i_systimes" in | |
7926 | "$define") inc='sys/times.h';; | |
7927 | esac | |
7928 | set clock_t clocktype long stdio.h sys/types.h $inc | |
7929 | eval $typedef | |
7930 | dflt="$clocktype" | |
7931 | echo " " | |
7932 | rp="What type is returned by times() on this system?" | |
7933 | . ./myread | |
7934 | clocktype="$ans" | |
7935 | else | |
7936 | echo 'times() NOT found, hope that will do.' >&4 | |
7937 | d_times="$undef" | |
7938 | clocktype='int' | |
7939 | fi | |
2304df62 | 7940 | |
2c7991dc | 7941 | : see if truncate exists |
7942 | set truncate d_truncate | |
7943 | eval $inlibc | |
2304df62 | 7944 | |
2c7991dc | 7945 | : see if tzname[] exists |
7946 | echo " " | |
7947 | if set tzname val -a d_tzname; eval $csym; $val; then | |
7948 | val="$define" | |
7949 | echo 'tzname[] found.' >&4 | |
7950 | else | |
7951 | val="$undef" | |
7952 | echo 'tzname[] NOT found.' >&4 | |
7953 | fi | |
7954 | set d_tzname | |
7955 | eval $setvar | |
7956 | ||
7957 | : see if umask exists | |
7958 | set umask d_umask | |
7959 | eval $inlibc | |
85e6fe83 | 7960 | |
4633a7c4 | 7961 | : see how we will look up host name |
a0d0e21e | 7962 | echo " " |
4633a7c4 LW |
7963 | if false; then |
7964 | : dummy stub to allow use of elif | |
7965 | elif set uname val -f d_uname; eval $csym; $val; then | |
7966 | if ./xenix; then | |
7967 | $cat <<'EOM' | |
7968 | uname() was found, but you're running xenix, and older versions of xenix | |
7969 | have a broken uname(). If you don't really know whether your xenix is old | |
7970 | enough to have a broken system call, use the default answer. | |
7971 | ||
85e6fe83 | 7972 | EOM |
4633a7c4 LW |
7973 | dflt=y |
7974 | case "$d_uname" in | |
7975 | "$define") dflt=n;; | |
7976 | esac | |
7977 | rp='Is your uname() broken?' | |
7978 | . ./myread | |
7979 | case "$ans" in | |
7980 | n*) d_uname="$define"; call=uname;; | |
7981 | esac | |
7982 | else | |
7983 | echo 'uname() found.' >&4 | |
7984 | d_uname="$define" | |
7985 | call=uname | |
7986 | fi | |
a0d0e21e | 7987 | fi |
4633a7c4 LW |
7988 | case "$d_gethname" in |
7989 | '') d_gethname="$undef";; | |
7990 | esac | |
7991 | case "$d_uname" in | |
7992 | '') d_uname="$undef";; | |
7993 | esac | |
7994 | case "$d_phostname" in | |
7995 | '') d_phostname="$undef";; | |
7996 | esac | |
ecfc5424 | 7997 | |
4633a7c4 LW |
7998 | : backward compatibility for d_hvfork |
7999 | if test X$d_hvfork != X; then | |
8000 | d_vfork="$d_hvfork" | |
8001 | d_hvfork='' | |
8002 | fi | |
8003 | : see if there is a vfork | |
8004 | val='' | |
8005 | set vfork val | |
8006 | eval $inlibc | |
ecfc5424 | 8007 | |
4633a7c4 LW |
8008 | : Ok, but do we want to use it. vfork is reportedly unreliable in |
8009 | : perl on Solaris 2.x, and probably elsewhere. | |
8010 | case "$val" in | |
8011 | $define) | |
16d20bd9 | 8012 | echo " " |
4633a7c4 LW |
8013 | case "$usevfork" in |
8014 | false) dflt='n';; | |
8015 | *) dflt='y';; | |
8016 | esac | |
8017 | rp="Some systems have problems with vfork(). Do you want to use it?" | |
8018 | . ./myread | |
8019 | case "$ans" in | |
8020 | y|Y) ;; | |
8021 | *) | |
8022 | echo "Ok, we won't use vfork()." | |
8023 | val="$undef" | |
8024 | ;; | |
8025 | esac | |
ecfc5424 AD |
8026 | ;; |
8027 | esac | |
4633a7c4 LW |
8028 | set d_vfork |
8029 | eval $setvar | |
8030 | case "$d_vfork" in | |
8031 | $define) usevfork='true';; | |
8032 | *) usevfork='false';; | |
8033 | esac | |
ecfc5424 | 8034 | |
4633a7c4 LW |
8035 | : see if this is an sysdir system |
8036 | set sys/dir.h i_sysdir | |
8037 | eval $inhdr | |
8038 | ||
8039 | : see if this is an sysndir system | |
8040 | set sys/ndir.h i_sysndir | |
8041 | eval $inhdr | |
8042 | ||
8043 | : see if closedir exists | |
8044 | set closedir d_closedir | |
8045 | eval $inlibc | |
8046 | ||
8047 | case "$d_closedir" in | |
8048 | "$define") | |
16d20bd9 | 8049 | echo " " |
4633a7c4 LW |
8050 | echo "Checking whether closedir() returns a status..." >&4 |
8051 | cat > closedir.c <<EOM | |
8052 | #$i_dirent I_DIRENT /**/ | |
8053 | #$i_sysdir I_SYS_DIR /**/ | |
8054 | #$i_sysndir I_SYS_NDIR /**/ | |
8055 | ||
8056 | #if defined(I_DIRENT) | |
8057 | #include <dirent.h> | |
8058 | #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */ | |
8059 | #include <sys/dir.h> | |
4aa0a1f7 | 8060 | #endif |
4633a7c4 LW |
8061 | #else |
8062 | #ifdef I_SYS_NDIR | |
8063 | #include <sys/ndir.h> | |
8064 | #else | |
8065 | #ifdef I_SYS_DIR | |
8066 | #ifdef hp9000s500 | |
8067 | #include <ndir.h> /* may be wrong in the future */ | |
8068 | #else | |
8069 | #include <sys/dir.h> | |
8070 | #endif | |
8071 | #endif | |
8072 | #endif | |
8073 | #endif | |
8074 | int main() { return closedir(opendir(".")); } | |
8075 | EOM | |
8076 | if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then | |
8077 | if ./closedir > /dev/null 2>&1 ; then | |
8078 | echo "Yes, it does." | |
8079 | val="$undef" | |
ecfc5424 | 8080 | else |
4633a7c4 LW |
8081 | echo "No, it doesn't." |
8082 | val="$define" | |
ecfc5424 AD |
8083 | fi |
8084 | else | |
4633a7c4 LW |
8085 | echo "(I can't seem to compile the test program--assuming it doesn't)" |
8086 | val="$define" | |
ecfc5424 | 8087 | fi |
ecfc5424 | 8088 | ;; |
4633a7c4 LW |
8089 | *) |
8090 | val="$undef"; | |
ecfc5424 AD |
8091 | ;; |
8092 | esac | |
4633a7c4 LW |
8093 | set d_void_closedir |
8094 | eval $setvar | |
8095 | $rm -f closedir* | |
8096 | : check for volatile keyword | |
ecfc5424 | 8097 | echo " " |
4633a7c4 LW |
8098 | echo 'Checking to see if your C compiler knows about "volatile"...' >&4 |
8099 | $cat >try.c <<'EOCP' | |
8100 | main() | |
8101 | { | |
8102 | typedef struct _goo_struct goo_struct; | |
8103 | goo_struct * volatile goo = ((goo_struct *)0); | |
8104 | struct _goo_struct { | |
8105 | long long_int; | |
8106 | int reg_int; | |
8107 | char char_var; | |
8108 | }; | |
8109 | typedef unsigned short foo_t; | |
8110 | char *volatile foo; | |
8111 | volatile int bar; | |
8112 | volatile foo_t blech; | |
8113 | foo = foo; | |
a0d0e21e LW |
8114 | } |
8115 | EOCP | |
4633a7c4 LW |
8116 | if $cc -c $ccflags try.c >/dev/null 2>&1 ; then |
8117 | val="$define" | |
8118 | echo "Yup, it does." | |
8119 | else | |
8120 | val="$undef" | |
8121 | echo "Nope, it doesn't." | |
8122 | fi | |
8123 | set d_volatile | |
8124 | eval $setvar | |
8125 | $rm -f try.* | |
a0d0e21e | 8126 | |
4633a7c4 LW |
8127 | : see if there is a wait4 |
8128 | set wait4 d_wait4 | |
8e07c86e AD |
8129 | eval $inlibc |
8130 | ||
4633a7c4 LW |
8131 | : see if waitpid exists |
8132 | set waitpid d_waitpid | |
8133 | eval $inlibc | |
8134 | ||
8135 | : see if wcstombs exists | |
8136 | set wcstombs d_wcstombs | |
8137 | eval $inlibc | |
8138 | ||
8139 | : see if wctomb exists | |
8140 | set wctomb d_wctomb | |
8141 | eval $inlibc | |
8142 | ||
8143 | : preserve RCS keywords in files with variable substitution, grrr | |
8144 | Date='$Date' | |
8145 | Id='$Id' | |
8146 | Log='$Log' | |
8147 | RCSfile='$RCSfile' | |
8148 | Revision='$Revision' | |
8149 | ||
8150 | : check for alignment requirements | |
8151 | echo " " | |
8152 | case "$alignbytes" in | |
8153 | '') echo "Checking alignment constraints..." >&4 | |
8154 | $cat >try.c <<'EOCP' | |
8155 | struct foobar { | |
8156 | char foo; | |
8157 | double bar; | |
8158 | } try; | |
8159 | main() | |
8160 | { | |
8161 | printf("%d\n", (char *)&try.bar - (char *)&try.foo); | |
8162 | } | |
8163 | EOCP | |
8164 | if $cc $ccflags try.c -o try >/dev/null 2>&1; then | |
8165 | dflt=`./try` | |
8166 | else | |
8167 | dflt='8' | |
41992daf | 8168 | echo "(I can't seem to compile the test program...)" |
4633a7c4 | 8169 | fi |
ecfc5424 | 8170 | ;; |
4633a7c4 | 8171 | *) dflt="$alignbytes" |
8e07c86e | 8172 | ;; |
ecfc5424 | 8173 | esac |
4633a7c4 LW |
8174 | rp="Doubles must be aligned on a how-many-byte boundary?" |
8175 | . ./myread | |
8176 | alignbytes="$ans" | |
8177 | $rm -f try.c try | |
85e6fe83 | 8178 | |
4633a7c4 LW |
8179 | : check for ordering of bytes in a long |
8180 | case "$byteorder" in | |
8181 | '') | |
8182 | $cat <<'EOM' | |
8183 | ||
8184 | In the following, larger digits indicate more significance. A big-endian | |
8185 | machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A | |
8186 | little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other | |
8187 | machines may have weird orders like 3412. A Cray will report 87654321. If | |
8188 | the test program works the default is probably right. | |
8189 | I'm now running the test program... | |
8190 | EOM | |
8191 | $cat >try.c <<'EOCP' | |
8192 | #include <stdio.h> | |
8193 | main() | |
8194 | { | |
8195 | int i; | |
8196 | union { | |
8197 | unsigned long l; | |
8198 | char c[sizeof(long)]; | |
8199 | } u; | |
8200 | ||
8201 | if (sizeof(long) > 4) | |
8202 | u.l = (0x08070605L << 32) | 0x04030201L; | |
8203 | else | |
8204 | u.l = 0x04030201L; | |
8205 | for (i = 0; i < sizeof(long); i++) | |
8206 | printf("%c", u.c[i]+'0'); | |
8207 | printf("\n"); | |
8208 | exit(0); | |
8209 | } | |
8210 | EOCP | |
8211 | xxx_prompt=y | |
8212 | if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then | |
8213 | dflt=`./try` | |
8214 | case "$dflt" in | |
8215 | [1-4][1-4][1-4][1-4]|12345678|87654321) | |
8216 | echo "(The test program ran ok.)" | |
8217 | echo "byteorder=$dflt" | |
8218 | xxx_prompt=n | |
8219 | ;; | |
8220 | ????|????????) echo "(The test program ran ok.)" ;; | |
8221 | *) echo "(The test program didn't run right for some reason.)" ;; | |
8222 | esac | |
8223 | else | |
8224 | dflt='4321' | |
8225 | cat <<'EOM' | |
8226 | (I can't seem to compile the test program. Guessing big-endian...) | |
8227 | EOM | |
8228 | fi | |
8229 | case "$xxx_prompt" in | |
8230 | y) | |
8231 | rp="What is the order of bytes in a long?" | |
8232 | . ./myread | |
8233 | byteorder="$ans" | |
8234 | ;; | |
8235 | *) byteorder=$dflt | |
ecfc5424 AD |
8236 | ;; |
8237 | esac | |
8238 | ;; | |
8239 | esac | |
4633a7c4 | 8240 | $rm -f try.c try |
85e6fe83 | 8241 | |
4633a7c4 | 8242 | : how do we catenate cpp tokens here? |
2304df62 | 8243 | echo " " |
4633a7c4 LW |
8244 | echo "Checking to see how your cpp does stuff like catenate tokens..." >&4 |
8245 | $cat >cpp_stuff.c <<'EOCP' | |
8246 | #define RCAT(a,b)a/**/b | |
8247 | #define ACAT(a,b)a ## b | |
8248 | RCAT(Rei,ser) | |
8249 | ACAT(Cir,cus) | |
8250 | EOCP | |
8251 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 | |
8252 | if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then | |
8253 | echo "Oh! Smells like ANSI's been here." | |
8254 | echo "We can catify or stringify, separately or together!" | |
8255 | cpp_stuff=42 | |
8256 | elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then | |
8257 | echo "Ah, yes! The good old days!" | |
8258 | echo "However, in the good old days we don't know how to stringify and" | |
8259 | echo "catify at the same time." | |
8260 | cpp_stuff=1 | |
8261 | else | |
8262 | $cat >&4 <<EOM | |
8263 | Hmm, I don't seem to be able to catenate tokens with your cpp. You're going | |
8264 | to have to edit the values of CAT[2-5] in config.h... | |
a0d0e21e | 8265 | EOM |
4633a7c4 LW |
8266 | cpp_stuff="/* Help! How do we handle cpp_stuff? */*/" |
8267 | fi | |
8268 | $rm -f cpp_stuff.* | |
a0d0e21e | 8269 | |
4633a7c4 LW |
8270 | : see if this is a db.h system |
8271 | set db.h i_db | |
8272 | eval $inhdr | |
8273 | ||
8274 | case "$i_db" in | |
68dc0745 | 8275 | $define) |
8276 | : Check db version. We can not use version 2. | |
8277 | echo " " | |
8278 | echo "Checking Berkeley DB version ..." >&4 | |
8279 | $cat >try.c <<EOCP | |
8280 | #$d_const HASCONST | |
8281 | #ifndef HASCONST | |
8282 | #define const | |
8283 | #endif | |
8284 | #include <sys/types.h> | |
8285 | #include <stdio.h> | |
8286 | #include <db.h> | |
8287 | main() | |
8288 | { | |
6a1b87e5 | 8289 | #ifdef DB_VERSION_MAJOR /* DB version >= 2: not yet. */ |
68dc0745 | 8290 | printf("You have Berkeley DB Version %d.%d\n", |
8291 | DB_VERSION_MAJOR, DB_VERSION_MINOR); | |
8292 | printf("Perl currently only supports up to version 1.86.\n"); | |
6a1b87e5 | 8293 | exit(2); |
68dc0745 | 8294 | #else |
6a1b87e5 JH |
8295 | #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC) |
8296 | exit(0); /* DB version < 2: the coast is clear. */ | |
8297 | #else | |
8298 | exit(1); /* <db.h> not Berkeley DB? */ | |
8299 | #endif | |
68dc0745 | 8300 | #endif |
8301 | } | |
8302 | EOCP | |
8303 | if $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try; then | |
8304 | echo 'Looks OK. (Perl supports up to version 1.86).' >&4 | |
8305 | else | |
c90c0ff4 | 8306 | echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4 |
68dc0745 | 8307 | i_db=$undef |
8308 | case " $libs " in | |
8309 | *"-ldb "*) | |
8310 | : Remove db from list of libraries to use | |
8311 | echo "Removing unusable -ldb from library list" >&4 | |
8312 | set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'` | |
8313 | shift | |
8314 | libs="$*" | |
8315 | echo "libs = $libs" >&4 | |
8316 | ;; | |
8317 | esac | |
8318 | fi | |
8319 | $rm -f try.* | |
8320 | ;; | |
8321 | esac | |
8322 | ||
8323 | case "$i_db" in | |
4633a7c4 LW |
8324 | define) |
8325 | : Check the return type needed for hash | |
8326 | echo " " | |
8327 | echo "Checking return type needed for hash for Berkeley DB ..." >&4 | |
8328 | $cat >try.c <<EOCP | |
8329 | #$d_const HASCONST | |
8330 | #ifndef HASCONST | |
8331 | #define const | |
8332 | #endif | |
8333 | #include <sys/types.h> | |
8334 | #include <db.h> | |
8335 | u_int32_t hash_cb (ptr, size) | |
8336 | const void *ptr; | |
8337 | size_t size; | |
8338 | { | |
8339 | } | |
8340 | HASHINFO info; | |
8341 | main() | |
8342 | { | |
8343 | info.hash = hash_cb; | |
8344 | } | |
8345 | EOCP | |
8346 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
8347 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
8348 | db_hashtype='int' | |
8349 | else | |
8350 | db_hashtype='u_int32_t' | |
8351 | fi | |
8352 | else | |
68dc0745 | 8353 | : XXX Maybe we should just give up here. |
8354 | db_hashtype=u_int32_t | |
8355 | echo "Help: I can't seem to compile the db test program." >&4 | |
8356 | echo "Something's wrong, but I'll assume you use $db_hashtype." >&4 | |
4633a7c4 LW |
8357 | fi |
8358 | $rm -f try.* | |
8359 | echo "Your version of Berkeley DB uses $db_hashtype for hash." | |
8360 | ;; | |
68dc0745 | 8361 | *) db_hashtype=u_int32_t |
4633a7c4 LW |
8362 | ;; |
8363 | esac | |
a0d0e21e | 8364 | |
4633a7c4 LW |
8365 | case "$i_db" in |
8366 | define) | |
8367 | : Check the return type needed for prefix | |
8368 | echo " " | |
8369 | echo "Checking return type needed for prefix for Berkeley DB ..." >&4 | |
8370 | cat >try.c <<EOCP | |
8371 | #$d_const HASCONST | |
8372 | #ifndef HASCONST | |
8373 | #define const | |
8374 | #endif | |
8375 | #include <sys/types.h> | |
8376 | #include <db.h> | |
8377 | size_t prefix_cb (key1, key2) | |
8378 | const DBT *key1; | |
8379 | const DBT *key2; | |
8380 | { | |
8381 | } | |
8382 | BTREEINFO info; | |
8383 | main() | |
8384 | { | |
8385 | info.prefix = prefix_cb; | |
8386 | } | |
8387 | EOCP | |
8388 | if $cc $ccflags -c try.c >try.out 2>&1 ; then | |
8389 | if $contains warning try.out >>/dev/null 2>&1 ; then | |
8390 | db_prefixtype='int' | |
8391 | else | |
8392 | db_prefixtype='size_t' | |
8393 | fi | |
8394 | else | |
68dc0745 | 8395 | db_prefixtype='size_t' |
8396 | : XXX Maybe we should just give up here. | |
8397 | echo "Help: I can't seem to compile the db test program." >&4 | |
8398 | echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4 | |
4633a7c4 LW |
8399 | fi |
8400 | $rm -f try.* | |
8401 | echo "Your version of Berkeley DB uses $db_prefixtype for prefix." | |
a0d0e21e | 8402 | ;; |
68dc0745 | 8403 | *) db_prefixtype='size_t' |
4633a7c4 LW |
8404 | ;; |
8405 | esac | |
a0d0e21e | 8406 | |
4633a7c4 LW |
8407 | : check for void type |
8408 | echo " " | |
8409 | echo "Checking to see how well your C compiler groks the void type..." >&4 | |
8410 | echo " " | |
8411 | $cat >&4 <<EOM | |
8412 | Support flag bits are: | |
8413 | 1: basic void declarations. | |
8414 | 2: arrays of pointers to functions returning void. | |
8415 | 4: operations between pointers to and addresses of void functions. | |
8416 | 8: generic void pointers. | |
a0d0e21e | 8417 | EOM |
4633a7c4 LW |
8418 | echo " " |
8419 | case "$voidflags" in | |
8420 | '') | |
8421 | $cat >try.c <<'EOCP' | |
8422 | #if TRY & 1 | |
760ac839 | 8423 | void sub() { |
4633a7c4 | 8424 | #else |
760ac839 | 8425 | sub() { |
4633a7c4 LW |
8426 | #endif |
8427 | extern void moo(); /* function returning void */ | |
8428 | void (*goo)(); /* ptr to func returning void */ | |
8429 | #if TRY & 8 | |
8430 | void *hue; /* generic ptr */ | |
8431 | #endif | |
8432 | #if TRY & 2 | |
8433 | void (*foo[10])(); | |
8434 | #endif | |
a0d0e21e | 8435 | |
4633a7c4 LW |
8436 | #if TRY & 4 |
8437 | if(goo == moo) { | |
8438 | exit(0); | |
8439 | } | |
8440 | #endif | |
8441 | exit(0); | |
8442 | } | |
760ac839 | 8443 | main() { sub(); } |
4633a7c4 | 8444 | EOCP |
760ac839 | 8445 | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then |
4633a7c4 LW |
8446 | voidflags=$defvoidused |
8447 | echo "It appears to support void to the level $package wants ($defvoidused)." | |
8448 | if $contains warning .out >/dev/null 2>&1; then | |
8449 | echo "However, you might get some warnings that look like this:" | |
8450 | $cat .out | |
8451 | fi | |
8452 | else | |
8453 | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 | |
760ac839 | 8454 | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then |
4633a7c4 | 8455 | echo "It supports 1..." |
760ac839 | 8456 | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then |
4633a7c4 | 8457 | echo "It also supports 2..." |
760ac839 | 8458 | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8459 | voidflags=7 |
8460 | echo "And it supports 4 but not 8 definitely." | |
8461 | else | |
8462 | echo "It doesn't support 4..." | |
760ac839 | 8463 | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8464 | voidflags=11 |
8465 | echo "But it supports 8." | |
8466 | else | |
8467 | voidflags=3 | |
8468 | echo "Neither does it support 8." | |
8469 | fi | |
8470 | fi | |
8471 | else | |
8472 | echo "It does not support 2..." | |
760ac839 | 8473 | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8474 | voidflags=13 |
8475 | echo "But it supports 4 and 8." | |
8476 | else | |
760ac839 | 8477 | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then |
4633a7c4 LW |
8478 | voidflags=5 |
8479 | echo "And it supports 4 but has not heard about 8." | |
8480 | else | |
8481 | echo "However it supports 8 but not 4." | |
8482 | fi | |
8483 | fi | |
8484 | fi | |
8485 | else | |
8486 | echo "There is no support at all for void." | |
8487 | voidflags=0 | |
8488 | fi | |
8489 | fi | |
8490 | esac | |
2c7991dc | 8491 | : Only prompt user if support does not match the level we want |
4633a7c4 | 8492 | case "$voidflags" in |
2c7991dc | 8493 | "$defvoidused") ;; |
8494 | *) | |
8495 | dflt="$voidflags"; | |
4633a7c4 | 8496 | rp="Your void support flags add up to what?" |
a0d0e21e | 8497 | . ./myread |
4633a7c4 | 8498 | voidflags="$ans" |
a0d0e21e LW |
8499 | ;; |
8500 | esac | |
4633a7c4 | 8501 | $rm -f try.* .out |
a0d0e21e LW |
8502 | |
8503 | : see what type file positions are declared as in the library | |
8504 | set fpos_t fpostype long stdio.h sys/types.h | |
8505 | eval $typedef | |
8506 | echo " " | |
8507 | dflt="$fpostype" | |
8508 | rp="What is the type for file position used by fsetpos()?" | |
2304df62 | 8509 | . ./myread |
a0d0e21e | 8510 | fpostype="$ans" |
2304df62 | 8511 | |
1aef975c AD |
8512 | : Store the full pathname to the sed program for use in the C program |
8513 | full_sed=$sed | |
8514 | ||
2304df62 | 8515 | : see what type gids are declared as in the kernel |
a0d0e21e LW |
8516 | set gid_t gidtype xxx stdio.h sys/types.h |
8517 | eval $typedef | |
2304df62 | 8518 | case "$gidtype" in |
a0d0e21e LW |
8519 | xxx) |
8520 | xxx=`./findhdr sys/user.h` | |
8521 | set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short | |
8522 | case $1 in | |
8523 | unsigned) dflt="$1 $2" ;; | |
8524 | *) dflt="$1" ;; | |
8525 | esac | |
2304df62 | 8526 | ;; |
a0d0e21e | 8527 | *) dflt="$gidtype";; |
2304df62 AD |
8528 | esac |
8529 | echo " " | |
8530 | rp="What is the type for group ids returned by getgid()?" | |
8531 | . ./myread | |
a0d0e21e LW |
8532 | gidtype="$ans" |
8533 | ||
2304df62 AD |
8534 | : see if getgroups exists |
8535 | set getgroups d_getgrps | |
8536 | eval $inlibc | |
8537 | ||
5cd24f17 | 8538 | : see if setgroups exists |
8539 | set setgroups d_setgrps | |
8540 | eval $inlibc | |
8541 | ||
8cc95fdb | 8542 | : Find type of 2nd arg to 'getgroups()' and 'setgroups()' |
a0d0e21e | 8543 | echo " " |
5cd24f17 | 8544 | case "$d_getgrps$d_setgrps" in |
8545 | *define*) | |
a0d0e21e | 8546 | case "$groupstype" in |
2304df62 AD |
8547 | '') dflt="$gidtype" ;; |
8548 | *) dflt="$groupstype" ;; | |
a0d0e21e LW |
8549 | esac |
8550 | $cat <<EOM | |
5cd24f17 | 8551 | What is the type of the second argument to getgroups() and setgroups()? |
8552 | Usually this is the same as group ids, $gidtype, but not always. | |
2304df62 AD |
8553 | |
8554 | EOM | |
5cd24f17 | 8555 | rp='What type is the second argument to getgroups() and setgroups()?' |
a0d0e21e LW |
8556 | . ./myread |
8557 | groupstype="$ans" | |
8558 | ;; | |
8559 | *) groupstype="$gidtype";; | |
2304df62 | 8560 | esac |
2304df62 | 8561 | |
85e6fe83 | 8562 | : see what type lseek is declared as in the kernel |
a0d0e21e LW |
8563 | set off_t lseektype long stdio.h sys/types.h |
8564 | eval $typedef | |
2304df62 | 8565 | echo " " |
a0d0e21e | 8566 | dflt="$lseektype" |
85e6fe83 LW |
8567 | rp="What type is lseek's offset on this system declared as?" |
8568 | . ./myread | |
8569 | lseektype="$ans" | |
2304df62 | 8570 | |
8ff267be | 8571 | echo " " |
8572 | case "$make" in | |
8573 | '') | |
8574 | make=`./loc make make $pth` | |
8575 | case "$make" in | |
8576 | /*) echo make is in $make. ;; | |
8577 | ?:[\\/]*) echo make is in $make. ;; | |
8578 | *) echo "I don't know where 'make' is, and my life depends on it." >&4 | |
8579 | echo "Go find a make program or fix your PATH setting!" >&4 | |
8580 | exit 1 | |
8581 | ;; | |
8582 | esac | |
8583 | ;; | |
8584 | *) echo make is in $make. ;; | |
8585 | esac | |
8586 | ||
8587 | $echo $n "Checking if your $make program sets \$(MAKE)... $c" >&4 | |
8588 | case "$make_set_make" in | |
8589 | '') | |
8590 | $sed 's/^X //' > testmake.mak << 'EOF' | |
8591 | Xall: | |
8592 | X @echo 'ac_maketemp="$(MAKE)"' | |
8593 | EOF | |
8594 | : GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
8595 | case "`$make -f testmake.mak 2>/dev/null`" in | |
8596 | *ac_maketemp=*) make_set_make='#' ;; | |
8597 | *) make_set_make="MAKE=$make" ;; | |
8598 | esac | |
8599 | $rm -f testmake.mak | |
8600 | ;; | |
8601 | esac | |
8602 | case "$make_set_make" in | |
8603 | '#') echo "Yup, it does." >&4 ;; | |
8604 | *) echo "Nope, it doesn't." >&4 ;; | |
8605 | esac | |
8606 | ||
a0d0e21e LW |
8607 | : see what type is used for mode_t |
8608 | set mode_t modetype int stdio.h sys/types.h | |
8609 | eval $typedef | |
8610 | dflt="$modetype" | |
85e6fe83 | 8611 | echo " " |
a0d0e21e | 8612 | rp="What type is used for file modes?" |
85e6fe83 | 8613 | . ./myread |
a0d0e21e | 8614 | modetype="$ans" |
85e6fe83 | 8615 | |
2c7991dc | 8616 | : locate the preferred pager for this system |
8617 | case "$pager" in | |
8618 | '') | |
8619 | dflt='' | |
8620 | case "$pg" in | |
8621 | /*) dflt=$pg;; | |
8622 | esac | |
8623 | case "$more" in | |
8624 | /*) dflt=$more;; | |
8625 | esac | |
8626 | case "$less" in | |
8627 | /*) dflt=$less;; | |
8628 | esac | |
8629 | case "$dflt" in | |
8630 | '') dflt=/usr/ucb/more;; | |
8631 | esac | |
8632 | ;; | |
8633 | *) dflt="$pager";; | |
8634 | esac | |
8635 | echo " " | |
8636 | fn=f/ | |
8637 | rp='What pager is used on your system?' | |
8638 | . ./getfile | |
8639 | pager="$ans" | |
8640 | ||
2304df62 AD |
8641 | : Cruising for prototypes |
8642 | echo " " | |
8643 | echo "Checking out function prototypes..." >&4 | |
8644 | $cat >prototype.c <<'EOCP' | |
8645 | main(int argc, char *argv[]) { | |
8646 | exit(0);} | |
8647 | EOCP | |
a0d0e21e | 8648 | if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then |
2304df62 AD |
8649 | echo "Your C compiler appears to support function prototypes." |
8650 | val="$define" | |
8651 | else | |
8652 | echo "Your C compiler doesn't seem to understand function prototypes." | |
8653 | val="$undef" | |
8654 | fi | |
8655 | set prototype | |
8656 | eval $setvar | |
8657 | $rm -f prototype* | |
8658 | ||
8659 | : check for size of random number generator | |
8660 | echo " " | |
8661 | case "$randbits" in | |
8662 | '') | |
8663 | echo "Checking to see how many bits your rand function produces..." >&4 | |
8ff267be | 8664 | $cat >try.c <<EOCP |
8665 | #$i_unistd I_UNISTD | |
8666 | #$i_stdlib I_STDLIB | |
2304df62 | 8667 | #include <stdio.h> |
8ff267be | 8668 | #ifdef I_UNISTD |
8669 | # include <unistd.h> | |
8670 | #endif | |
8671 | #ifdef I_STDLIB | |
8672 | # include <stdlib.h> | |
8673 | #endif | |
8674 | EOCP | |
8675 | $cat >>try.c <<'EOCP' | |
2304df62 AD |
8676 | main() |
8677 | { | |
8678 | register int i; | |
8679 | register unsigned long tmp; | |
8680 | register unsigned long max = 0L; | |
8681 | ||
8682 | for (i = 1000; i; i--) { | |
8683 | tmp = (unsigned long)rand(); | |
8684 | if (tmp > max) max = tmp; | |
8685 | } | |
8686 | for (i = 0; max; i++) | |
8687 | max /= 2; | |
8688 | printf("%d\n",i); | |
1e422769 | 8689 | fflush(stdout); |
2304df62 AD |
8690 | } |
8691 | EOCP | |
b971f6e4 | 8692 | if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then |
2304df62 AD |
8693 | dflt=`try` |
8694 | else | |
8695 | dflt='?' | |
8696 | echo "(I can't seem to compile the test program...)" | |
8697 | fi | |
8698 | ;; | |
8699 | *) | |
8700 | dflt="$randbits" | |
8701 | ;; | |
8702 | esac | |
a0d0e21e LW |
8703 | rp='How many bits does your rand() function produce?' |
8704 | . ./myread | |
8705 | randbits="$ans" | |
b971f6e4 | 8706 | $rm -f try.c try.o try |
a0d0e21e LW |
8707 | |
8708 | : see if ar generates random libraries by itself | |
8709 | echo " " | |
8710 | echo "Checking how to generate random libraries on your machine..." >&4 | |
8711 | echo 'int bar1() { return bar2(); }' > bar1.c | |
8712 | echo 'int bar2() { return 2; }' > bar2.c | |
8713 | $cat > foo.c <<'EOP' | |
8714 | main() { printf("%d\n", bar1()); exit(0); } | |
8715 | EOP | |
8716 | $cc $ccflags -c bar1.c >/dev/null 2>&1 | |
8717 | $cc $ccflags -c bar2.c >/dev/null 2>&1 | |
8718 | $cc $ccflags -c foo.c >/dev/null 2>&1 | |
5f05dabc | 8719 | ar rc bar$lib_ext bar2.o bar1.o >/dev/null 2>&1 |
8720 | if $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 && | |
a0d0e21e LW |
8721 | ./foobar >/dev/null 2>&1; then |
8722 | echo "ar appears to generate random libraries itself." | |
8723 | orderlib=false | |
8724 | ranlib=":" | |
5f05dabc | 8725 | elif ar ts bar$lib_ext >/dev/null 2>&1 && |
8726 | $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 && | |
a0d0e21e LW |
8727 | ./foobar >/dev/null 2>&1; then |
8728 | echo "a table of contents needs to be added with 'ar ts'." | |
8729 | orderlib=false | |
8730 | ranlib="ar ts" | |
8731 | else | |
ecfc5424 AD |
8732 | case "$ranlib" in |
8733 | :) ranlib='';; | |
8734 | '') | |
8735 | ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin` | |
8736 | $test -f $ranlib || ranlib='' | |
8737 | ;; | |
8738 | esac | |
a0d0e21e | 8739 | if $test -n "$ranlib"; then |
ecfc5424 | 8740 | echo "your system has '$ranlib'; we'll use that." |
a0d0e21e LW |
8741 | orderlib=false |
8742 | else | |
8743 | echo "your system doesn't seem to support random libraries" | |
8744 | echo "so we'll use lorder and tsort to order the libraries." | |
8745 | orderlib=true | |
8746 | ranlib=":" | |
8747 | fi | |
8748 | fi | |
8749 | $rm -f foo* bar* | |
8750 | ||
a0d0e21e LW |
8751 | : see if sys/select.h has to be included |
8752 | set sys/select.h i_sysselct | |
8753 | eval $inhdr | |
8754 | ||
8755 | : see if we should include time.h, sys/time.h, or both | |
8756 | echo " " | |
8757 | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 | |
8758 | $echo $n "I'm now running the test program...$c" | |
8759 | $cat >try.c <<'EOCP' | |
8760 | #include <sys/types.h> | |
8761 | #ifdef I_TIME | |
8762 | #include <time.h> | |
8763 | #endif | |
8764 | #ifdef I_SYSTIME | |
8765 | #ifdef SYSTIMEKERNEL | |
8766 | #define KERNEL | |
8767 | #endif | |
8768 | #include <sys/time.h> | |
8769 | #endif | |
8770 | #ifdef I_SYSSELECT | |
8771 | #include <sys/select.h> | |
8772 | #endif | |
8773 | main() | |
8774 | { | |
8775 | struct tm foo; | |
8776 | #ifdef S_TIMEVAL | |
8777 | struct timeval bar; | |
8778 | #endif | |
8779 | #ifdef S_TIMEZONE | |
8780 | struct timezone tzp; | |
8781 | #endif | |
8782 | if (foo.tm_sec == foo.tm_sec) | |
8783 | exit(0); | |
8784 | #ifdef S_TIMEVAL | |
8785 | if (bar.tv_sec == bar.tv_sec) | |
8786 | exit(0); | |
8787 | #endif | |
8788 | exit(1); | |
8789 | } | |
8790 | EOCP | |
8791 | flags='' | |
40a7a20a | 8792 | for s_timezone in '-DS_TIMEZONE' ''; do |
a0d0e21e LW |
8793 | sysselect='' |
8794 | for s_timeval in '-DS_TIMEVAL' ''; do | |
8795 | for i_systimek in '' '-DSYSTIMEKERNEL'; do | |
8796 | for i_time in '' '-DI_TIME'; do | |
8797 | for i_systime in '-DI_SYSTIME' ''; do | |
8798 | case "$flags" in | |
8799 | '') $echo $n ".$c" | |
8800 | if $cc $ccflags \ | |
8801 | $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \ | |
8802 | try.c -o try >/dev/null 2>&1 ; then | |
8803 | set X $i_time $i_systime $i_systimek $sysselect $s_timeval | |
8804 | shift | |
8805 | flags="$*" | |
8806 | echo " " | |
8807 | $echo $n "Succeeded with $flags$c" | |
8808 | fi | |
8809 | ;; | |
8810 | esac | |
8811 | done | |
8812 | done | |
8813 | done | |
8814 | done | |
40a7a20a | 8815 | done |
a0d0e21e LW |
8816 | timeincl='' |
8817 | echo " " | |
8818 | case "$flags" in | |
8819 | *SYSTIMEKERNEL*) i_systimek="$define" | |
8820 | timeincl=`./findhdr sys/time.h` | |
8821 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; | |
8822 | *) i_systimek="$undef";; | |
8823 | esac | |
8824 | case "$flags" in | |
8825 | *I_TIME*) i_time="$define" | |
8826 | timeincl=`./findhdr time.h`" $timeincl" | |
8827 | echo "We'll include <time.h>." >&4;; | |
8828 | *) i_time="$undef";; | |
8829 | esac | |
8830 | case "$flags" in | |
8831 | *I_SYSTIME*) i_systime="$define" | |
8832 | timeincl=`./findhdr sys/time.h`" $timeincl" | |
8833 | echo "We'll include <sys/time.h>." >&4;; | |
8834 | *) i_systime="$undef";; | |
8835 | esac | |
2304df62 AD |
8836 | $rm -f try.c try |
8837 | ||
a0d0e21e LW |
8838 | : check for fd_set items |
8839 | $cat <<EOM | |
8840 | ||
8841 | Checking to see how well your C compiler handles fd_set and friends ... | |
8842 | EOM | |
8843 | $cat >fd_set.c <<EOCP | |
8844 | #$i_systime I_SYS_TIME | |
8845 | #$i_sysselct I_SYS_SELECT | |
8846 | #$d_socket HAS_SOCKET | |
8847 | #include <sys/types.h> | |
8848 | #ifdef HAS_SOCKET | |
8849 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
8850 | #endif | |
8851 | #ifdef I_SYS_TIME | |
8852 | #include <sys/time.h> | |
a4f3eea9 | 8853 | #endif |
a0d0e21e LW |
8854 | #ifdef I_SYS_SELECT |
8855 | #include <sys/select.h> | |
8856 | #endif | |
a0d0e21e LW |
8857 | main() { |
8858 | fd_set fds; | |
8859 | ||
8860 | #ifdef TRYBITS | |
8861 | if(fds.fds_bits); | |
8862 | #endif | |
8863 | ||
8864 | #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO) | |
8865 | exit(0); | |
8866 | #else | |
8867 | exit(1); | |
8868 | #endif | |
8869 | } | |
8870 | EOCP | |
8871 | if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then | |
8872 | d_fds_bits="$define" | |
8873 | d_fd_set="$define" | |
8874 | echo "Well, your system knows about the normal fd_set typedef..." >&4 | |
8875 | if ./fd_set; then | |
8876 | echo "and you have the normal fd_set macros (just as I'd expect)." >&4 | |
8877 | d_fd_macros="$define" | |
85e6fe83 | 8878 | else |
a0d0e21e LW |
8879 | $cat >&4 <<'EOM' |
8880 | but not the normal fd_set macros! Gaaack! I'll have to cover for you. | |
8881 | EOM | |
8882 | d_fd_macros="$undef" | |
85e6fe83 LW |
8883 | fi |
8884 | else | |
a0d0e21e LW |
8885 | $cat <<'EOM' |
8886 | Hmm, your compiler has some difficulty with fd_set. Checking further... | |
8887 | EOM | |
8888 | if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then | |
8889 | d_fds_bits="$undef" | |
8890 | d_fd_set="$define" | |
8891 | echo "Well, your system has some sort of fd_set available..." >&4 | |
8892 | if ./fd_set; then | |
8893 | echo "and you have the normal fd_set macros." >&4 | |
8894 | d_fd_macros="$define" | |
8895 | else | |
8896 | $cat <<'EOM' | |
8897 | but not the normal fd_set macros! Gross! More work for me... | |
8898 | EOM | |
8899 | d_fd_macros="$undef" | |
8900 | fi | |
85e6fe83 | 8901 | else |
a0d0e21e LW |
8902 | echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4 |
8903 | d_fd_set="$undef" | |
8904 | d_fds_bits="$undef" | |
8905 | d_fd_macros="$undef" | |
85e6fe83 LW |
8906 | fi |
8907 | fi | |
a0d0e21e LW |
8908 | $rm -f fd_set* |
8909 | ||
8910 | ||
8911 | : check for type of arguments to select. This will only really | |
8912 | : work if the system supports prototypes and provides one for | |
8913 | : select. | |
8914 | case "$d_select" in | |
8915 | $define) | |
8916 | : Make initial guess | |
8917 | case "$selecttype" in | |
8918 | ''|' ') | |
8919 | case "$d_fd_set" in | |
8920 | $define) xxx='fd_set *' ;; | |
8921 | *) xxx='int *' ;; | |
8922 | esac | |
8923 | ;; | |
8924 | *) xxx="$selecttype" | |
8925 | ;; | |
8926 | esac | |
8927 | : backup guess | |
8928 | case "$xxx" in | |
8929 | 'fd_set *') yyy='int *' ;; | |
8930 | 'int *') yyy='fd_set *' ;; | |
8931 | esac | |
85e6fe83 | 8932 | |
2304df62 AD |
8933 | $cat <<EOM |
8934 | ||
a0d0e21e | 8935 | Checking to see what type of arguments are expected by select(). |
2304df62 | 8936 | EOM |
a0d0e21e LW |
8937 | $cat >try.c <<EOCP |
8938 | #$i_systime I_SYS_TIME | |
8939 | #$i_sysselct I_SYS_SELECT | |
8940 | #$d_socket HAS_SOCKET | |
8941 | #include <sys/types.h> | |
8942 | #ifdef HAS_SOCKET | |
8943 | #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */ | |
8944 | #endif | |
8945 | #ifdef I_SYS_TIME | |
8946 | #include <sys/time.h> | |
8ff267be | 8947 | #endif |
a0d0e21e LW |
8948 | #ifdef I_SYS_SELECT |
8949 | #include <sys/select.h> | |
8950 | #endif | |
a0d0e21e LW |
8951 | main() |
8952 | { | |
8953 | int width; | |
8954 | Select_fd_set_t readfds; | |
8955 | Select_fd_set_t writefds; | |
8956 | Select_fd_set_t exceptfds; | |
8957 | struct timeval timeout; | |
8958 | select(width, readfds, writefds, exceptfds, &timeout); | |
8959 | exit(0); | |
8960 | } | |
8961 | EOCP | |
8962 | if $cc $ccflags -c -DSelect_fd_set_t="$xxx" try.c >/dev/null 2>&1 ; then | |
8963 | selecttype="$xxx" | |
8964 | echo "Your system uses $xxx for the arguments to select." >&4 | |
8965 | elif $cc $ccflags -c -DSelect_fd_set_t="$yyy" try.c >/dev/null 2>&1 ; then | |
8966 | selecttype="$yyy" | |
8967 | echo "Your system uses $yyy for the arguments to select." >&4 | |
8968 | else | |
8969 | rp='What is the type for the 2nd, 3rd, and 4th arguments to select?' | |
8970 | dflt="$xxx" | |
8971 | . ./myread | |
8972 | selecttype="$ans" | |
8973 | fi | |
8974 | $rm -f try.[co] | |
8975 | ;; | |
8e07c86e | 8976 | *) selecttype='int *' |
a0d0e21e LW |
8977 | ;; |
8978 | esac | |
2304df62 | 8979 | |
8e07c86e AD |
8980 | : Trace out the files included by signal.h, then look for SIGxxx names. |
8981 | : Remove SIGARRAYSIZE used by HPUX. | |
4633a7c4 | 8982 | : Remove SIGTYP void lines used by OS2. |
8e07c86e AD |
8983 | xxx=`echo '#include <signal.h>' | |
8984 | $cppstdin $cppminus $cppflags 2>/dev/null | | |
8985 | $grep '^[ ]*#.*include' | | |
8986 | $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq` | |
8987 | : Check this list of files to be sure we have parsed the cpp output ok. | |
8988 | : This will also avoid potentially non-existent files, such | |
8989 | : as ../foo/bar.h | |
8990 | xxxfiles='' | |
8991 | for xx in $xxx /dev/null ; do | |
8992 | $test -f "$xx" && xxxfiles="$xxxfiles $xx" | |
8993 | done | |
8994 | : If we have found no files, at least try signal.h | |
8995 | case "$xxxfiles" in | |
8996 | '') xxxfiles=`./findhdr signal.h` ;; | |
8997 | esac | |
8998 | xxx=`awk ' | |
4633a7c4 | 8999 | $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ { |
8e07c86e AD |
9000 | print substr($2, 4, 20) |
9001 | } | |
4633a7c4 | 9002 | $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ { |
8e07c86e AD |
9003 | print substr($3, 4, 20) |
9004 | }' $xxxfiles` | |
9005 | : Append some common names just in case the awk scan failed. | |
9006 | xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL" | |
9007 | xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP" | |
9008 | xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM" | |
9009 | xxx="$xxx WINCH WIND WINDOW XCPU XFSZ" | |
9010 | : generate a few handy files for later | |
4633a7c4 LW |
9011 | $cat > signal.c <<'EOP' |
9012 | #include <sys/types.h> | |
9013 | #include <signal.h> | |
9014 | int main() { | |
760ac839 LW |
9015 | |
9016 | /* Strange style to avoid deeply-nested #if/#else/#endif */ | |
9017 | #ifndef NSIG | |
9018 | # ifdef _NSIG | |
9019 | # define NSIG (_NSIG) | |
9020 | # endif | |
9021 | #endif | |
9022 | ||
9023 | #ifndef NSIG | |
9024 | # ifdef SIGMAX | |
9025 | # define NSIG (SIGMAX+1) | |
9026 | # endif | |
9027 | #endif | |
9028 | ||
9029 | #ifndef NSIG | |
9030 | # ifdef SIG_MAX | |
9031 | # define NSIG (SIG_MAX+1) | |
9032 | # endif | |
9033 | #endif | |
9034 | ||
9035 | #ifndef NSIG | |
9036 | # ifdef MAXSIG | |
9037 | # define NSIG (MAXSIG+1) | |
9038 | # endif | |
4633a7c4 | 9039 | #endif |
760ac839 LW |
9040 | |
9041 | #ifndef NSIG | |
9042 | # ifdef MAX_SIG | |
9043 | # define NSIG (MAX_SIG+1) | |
9044 | # endif | |
9045 | #endif | |
9046 | ||
9047 | #ifndef NSIG | |
9048 | # ifdef SIGARRAYSIZE | |
9049 | # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */ | |
9050 | # endif | |
9051 | #endif | |
9052 | ||
9053 | #ifndef NSIG | |
9054 | # ifdef _sys_nsig | |
9055 | # define NSIG (_sys_nsig) /* Solaris 2.5 */ | |
9056 | # endif | |
9057 | #endif | |
9058 | ||
9059 | /* Default to some arbitrary number that's big enough to get most | |
9060 | of the common signals. | |
9061 | */ | |
9062 | #ifndef NSIG | |
9063 | # define NSIG 50 | |
4633a7c4 | 9064 | #endif |
760ac839 LW |
9065 | |
9066 | printf("NSIG %d\n", NSIG); | |
9067 | ||
4633a7c4 LW |
9068 | EOP |
9069 | echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk ' | |
8e07c86e AD |
9070 | { |
9071 | printf "#ifdef SIG"; printf $1; printf "\n" | |
9072 | printf "printf(\""; printf $1; printf " %%d\\n\",SIG"; | |
9073 | printf $1; printf ");\n" | |
9074 | printf "#endif\n" | |
2304df62 | 9075 | } |
2304df62 | 9076 | END { |
8e07c86e | 9077 | printf "}\n"; |
2304df62 | 9078 | } |
4633a7c4 LW |
9079 | ' >>signal.c |
9080 | $cat >signal.awk <<'EOP' | |
9081 | BEGIN { ndups = 0 } | |
9082 | $1 ~ /^NSIG$/ { nsig = $2 } | |
9083 | ($1 !~ /^NSIG$/) && (NF == 2) { | |
9084 | if ($2 > maxsig) { maxsig = $2 } | |
9085 | if (sig_name[$2]) { | |
9086 | dup_name[ndups] = $1 | |
9087 | dup_num[ndups] = $2 | |
9088 | ndups++ | |
9089 | } | |
9090 | else { | |
9091 | sig_name[$2] = $1 | |
9092 | sig_num[$2] = $2 | |
9093 | } | |
9094 | ||
9095 | } | |
9096 | END { | |
9097 | if (nsig == 0) { nsig = maxsig + 1 } | |
9098 | for (n = 1; n < nsig; n++) { | |
9099 | if (sig_name[n]) { | |
9100 | printf("%s %d\n", sig_name[n], sig_num[n]) | |
9101 | } | |
9102 | else { | |
9103 | printf("NUM%d %d\n", n, n) | |
9104 | } | |
9105 | } | |
9106 | for (n = 0; n < ndups; n++) { | |
9107 | printf("%s %d\n", dup_name[n], dup_num[n]) | |
9108 | } | |
9109 | } | |
9110 | EOP | |
9111 | $cat >signal_cmd <<EOS | |
8e07c86e AD |
9112 | $startsh |
9113 | $test -s signal.lst && exit 0 | |
3e3baf6d | 9114 | if $cc $ccflags $ldflags signal.c -o signal >/dev/null 2>&1; then |
4633a7c4 | 9115 | ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst |
8e07c86e AD |
9116 | else |
9117 | echo "(I can't seem be able to compile the test program -- Guessing)" | |
9118 | echo 'kill -l' >signal | |
9119 | set X \`csh -f <signal\` | |
9120 | $rm -f signal | |
2304df62 | 9121 | shift |
8e07c86e AD |
9122 | case \$# in |
9123 | 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;; | |
2304df62 | 9124 | esac |
8e07c86e | 9125 | echo \$@ | $tr ' ' '\012' | \ |
3e3baf6d | 9126 | $awk '{ printf \$1; printf " %d\n", ++s; }' >signal.lst |
8e07c86e AD |
9127 | fi |
9128 | $rm -f signal.c signal signal.o | |
9129 | EOS | |
4633a7c4 LW |
9130 | chmod a+x signal_cmd |
9131 | $eunicefix signal_cmd | |
8e07c86e AD |
9132 | |
9133 | : generate list of signal names | |
9134 | echo " " | |
9135 | case "$sig_name" in | |
4633a7c4 LW |
9136 | '') sig_num='' ;; |
9137 | esac | |
9138 | case "$sig_num" in | |
9139 | '') sig_name='' ;; | |
9140 | esac | |
9141 | case "$sig_name" in | |
8e07c86e | 9142 | '') |
4633a7c4 LW |
9143 | echo "Generating a list of signal names and numbers..." >&4 |
9144 | ./signal_cmd | |
8e07c86e AD |
9145 | sig_name=`$awk '{printf "%s ", $1}' signal.lst` |
9146 | sig_name="ZERO $sig_name" | |
4633a7c4 LW |
9147 | sig_num=`$awk '{printf "%d ", $2}' signal.lst` |
9148 | sig_num="0 $sig_num" | |
a0d0e21e | 9149 | ;; |
2304df62 | 9150 | esac |
a0d0e21e LW |
9151 | echo "The following signals are available:" |
9152 | echo " " | |
9153 | echo $sig_name | $awk \ | |
9154 | 'BEGIN { linelen = 0 } | |
9155 | { | |
8e07c86e | 9156 | for (i = 1; i <= NF; i++) { |
a0d0e21e LW |
9157 | name = "SIG" $i " " |
9158 | linelen = linelen + length(name) | |
9159 | if (linelen > 70) { | |
9160 | printf "\n" | |
9161 | linelen = length(name) | |
9162 | } | |
9163 | printf "%s", name | |
9164 | } | |
8e07c86e | 9165 | printf "\n" |
a0d0e21e | 9166 | }' |
4633a7c4 | 9167 | $rm -f signal signal.c signal.awk signal.lst signal_cmd |
a0d0e21e LW |
9168 | |
9169 | : see what type is used for size_t | |
9170 | set size_t sizetype 'unsigned int' stdio.h sys/types.h | |
9171 | eval $typedef | |
9172 | dflt="$sizetype" | |
9173 | echo " " | |
9174 | rp="What type is used for the length parameter for string functions?" | |
2304df62 | 9175 | . ./myread |
a0d0e21e LW |
9176 | sizetype="$ans" |
9177 | ||
9178 | : see what type is used for signed size_t | |
9179 | set ssize_t ssizetype int stdio.h sys/types.h | |
9180 | eval $typedef | |
9181 | dflt="$ssizetype" | |
9182 | $cat > ssize.c <<EOM | |
9183 | #include <stdio.h> | |
9184 | #include <sys/types.h> | |
9185 | #define Size_t $sizetype | |
9186 | #define SSize_t $dflt | |
9187 | main() | |
9188 | { | |
9189 | if (sizeof(Size_t) == sizeof(SSize_t)) | |
9190 | printf("$dflt\n"); | |
9191 | else if (sizeof(Size_t) == sizeof(int)) | |
9192 | printf("int\n"); | |
9193 | else | |
9194 | printf("long\n"); | |
d97d40b5 | 9195 | fflush(stdout); |
760ac839 | 9196 | exit(0); |
a0d0e21e LW |
9197 | } |
9198 | EOM | |
9199 | echo " " | |
24fef2a7 AD |
9200 | # If $libs contains -lsfio, and sfio is mis-configured, then it |
9201 | # sometimes (apparently) runs and exits with a 0 status, but with no | |
9202 | # output!. Thus we check with test -s whether we actually got any | |
9203 | # output. I think it has to do with sfio's use of _exit vs. exit, | |
9204 | # but I don't know for sure. --Andy Dougherty 1/27/97. | |
9205 | if $cc $optimize $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1 && | |
9206 | ./ssize > ssize.out 2>/dev/null && test -s ssize.out ; then | |
9207 | ssizetype=`$cat ssize.out` | |
a0d0e21e LW |
9208 | echo "I'll be using $ssizetype for functions returning a byte count." >&4 |
9209 | else | |
24fef2a7 AD |
9210 | $cat >&4 <<EOM |
9211 | ||
9212 | Help! I can't compile and run the ssize_t test program: please enlighten me! | |
9213 | (This is probably a misconfiguration in your system or libraries, and | |
9214 | you really ought to fix it. Still, I'll try anyway.) | |
a0d0e21e LW |
9215 | |
9216 | I need a type that is the same size as $sizetype, but is guaranteed to | |
24fef2a7 | 9217 | be signed. Common values are ssize_t, int and long. |
a0d0e21e LW |
9218 | |
9219 | EOM | |
9220 | rp="What signed type is the same size as $sizetype?" | |
9221 | . ./myread | |
9222 | ssizetype="$ans" | |
9223 | fi | |
24fef2a7 | 9224 | $rm -f ssize ssize.[co] ssize.out |
a0d0e21e LW |
9225 | |
9226 | : see what type of char stdio uses. | |
9227 | echo " " | |
9228 | if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then | |
9229 | echo "Your stdio uses unsigned chars." >&4 | |
9230 | stdchar="unsigned char" | |
9231 | else | |
9232 | echo "Your stdio uses signed chars." >&4 | |
9233 | stdchar="char" | |
9234 | fi | |
9235 | ||
9236 | : see if time exists | |
9237 | echo " " | |
ecfc5424 | 9238 | if set time val -f d_time; eval $csym; $val; then |
a0d0e21e | 9239 | echo 'time() found.' >&4 |
ecfc5424 | 9240 | val="$define" |
a0d0e21e LW |
9241 | set time_t timetype long stdio.h sys/types.h |
9242 | eval $typedef | |
9243 | dflt="$timetype" | |
9244 | echo " " | |
c2960299 | 9245 | rp="What type is returned by time() on this system?" |
a0d0e21e LW |
9246 | . ./myread |
9247 | timetype="$ans" | |
9248 | else | |
9249 | echo 'time() not found, hope that will do.' >&4 | |
ecfc5424 | 9250 | val="$undef" |
a0d0e21e LW |
9251 | timetype='int'; |
9252 | fi | |
a0d0e21e LW |
9253 | set d_time |
9254 | eval $setvar | |
9255 | ||
9256 | : see what type uids are declared as in the kernel | |
9257 | set uid_t uidtype xxx stdio.h sys/types.h | |
9258 | eval $typedef | |
9259 | case "$uidtype" in | |
9260 | xxx) | |
9261 | xxx=`./findhdr sys/user.h` | |
9262 | set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short | |
9263 | case $1 in | |
9264 | unsigned) dflt="$1 $2" ;; | |
9265 | *) dflt="$1" ;; | |
9266 | esac | |
9267 | ;; | |
4633a7c4 LW |
9268 | *) dflt="$uidtype";; |
9269 | esac | |
9270 | echo " " | |
9271 | rp="What is the type for user ids returned by getuid()?" | |
9272 | . ./myread | |
9273 | uidtype="$ans" | |
9274 | ||
9275 | : see if dbm.h is available | |
9276 | : see if dbmclose exists | |
9277 | set dbmclose d_dbmclose | |
9278 | eval $inlibc | |
9279 | ||
9280 | case "$d_dbmclose" in | |
9281 | $define) | |
9282 | set dbm.h i_dbm | |
9283 | eval $inhdr | |
9284 | case "$i_dbm" in | |
9285 | $define) | |
9286 | val="$undef" | |
9287 | set i_rpcsvcdbm | |
9288 | eval $setvar | |
9289 | ;; | |
9290 | *) set rpcsvc/dbm.h i_rpcsvcdbm | |
9291 | eval $inhdr | |
9292 | ;; | |
9293 | esac | |
9294 | ;; | |
9295 | *) echo "We won't be including <dbm.h>" | |
9296 | val="$undef" | |
9297 | set i_dbm | |
9298 | eval $setvar | |
9299 | val="$undef" | |
9300 | set i_rpcsvcdbm | |
9301 | eval $setvar | |
9302 | ;; | |
a0d0e21e | 9303 | esac |
2304df62 | 9304 | |
2304df62 AD |
9305 | : see if this is a sys/file.h system |
9306 | val='' | |
9307 | set sys/file.h val | |
9308 | eval $inhdr | |
9309 | ||
8e07c86e | 9310 | : do we need to include sys/file.h ? |
2304df62 AD |
9311 | case "$val" in |
9312 | "$define") | |
9313 | echo " " | |
9314 | if $h_sysfile; then | |
9315 | val="$define" | |
9316 | echo "We'll be including <sys/file.h>." >&4 | |
9317 | else | |
9318 | val="$undef" | |
9319 | echo "We won't be including <sys/file.h>." >&4 | |
9320 | fi | |
9321 | ;; | |
9322 | *) | |
9323 | h_sysfile=false | |
9324 | ;; | |
9325 | esac | |
9326 | set i_sysfile | |
9327 | eval $setvar | |
9328 | ||
9329 | : see if fcntl.h is there | |
9330 | val='' | |
9331 | set fcntl.h val | |
9332 | eval $inhdr | |
9333 | ||
9334 | : see if we can include fcntl.h | |
9335 | case "$val" in | |
9336 | "$define") | |
9337 | echo " " | |
9338 | if $h_fcntl; then | |
9339 | val="$define" | |
9340 | echo "We'll be including <fcntl.h>." >&4 | |
9341 | else | |
9342 | val="$undef" | |
9343 | if $h_sysfile; then | |
9344 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 | |
9345 | else | |
9346 | echo "We won't be including <fcntl.h>." >&4 | |
9347 | fi | |
9348 | fi | |
9349 | ;; | |
9350 | *) | |
9351 | h_fcntl=false | |
9352 | val="$undef" | |
9353 | ;; | |
9354 | esac | |
9355 | set i_fcntl | |
9356 | eval $setvar | |
9357 | ||
2304df62 AD |
9358 | : see if this is an grp system |
9359 | set grp.h i_grp | |
9360 | eval $inhdr | |
9361 | ||
4633a7c4 LW |
9362 | : see if locale.h is available |
9363 | set locale.h i_locale | |
9364 | eval $inhdr | |
9365 | ||
a0d0e21e LW |
9366 | : see if this is a math.h system |
9367 | set math.h i_math | |
9368 | eval $inhdr | |
9369 | ||
4633a7c4 LW |
9370 | : see if ndbm.h is available |
9371 | set ndbm.h t_ndbm | |
9372 | eval $inhdr | |
9373 | case "$t_ndbm" in | |
9374 | $define) | |
9375 | : see if dbm_open exists | |
9376 | set dbm_open d_dbm_open | |
9377 | eval $inlibc | |
9378 | case "$d_dbm_open" in | |
9379 | $undef) | |
9380 | t_ndbm="$undef" | |
9381 | echo "We won't be including <ndbm.h>" | |
9382 | ;; | |
9383 | esac | |
9384 | ;; | |
9385 | esac | |
9386 | val="$t_ndbm" | |
9387 | set i_ndbm | |
9388 | eval $setvar | |
9389 | ||
85e6fe83 | 9390 | : see if net/errno.h is available |
a0d0e21e LW |
9391 | val='' |
9392 | set net/errno.h val | |
2304df62 | 9393 | eval $inhdr |
a0d0e21e | 9394 | |
85e6fe83 | 9395 | : Unfortunately, it causes problems on some systems. Arrgh. |
a0d0e21e LW |
9396 | case "$val" in |
9397 | $define) | |
9398 | cat > try.c <<'EOM' | |
85e6fe83 LW |
9399 | #include <stdio.h> |
9400 | #include <errno.h> | |
9401 | #include <net/errno.h> | |
9402 | int func() | |
9403 | { | |
a0d0e21e | 9404 | return ENOTSOCK; |
85e6fe83 LW |
9405 | } |
9406 | EOM | |
a0d0e21e LW |
9407 | if $cc $ccflags -c try.c >/dev/null 2>&1; then |
9408 | echo "We'll be including <net/errno.h>." >&4 | |
9409 | else | |
9410 | echo "We won't be including <net/errno.h>." >&4 | |
9411 | val="$undef" | |
9412 | fi | |
9413 | $rm -f try.* try | |
9414 | ;; | |
85e6fe83 | 9415 | esac |
a0d0e21e LW |
9416 | set i_neterrno |
9417 | eval $setvar | |
2304df62 AD |
9418 | |
9419 | : get C preprocessor symbols handy | |
9420 | echo " " | |
ecfc5424 | 9421 | $echo $n "Hmm... $c" |
a0d0e21e | 9422 | echo $al | $tr ' ' '\012' >Cppsym.know |
2304df62 AD |
9423 | $cat <<EOSS >Cppsym |
9424 | $startsh | |
9425 | case "\$1" in | |
9426 | -l) list=true | |
9427 | shift | |
9428 | ;; | |
9429 | esac | |
9430 | unknown='' | |
9431 | case "\$list\$#" in | |
9432 | 1|2) | |
9433 | for sym do | |
9434 | if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then | |
9435 | exit 0 | |
9436 | elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then | |
9437 | : | |
9438 | else | |
9439 | unknown="\$unknown \$sym" | |
9440 | fi | |
9441 | done | |
9442 | set X \$unknown | |
9443 | shift | |
9444 | ;; | |
9445 | esac | |
9446 | case \$# in | |
9447 | 0) exit 1;; | |
9448 | esac | |
9449 | echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\ | |
9450 | #ifdef \1\\ | |
9451 | exit 0; _ _ _ _\1\\ \1\\ | |
9452 | #endif\\ | |
9453 | /' >Cppsym\$\$ | |
9454 | echo "exit 1; _ _ _" >>Cppsym\$\$ | |
9455 | $cppstdin $cppminus <Cppsym\$\$ | $grep '^exit [01]; _ _' >Cppsym2\$\$ | |
9456 | case "\$list" in | |
9457 | true) $awk 'NF > 5 {print substr(\$6,2,100)}' <Cppsym2\$\$ ;; | |
9458 | *) | |
9459 | sh Cppsym2\$\$ | |
9460 | status=\$? | |
9461 | ;; | |
9462 | esac | |
9463 | $rm -f Cppsym\$\$ Cppsym2\$\$ | |
9464 | exit \$status | |
9465 | EOSS | |
9466 | chmod +x Cppsym | |
9467 | $eunicefix Cppsym | |
ecfc5424 AD |
9468 | ./Cppsym -l $al | $sort | $grep -v '^$' >Cppsym.true |
9469 | ||
9470 | : now check the C compiler for additional symbols | |
9471 | $cat >ccsym <<EOS | |
9472 | $startsh | |
9473 | $cat >tmp.c <<EOF | |
9474 | extern int foo; | |
9475 | EOF | |
9476 | for i in \`$cc -v -c tmp.c 2>&1\` | |
9477 | do | |
9478 | case "\$i" in | |
9479 | -D*) echo "\$i" | $sed 's/^-D//';; | |
9480 | -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';; | |
9481 | esac | |
9482 | done | |
9483 | $rm -f try.c | |
9484 | EOS | |
9485 | chmod +x ccsym | |
9486 | $eunicefix ccsym | |
9487 | ./ccsym | $sort | $uniq >ccsym.raw | |
f0b7e567 AD |
9488 | $awk '/\=/ { print $0; next } |
9489 | { print $0"=1" }' ccsym.raw >ccsym.list | |
ecfc5424 AD |
9490 | $awk '{ print $0"=1" }' Cppsym.true >ccsym.true |
9491 | $comm -13 ccsym.true ccsym.list >ccsym.own | |
9492 | $comm -12 ccsym.true ccsym.list >ccsym.com | |
9493 | $comm -23 ccsym.true ccsym.list >ccsym.cpp | |
9494 | also='' | |
9495 | symbols='symbols' | |
9496 | if $test -z ccsym.raw; then | |
9497 | echo "Your C compiler doesn't seem to define any symbol!" >&4 | |
9498 | echo " " | |
9499 | echo "However, your C preprocessor defines the following ones:" | |
9500 | $cat Cppsym.true | |
9501 | else | |
9502 | if $test -s ccsym.com; then | |
9503 | echo "Your C compiler and pre-processor define these symbols:" | |
9504 | $sed -e 's/\(.*\)=.*/\1/' ccsym.com | |
9505 | also='also ' | |
9506 | symbols='ones' | |
9507 | $test "$silent" || sleep 1 | |
9508 | fi | |
9509 | if $test -s ccsym.cpp; then | |
9510 | $test "$also" && echo " " | |
9511 | echo "Your C pre-processor ${also}defines the following $symbols:" | |
9512 | $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp | |
9513 | also='further ' | |
9514 | $test "$silent" || sleep 1 | |
9515 | fi | |
9516 | if $test -s ccsym.own; then | |
9517 | $test "$also" && echo " " | |
9518 | echo "Your C compiler ${also}defines the following cpp variables:" | |
9519 | $sed -e 's/\(.*\)=1/\1/' ccsym.own | |
9520 | $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true | |
9521 | $test "$silent" || sleep 1 | |
9522 | fi | |
9523 | fi | |
9524 | $rm -f ccsym* | |
2304df62 AD |
9525 | |
9526 | : see if this is a termio system | |
9527 | val="$undef" | |
9528 | val2="$undef" | |
9529 | val3="$undef" | |
9530 | if $test `./findhdr termios.h`; then | |
9531 | set tcsetattr i_termios | |
9532 | eval $inlibc | |
9533 | val3="$i_termios" | |
9534 | fi | |
9535 | echo " " | |
9536 | case "$val3" in | |
9537 | "$define") echo "You have POSIX termios.h... good!" >&4;; | |
ecfc5424 | 9538 | *) if ./Cppsym pyr; then |
2304df62 AD |
9539 | case "`/bin/universe`" in |
9540 | ucb) if $test `./findhdr sgtty.h`; then | |
9541 | val2="$define" | |
9542 | echo "<sgtty.h> found." >&4 | |
9543 | else | |
9544 | echo "System is pyramid with BSD universe." | |
9545 | echo "<sgtty.h> not found--you could have problems." >&4 | |
9546 | fi;; | |
9547 | *) if $test `./findhdr termio.h`; then | |
9548 | val="$define" | |
9549 | echo "<termio.h> found." >&4 | |
9550 | else | |
9551 | echo "System is pyramid with USG universe." | |
9552 | echo "<termio.h> not found--you could have problems." >&4 | |
9553 | fi;; | |
9554 | esac | |
ecfc5424 | 9555 | elif ./usg; then |
2304df62 AD |
9556 | if $test `./findhdr termio.h`; then |
9557 | echo "<termio.h> found." >&4 | |
9558 | val="$define" | |
9559 | elif $test `./findhdr sgtty.h`; then | |
9560 | echo "<sgtty.h> found." >&4 | |
9561 | val2="$define" | |
9562 | else | |
9563 | echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4 | |
9564 | fi | |
9565 | else | |
9566 | if $test `./findhdr sgtty.h`; then | |
9567 | echo "<sgtty.h> found." >&4 | |
9568 | val2="$define" | |
9569 | elif $test `./findhdr termio.h`; then | |
9570 | echo "<termio.h> found." >&4 | |
9571 | val="$define" | |
9572 | else | |
9573 | echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4 | |
9574 | fi | |
9575 | fi;; | |
9576 | esac | |
9577 | set i_termio; eval $setvar | |
9578 | val=$val2; set i_sgtty; eval $setvar | |
9579 | val=$val3; set i_termios; eval $setvar | |
9580 | ||
a0d0e21e | 9581 | : see if stdarg is available |
2304df62 | 9582 | echo " " |
a0d0e21e LW |
9583 | if $test `./findhdr stdarg.h`; then |
9584 | echo "<stdarg.h> found." >&4 | |
9585 | valstd="$define" | |
2304df62 | 9586 | else |
a0d0e21e LW |
9587 | echo "<stdarg.h> NOT found." >&4 |
9588 | valstd="$undef" | |
2304df62 | 9589 | fi |
85e6fe83 | 9590 | |
a0d0e21e | 9591 | : see if varags is available |
2304df62 AD |
9592 | echo " " |
9593 | if $test `./findhdr varargs.h`; then | |
2304df62 AD |
9594 | echo "<varargs.h> found." >&4 |
9595 | else | |
2304df62 AD |
9596 | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 |
9597 | fi | |
2304df62 AD |
9598 | |
9599 | : set up the varargs testing programs | |
9600 | $cat > varargs.c <<EOP | |
9601 | #ifdef I_STDARG | |
9602 | #include <stdarg.h> | |
9603 | #endif | |
9604 | #ifdef I_VARARGS | |
9605 | #include <varargs.h> | |
9606 | #endif | |
9607 | ||
9608 | #ifdef I_STDARG | |
9609 | int f(char *p, ...) | |
9610 | #else | |
9611 | int f(va_alist) | |
9612 | va_dcl | |
9613 | #endif | |
9614 | { | |
9615 | va_list ap; | |
9616 | #ifndef I_STDARG | |
9617 | char *p; | |
9618 | #endif | |
9619 | #ifdef I_STDARG | |
9620 | va_start(ap,p); | |
9621 | #else | |
9622 | va_start(ap); | |
9623 | p = va_arg(ap, char *); | |
9624 | #endif | |
9625 | va_end(ap); | |
9626 | } | |
9627 | EOP | |
9628 | $cat > varargs <<EOP | |
40a7a20a | 9629 | $startsh |
2304df62 AD |
9630 | if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then |
9631 | echo "true" | |
9632 | else | |
9633 | echo "false" | |
9634 | fi | |
9635 | $rm -f varargs.o | |
9636 | EOP | |
9637 | chmod +x varargs | |
9638 | ||
9639 | : now check which varargs header should be included | |
9640 | echo " " | |
9641 | i_varhdr='' | |
a0d0e21e | 9642 | case "$valstd" in |
2304df62 AD |
9643 | "$define") |
9644 | if `./varargs I_STDARG`; then | |
a0d0e21e | 9645 | val='stdarg.h' |
2304df62 | 9646 | elif `./varargs I_VARARGS`; then |
a0d0e21e | 9647 | val='varargs.h' |
2304df62 AD |
9648 | fi |
9649 | ;; | |
9650 | *) | |
9651 | if `./varargs I_VARARGS`; then | |
a0d0e21e | 9652 | val='varargs.h' |
2304df62 AD |
9653 | fi |
9654 | ;; | |
9655 | esac | |
a0d0e21e | 9656 | case "$val" in |
2304df62 AD |
9657 | '') |
9658 | echo "I could not find the definition for va_dcl... You have problems..." >&4 | |
a0d0e21e LW |
9659 | val="$undef"; set i_stdarg; eval $setvar |
9660 | val="$undef"; set i_varargs; eval $setvar | |
2304df62 | 9661 | ;; |
a0d0e21e LW |
9662 | *) |
9663 | set i_varhdr | |
9664 | eval $setvar | |
9665 | case "$i_varhdr" in | |
9666 | stdarg.h) | |
9667 | val="$define"; set i_stdarg; eval $setvar | |
9668 | val="$undef"; set i_varargs; eval $setvar | |
9669 | ;; | |
9670 | varargs.h) | |
9671 | val="$undef"; set i_stdarg; eval $setvar | |
9672 | val="$define"; set i_varargs; eval $setvar | |
9673 | ;; | |
9674 | esac | |
9675 | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; | |
2304df62 AD |
9676 | esac |
9677 | $rm -f varargs* | |
9678 | ||
a0d0e21e LW |
9679 | : see if stddef is available |
9680 | set stddef.h i_stddef | |
9681 | eval $inhdr | |
9682 | ||
a0d0e21e LW |
9683 | : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl |
9684 | set sys/filio.h i_sysfilio | |
9685 | eval $inhdr | |
9686 | echo " " | |
9687 | if $test `./findhdr sys/ioctl.h`; then | |
9688 | val="$define" | |
9689 | echo '<sys/ioctl.h> found.' >&4 | |
9690 | else | |
9691 | val="$undef" | |
9692 | if $test $i_sysfilio = "$define"; then | |
9693 | echo '<sys/ioctl.h> NOT found.' >&4 | |
9694 | else | |
9695 | $test $i_sgtty = "$define" && xxx="sgtty.h" | |
9696 | $test $i_termio = "$define" && xxx="termio.h" | |
9697 | $test $i_termios = "$define" && xxx="termios.h" | |
9698 | echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4 | |
9699 | fi | |
9700 | fi | |
9701 | set i_sysioctl | |
9702 | eval $setvar | |
9703 | ||
9704 | : see if this is a sys/param system | |
9705 | set sys/param.h i_sysparam | |
9706 | eval $inhdr | |
9707 | ||
8ff267be | 9708 | : see if sys/resource.h has to be included |
9709 | set sys/resource.h i_sysresrc | |
9710 | eval $inhdr | |
9711 | ||
1aef975c AD |
9712 | : see if sys/stat.h is available |
9713 | set sys/stat.h i_sysstat | |
9714 | eval $inhdr | |
9715 | ||
fed7345c AD |
9716 | : see if sys/types.h has to be included |
9717 | set sys/types.h i_systypes | |
9718 | eval $inhdr | |
9719 | ||
25f94b33 AD |
9720 | : see if this is a sys/un.h system |
9721 | set sys/un.h i_sysun | |
9722 | eval $inhdr | |
9723 | ||
8ff267be | 9724 | : see if this is a syswait system |
9725 | set sys/wait.h i_syswait | |
a0d0e21e LW |
9726 | eval $inhdr |
9727 | ||
9728 | : see if this is an utime system | |
9729 | set utime.h i_utime | |
9730 | eval $inhdr | |
9731 | ||
760ac839 LW |
9732 | : see if this is a values.h system |
9733 | set values.h i_values | |
9734 | eval $inhdr | |
9735 | ||
2304df62 | 9736 | : see if this is a vfork system |
85e6fe83 | 9737 | case "$d_vfork" in |
a0d0e21e LW |
9738 | "$define") |
9739 | set vfork.h i_vfork | |
85e6fe83 LW |
9740 | eval $inhdr |
9741 | ;; | |
a0d0e21e LW |
9742 | *) |
9743 | i_vfork="$undef" | |
9744 | ;; | |
85e6fe83 | 9745 | esac |
a0d0e21e | 9746 | |
4633a7c4 LW |
9747 | : see if gdbm.h is available |
9748 | set gdbm.h t_gdbm | |
9749 | eval $inhdr | |
9750 | case "$t_gdbm" in | |
9751 | $define) | |
9752 | : see if gdbm_open exists | |
9753 | set gdbm_open d_gdbm_open | |
9754 | eval $inlibc | |
9755 | case "$d_gdbm_open" in | |
9756 | $undef) | |
9757 | t_gdbm="$undef" | |
9758 | echo "We won't be including <gdbm.h>" | |
9759 | ;; | |
9760 | esac | |
9761 | ;; | |
9762 | esac | |
9763 | val="$t_gdbm" | |
9764 | set i_gdbm | |
9765 | eval $setvar | |
9766 | ||
9767 | echo " " | |
9768 | echo "Looking for extensions..." >&4 | |
9769 | cd ../ext | |
9770 | : If we are using the old config.sh, known_extensions may contain | |
9771 | : old or inaccurate or duplicate values. | |
9772 | known_extensions='' | |
9773 | : We do not use find because it might not be available. | |
9774 | : We do not just use MANIFEST because the user may have dropped | |
9775 | : some additional extensions into the source tree and expect them | |
9776 | : to be built. | |
9777 | for xxx in * ; do | |
5f05dabc | 9778 | case "$xxx" in |
9779 | DynaLoader) ;; | |
9780 | *) if $test -f $xxx/$xxx.xs; then | |
9781 | known_extensions="$known_extensions $xxx" | |
9782 | else | |
9783 | if $test -d $xxx; then | |
9784 | cd $xxx | |
9785 | for yyy in * ; do | |
9786 | if $test -f $yyy/$yyy.xs; then | |
9787 | known_extensions="$known_extensions $xxx/$yyy" | |
9788 | fi | |
9789 | done | |
9790 | cd .. | |
9791 | fi | |
9792 | fi ;; | |
9793 | esac | |
4633a7c4 LW |
9794 | done |
9795 | set X $known_extensions | |
9796 | shift | |
9797 | known_extensions="$*" | |
9798 | cd ../UU | |
9799 | ||
9800 | : Now see which are supported on this system. | |
9801 | avail_ext='' | |
9802 | for xxx in $known_extensions ; do | |
9803 | case "$xxx" in | |
9804 | DB_File) case "$i_db" in | |
9805 | $define) avail_ext="$avail_ext $xxx" ;; | |
9806 | esac | |
9807 | ;; | |
9808 | GDBM_File) case "$i_gdbm" in | |
9809 | $define) avail_ext="$avail_ext $xxx" ;; | |
9810 | esac | |
9811 | ;; | |
9812 | NDBM_File) case "$i_ndbm" in | |
9813 | $define) avail_ext="$avail_ext $xxx" ;; | |
9814 | esac | |
9815 | ;; | |
9816 | ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in | |
9817 | *"${define}"*) avail_ext="$avail_ext $xxx" ;; | |
9818 | esac | |
9819 | ;; | |
9820 | POSIX) case "$useposix" in | |
9821 | true|define|y) avail_ext="$avail_ext $xxx" ;; | |
9822 | esac | |
9823 | ;; | |
8ff267be | 9824 | Opcode) case "$useopcode" in |
2c7991dc | 9825 | true|define|y) avail_ext="$avail_ext $xxx" ;; |
9826 | esac | |
9827 | ;; | |
4633a7c4 LW |
9828 | Socket) case "$d_socket" in |
9829 | $define) avail_ext="$avail_ext $xxx" ;; | |
9830 | esac | |
9831 | ;; | |
9832 | *) avail_ext="$avail_ext $xxx" | |
9833 | ;; | |
9834 | esac | |
9835 | done | |
9836 | ||
9837 | set X $avail_ext | |
9838 | shift | |
9839 | avail_ext="$*" | |
9840 | ||
9841 | case $usedl in | |
9842 | $define) | |
9843 | $cat <<EOM | |
9844 | A number of extensions are supplied with $package. You may choose to | |
9845 | compile these extensions for dynamic loading (the default), compile | |
9846 | them into the $package executable (static loading), or not include | |
9847 | them at all. Answer "none" to include no extensions. | |
9848 | ||
9849 | EOM | |
9850 | case "$dynamic_ext" in | |
9851 | '') dflt="$avail_ext" ;; | |
9852 | *) dflt="$dynamic_ext" ;; | |
9853 | esac | |
9854 | case "$dflt" in | |
9855 | '') dflt=none;; | |
9856 | esac | |
9857 | rp="What extensions do you wish to load dynamically?" | |
9858 | . ./myread | |
9859 | case "$ans" in | |
9860 | none) dynamic_ext=' ' ;; | |
9861 | *) dynamic_ext="$ans" ;; | |
9862 | esac | |
9863 | ||
9864 | case "$static_ext" in | |
9865 | '') | |
9866 | : Exclude those already listed in dynamic linking | |
9867 | dflt='' | |
9868 | for xxx in $avail_ext; do | |
9869 | case " $dynamic_ext " in | |
9870 | *" $xxx "*) ;; | |
9871 | *) dflt="$dflt $xxx" ;; | |
9872 | esac | |
9873 | done | |
9874 | set X $dflt | |
9875 | shift | |
9876 | dflt="$*" | |
9877 | ;; | |
9878 | *) dflt="$static_ext" | |
9879 | ;; | |
9880 | esac | |
9881 | ||
9882 | case "$dflt" in | |
9883 | '') dflt=none;; | |
9884 | esac | |
9885 | rp="What extensions do you wish to load statically?" | |
9886 | . ./myread | |
9887 | case "$ans" in | |
9888 | none) static_ext=' ' ;; | |
9889 | *) static_ext="$ans" ;; | |
9890 | esac | |
9891 | ;; | |
9892 | *) | |
9893 | $cat <<EOM | |
9894 | A number of extensions are supplied with $package. Answer "none" | |
9895 | to include no extensions. | |
9896 | ||
9897 | EOM | |
9898 | case "$static_ext" in | |
9899 | '') dflt="$avail_ext" ;; | |
9900 | *) dflt="$static_ext" ;; | |
9901 | esac | |
9902 | ||
9903 | case "$dflt" in | |
9904 | '') dflt=none;; | |
9905 | esac | |
9906 | rp="What extensions do you wish to include?" | |
9907 | . ./myread | |
9908 | case "$ans" in | |
9909 | none) static_ext=' ' ;; | |
9910 | *) static_ext="$ans" ;; | |
9911 | esac | |
9912 | ;; | |
9913 | esac | |
9914 | ||
9915 | set X $dynamic_ext $static_ext | |
9916 | shift | |
9917 | extensions="$*" | |
9918 | ||
16d20bd9 AD |
9919 | : Remove build directory name from cppstdin so it can be used from |
9920 | : either the present location or the final installed location. | |
9921 | echo " " | |
9922 | : Get out of the UU directory to get correct path name. | |
9923 | cd .. | |
9924 | case "$cppstdin" in | |
9925 | `pwd`/cppstdin) | |
9926 | echo "Stripping down cppstdin path name" | |
9927 | cppstdin=cppstdin | |
9928 | ;; | |
9929 | esac | |
9930 | cd UU | |
9931 | ||
2304df62 AD |
9932 | : end of configuration questions |
9933 | echo " " | |
9934 | echo "End of configuration questions." | |
9935 | echo " " | |
9936 | ||
9937 | : back to where it started | |
9938 | if test -d ../UU; then | |
9939 | cd .. | |
9940 | fi | |
9941 | ||
9942 | : configuration may be patched via a 'config.over' file | |
9943 | if $test -f config.over; then | |
9944 | echo " " | |
9945 | dflt=y | |
9946 | rp='I see a config.over file. Do you wish to load it?' | |
9947 | . UU/myread | |
9948 | case "$ans" in | |
9949 | n*) echo "OK, I'll ignore it.";; | |
9950 | *) . ./config.over | |
9951 | echo "Configuration override changes have been loaded." | |
9952 | ;; | |
9953 | esac | |
9954 | fi | |
9955 | ||
ecfc5424 AD |
9956 | : in case they want portability, strip down executable paths |
9957 | case "$d_portable" in | |
9958 | "$define") | |
9959 | echo " " | |
9960 | echo "Stripping down executable paths..." >&4 | |
9961 | for file in $loclist $trylist; do | |
9962 | eval $file="\$file" | |
9963 | done | |
9964 | ;; | |
9965 | esac | |
9966 | ||
2304df62 AD |
9967 | : create config.sh file |
9968 | echo " " | |
9969 | echo "Creating config.sh..." >&4 | |
9970 | $spitshell <<EOT >config.sh | |
9971 | $startsh | |
9972 | # | |
5cd24f17 | 9973 | # This file was produced by running the Configure script. It holds all |
9974 | # the definitions figured out by Configure. Should you modify any of | |
9975 | # these values, do not forget to propagate your changes by running | |
9976 | # "Configure -S"; or, equivalently, you may run each .SH file yourself. | |
2304df62 AD |
9977 | # |
9978 | ||
9979 | # Configuration time: $cf_time | |
9980 | # Configured by: $cf_by | |
9981 | # Target system: $myuname | |
9982 | ||
2304df62 AD |
9983 | Author='$Author' |
9984 | Date='$Date' | |
9985 | Header='$Header' | |
9986 | Id='$Id' | |
9987 | Locker='$Locker' | |
9988 | Log='$Log' | |
ecfc5424 | 9989 | Mcc='$Mcc' |
2304df62 AD |
9990 | RCSfile='$RCSfile' |
9991 | Revision='$Revision' | |
9992 | Source='$Source' | |
9993 | State='$State' | |
9994 | afs='$afs' | |
a0d0e21e | 9995 | alignbytes='$alignbytes' |
ecfc5424 | 9996 | aphostname='$aphostname' |
4633a7c4 | 9997 | ar='$ar' |
a0d0e21e LW |
9998 | archlib='$archlib' |
9999 | archlibexp='$archlibexp' | |
10000 | archname='$archname' | |
4633a7c4 | 10001 | archobjs='$archobjs' |
ecfc5424 AD |
10002 | awk='$awk' |
10003 | baserev='$baserev' | |
10004 | bash='$bash' | |
2304df62 | 10005 | bin='$bin' |
5f05dabc | 10006 | bincompat3='$bincompat3' |
2304df62 | 10007 | binexp='$binexp' |
ecfc5424 AD |
10008 | bison='$bison' |
10009 | byacc='$byacc' | |
2304df62 | 10010 | byteorder='$byteorder' |
ecfc5424 AD |
10011 | c='$c' |
10012 | castflags='$castflags' | |
10013 | cat='$cat' | |
2304df62 | 10014 | cc='$cc' |
ecfc5424 AD |
10015 | cccdlflags='$cccdlflags' |
10016 | ccdlflags='$ccdlflags' | |
2304df62 | 10017 | ccflags='$ccflags' |
2304df62 | 10018 | cf_by='$cf_by' |
8e07c86e | 10019 | cf_email='$cf_email' |
2304df62 | 10020 | cf_time='$cf_time' |
ecfc5424 AD |
10021 | chgrp='$chgrp' |
10022 | chmod='$chmod' | |
10023 | chown='$chown' | |
10024 | clocktype='$clocktype' | |
10025 | comm='$comm' | |
10026 | compress='$compress' | |
2304df62 | 10027 | contains='$contains' |
ecfc5424 AD |
10028 | cp='$cp' |
10029 | cpio='$cpio' | |
10030 | cpp='$cpp' | |
a0d0e21e | 10031 | cpp_stuff='$cpp_stuff' |
ecfc5424 | 10032 | cppflags='$cppflags' |
2304df62 AD |
10033 | cpplast='$cpplast' |
10034 | cppminus='$cppminus' | |
10035 | cpprun='$cpprun' | |
10036 | cppstdin='$cppstdin' | |
ecfc5424 AD |
10037 | cryptlib='$cryptlib' |
10038 | csh='$csh' | |
10039 | d_Gconvert='$d_Gconvert' | |
2304df62 | 10040 | d_access='$d_access' |
a0d0e21e | 10041 | d_alarm='$d_alarm' |
ecfc5424 AD |
10042 | d_archlib='$d_archlib' |
10043 | d_attribut='$d_attribut' | |
2304df62 AD |
10044 | d_bcmp='$d_bcmp' |
10045 | d_bcopy='$d_bcopy' | |
5f05dabc | 10046 | d_bincompat3='$d_bincompat3' |
ecfc5424 | 10047 | d_bsd='$d_bsd' |
2afac517 | 10048 | d_bsdgetpgrp='$d_bsdgetpgrp' |
ecfc5424 | 10049 | d_bsdpgrp='$d_bsdpgrp' |
2afac517 | 10050 | d_bsdsetpgrp='$d_bsdsetpgrp' |
2304df62 AD |
10051 | d_bzero='$d_bzero' |
10052 | d_casti32='$d_casti32' | |
2304df62 | 10053 | d_castneg='$d_castneg' |
ecfc5424 | 10054 | d_charvspr='$d_charvspr' |
a0d0e21e LW |
10055 | d_chown='$d_chown' |
10056 | d_chroot='$d_chroot' | |
2304df62 | 10057 | d_chsize='$d_chsize' |
a0d0e21e | 10058 | d_closedir='$d_closedir' |
2304df62 | 10059 | d_const='$d_const' |
2304df62 AD |
10060 | d_crypt='$d_crypt' |
10061 | d_csh='$d_csh' | |
a0d0e21e LW |
10062 | d_cuserid='$d_cuserid' |
10063 | d_dbl_dig='$d_dbl_dig' | |
10064 | d_difftime='$d_difftime' | |
ecfc5424 | 10065 | d_dirnamlen='$d_dirnamlen' |
a0d0e21e LW |
10066 | d_dlerror='$d_dlerror' |
10067 | d_dlopen='$d_dlopen' | |
10068 | d_dlsymun='$d_dlsymun' | |
2304df62 AD |
10069 | d_dosuid='$d_dosuid' |
10070 | d_dup2='$d_dup2' | |
8e07c86e | 10071 | d_eofnblk='$d_eofnblk' |
40a7a20a | 10072 | d_eunice='$d_eunice' |
2304df62 AD |
10073 | d_fchmod='$d_fchmod' |
10074 | d_fchown='$d_fchown' | |
10075 | d_fcntl='$d_fcntl' | |
a0d0e21e LW |
10076 | d_fd_macros='$d_fd_macros' |
10077 | d_fd_set='$d_fd_set' | |
10078 | d_fds_bits='$d_fds_bits' | |
10079 | d_fgetpos='$d_fgetpos' | |
2304df62 AD |
10080 | d_flexfnam='$d_flexfnam' |
10081 | d_flock='$d_flock' | |
a0d0e21e | 10082 | d_fork='$d_fork' |
ecfc5424 | 10083 | d_fpathconf='$d_fpathconf' |
a0d0e21e | 10084 | d_fsetpos='$d_fsetpos' |
5f05dabc | 10085 | d_ftime='$d_ftime' |
2304df62 | 10086 | d_getgrps='$d_getgrps' |
5cd24f17 | 10087 | d_setgrps='$d_setgrps' |
2304df62 | 10088 | d_gethent='$d_gethent' |
2304df62 | 10089 | d_gethname='$d_gethname' |
a0d0e21e | 10090 | d_getlogin='$d_getlogin' |
2afac517 | 10091 | d_getpgid='$d_getpgid' |
2304df62 AD |
10092 | d_getpgrp2='$d_getpgrp2' |
10093 | d_getpgrp='$d_getpgrp' | |
a0d0e21e | 10094 | d_getppid='$d_getppid' |
2304df62 | 10095 | d_getprior='$d_getprior' |
5f05dabc | 10096 | d_gettimeod='$d_gettimeod' |
a4f3eea9 | 10097 | d_gnulibc='$d_gnulibc' |
2304df62 | 10098 | d_htonl='$d_htonl' |
ecfc5424 | 10099 | d_index='$d_index' |
7e1af8bc | 10100 | d_inetaton='$d_inetaton' |
2304df62 AD |
10101 | d_isascii='$d_isascii' |
10102 | d_killpg='$d_killpg' | |
10103 | d_link='$d_link' | |
a0d0e21e LW |
10104 | d_locconv='$d_locconv' |
10105 | d_lockf='$d_lockf' | |
2304df62 | 10106 | d_lstat='$d_lstat' |
a0d0e21e LW |
10107 | d_mblen='$d_mblen' |
10108 | d_mbstowcs='$d_mbstowcs' | |
10109 | d_mbtowc='$d_mbtowc' | |
2304df62 AD |
10110 | d_memcmp='$d_memcmp' |
10111 | d_memcpy='$d_memcpy' | |
10112 | d_memmove='$d_memmove' | |
10113 | d_memset='$d_memset' | |
10114 | d_mkdir='$d_mkdir' | |
a0d0e21e LW |
10115 | d_mkfifo='$d_mkfifo' |
10116 | d_mktime='$d_mktime' | |
2304df62 AD |
10117 | d_msg='$d_msg' |
10118 | d_msgctl='$d_msgctl' | |
10119 | d_msgget='$d_msgget' | |
10120 | d_msgrcv='$d_msgrcv' | |
10121 | d_msgsnd='$d_msgsnd' | |
ecfc5424 | 10122 | d_mymalloc='$d_mymalloc' |
a0d0e21e | 10123 | d_nice='$d_nice' |
4633a7c4 | 10124 | d_oldarchlib='$d_oldarchlib' |
ecfc5424 | 10125 | d_oldsock='$d_oldsock' |
2304df62 | 10126 | d_open3='$d_open3' |
a0d0e21e LW |
10127 | d_pathconf='$d_pathconf' |
10128 | d_pause='$d_pause' | |
ecfc5424 | 10129 | d_phostname='$d_phostname' |
a0d0e21e | 10130 | d_pipe='$d_pipe' |
8e07c86e | 10131 | d_poll='$d_poll' |
2304df62 | 10132 | d_portable='$d_portable' |
ecfc5424 AD |
10133 | d_pwage='$d_pwage' |
10134 | d_pwchange='$d_pwchange' | |
10135 | d_pwclass='$d_pwclass' | |
10136 | d_pwcomment='$d_pwcomment' | |
10137 | d_pwexpire='$d_pwexpire' | |
10138 | d_pwquota='$d_pwquota' | |
2304df62 | 10139 | d_readdir='$d_readdir' |
a0d0e21e | 10140 | d_readlink='$d_readlink' |
2304df62 | 10141 | d_rename='$d_rename' |
ecfc5424 | 10142 | d_rewinddir='$d_rewinddir' |
2304df62 AD |
10143 | d_rmdir='$d_rmdir' |
10144 | d_safebcpy='$d_safebcpy' | |
10145 | d_safemcpy='$d_safemcpy' | |
36477c24 | 10146 | d_sanemcmp='$d_sanemcmp' |
ecfc5424 | 10147 | d_seekdir='$d_seekdir' |
2304df62 AD |
10148 | d_select='$d_select' |
10149 | d_sem='$d_sem' | |
10150 | d_semctl='$d_semctl' | |
10151 | d_semget='$d_semget' | |
10152 | d_semop='$d_semop' | |
10153 | d_setegid='$d_setegid' | |
10154 | d_seteuid='$d_seteuid' | |
a0d0e21e | 10155 | d_setlinebuf='$d_setlinebuf' |
2304df62 AD |
10156 | d_setlocale='$d_setlocale' |
10157 | d_setpgid='$d_setpgid' | |
10158 | d_setpgrp2='$d_setpgrp2' | |
2304df62 AD |
10159 | d_setpgrp='$d_setpgrp' |
10160 | d_setprior='$d_setprior' | |
10161 | d_setregid='$d_setregid' | |
10162 | d_setresgid='$d_setresgid' | |
10163 | d_setresuid='$d_setresuid' | |
10164 | d_setreuid='$d_setreuid' | |
10165 | d_setrgid='$d_setrgid' | |
10166 | d_setruid='$d_setruid' | |
10167 | d_setsid='$d_setsid' | |
760ac839 | 10168 | d_sfio='$d_sfio' |
2304df62 AD |
10169 | d_shm='$d_shm' |
10170 | d_shmat='$d_shmat' | |
a0d0e21e | 10171 | d_shmatprototype='$d_shmatprototype' |
2304df62 AD |
10172 | d_shmctl='$d_shmctl' |
10173 | d_shmdt='$d_shmdt' | |
10174 | d_shmget='$d_shmget' | |
2c7991dc | 10175 | d_sigaction='$d_sigaction' |
a5f75d66 | 10176 | d_sigsetjmp='$d_sigsetjmp' |
2304df62 AD |
10177 | d_socket='$d_socket' |
10178 | d_sockpair='$d_sockpair' | |
2304df62 | 10179 | d_statblks='$d_statblks' |
c2960299 AD |
10180 | d_stdio_cnt_lval='$d_stdio_cnt_lval' |
10181 | d_stdio_ptr_lval='$d_stdio_ptr_lval' | |
16d20bd9 | 10182 | d_stdiobase='$d_stdiobase' |
2304df62 | 10183 | d_stdstdio='$d_stdstdio' |
2304df62 | 10184 | d_strchr='$d_strchr' |
a0d0e21e | 10185 | d_strcoll='$d_strcoll' |
2304df62 AD |
10186 | d_strctcpy='$d_strctcpy' |
10187 | d_strerrm='$d_strerrm' | |
10188 | d_strerror='$d_strerror' | |
a89d8a78 DH |
10189 | d_strtod='$d_strtod' |
10190 | d_strtol='$d_strtol' | |
10191 | d_strtoul='$d_strtoul' | |
a0d0e21e | 10192 | d_strxfrm='$d_strxfrm' |
ecfc5424 | 10193 | d_suidsafe='$d_suidsafe' |
2304df62 AD |
10194 | d_symlink='$d_symlink' |
10195 | d_syscall='$d_syscall' | |
a0d0e21e | 10196 | d_sysconf='$d_sysconf' |
ecfc5424 AD |
10197 | d_sysernlst='$d_sysernlst' |
10198 | d_syserrlst='$d_syserrlst' | |
2304df62 | 10199 | d_system='$d_system' |
a0d0e21e LW |
10200 | d_tcgetpgrp='$d_tcgetpgrp' |
10201 | d_tcsetpgrp='$d_tcsetpgrp' | |
ecfc5424 | 10202 | d_telldir='$d_telldir' |
85e6fe83 | 10203 | d_time='$d_time' |
2304df62 AD |
10204 | d_times='$d_times' |
10205 | d_truncate='$d_truncate' | |
a0d0e21e LW |
10206 | d_tzname='$d_tzname' |
10207 | d_umask='$d_umask' | |
ecfc5424 | 10208 | d_uname='$d_uname' |
2304df62 | 10209 | d_vfork='$d_vfork' |
ecfc5424 | 10210 | d_void_closedir='$d_void_closedir' |
2304df62 | 10211 | d_voidsig='$d_voidsig' |
ecfc5424 | 10212 | d_voidtty='$d_voidtty' |
2304df62 | 10213 | d_volatile='$d_volatile' |
2304df62 AD |
10214 | d_vprintf='$d_vprintf' |
10215 | d_wait4='$d_wait4' | |
10216 | d_waitpid='$d_waitpid' | |
a0d0e21e LW |
10217 | d_wcstombs='$d_wcstombs' |
10218 | d_wctomb='$d_wctomb' | |
ecfc5424 AD |
10219 | d_xenix='$d_xenix' |
10220 | date='$date' | |
10221 | db_hashtype='$db_hashtype' | |
10222 | db_prefixtype='$db_prefixtype' | |
10223 | defvoidused='$defvoidused' | |
10224 | direntrytype='$direntrytype' | |
a0d0e21e | 10225 | dlext='$dlext' |
2304df62 | 10226 | dlsrc='$dlsrc' |
ecfc5424 | 10227 | dynamic_ext='$dynamic_ext' |
8e07c86e | 10228 | eagain='$eagain' |
ecfc5424 AD |
10229 | echo='$echo' |
10230 | egrep='$egrep' | |
10231 | emacs='$emacs' | |
10232 | eunicefix='$eunicefix' | |
4633a7c4 | 10233 | exe_ext='$exe_ext' |
ecfc5424 AD |
10234 | expr='$expr' |
10235 | extensions='$extensions' | |
10236 | find='$find' | |
4633a7c4 | 10237 | firstmakefile='$firstmakefile' |
ecfc5424 | 10238 | flex='$flex' |
a0d0e21e | 10239 | fpostype='$fpostype' |
94b6baf5 | 10240 | freetype='$freetype' |
1aef975c AD |
10241 | full_csh='$full_csh' |
10242 | full_sed='$full_sed' | |
ecfc5424 AD |
10243 | gcc='$gcc' |
10244 | gccversion='$gccversion' | |
2304df62 | 10245 | gidtype='$gidtype' |
ecfc5424 AD |
10246 | glibpth='$glibpth' |
10247 | grep='$grep' | |
10248 | groupcat='$groupcat' | |
2304df62 | 10249 | groupstype='$groupstype' |
8ff267be | 10250 | gzip='$gzip' |
2304df62 AD |
10251 | h_fcntl='$h_fcntl' |
10252 | h_sysfile='$h_sysfile' | |
ecfc5424 AD |
10253 | hint='$hint' |
10254 | hostcat='$hostcat' | |
10255 | huge='$huge' | |
10256 | i_bsdioctl='$i_bsdioctl' | |
a0d0e21e | 10257 | i_db='$i_db' |
2304df62 | 10258 | i_dbm='$i_dbm' |
2304df62 | 10259 | i_dirent='$i_dirent' |
a0d0e21e | 10260 | i_dld='$i_dld' |
2304df62 AD |
10261 | i_dlfcn='$i_dlfcn' |
10262 | i_fcntl='$i_fcntl' | |
a0d0e21e | 10263 | i_float='$i_float' |
2304df62 AD |
10264 | i_gdbm='$i_gdbm' |
10265 | i_grp='$i_grp' | |
a0d0e21e | 10266 | i_limits='$i_limits' |
4633a7c4 | 10267 | i_locale='$i_locale' |
a0d0e21e LW |
10268 | i_malloc='$i_malloc' |
10269 | i_math='$i_math' | |
85e6fe83 | 10270 | i_memory='$i_memory' |
2304df62 | 10271 | i_ndbm='$i_ndbm' |
85e6fe83 | 10272 | i_neterrno='$i_neterrno' |
2304df62 | 10273 | i_niin='$i_niin' |
2304df62 | 10274 | i_pwd='$i_pwd' |
8e07c86e | 10275 | i_rpcsvcdbm='$i_rpcsvcdbm' |
760ac839 | 10276 | i_sfio='$i_sfio' |
ecfc5424 AD |
10277 | i_sgtty='$i_sgtty' |
10278 | i_stdarg='$i_stdarg' | |
2304df62 | 10279 | i_stddef='$i_stddef' |
a0d0e21e | 10280 | i_stdlib='$i_stdlib' |
2304df62 | 10281 | i_string='$i_string' |
2304df62 AD |
10282 | i_sysdir='$i_sysdir' |
10283 | i_sysfile='$i_sysfile' | |
a0d0e21e | 10284 | i_sysfilio='$i_sysfilio' |
ecfc5424 | 10285 | i_sysin='$i_sysin' |
2304df62 | 10286 | i_sysioctl='$i_sysioctl' |
2304df62 | 10287 | i_sysndir='$i_sysndir' |
a0d0e21e | 10288 | i_sysparam='$i_sysparam' |
8ff267be | 10289 | i_sysresrc='$i_sysresrc' |
2304df62 | 10290 | i_sysselct='$i_sysselct' |
ecfc5424 | 10291 | i_syssockio='$i_syssockio' |
1aef975c | 10292 | i_sysstat='$i_sysstat' |
ecfc5424 AD |
10293 | i_systime='$i_systime' |
10294 | i_systimek='$i_systimek' | |
a0d0e21e | 10295 | i_systimes='$i_systimes' |
fed7345c | 10296 | i_systypes='$i_systypes' |
25f94b33 | 10297 | i_sysun='$i_sysun' |
8ff267be | 10298 | i_syswait='$i_syswait' |
2304df62 AD |
10299 | i_termio='$i_termio' |
10300 | i_termios='$i_termios' | |
2304df62 | 10301 | i_time='$i_time' |
85e6fe83 | 10302 | i_unistd='$i_unistd' |
2304df62 | 10303 | i_utime='$i_utime' |
760ac839 | 10304 | i_values='$i_values' |
2304df62 AD |
10305 | i_varargs='$i_varargs' |
10306 | i_varhdr='$i_varhdr' | |
10307 | i_vfork='$i_vfork' | |
ecfc5424 AD |
10308 | incpath='$incpath' |
10309 | inews='$inews' | |
10310 | installarchlib='$installarchlib' | |
10311 | installbin='$installbin' | |
16d20bd9 AD |
10312 | installman1dir='$installman1dir' |
10313 | installman3dir='$installman3dir' | |
ecfc5424 AD |
10314 | installprivlib='$installprivlib' |
10315 | installscript='$installscript' | |
4633a7c4 | 10316 | installsitearch='$installsitearch' |
25f94b33 | 10317 | installsitelib='$installsitelib' |
2304df62 | 10318 | intsize='$intsize' |
ecfc5424 AD |
10319 | known_extensions='$known_extensions' |
10320 | ksh='$ksh' | |
10321 | large='$large' | |
232e078e | 10322 | ld='$ld' |
ecfc5424 AD |
10323 | lddlflags='$lddlflags' |
10324 | ldflags='$ldflags' | |
10325 | less='$less' | |
4633a7c4 | 10326 | lib_ext='$lib_ext' |
2304df62 | 10327 | libc='$libc' |
8ff267be | 10328 | libperl='$libperl' |
2304df62 | 10329 | libpth='$libpth' |
2304df62 | 10330 | libs='$libs' |
ecfc5424 AD |
10331 | libswanted='$libswanted' |
10332 | line='$line' | |
10333 | lint='$lint' | |
10334 | lkflags='$lkflags' | |
10335 | ln='$ln' | |
85e6fe83 | 10336 | lns='$lns' |
8e07c86e AD |
10337 | locincpth='$locincpth' |
10338 | loclibpth='$loclibpth' | |
24fef2a7 | 10339 | longsize='$longsize' |
ecfc5424 AD |
10340 | lp='$lp' |
10341 | lpr='$lpr' | |
10342 | ls='$ls' | |
85e6fe83 | 10343 | lseektype='$lseektype' |
ecfc5424 AD |
10344 | mail='$mail' |
10345 | mailx='$mailx' | |
10346 | make='$make' | |
8ff267be | 10347 | make_set_make='$make_set_make' |
2304df62 AD |
10348 | mallocobj='$mallocobj' |
10349 | mallocsrc='$mallocsrc' | |
10350 | malloctype='$malloctype' | |
16d20bd9 AD |
10351 | man1dir='$man1dir' |
10352 | man1direxp='$man1direxp' | |
10353 | man1ext='$man1ext' | |
10354 | man3dir='$man3dir' | |
10355 | man3direxp='$man3direxp' | |
10356 | man3ext='$man3ext' | |
2304df62 | 10357 | medium='$medium' |
ecfc5424 AD |
10358 | mips='$mips' |
10359 | mips_type='$mips_type' | |
10360 | mkdir='$mkdir' | |
2304df62 | 10361 | models='$models' |
a0d0e21e | 10362 | modetype='$modetype' |
ecfc5424 AD |
10363 | more='$more' |
10364 | mv='$mv' | |
40000a8c | 10365 | myarchname='$myarchname' |
2304df62 AD |
10366 | mydomain='$mydomain' |
10367 | myhostname='$myhostname' | |
ecfc5424 | 10368 | myuname='$myuname' |
2304df62 | 10369 | n='$n' |
ecfc5424 | 10370 | nm_opt='$nm_opt' |
40a7a20a | 10371 | nm_so_opt='$nm_so_opt' |
ecfc5424 | 10372 | nroff='$nroff' |
8e07c86e | 10373 | o_nonblock='$o_nonblock' |
4633a7c4 LW |
10374 | obj_ext='$obj_ext' |
10375 | oldarchlib='$oldarchlib' | |
10376 | oldarchlibexp='$oldarchlibexp' | |
ecfc5424 | 10377 | optimize='$optimize' |
85e6fe83 | 10378 | orderlib='$orderlib' |
ecfc5424 AD |
10379 | osname='$osname' |
10380 | osvers='$osvers' | |
2304df62 | 10381 | package='$package' |
2c7991dc | 10382 | pager='$pager' |
ecfc5424 AD |
10383 | passcat='$passcat' |
10384 | patchlevel='$patchlevel' | |
4633a7c4 | 10385 | path_sep='$path_sep' |
ecfc5424 | 10386 | perl='$perl' |
8e07c86e | 10387 | perladmin='$perladmin' |
4633a7c4 | 10388 | perlpath='$perlpath' |
ecfc5424 AD |
10389 | pg='$pg' |
10390 | phostname='$phostname' | |
10391 | plibpth='$plibpth' | |
10392 | pmake='$pmake' | |
10393 | pr='$pr' | |
a0d0e21e | 10394 | prefix='$prefix' |
1aef975c | 10395 | prefixexp='$prefixexp' |
2304df62 AD |
10396 | privlib='$privlib' |
10397 | privlibexp='$privlibexp' | |
10398 | prototype='$prototype' | |
10399 | randbits='$randbits' | |
ecfc5424 | 10400 | ranlib='$ranlib' |
8e07c86e | 10401 | rd_nodata='$rd_nodata' |
ecfc5424 AD |
10402 | rm='$rm' |
10403 | rmail='$rmail' | |
10404 | runnm='$runnm' | |
2304df62 AD |
10405 | scriptdir='$scriptdir' |
10406 | scriptdirexp='$scriptdirexp' | |
ecfc5424 | 10407 | sed='$sed' |
a0d0e21e | 10408 | selecttype='$selecttype' |
ecfc5424 AD |
10409 | sendmail='$sendmail' |
10410 | sh='$sh' | |
10411 | shar='$shar' | |
10412 | sharpbang='$sharpbang' | |
10413 | shmattype='$shmattype' | |
24fef2a7 | 10414 | shortsize='$shortsize' |
2afac517 | 10415 | shrpenv='$shrpenv' |
ecfc5424 | 10416 | shsharp='$shsharp' |
2304df62 | 10417 | sig_name='$sig_name' |
8e07c86e | 10418 | sig_num='$sig_num' |
ecfc5424 | 10419 | signal_t='$signal_t' |
4633a7c4 LW |
10420 | sitearch='$sitearch' |
10421 | sitearchexp='$sitearchexp' | |
25f94b33 AD |
10422 | sitelib='$sitelib' |
10423 | sitelibexp='$sitelibexp' | |
a0d0e21e | 10424 | sizetype='$sizetype' |
ecfc5424 AD |
10425 | sleep='$sleep' |
10426 | smail='$smail' | |
10427 | small='$small' | |
a0d0e21e | 10428 | so='$so' |
ecfc5424 AD |
10429 | sockethdr='$sockethdr' |
10430 | socketlib='$socketlib' | |
10431 | sort='$sort' | |
10432 | spackage='$spackage' | |
2304df62 | 10433 | spitshell='$spitshell' |
ecfc5424 | 10434 | split='$split' |
a0d0e21e | 10435 | ssizetype='$ssizetype' |
4633a7c4 | 10436 | startperl='$startperl' |
2304df62 | 10437 | startsh='$startsh' |
ecfc5424 | 10438 | static_ext='$static_ext' |
2304df62 | 10439 | stdchar='$stdchar' |
16d20bd9 AD |
10440 | stdio_base='$stdio_base' |
10441 | stdio_bufsiz='$stdio_bufsiz' | |
10442 | stdio_cnt='$stdio_cnt' | |
10443 | stdio_ptr='$stdio_ptr' | |
ecfc5424 AD |
10444 | strings='$strings' |
10445 | submit='$submit' | |
f55a7265 | 10446 | subversion='$subversion' |
2304df62 | 10447 | sysman='$sysman' |
ecfc5424 AD |
10448 | tail='$tail' |
10449 | tar='$tar' | |
10450 | tbl='$tbl' | |
10451 | test='$test' | |
10452 | timeincl='$timeincl' | |
10453 | timetype='$timetype' | |
10454 | touch='$touch' | |
10455 | tr='$tr' | |
10456 | troff='$troff' | |
2304df62 | 10457 | uidtype='$uidtype' |
ecfc5424 AD |
10458 | uname='$uname' |
10459 | uniq='$uniq' | |
10460 | usedl='$usedl' | |
10461 | usemymalloc='$usemymalloc' | |
2304df62 | 10462 | usenm='$usenm' |
8ff267be | 10463 | useopcode='$useopcode' |
10464 | useperlio='$useperlio' | |
ecfc5424 | 10465 | useposix='$useposix' |
8ff267be | 10466 | usesfio='$usesfio' |
10467 | useshrplib='$useshrplib' | |
ecfc5424 | 10468 | usevfork='$usevfork' |
2304df62 | 10469 | usrinc='$usrinc' |
ecfc5424 AD |
10470 | uuname='$uuname' |
10471 | vi='$vi' | |
2304df62 | 10472 | voidflags='$voidflags' |
ecfc5424 AD |
10473 | xlibpth='$xlibpth' |
10474 | zcat='$zcat' | |
8ff267be | 10475 | zip='$zip' |
2304df62 AD |
10476 | EOT |
10477 | ||
10478 | : add special variables | |
10479 | $test -f patchlevel.h && \ | |
10480 | awk '/^#define/ {printf "%s=%s\n",$2,$3}' patchlevel.h >>config.sh | |
10481 | echo "CONFIG=true" >>config.sh | |
10482 | ||
10483 | : propagate old symbols | |
10484 | if $test -f UU/config.sh; then | |
10485 | <UU/config.sh sort | uniq >UU/oldconfig.sh | |
10486 | sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\ | |
10487 | sort | uniq -u >UU/oldsyms | |
10488 | set X `cat UU/oldsyms` | |
10489 | shift | |
10490 | case $# in | |
10491 | 0) ;; | |
10492 | *) | |
10493 | cat <<EOM | |
10494 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em... | |
10495 | EOM | |
10496 | echo "# Variables propagated from previous config.sh file." >>config.sh | |
10497 | for sym in `cat UU/oldsyms`; do | |
10498 | echo " Propagating $hint variable "'$'"$sym..." | |
10499 | eval 'tmp="$'"${sym}"'"' | |
10500 | echo "$tmp" | \ | |
10501 | sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh | |
10502 | done | |
10503 | ;; | |
10504 | esac | |
10505 | fi | |
10506 | ||
10507 | : Finish up by extracting the .SH files | |
10508 | case "$alldone" in | |
10509 | exit) | |
10510 | $rm -rf UU | |
10511 | echo "Done." | |
10512 | exit 0 | |
10513 | ;; | |
10514 | cont) | |
10515 | ;; | |
10516 | '') | |
2304df62 AD |
10517 | dflt='' |
10518 | nostick=true | |
40000a8c AD |
10519 | $cat <<EOM |
10520 | ||
10521 | If you'd like to make any changes to the config.sh file before I begin | |
10522 | to configure things, do it as a shell escape now (e.g. !vi config.sh). | |
10523 | ||
10524 | EOM | |
10525 | rp="Press return or use a shell escape to edit config.sh:" | |
2304df62 AD |
10526 | . UU/myread |
10527 | nostick='' | |
10528 | case "$ans" in | |
10529 | '') ;; | |
10530 | *) : in case they cannot read | |
10531 | sh 1>&4 -c "$ans";; | |
10532 | esac | |
10533 | ;; | |
10534 | esac | |
10535 | ||
10536 | : if this fails, just run all the .SH files by hand | |
10537 | . ./config.sh | |
10538 | ||
10539 | echo " " | |
10540 | exec 1>&4 | |
10541 | . ./UU/extract | |
10542 | ||
10543 | if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then | |
10544 | dflt=y | |
10545 | case "$silent" in | |
10546 | true) ;; | |
10547 | *) | |
10548 | $cat <<EOM | |
10549 | ||
10550 | Now you need to generate make dependencies by running "make depend". | |
10551 | You might prefer to run it in background: "make depend > makedepend.out &" | |
10552 | It can take a while, so you might not want to run it right now. | |
10553 | ||
10554 | EOM | |
10555 | ;; | |
10556 | esac | |
10557 | rp="Run make depend now?" | |
10558 | . UU/myread | |
10559 | case "$ans" in | |
10560 | y*) | |
10561 | make depend && echo "Now you must run a make." | |
10562 | ;; | |
10563 | *) | |
10564 | echo "You must run 'make depend' then 'make'." | |
10565 | ;; | |
10566 | esac | |
10567 | elif test -f [Mm]akefile; then | |
10568 | echo " " | |
10569 | echo "Now you must run a make." | |
10570 | else | |
10571 | echo "Done." | |
10572 | fi | |
10573 | ||
10574 | $rm -f kit*isdone ark*isdone | |
10575 | $rm -rf UU | |
a0d0e21e | 10576 | |
2304df62 | 10577 | : End of Configure |
a0d0e21e | 10578 |