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 | # |
8e07c86e | 23 | # Generated on Thu Oct 19 10:47:09 EDT 1995 [metaconfig 3.0 PL58] |
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 :-] | |
61 | if test -d c:/.; then | |
62 | p_=\; | |
63 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` | |
64 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` | |
65 | fi | |
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 | ||
a0d0e21e | 88 | : Sanity checks |
2304df62 | 89 | if test ! -t 0; then |
a0d0e21e | 90 | echo "Say 'sh $me', not 'sh <$me'" |
2304df62 AD |
91 | exit 1 |
92 | fi | |
93 | ||
94 | : On HP-UX, large Configure scripts may exercise a bug in /bin/sh | |
95 | if test -f /hp-ux -a -f /bin/ksh; then | |
96 | if (PATH=.; alias -x) >/dev/null 2>&1; then | |
97 | : already under /bin/ksh | |
98 | else | |
99 | cat <<'EOM' | |
100 | (Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.) | |
101 | EOM | |
ecfc5424 | 102 | unset ENV |
2304df62 AD |
103 | exec /bin/ksh $0 "$@" |
104 | fi | |
105 | else | |
106 | : Warn them if they use ksh on other systems | |
107 | (PATH=.; alias -x) >/dev/null 2>&1 && \ | |
a0d0e21e LW |
108 | cat <<EOM |
109 | (I see you are using the Korn shell. Some ksh's blow up on $me, | |
2304df62 AD |
110 | especially on exotic machines. If yours does, try the Bourne shell instead.) |
111 | EOM | |
112 | fi | |
113 | ||
114 | : Configure runs within the UU subdirectory | |
115 | test -d UU || mkdir UU | |
8e07c86e | 116 | cd UU && rm -f ./* |
2304df62 | 117 | |
a0d0e21e | 118 | dynamic_ext='' |
2304df62 | 119 | extensions='' |
a0d0e21e LW |
120 | known_extensions='' |
121 | static_ext='' | |
122 | useposix='' | |
ecfc5424 | 123 | d_bsd='' |
2304df62 AD |
124 | d_eunice='' |
125 | d_xenix='' | |
126 | eunicefix='' | |
127 | Mcc='' | |
128 | awk='' | |
129 | bash='' | |
130 | bison='' | |
131 | byacc='' | |
132 | cat='' | |
133 | chgrp='' | |
134 | chmod='' | |
135 | chown='' | |
ecfc5424 | 136 | comm='' |
2304df62 AD |
137 | compress='' |
138 | cp='' | |
139 | cpio='' | |
140 | cpp='' | |
141 | csh='' | |
142 | date='' | |
143 | echo='' | |
144 | egrep='' | |
145 | emacs='' | |
146 | expr='' | |
147 | find='' | |
148 | flex='' | |
149 | gcc='' | |
150 | grep='' | |
151 | inews='' | |
152 | ksh='' | |
153 | less='' | |
154 | line='' | |
155 | lint='' | |
156 | ln='' | |
157 | lp='' | |
158 | lpr='' | |
159 | ls='' | |
160 | mail='' | |
161 | mailx='' | |
162 | make='' | |
163 | mkdir='' | |
164 | more='' | |
165 | mv='' | |
166 | nroff='' | |
167 | perl='' | |
168 | pg='' | |
169 | pmake='' | |
170 | pr='' | |
171 | rm='' | |
172 | rmail='' | |
173 | sed='' | |
174 | sendmail='' | |
175 | sh='' | |
176 | shar='' | |
177 | sleep='' | |
178 | smail='' | |
179 | sort='' | |
180 | submit='' | |
181 | tail='' | |
182 | tar='' | |
183 | tbl='' | |
184 | test='' | |
185 | touch='' | |
186 | tr='' | |
187 | troff='' | |
188 | uname='' | |
189 | uniq='' | |
190 | uuname='' | |
191 | vi='' | |
192 | zcat='' | |
1aef975c | 193 | full_sed='' |
a0d0e21e | 194 | libswanted='' |
2304df62 AD |
195 | hint='' |
196 | myuname='' | |
85e6fe83 LW |
197 | osname='' |
198 | osvers='' | |
2304df62 AD |
199 | Author='' |
200 | Date='' | |
201 | Header='' | |
202 | Id='' | |
203 | Locker='' | |
204 | Log='' | |
205 | RCSfile='' | |
206 | Revision='' | |
207 | Source='' | |
208 | State='' | |
209 | afs='' | |
a0d0e21e LW |
210 | alignbytes='' |
211 | archlib='' | |
212 | archlibexp='' | |
a0d0e21e LW |
213 | d_archlib='' |
214 | installarchlib='' | |
40000a8c AD |
215 | archname='' |
216 | myarchname='' | |
ecfc5424 | 217 | baserev='' |
2304df62 AD |
218 | bin='' |
219 | binexp='' | |
220 | installbin='' | |
221 | byteorder='' | |
222 | cc='' | |
223 | gccversion='' | |
224 | ccflags='' | |
225 | cppflags='' | |
226 | ldflags='' | |
227 | lkflags='' | |
8e07c86e | 228 | locincpth='' |
2304df62 | 229 | optimize='' |
8e07c86e | 230 | cf_email='' |
2304df62 AD |
231 | cf_by='' |
232 | cf_time='' | |
233 | contains='' | |
a0d0e21e | 234 | cpp_stuff='' |
2304df62 AD |
235 | cpplast='' |
236 | cppminus='' | |
237 | cpprun='' | |
238 | cppstdin='' | |
239 | d_access='' | |
a0d0e21e | 240 | d_alarm='' |
ecfc5424 | 241 | d_attribut='' |
2304df62 AD |
242 | d_bcmp='' |
243 | d_bcopy='' | |
244 | d_bzero='' | |
245 | d_casti32='' | |
246 | castflags='' | |
247 | d_castneg='' | |
a0d0e21e LW |
248 | d_chown='' |
249 | d_chroot='' | |
2304df62 | 250 | d_chsize='' |
a0d0e21e LW |
251 | d_closedir='' |
252 | d_void_closedir='' | |
2304df62 AD |
253 | d_const='' |
254 | cryptlib='' | |
255 | d_crypt='' | |
256 | d_csh='' | |
1aef975c | 257 | full_csh='' |
a0d0e21e LW |
258 | d_cuserid='' |
259 | d_dbl_dig='' | |
260 | d_difftime='' | |
261 | d_dlerror='' | |
262 | d_dlopen='' | |
263 | d_dlsymun='' | |
2304df62 | 264 | d_dosuid='' |
a0d0e21e | 265 | d_suidsafe='' |
2304df62 AD |
266 | d_dup2='' |
267 | d_fchmod='' | |
268 | d_fchown='' | |
269 | d_fcntl='' | |
a0d0e21e LW |
270 | d_fd_macros='' |
271 | d_fd_set='' | |
272 | d_fds_bits='' | |
273 | d_fgetpos='' | |
2304df62 AD |
274 | d_flexfnam='' |
275 | d_flock='' | |
a0d0e21e LW |
276 | d_fork='' |
277 | d_fsetpos='' | |
278 | d_Gconvert='' | |
2304df62 AD |
279 | d_getgrps='' |
280 | d_gethent='' | |
281 | aphostname='' | |
282 | d_gethname='' | |
283 | d_phostname='' | |
284 | d_uname='' | |
a0d0e21e | 285 | d_getlogin='' |
2304df62 AD |
286 | d_getpgrp2='' |
287 | d_getpgrp='' | |
a0d0e21e | 288 | d_getppid='' |
2304df62 AD |
289 | d_getprior='' |
290 | d_htonl='' | |
291 | d_isascii='' | |
292 | d_killpg='' | |
293 | d_link='' | |
a0d0e21e LW |
294 | d_locconv='' |
295 | d_lockf='' | |
2304df62 | 296 | d_lstat='' |
a0d0e21e LW |
297 | d_mblen='' |
298 | d_mbstowcs='' | |
299 | d_mbtowc='' | |
2304df62 AD |
300 | d_memcmp='' |
301 | d_memcpy='' | |
302 | d_memmove='' | |
303 | d_memset='' | |
304 | d_mkdir='' | |
a0d0e21e LW |
305 | d_mkfifo='' |
306 | d_mktime='' | |
2304df62 AD |
307 | d_msg='' |
308 | d_msgctl='' | |
309 | d_msgget='' | |
310 | d_msgrcv='' | |
311 | d_msgsnd='' | |
a0d0e21e | 312 | d_nice='' |
2304df62 | 313 | d_open3='' |
a0d0e21e LW |
314 | d_fpathconf='' |
315 | d_pathconf='' | |
316 | d_pause='' | |
317 | d_pipe='' | |
8e07c86e | 318 | d_poll='' |
2304df62 AD |
319 | d_portable='' |
320 | d_readdir='' | |
85e6fe83 LW |
321 | d_rewinddir='' |
322 | d_seekdir='' | |
323 | d_telldir='' | |
a0d0e21e | 324 | d_readlink='' |
2304df62 AD |
325 | d_rename='' |
326 | d_rmdir='' | |
327 | d_safebcpy='' | |
328 | d_safemcpy='' | |
329 | d_select='' | |
330 | d_sem='' | |
331 | d_semctl='' | |
332 | d_semget='' | |
333 | d_semop='' | |
334 | d_setegid='' | |
335 | d_seteuid='' | |
a0d0e21e | 336 | d_setlinebuf='' |
2304df62 AD |
337 | d_setlocale='' |
338 | d_setpgid='' | |
339 | d_setpgrp2='' | |
340 | d_bsdpgrp='' | |
341 | d_setpgrp='' | |
342 | d_setprior='' | |
343 | d_setregid='' | |
344 | d_setresgid='' | |
345 | d_setresuid='' | |
346 | d_setreuid='' | |
347 | d_setrgid='' | |
348 | d_setruid='' | |
349 | d_setsid='' | |
350 | d_shm='' | |
351 | d_shmat='' | |
a0d0e21e LW |
352 | d_shmatprototype='' |
353 | shmattype='' | |
2304df62 AD |
354 | d_shmctl='' |
355 | d_shmdt='' | |
356 | d_shmget='' | |
357 | d_oldsock='' | |
358 | d_socket='' | |
359 | d_sockpair='' | |
360 | sockethdr='' | |
361 | socketlib='' | |
362 | d_statblks='' | |
c2960299 AD |
363 | d_stdio_cnt_lval='' |
364 | d_stdio_ptr_lval='' | |
16d20bd9 | 365 | d_stdiobase='' |
2304df62 | 366 | d_stdstdio='' |
16d20bd9 AD |
367 | stdio_base='' |
368 | stdio_bufsiz='' | |
369 | stdio_cnt='' | |
370 | stdio_ptr='' | |
2304df62 AD |
371 | d_index='' |
372 | d_strchr='' | |
a0d0e21e | 373 | d_strcoll='' |
2304df62 AD |
374 | d_strctcpy='' |
375 | d_strerrm='' | |
376 | d_strerror='' | |
377 | d_sysernlst='' | |
378 | d_syserrlst='' | |
a0d0e21e | 379 | d_strxfrm='' |
2304df62 AD |
380 | d_symlink='' |
381 | d_syscall='' | |
a0d0e21e | 382 | d_sysconf='' |
2304df62 | 383 | d_system='' |
a0d0e21e LW |
384 | d_tcgetpgrp='' |
385 | d_tcsetpgrp='' | |
85e6fe83 LW |
386 | d_time='' |
387 | timetype='' | |
2304df62 AD |
388 | clocktype='' |
389 | d_times='' | |
390 | d_truncate='' | |
a0d0e21e LW |
391 | d_tzname='' |
392 | d_umask='' | |
2304df62 | 393 | d_vfork='' |
a0d0e21e | 394 | usevfork='' |
2304df62 AD |
395 | d_voidsig='' |
396 | signal_t='' | |
397 | d_volatile='' | |
398 | d_charvspr='' | |
399 | d_vprintf='' | |
400 | d_wait4='' | |
401 | d_waitpid='' | |
a0d0e21e LW |
402 | d_wcstombs='' |
403 | d_wctomb='' | |
404 | dlext='' | |
85e6fe83 LW |
405 | cccdlflags='' |
406 | ccdlflags='' | |
ecfc5424 | 407 | d_shrplib='' |
2304df62 | 408 | dlsrc='' |
232e078e | 409 | ld='' |
85e6fe83 | 410 | lddlflags='' |
ecfc5424 | 411 | shrpdir='' |
2304df62 | 412 | usedl='' |
a0d0e21e | 413 | fpostype='' |
2304df62 AD |
414 | gidtype='' |
415 | groupstype='' | |
416 | h_fcntl='' | |
417 | h_sysfile='' | |
ecfc5424 AD |
418 | db_hashtype='' |
419 | db_prefixtype='' | |
a0d0e21e | 420 | i_db='' |
2304df62 | 421 | i_dbm='' |
8e07c86e | 422 | i_rpcsvcdbm='' |
2304df62 | 423 | d_dirnamlen='' |
a0d0e21e | 424 | direntrytype='' |
2304df62 | 425 | i_dirent='' |
a0d0e21e | 426 | i_dld='' |
2304df62 AD |
427 | i_dlfcn='' |
428 | i_fcntl='' | |
a0d0e21e | 429 | i_float='' |
2304df62 AD |
430 | i_gdbm='' |
431 | i_grp='' | |
a0d0e21e LW |
432 | i_limits='' |
433 | i_malloc='' | |
434 | i_math='' | |
85e6fe83 | 435 | i_memory='' |
2304df62 | 436 | i_ndbm='' |
85e6fe83 | 437 | i_neterrno='' |
2304df62 AD |
438 | i_niin='' |
439 | i_sysin='' | |
440 | d_pwage='' | |
441 | d_pwchange='' | |
442 | d_pwclass='' | |
443 | d_pwcomment='' | |
444 | d_pwexpire='' | |
445 | d_pwquota='' | |
446 | i_pwd='' | |
2304df62 | 447 | i_stddef='' |
a0d0e21e | 448 | i_stdlib='' |
2304df62 AD |
449 | i_string='' |
450 | strings='' | |
451 | i_sysdir='' | |
452 | i_sysfile='' | |
453 | d_voidtty='' | |
454 | i_bsdioctl='' | |
a0d0e21e | 455 | i_sysfilio='' |
2304df62 AD |
456 | i_sysioctl='' |
457 | i_syssockio='' | |
458 | i_sysndir='' | |
a0d0e21e | 459 | i_sysparam='' |
2304df62 | 460 | i_sysselct='' |
1aef975c | 461 | i_sysstat='' |
a0d0e21e | 462 | i_systimes='' |
fed7345c | 463 | i_systypes='' |
2304df62 AD |
464 | i_sgtty='' |
465 | i_termio='' | |
466 | i_termios='' | |
467 | i_systime='' | |
468 | i_systimek='' | |
469 | i_time='' | |
470 | timeincl='' | |
85e6fe83 | 471 | i_unistd='' |
2304df62 | 472 | i_utime='' |
a0d0e21e | 473 | i_stdarg='' |
2304df62 AD |
474 | i_varargs='' |
475 | i_varhdr='' | |
476 | i_vfork='' | |
477 | intsize='' | |
2304df62 | 478 | libc='' |
a0d0e21e | 479 | glibpth='' |
2304df62 | 480 | libpth='' |
8e07c86e | 481 | loclibpth='' |
2304df62 AD |
482 | plibpth='' |
483 | xlibpth='' | |
484 | libs='' | |
85e6fe83 LW |
485 | lns='' |
486 | lseektype='' | |
487 | d_mymalloc='' | |
94b6baf5 | 488 | freetype='' |
2304df62 AD |
489 | mallocobj='' |
490 | mallocsrc='' | |
491 | malloctype='' | |
492 | usemymalloc='' | |
16d20bd9 AD |
493 | installman1dir='' |
494 | man1dir='' | |
495 | man1direxp='' | |
496 | man1ext='' | |
497 | installman3dir='' | |
498 | man3dir='' | |
499 | man3direxp='' | |
500 | man3ext='' | |
2304df62 AD |
501 | huge='' |
502 | large='' | |
503 | medium='' | |
504 | models='' | |
505 | small='' | |
506 | split='' | |
a0d0e21e | 507 | modetype='' |
2304df62 AD |
508 | mydomain='' |
509 | myhostname='' | |
510 | phostname='' | |
511 | c='' | |
512 | n='' | |
8e07c86e AD |
513 | d_eofnblk='' |
514 | eagain='' | |
515 | o_nonblock='' | |
516 | rd_nodata='' | |
2304df62 AD |
517 | groupcat='' |
518 | hostcat='' | |
519 | passcat='' | |
85e6fe83 LW |
520 | orderlib='' |
521 | ranlib='' | |
2304df62 AD |
522 | package='' |
523 | spackage='' | |
ecfc5424 | 524 | patchlevel='' |
8e07c86e | 525 | perladmin='' |
a0d0e21e | 526 | prefix='' |
1aef975c | 527 | prefixexp='' |
2304df62 AD |
528 | installprivlib='' |
529 | privlib='' | |
530 | privlibexp='' | |
531 | prototype='' | |
532 | randbits='' | |
533 | installscript='' | |
534 | scriptdir='' | |
535 | scriptdirexp='' | |
a0d0e21e | 536 | selecttype='' |
2304df62 | 537 | sig_name='' |
8e07c86e AD |
538 | sig_max='' |
539 | sig_num='' | |
16d20bd9 AD |
540 | d_sitelib='' |
541 | installsitelib='' | |
542 | sitelib='' | |
543 | sitelibexp='' | |
a0d0e21e LW |
544 | sizetype='' |
545 | so='' | |
2304df62 AD |
546 | sharpbang='' |
547 | shsharp='' | |
548 | spitshell='' | |
a0d0e21e | 549 | ssizetype='' |
2304df62 AD |
550 | startsh='' |
551 | stdchar='' | |
552 | sysman='' | |
553 | uidtype='' | |
554 | nm_opt='' | |
555 | runnm='' | |
556 | usenm='' | |
557 | incpath='' | |
558 | mips='' | |
559 | mips_type='' | |
560 | usrinc='' | |
561 | defvoidused='' | |
562 | voidflags='' | |
2304df62 AD |
563 | CONFIG='' |
564 | ||
ecfc5424 AD |
565 | define='define' |
566 | undef='undef' | |
567 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' | |
568 | rmlist='' | |
569 | ||
570 | : We must find out about Eunice early | |
571 | eunicefix=':' | |
572 | if test -f /etc/unixtovms; then | |
573 | eunicefix=/etc/unixtovms | |
574 | fi | |
575 | if test -f /etc/unixtovms.exe; then | |
576 | eunicefix=/etc/unixtovms.exe | |
577 | fi | |
578 | ||
579 | : list of known cpp symbols, sorted alphabetically | |
580 | al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2" | |
581 | al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH" | |
582 | al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS" | |
583 | al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM" | |
584 | al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX" | |
585 | al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX" | |
586 | al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4" | |
587 | al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300" | |
588 | al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek" | |
589 | al="$al VMS Xenix286" | |
590 | al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI" | |
591 | al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET" | |
592 | al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3" | |
593 | al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000" | |
594 | al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4" | |
595 | al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS" | |
596 | al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__" | |
597 | al="$al __DGUX__ __DPX2__ __H3050R __H3050RX" | |
598 | al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__" | |
599 | al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__" | |
600 | al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__" | |
601 | al="$al __SVR4_2__ __UMAXV__" | |
602 | al="$al ____386BSD____ __alpha __alpha__ __amiga" | |
603 | al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__" | |
604 | al="$al __host_mips__" | |
605 | al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500" | |
606 | al="$al __hp9000s500 __hp9000s700 __hp9000s800" | |
607 | al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__" | |
608 | al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__" | |
609 | al="$al __m68k __m68k__ __m88100__ __m88k __m88k__" | |
610 | al="$al __mc68000 __mc68000__ __mc68020 __mc68020__" | |
611 | al="$al __mc68030 __mc68030__ __mc68040 __mc68040__" | |
612 | al="$al __mc88100 __mc88100__ __mips __mips__" | |
613 | al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__" | |
614 | al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__" | |
615 | al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__" | |
616 | al="$al _host_mips _mips _unix" | |
617 | al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent" | |
618 | al="$al apollo ardent att386 att3b" | |
619 | al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull" | |
620 | al="$al cadmus clipper concurrent convex cray ctix" | |
621 | al="$al dmert encore gcos gcx gimpel gould" | |
622 | al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800" | |
623 | al="$al hp9000 hp9000s300 hp9000s400 hp9000s500" | |
624 | al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux" | |
625 | al="$al i186 i286 i386 i486 i8086" | |
626 | al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k" | |
627 | al="$al ksr1 linux luna luna88k m68k m88100 m88k" | |
628 | al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030" | |
629 | al="$al mc68040 mc68060 mc68k mc68k32 mc700" | |
630 | al="$al mc88000 mc88100 merlin mert mips mvs n16" | |
631 | al="$al ncl_el ncl_mr" | |
632 | al="$al news1500 news1700 news1800 news1900 news3700" | |
633 | al="$al news700 news800 news900 ns16000 ns32000" | |
634 | al="$al ns32016 ns32332 ns32k nsc32000 os osf" | |
635 | al="$al parisc pc532 pdp11 plexus posix pyr" | |
636 | al="$al riscix riscos scs sequent sgi sinix sony sony_news" | |
637 | al="$al sonyrisc sparc sparclite spectrum stardent stratos" | |
638 | al="$al sun sun3 sun386 svr4 sysV68 sysV88" | |
639 | al="$al titan tower tower32 tower32_200 tower32_600 tower32_700" | |
640 | al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200" | |
641 | al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms" | |
642 | al="$al xenix z8000" | |
643 | ||
ecfc5424 AD |
644 | groupstype='' |
645 | i_whoami='' | |
8e07c86e AD |
646 | : default library list |
647 | libswanted='' | |
648 | : set useposix=false in your hint file to disable the POSIX extension. | |
649 | useposix=true | |
650 | : Possible local include directories to search. | |
651 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" | |
652 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" | |
653 | : | |
654 | : no include file wanted by default | |
655 | inclwanted='' | |
656 | ||
ecfc5424 AD |
657 | : change the next line if compiling for Xenix/286 on Xenix/386 |
658 | xlibpth='/usr/lib/386 /lib/386' | |
659 | ||
8e07c86e AD |
660 | : Possible local library directories to search. |
661 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
662 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
663 | ||
ecfc5424 | 664 | : general looking path for locating libraries |
8e07c86e AD |
665 | glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" |
666 | glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" | |
667 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" | |
ecfc5424 AD |
668 | |
669 | : Private path used by Configure to find libraries. Its value | |
670 | : is prepended to libpth. This variable takes care of special | |
671 | : machines, like the mips. Usually, it should be empty. | |
672 | plibpth='' | |
673 | ||
ecfc5424 AD |
674 | : full support for void wanted by default |
675 | defvoidused=15 | |
676 | ||
ecfc5424 AD |
677 | : List of libraries we want. |
678 | libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' | |
679 | libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" | |
680 | libswanted="$libswanted ucb bsd BSD PW x" | |
1aef975c | 681 | : We probably want to search /usr/shlib before most other libraries. |
94b6baf5 | 682 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
ecfc5424 AD |
683 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
684 | glibpth="/usr/shlib $glibpth" | |
685 | : Do not use vfork unless overridden by a hint file. | |
686 | usevfork=false | |
687 | ||
2304df62 AD |
688 | : script used to extract .SH files with variable substitutions |
689 | cat >extract <<'EOS' | |
690 | CONFIG=true | |
691 | echo "Doing variable substitutions on .SH files..." | |
692 | if test -f MANIFEST; then | |
a0d0e21e LW |
693 | shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'` |
694 | : Pick up possible extension manifests. | |
695 | for dir in ext/* ; do | |
696 | if test -f $dir/MANIFEST; then | |
697 | xxx=`awk '{print $1}' < $dir/MANIFEST | | |
698 | sed -n "/\.SH$/ s@^@$dir/@p"` | |
699 | shlist="$shlist $xxx" | |
700 | fi | |
701 | done | |
702 | set x $shlist | |
2304df62 AD |
703 | else |
704 | echo "(Looking for .SH files under the current directory.)" | |
705 | set x `find . -name "*.SH" -print` | |
706 | fi | |
707 | shift | |
708 | case $# in | |
709 | 0) set x *.SH; shift;; | |
710 | esac | |
711 | if test ! -f $1; then | |
712 | shift | |
713 | fi | |
714 | for file in $*; do | |
715 | case "$file" in | |
716 | */*) | |
717 | dir=`expr X$file : 'X\(.*\)/'` | |
718 | file=`expr X$file : 'X.*/\(.*\)'` | |
719 | (cd $dir && . ./$file) | |
720 | ;; | |
721 | *) | |
722 | . ./$file | |
723 | ;; | |
724 | esac | |
725 | done | |
726 | if test -f config_h.SH; then | |
727 | if test ! -f config.h; then | |
728 | : oops, they left it out of MANIFEST, probably, so do it anyway. | |
729 | . ./config_h.SH | |
730 | fi | |
731 | fi | |
732 | EOS | |
733 | ||
734 | : produce awk script to parse command line options | |
735 | cat >options.awk <<'EOF' | |
736 | BEGIN { | |
16d20bd9 | 737 | optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification |
2304df62 AD |
738 | |
739 | len = length(optstr); | |
740 | for (i = 1; i <= len; i++) { | |
741 | c = substr(optstr, i, 1); | |
742 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; | |
743 | if (a == ":") { | |
744 | arg[c] = 1; | |
745 | i++; | |
746 | } | |
747 | opt[c] = 1; | |
748 | } | |
749 | } | |
750 | { | |
751 | expect = 0; | |
752 | str = $0; | |
753 | if (substr(str, 1, 1) != "-") { | |
754 | printf("'%s'\n", str); | |
755 | next; | |
756 | } | |
757 | len = length($0); | |
758 | for (i = 2; i <= len; i++) { | |
759 | c = substr(str, i, 1); | |
760 | if (!opt[c]) { | |
761 | printf("-%s\n", substr(str, i)); | |
762 | next; | |
763 | } | |
764 | printf("-%s\n", c); | |
765 | if (arg[c]) { | |
766 | if (i < len) | |
767 | printf("'%s'\n", substr(str, i + 1)); | |
768 | else | |
769 | expect = 1; | |
770 | next; | |
771 | } | |
772 | } | |
773 | } | |
774 | END { | |
775 | if (expect) | |
776 | print "?"; | |
777 | } | |
778 | EOF | |
779 | ||
780 | : process the command line options | |
781 | set X `for arg in "$@"; do echo $arg; done | awk -f options.awk` | |
782 | eval "set $*" | |
783 | shift | |
784 | rm -f options.awk | |
785 | ||
786 | : set up default values | |
787 | fastread='' | |
788 | reuseval=false | |
789 | config_sh='' | |
790 | alldone='' | |
791 | error='' | |
792 | silent='' | |
793 | extractsh='' | |
ecfc5424 | 794 | override='' |
16d20bd9 | 795 | knowitall='' |
1aef975c | 796 | rm -f optdef.sh |
2304df62 AD |
797 | |
798 | : option parsing | |
799 | while test $# -gt 0; do | |
800 | case "$1" in | |
801 | -d) shift; fastread=yes;; | |
802 | -e) shift; alldone=cont;; | |
803 | -f) | |
804 | shift | |
805 | cd .. | |
806 | if test -r "$1"; then | |
807 | config_sh="$1" | |
808 | else | |
a0d0e21e | 809 | echo "$me: cannot read config file $1." >&2 |
2304df62 AD |
810 | error=true |
811 | fi | |
812 | cd UU | |
813 | shift;; | |
814 | -h) shift; error=true;; | |
815 | -r) shift; reuseval=true;; | |
816 | -s) shift; silent=true;; | |
817 | -E) shift; alldone=exit;; | |
16d20bd9 | 818 | -K) shift; knowitall=true;; |
ecfc5424 | 819 | -O) shift; override=true;; |
2304df62 | 820 | -S) shift; extractsh=true;; |
a0d0e21e LW |
821 | -D) |
822 | shift | |
823 | case "$1" in | |
824 | *=) | |
825 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 | |
826 | echo "$me: ignoring -D $1" >&2 | |
827 | ;; | |
ecfc5424 | 828 | *=*) echo "$1" | \ |
1aef975c AD |
829 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
830 | *) echo "$1='define'" >> optdef.sh;; | |
a0d0e21e LW |
831 | esac |
832 | shift | |
833 | ;; | |
834 | -U) | |
835 | shift | |
836 | case "$1" in | |
1aef975c | 837 | *=) echo "$1" >> optdef.sh;; |
a0d0e21e LW |
838 | *=*) |
839 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 | |
840 | echo "$me: ignoring -U $1" >&2 | |
841 | ;; | |
1aef975c | 842 | *) echo "$1='undef'" >> optdef.sh;; |
a0d0e21e LW |
843 | esac |
844 | shift | |
845 | ;; | |
8e07c86e | 846 | -V) echo "$me generated by metaconfig 3.0 PL58." >&2 |
2304df62 AD |
847 | exit 0;; |
848 | --) break;; | |
a0d0e21e | 849 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
2304df62 AD |
850 | *) break;; |
851 | esac | |
852 | done | |
853 | ||
854 | case "$error" in | |
855 | true) | |
856 | cat >&2 <<EOM | |
16d20bd9 | 857 | Usage: $me [-dehrEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
a0d0e21e | 858 | [-U symbol] [-U symbol=] |
2304df62 AD |
859 | -d : use defaults for all answers. |
860 | -e : go on without questioning past the production of config.sh. | |
861 | -f : specify an alternate default configuration file. | |
862 | -h : print this help message and exit (with an error status). | |
863 | -r : reuse C symbols value if possible (skips costly nm extraction). | |
864 | -s : silent mode, only echoes questions and essential information. | |
a0d0e21e LW |
865 | -D : define symbol to have some value: |
866 | -D symbol symbol gets the value 'define' | |
867 | -D symbol=value symbol gets the value 'value' | |
2304df62 | 868 | -E : stop at the end of questions, after having produced config.sh. |
16d20bd9 | 869 | -K : do not use unless you know what you are doing. |
ecfc5424 | 870 | -O : let -D and -U override definitions from loaded configuration file. |
2304df62 | 871 | -S : perform variable substitutions on all .SH files (can mix with -f) |
a0d0e21e LW |
872 | -U : undefine symbol: |
873 | -U symbol symbol gets the value 'undef' | |
874 | -U symbol= symbol gets completely empty | |
2304df62 AD |
875 | -V : print version number and exit (with a zero status). |
876 | EOM | |
877 | exit 1 | |
878 | ;; | |
879 | esac | |
880 | ||
881 | exec 4>&1 | |
882 | case "$silent" in | |
883 | true) exec 1>/dev/null;; | |
884 | esac | |
885 | ||
ecfc5424 | 886 | : run the defines and the undefines, if any, but leave the file out there... |
1aef975c AD |
887 | touch optdef.sh |
888 | . ./optdef.sh | |
a0d0e21e | 889 | |
2304df62 AD |
890 | case "$extractsh" in |
891 | true) | |
892 | case "$config_sh" in | |
893 | '') config_sh='config.sh'; config='./config.sh';; | |
894 | /*) config="$config_sh";; | |
895 | *) config="./$config_sh";; | |
896 | esac | |
897 | echo " " | |
898 | echo "Fetching answers from $config_sh..." | |
899 | cd .. | |
900 | . $config | |
1aef975c | 901 | test "$override" && . ./optdef.sh |
2304df62 AD |
902 | echo " " |
903 | . ./UU/extract | |
904 | rm -rf UU | |
905 | echo "Done." | |
906 | exit 0 | |
907 | ;; | |
908 | esac | |
909 | ||
910 | : set package name | |
85e6fe83 | 911 | package=perl5 |
1aef975c AD |
912 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
913 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` | |
914 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
915 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; | |
916 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; | |
917 | esac | |
2304df62 AD |
918 | |
919 | : Eunice requires " " instead of "", can you believe it | |
920 | echo " " | |
921 | : Here we go... | |
922 | echo "Beginning of configuration questions for $package." | |
923 | ||
1aef975c | 924 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 |
2304df62 | 925 | |
2304df62 AD |
926 | : Some greps do not return status, grrr. |
927 | echo "grimblepritz" >grimble | |
928 | if grep blurfldyick grimble >/dev/null 2>&1 ; then | |
929 | contains=contains | |
930 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then | |
931 | contains=grep | |
932 | else | |
933 | contains=contains | |
934 | fi | |
935 | rm -f grimble | |
936 | : the following should work in any shell | |
937 | case "$contains" in | |
938 | contains*) | |
939 | echo " " | |
940 | echo "AGH! Grep doesn't return a status. Attempting remedial action." | |
941 | cat >contains <<'EOSS' | |
942 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp | |
943 | EOSS | |
944 | chmod +x contains | |
945 | esac | |
946 | ||
947 | : first determine how to suppress newline on echo command | |
948 | echo " " | |
949 | echo "Checking echo to see how to suppress newlines..." | |
950 | (echo "hi there\c" ; echo " ") >.echotmp | |
951 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
952 | echo "...using -n." | |
953 | n='-n' | |
954 | c='' | |
955 | else | |
956 | cat <<'EOM' | |
957 | ...using \c | |
958 | EOM | |
959 | n='' | |
960 | c='\c' | |
961 | fi | |
962 | echo $n "The star should be here-->$c" | |
963 | echo '*' | |
964 | rm -f .echotmp | |
965 | ||
966 | : Now test for existence of everything in MANIFEST | |
967 | echo " " | |
968 | if test -f ../MANIFEST; then | |
969 | echo "First let's make sure your kit is complete. Checking..." >&4 | |
970 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50 | |
971 | rm -f missing | |
972 | for filelist in x??; do | |
973 | (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing) | |
974 | done | |
975 | if test -s missing; then | |
976 | cat missing >&4 | |
977 | cat >&4 <<'EOM' | |
978 | ||
979 | THIS PACKAGE SEEMS TO BE INCOMPLETE. | |
980 | ||
981 | You have the option of continuing the configuration process, despite the | |
982 | distinct possibility that your kit is damaged, by typing 'y'es. If you | |
983 | do, don't blame me if something goes wrong. I advise you to type 'n'o | |
984 | and contact the author (lwall@netlabs.com). | |
985 | ||
986 | EOM | |
987 | echo $n "Continue? [n] $c" >&4 | |
988 | read ans | |
989 | case "$ans" in | |
990 | y*) | |
991 | echo "Continuing..." >&4 | |
992 | rm -f missing | |
993 | ;; | |
994 | *) | |
995 | echo "ABORTING..." >&4 | |
996 | kill $$ | |
997 | ;; | |
998 | esac | |
999 | else | |
1000 | echo "Looks good..." >&4 | |
1001 | fi | |
1002 | else | |
1003 | echo "There is no MANIFEST file. I hope your kit is complete !" | |
1004 | fi | |
1005 | rm -f missing x?? | |
1006 | ||
1007 | : compute the number of columns on the terminal for proper question formatting | |
1008 | case "$COLUMNS" in | |
1009 | '') COLUMNS='80';; | |
1010 | esac | |
1011 | ||
1012 | : set up the echo used in my read | |
1013 | myecho="case \"\$xxxm\" in | |
1014 | '') echo $n \"\$rp $c\" >&4;; | |
1015 | *) case \"\$rp\" in | |
1016 | '') echo $n \"[\$xxxm] $c\";; | |
1017 | *) | |
1018 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then | |
1019 | echo \"\$rp\" >&4 | |
1020 | echo $n \"[\$xxxm] $c\" >&4 | |
1021 | else | |
1022 | echo $n \"\$rp [\$xxxm] $c\" >&4 | |
1023 | fi | |
1024 | ;; | |
1025 | esac;; | |
1026 | esac" | |
1027 | ||
1028 | : now set up to do reads with possible shell escape and default assignment | |
1029 | cat <<EOSC >myread | |
1030 | xxxm=\$dflt | |
1031 | $myecho | |
1032 | ans='!' | |
1033 | case "\$fastread" in | |
1034 | yes) case "\$dflt" in | |
1035 | '') ;; | |
1036 | *) ans=''; | |
1037 | case "\$silent-\$rp" in | |
1038 | true-) ;; | |
1039 | *) echo " " >&4;; | |
1040 | esac;; | |
1041 | esac;; | |
1042 | *) case "\$silent" in | |
1043 | true) case "\$rp" in | |
1044 | '') ans='';; | |
1045 | esac;; | |
1046 | esac;; | |
1047 | esac | |
1048 | while expr "X\$ans" : "X!" >/dev/null; do | |
1049 | read answ | |
1050 | set x \$xxxm | |
1051 | shift | |
1052 | aok=''; eval "ans=\"\$answ\"" && aok=y | |
1053 | case "\$answ" in | |
1054 | "\$ans") | |
1055 | case "\$ans" in | |
ecfc5424 AD |
1056 | \\&*) |
1057 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` | |
1058 | shift | |
1059 | case "\$1" in | |
1060 | -d) | |
1061 | fastread=yes | |
1062 | echo "(OK, I'll run with -d after this question.)" | |
1063 | ;; | |
1064 | -*) | |
1065 | echo "*** Sorry, \$1 not supported yet." | |
1066 | ;; | |
1067 | esac | |
1068 | $myecho | |
1069 | ans=! | |
1070 | ;; | |
2304df62 AD |
1071 | "!") |
1072 | sh 1>&4 | |
1073 | echo " " | |
1074 | $myecho | |
1075 | ;; | |
1076 | !*) | |
1077 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` | |
1078 | shift | |
1079 | sh 1>&4 -c "\$*" | |
1080 | echo " " | |
1081 | $myecho | |
1082 | ;; | |
1083 | esac;; | |
1084 | *) | |
1085 | case "\$aok" in | |
1086 | y) | |
1087 | echo "*** Substitution done -- please confirm." | |
1088 | xxxm="\$ans" | |
1089 | ans=\`echo $n "\$ans$c" | tr '\012' ' '\` | |
1090 | xxxm="\$ans" | |
1091 | ans=! | |
1092 | ;; | |
1093 | *) | |
1094 | echo "*** Error -- try again." | |
1095 | ans=! | |
1096 | ;; | |
1097 | esac | |
1098 | $myecho | |
1099 | ;; | |
1100 | esac | |
1101 | case "\$ans\$xxxm\$nostick" in | |
1102 | '') | |
1103 | ans=! | |
1104 | $myecho | |
1105 | ;; | |
1106 | esac | |
1107 | done | |
1108 | case "\$ans" in | |
1109 | '') ans="\$xxxm";; | |
1110 | esac | |
1111 | EOSC | |
1112 | ||
1113 | : create .config dir to save info across Configure sessions | |
1114 | test -d ../.config || mkdir ../.config | |
1115 | cat >../.config/README <<EOF | |
1116 | This directory created by Configure to save information that should | |
1117 | persist across sessions. | |
1118 | ||
1119 | You may safely delete it if you wish. | |
1120 | EOF | |
1121 | ||
1122 | : general instructions | |
1123 | needman=true | |
1124 | firsttime=true | |
1125 | user=`( (logname) 2>/dev/null || whoami) 2>&1` | |
1126 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then | |
1127 | firsttime=false | |
1128 | echo " " | |
1129 | rp='Would you like to see the instructions?' | |
1130 | dflt=n | |
1131 | . ./myread | |
1132 | case "$ans" in | |
1133 | [yY]*) ;; | |
1134 | *) needman=false;; | |
1135 | esac | |
1136 | fi | |
1137 | if $needman; then | |
1138 | cat <<EOH | |
1139 | ||
1140 | This installation shell script will examine your system and ask you questions | |
a0d0e21e | 1141 | to determine how the perl5 package should be installed. If you get |
2304df62 AD |
1142 | stuck on a question, you may use a ! shell escape to start a subshell or |
1143 | execute a command. Many of the questions will have default answers in square | |
1144 | brackets; typing carriage return will give you the default. | |
1145 | ||
1146 | On some of the questions which ask for file or directory names you are allowed | |
1147 | to use the ~name construct to specify the login directory belonging to "name", | |
1148 | even if you don't have a shell which knows about that. Questions where this is | |
1149 | allowed will be marked "(~name ok)". | |
1150 | ||
1151 | EOH | |
1152 | rp='' | |
1153 | dflt='Type carriage return to continue' | |
1154 | . ./myread | |
1155 | cat <<'EOH' | |
1156 | ||
1157 | The prompter used in this script allows you to use shell variables and | |
1158 | backticks in your answers. You may use $1, $2, etc... to refer to the words | |
1159 | in the default answer, as if the default line was a set of arguments given to a | |
1160 | script shell. This means you may also use $* to repeat the whole default line, | |
1161 | so you do not have to re-type everything to add something to the default. | |
1162 | ||
1163 | Everytime there is a substitution, you will have to confirm. If there is an | |
1164 | error (e.g. an unmatched backtick), the default answer will remain unchanged | |
1165 | and you will be prompted again. | |
1166 | ||
1167 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all | |
1168 | the questions and use the computed defaults (or the previous answers if there | |
1169 | was already a config.sh file). Type 'Configure -h' for a list of options. | |
ecfc5424 AD |
1170 | You may also start interactively and then answer '& -d' at any prompt to turn |
1171 | on the non-interactive behaviour for the remaining of the execution. | |
2304df62 AD |
1172 | |
1173 | EOH | |
1174 | . ./myread | |
1175 | cat <<EOH | |
1176 | ||
1177 | Much effort has been expended to ensure that this shell script will run on any | |
1178 | Unix system. If despite that it blows up on yours, your best bet is to edit | |
40000a8c AD |
1179 | Configure and run it again. If you can't run Configure for some reason, |
1180 | you'll have to generate a config.sh file by hand. Whatever problems you | |
1181 | have, let me (lwall@netlabs.com) know how I blew it. | |
2304df62 AD |
1182 | |
1183 | This installation script affects things in two ways: | |
1184 | ||
1185 | 1) it may do direct variable substitutions on some of the files included | |
1186 | in this kit. | |
1187 | 2) it builds a config.h file for inclusion in C programs. You may edit | |
1188 | any of these files as the need arises after running this script. | |
1189 | ||
1190 | If you make a mistake on a question, there is no easy way to back up to it | |
1191 | currently. The easiest thing to do is to edit config.sh and rerun all the SH | |
1192 | files. Configure will offer to let you do this before it runs the SH files. | |
1193 | ||
1194 | EOH | |
1195 | dflt='Type carriage return to continue' | |
1196 | . ./myread | |
1197 | case "$firsttime" in | |
1198 | true) echo $user >>../.config/instruct;; | |
1199 | esac | |
1200 | fi | |
1201 | ||
1202 | : see if sh knows # comments | |
1203 | echo " " | |
1204 | echo "Checking your sh to see if it knows about # comments..." >&4 | |
ecfc5424 | 1205 | if `sh -c '#' >/dev/null 2>&1`; then |
2304df62 AD |
1206 | echo "Your sh handles # comments correctly." |
1207 | shsharp=true | |
1208 | spitshell=cat | |
1209 | echo " " | |
1210 | echo "Okay, let's see if #! works on this system..." | |
a0d0e21e | 1211 | xcat=/bin/cat |
ecfc5424 | 1212 | test -f $xcat || xcat=/usr/bin/cat |
a0d0e21e | 1213 | echo "#!$xcat" >try |
2304df62 AD |
1214 | $eunicefix try |
1215 | chmod +x try | |
1216 | ./try > today | |
1217 | if test -s today; then | |
1218 | echo "It does." | |
1219 | sharpbang='#!' | |
1220 | else | |
a0d0e21e | 1221 | echo "#! $xcat" > try |
2304df62 AD |
1222 | $eunicefix try |
1223 | chmod +x try | |
1224 | ./try > today | |
1225 | if test -s today; then | |
1226 | echo "It does." | |
1227 | sharpbang='#! ' | |
1228 | else | |
1229 | echo "It's just a comment." | |
1230 | sharpbang=': use ' | |
1231 | fi | |
1232 | fi | |
1233 | else | |
1234 | echo "Your sh doesn't grok # comments--I will strip them later on." | |
1235 | shsharp=false | |
a0d0e21e | 1236 | cd .. |
2304df62 AD |
1237 | echo "exec grep -v '^[ ]*#'" >spitshell |
1238 | chmod +x spitshell | |
1239 | $eunicefix spitshell | |
1240 | spitshell=`pwd`/spitshell | |
a0d0e21e | 1241 | cd UU |
2304df62 AD |
1242 | echo "I presume that if # doesn't work, #! won't work either!" |
1243 | sharpbang=': use ' | |
1244 | fi | |
1245 | rm -f try today | |
1246 | ||
1247 | : figure out how to guarantee sh startup | |
1248 | echo " " | |
1249 | echo "Checking out how to guarantee sh startup..." >&4 | |
1250 | case "$SYSTYPE" in | |
1251 | *bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";; | |
1252 | *) startsh=$sharpbang'/bin/sh';; | |
1253 | esac | |
1254 | echo "Let's see if '$startsh' works..." | |
1255 | cat >try <<EOSS | |
1256 | $startsh | |
1257 | set abc | |
1258 | test "$?abc" != 1 | |
1259 | EOSS | |
1260 | ||
1261 | chmod +x try | |
1262 | $eunicefix try | |
1263 | if ./try; then | |
1264 | echo "Yup, it does." | |
1265 | else | |
1266 | echo "Nope. You may have to fix up the shell scripts to make sure sh runs them." | |
1267 | fi | |
1268 | rm -f try | |
1269 | ||
1270 | : find out where common programs are | |
1271 | echo " " | |
1272 | echo "Locating common programs..." >&4 | |
1273 | cat <<EOSC >loc | |
1274 | $startsh | |
1275 | case \$# in | |
1276 | 0) exit 1;; | |
1277 | esac | |
1278 | thing=\$1 | |
1279 | shift | |
1280 | dflt=\$1 | |
1281 | shift | |
1282 | for dir in \$*; do | |
1283 | case "\$thing" in | |
1284 | .) | |
1285 | if test -d \$dir/\$thing; then | |
1286 | echo \$dir | |
1287 | exit 0 | |
1288 | fi | |
1289 | ;; | |
1290 | *) | |
a0d0e21e | 1291 | for thisthing in \$dir/\$thing; do |
ecfc5424 | 1292 | : just loop through to pick last item |
a0d0e21e LW |
1293 | done |
1294 | if test -f \$thisthing; then | |
1295 | echo \$thisthing | |
2304df62 AD |
1296 | exit 0 |
1297 | elif test -f \$dir/\$thing.exe; then | |
1298 | : on Eunice apparently | |
1299 | echo \$dir/\$thing | |
1300 | exit 0 | |
1301 | fi | |
1302 | ;; | |
1303 | esac | |
1304 | done | |
1305 | echo \$dflt | |
1306 | exit 1 | |
1307 | EOSC | |
1308 | chmod +x loc | |
1309 | $eunicefix loc | |
1310 | loclist=" | |
1311 | awk | |
1312 | cat | |
ecfc5424 | 1313 | comm |
2304df62 AD |
1314 | cp |
1315 | echo | |
1316 | expr | |
a0d0e21e | 1317 | find |
2304df62 | 1318 | grep |
85e6fe83 | 1319 | ln |
a0d0e21e | 1320 | ls |
2304df62 | 1321 | mkdir |
2304df62 AD |
1322 | rm |
1323 | sed | |
1324 | sort | |
8e07c86e | 1325 | tail |
85e6fe83 | 1326 | touch |
2304df62 AD |
1327 | tr |
1328 | uniq | |
1329 | " | |
1330 | trylist=" | |
1331 | Mcc | |
2304df62 AD |
1332 | byacc |
1333 | cpp | |
1334 | csh | |
1335 | date | |
1336 | egrep | |
2304df62 AD |
1337 | line |
1338 | nroff | |
1339 | perl | |
1340 | test | |
1341 | uname | |
1342 | " | |
8e07c86e | 1343 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
1344 | pth="$pth /lib /usr/lib" |
1345 | for file in $loclist; do | |
1346 | xxx=`./loc $file $file $pth` | |
1347 | eval $file=$xxx | |
1348 | eval _$file=$xxx | |
1349 | case "$xxx" in | |
1350 | /*) | |
1351 | echo $file is in $xxx. | |
1352 | ;; | |
8e07c86e AD |
1353 | ?:[\\/]*) |
1354 | echo $file is in $xxx. | |
1355 | ;; | |
2304df62 AD |
1356 | *) |
1357 | echo "I don't know where $file is. I hope it's in everyone's PATH." | |
1358 | ;; | |
1359 | esac | |
1360 | done | |
1361 | echo " " | |
1362 | echo "Don't worry if any of the following aren't found..." | |
1363 | say=offhand | |
1364 | for file in $trylist; do | |
1365 | xxx=`./loc $file $file $pth` | |
1366 | eval $file=$xxx | |
1367 | eval _$file=$xxx | |
1368 | case "$xxx" in | |
1369 | /*) | |
1370 | echo $file is in $xxx. | |
1371 | ;; | |
8e07c86e AD |
1372 | ?:[\\/]*) |
1373 | echo $file is in $xxx. | |
1374 | ;; | |
2304df62 AD |
1375 | *) |
1376 | echo "I don't see $file out there, $say." | |
1377 | say=either | |
1378 | ;; | |
1379 | esac | |
1380 | done | |
1381 | case "$egrep" in | |
1382 | egrep) | |
1383 | echo "Substituting grep for egrep." | |
1384 | egrep=$grep | |
1385 | ;; | |
1386 | esac | |
1387 | case "$test" in | |
1388 | test) | |
1389 | echo "Hopefully test is built into your sh." | |
1390 | ;; | |
1391 | *) | |
ecfc5424 | 1392 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
2304df62 AD |
1393 | echo "Using the test built into your sh." |
1394 | test=test | |
1395 | _test=test | |
1396 | fi | |
1397 | ;; | |
1398 | esac | |
1399 | case "$echo" in | |
1400 | echo) | |
1401 | echo "Hopefully echo is built into your sh." | |
1402 | ;; | |
1403 | '') ;; | |
1404 | *) | |
1405 | echo " " | |
1406 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
1407 | $echo $n "hi there$c" >foo1 | |
1408 | echo $n "hi there$c" >foo2 | |
1409 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
1410 | echo "They are compatible. In fact, they may be identical." | |
1411 | else | |
1412 | case "$n" in | |
1413 | '-n') n='' c='\c';; | |
1414 | *) n='-n' c='';; | |
1415 | esac | |
1416 | cat <<FOO | |
1417 | They are not compatible! You are probably running ksh on a non-USG system. | |
1418 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
1419 | have echo built in and we may have to run some Bourne shell scripts. That | |
1420 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
1421 | ||
1422 | FOO | |
1423 | $echo $n "The star should be here-->$c" | |
1424 | $echo "*" | |
1425 | fi | |
1426 | $rm -f foo1 foo2 | |
1427 | ;; | |
1428 | esac | |
1429 | ||
a0d0e21e LW |
1430 | : determine whether symbolic links are supported |
1431 | echo " " | |
1432 | $touch blurfl | |
1433 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
1434 | echo "Symbolic links are supported." >&4 | |
1435 | lns="$ln -s" | |
1436 | else | |
1437 | echo "Symbolic links are NOT supported." >&4 | |
1438 | lns="$ln" | |
1439 | fi | |
1440 | $rm -f blurfl sym | |
1441 | ||
ecfc5424 AD |
1442 | : see whether [:lower:] and [:upper:] are supported character classes |
1443 | echo " " | |
1444 | up='[A-Z]' | |
1445 | low='[a-z]' | |
1446 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1447 | ABYZ) | |
1448 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
1449 | up='[:upper:]' | |
1450 | low='[:lower:]' | |
1451 | ;; | |
1452 | *) | |
1453 | echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 | |
1454 | ;; | |
1455 | esac | |
1456 | : set up the translation script tr, must be called with ./tr of course | |
1457 | cat >tr <<EOSC | |
1458 | $startsh | |
1459 | case "\$1\$2" in | |
1460 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
1461 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
1462 | esac | |
1463 | exec $tr "\$@" | |
1464 | EOSC | |
1465 | chmod +x tr | |
1466 | $eunicefix tr | |
1467 | ||
2304df62 AD |
1468 | : Try to determine whether config.sh was made on this system |
1469 | case "$config_sh" in | |
1470 | '') | |
1471 | myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` | |
a0d0e21e | 1472 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
ecfc5424 | 1473 | ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` |
1aef975c | 1474 | newmyuname="$myuname" |
2304df62 | 1475 | dflt=n |
16d20bd9 AD |
1476 | case "$knowitall" in |
1477 | '') | |
1478 | if test -f ../config.sh; then | |
1479 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
1480 | eval "`grep myuname= ../config.sh`" | |
1481 | fi | |
1482 | if test "X$myuname" = "X$newmyuname"; then | |
1483 | dflt=y | |
1484 | fi | |
2304df62 | 1485 | fi |
16d20bd9 AD |
1486 | ;; |
1487 | *) dflt=y;; | |
1488 | esac | |
2304df62 AD |
1489 | |
1490 | : Get old answers from old config file if Configure was run on the | |
1491 | : same system, otherwise use the hints. | |
1492 | hint=default | |
1493 | cd .. | |
1494 | if test -f config.sh; then | |
16d20bd9 AD |
1495 | echo " " |
1496 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
1497 | . UU/myread |
1498 | case "$ans" in | |
1499 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; | |
1500 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
ecfc5424 AD |
1501 | tmp_n="$n" |
1502 | tmp_c="$c" | |
2304df62 AD |
1503 | . ./config.sh |
1504 | cp config.sh UU | |
ecfc5424 AD |
1505 | n="$tmp_n" |
1506 | c="$tmp_c" | |
2304df62 AD |
1507 | hint=previous |
1508 | ;; | |
1509 | esac | |
1510 | fi | |
1511 | if test ! -f config.sh; then | |
1512 | $cat <<EOM | |
1513 | ||
1514 | First time through, eh? I have some defaults handy for the following systems: | |
1515 | ||
1516 | EOM | |
1517 | cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4 | |
1518 | dflt='' | |
1519 | : Half the following guesses are probably wrong... If you have better | |
1520 | : tests or hints, please send them to lwall@netlabs.com | |
1521 | : The metaconfig authors would also appreciate a copy... | |
a0d0e21e | 1522 | $test -f /irix && osname=irix |
85e6fe83 LW |
1523 | $test -f /xenix && osname=sco_xenix |
1524 | $test -f /dynix && osname=dynix | |
1525 | $test -f /dnix && osname=dnix | |
a0d0e21e | 1526 | $test -f /unicos && osname=unicos && osvers=`$uname -r` |
85e6fe83 | 1527 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
1528 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
1529 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
1530 | $test -d /usr/apollo/bin && osname=apollo |
1531 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 1532 | $test -d /usr/include/minix && osname=minix |
fec02dd3 AD |
1533 | $test -d /MachTen && osname=machten && \ |
1534 | osvers=`/usr/etc/version | $awk '{print $2}' | \ | |
1535 | $sed -e 's/[A-Za-z]$//'` | |
2304df62 AD |
1536 | if $test -f $uname; then |
1537 | set X $myuname | |
1538 | shift | |
1539 | ||
2304df62 | 1540 | case "$5" in |
85e6fe83 | 1541 | fps*) osname=fps ;; |
2304df62 AD |
1542 | mips*) |
1543 | case "$4" in | |
85e6fe83 LW |
1544 | umips) osname=umips ;; |
1545 | *) osname=mips ;; | |
2304df62 | 1546 | esac;; |
85e6fe83 LW |
1547 | [23]100) osname=mips ;; |
1548 | next*) osname=next ;; | |
1549 | news*) osname=news ;; | |
ecfc5424 AD |
1550 | i386*) |
1551 | if $test -f /etc/kconfig; then | |
1552 | osname=isc | |
a0d0e21e LW |
1553 | if test "$lns" = "ln -s"; then |
1554 | osvers=4 | |
1555 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
1556 | osvers=3 | |
2304df62 | 1557 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 1558 | osvers=2 |
ecfc5424 AD |
1559 | fi |
1560 | fi | |
1561 | ;; | |
2304df62 AD |
1562 | esac |
1563 | ||
1564 | case "$1" in | |
a0d0e21e LW |
1565 | aix) osname=aix |
1566 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
1567 | case "$tmp" in | |
1aef975c | 1568 | 'not found') osvers="$4"."$3" ;; |
a0d0e21e LW |
1569 | '<3240'|'<>3240') osvers=3.2.0 ;; |
1570 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
1571 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 1572 | *) osvers=$tmp;; |
a0d0e21e LW |
1573 | esac |
1574 | ;; | |
1575 | dnix) osname=dnix | |
1576 | osvers="$3" | |
1577 | ;; | |
1578 | domainos) osname=apollo | |
1579 | osvers="$3" | |
1580 | ;; | |
1581 | dgux) osname=dgux | |
1582 | osvers="$3" | |
1583 | ;; | |
1584 | freebsd) osname=freebsd | |
1585 | osvers="$3" ;; | |
1586 | genix) osname=genix ;; | |
1587 | hp*) osname=hpux | |
1588 | case "$3" in | |
1589 | *.08.*) osvers=9 ;; | |
1590 | *.09.*) osvers=9 ;; | |
1591 | *.10.*) osvers=10 ;; | |
ecfc5424 | 1592 | *) osvers="$3" ;; |
a0d0e21e LW |
1593 | esac |
1594 | ;; | |
1595 | irix) osname=irix | |
1596 | case "$3" in | |
1597 | 4*) osvers=4 ;; | |
1598 | 5*) osvers=5 ;; | |
ecfc5424 | 1599 | *) osvers="$3" ;; |
a0d0e21e LW |
1600 | esac |
1601 | ;; | |
1602 | linux) osname=linux | |
1603 | case "$3" in | |
1604 | 1*) osvers=1 ;; | |
1605 | *) osvers="$3" ;; | |
1606 | esac | |
1607 | ;; | |
1608 | netbsd*) osname=netbsd | |
ecfc5424 AD |
1609 | osvers="$3" |
1610 | ;; | |
a0d0e21e LW |
1611 | bsd386) osname=bsd386 |
1612 | osvers=`$uname -r` | |
1613 | ;; | |
1614 | next*) osname=next ;; | |
1615 | solaris) osname=solaris | |
1616 | case "$3" in | |
1617 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 1618 | *) osvers="$3" ;; |
a0d0e21e LW |
1619 | esac |
1620 | ;; | |
85e6fe83 LW |
1621 | sunos) osname=sunos |
1622 | case "$3" in | |
85e6fe83 LW |
1623 | 5*) osname=solaris |
1624 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 1625 | *) osvers="$3" ;; |
2304df62 AD |
1626 | esac |
1627 | ;; | |
a0d0e21e | 1628 | titanos) osname=titanos |
85e6fe83 | 1629 | case "$3" in |
a0d0e21e LW |
1630 | 1*) osvers=1 ;; |
1631 | 2*) osvers=2 ;; | |
1632 | 3*) osvers=3 ;; | |
1633 | 4*) osvers=4 ;; | |
ecfc5424 | 1634 | *) osvers="$3" ;; |
2304df62 AD |
1635 | esac |
1636 | ;; | |
85e6fe83 | 1637 | ultrix) osname=ultrix |
ecfc5424 | 1638 | osvers="$3" |
2304df62 | 1639 | ;; |
85e6fe83 | 1640 | osf1) case "$5" in |
fed7345c AD |
1641 | alpha) |
1642 | osname=dec_osf | |
1643 | osvers=`echo "$3" | sed 's/^[vt]//'` | |
ecfc5424 AD |
1644 | ;; |
1645 | hp*) osname=hp_osf1 ;; | |
1646 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
1647 | esac |
1648 | ;; | |
a0d0e21e LW |
1649 | uts) osname=uts |
1650 | osvers="$3" | |
1651 | ;; | |
85e6fe83 | 1652 | $2) case "$osname" in |
2304df62 | 1653 | *isc*) ;; |
a0d0e21e LW |
1654 | *freebsd*) ;; |
1655 | svr*) | |
1656 | : svr4.x or possibly later | |
1657 | case "svr$3" in | |
1658 | ${osname}*) | |
1659 | osname=svr$3 | |
1660 | osvers=$4 | |
1661 | ;; | |
1662 | esac | |
1663 | case "$osname" in | |
1664 | svr4.0) | |
1665 | : Check for ESIX | |
1666 | if test -f /stand/boot ; then | |
1667 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
1668 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
1669 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
1670 | if test -n "$isesix"; then | |
a0d0e21e LW |
1671 | osname=esix4 |
1672 | fi | |
1673 | fi | |
1674 | fi | |
1675 | ;; | |
1676 | esac | |
1677 | ;; | |
2304df62 | 1678 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
1679 | osname=sco |
1680 | set `echo $3 | $sed 's/\./ /g'` $4 | |
2304df62 | 1681 | if $test -f sco_$1_$2_$3.sh; then |
85e6fe83 | 1682 | osvers=$1.$2.$3 |
2304df62 | 1683 | elif $test -f sco_$1_$2.sh; then |
85e6fe83 | 1684 | osvers=$1.$2 |
2304df62 | 1685 | elif $test -f sco_$1.sh; then |
85e6fe83 | 1686 | osvers=$1 |
2304df62 | 1687 | fi |
a0d0e21e LW |
1688 | else |
1689 | case "$osname" in | |
1690 | '') : Still unknown. Probably a generic Sys V. | |
1691 | osname="sysv" | |
1692 | osvers="$3" | |
1693 | ;; | |
1694 | esac | |
2304df62 AD |
1695 | fi |
1696 | ;; | |
1697 | esac | |
1698 | ;; | |
a0d0e21e LW |
1699 | *) case "$osname" in |
1700 | '') : Still unknown. Probably a generic BSD. | |
1701 | osname="$1" | |
1702 | osvers="$3" | |
1703 | ;; | |
1704 | esac | |
1705 | ;; | |
2304df62 AD |
1706 | esac |
1707 | else | |
1708 | if test -f /vmunix -a -f news_os.sh; then | |
ecfc5424 | 1709 | (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1 |
2304df62 | 1710 | if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then |
85e6fe83 | 1711 | osname=news_os |
2304df62 AD |
1712 | fi |
1713 | $rm -f ../UU/kernel.what | |
8e07c86e AD |
1714 | elif test -d c:/.; then |
1715 | set X $myuname | |
1716 | osname=os2 | |
1717 | osvers="$5" | |
2304df62 AD |
1718 | fi |
1719 | fi | |
85e6fe83 | 1720 | |
a0d0e21e LW |
1721 | : Now look for a hint file osname_osvers, unless one has been |
1722 | : specified already. | |
1723 | case "$hintfile" in | |
1724 | ''|' ') | |
ecfc5424 | 1725 | file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` |
a0d0e21e | 1726 | : Also try without trailing minor version numbers. |
ecfc5424 AD |
1727 | xfile=`echo $file | $sed -e 's@_[^_]*$@@'` |
1728 | xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` | |
1729 | xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` | |
1730 | xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` | |
a0d0e21e LW |
1731 | case "$file" in |
1732 | '') dflt=none ;; | |
1733 | *) case "$osvers" in | |
1734 | '') dflt=$file | |
1735 | ;; | |
1736 | *) if $test -f $file.sh ; then | |
1737 | dflt=$file | |
1738 | elif $test -f $xfile.sh ; then | |
1739 | dflt=$xfile | |
1740 | elif $test -f $xxfile.sh ; then | |
1741 | dflt=$xxfile | |
1742 | elif $test -f $xxxfile.sh ; then | |
1743 | dflt=$xxxfile | |
1744 | elif $test -f $xxxxfile.sh ; then | |
1745 | dflt=$xxxxfile | |
1746 | elif $test -f "${osname}.sh" ; then | |
1747 | dflt="${osname}" | |
1748 | else | |
1749 | dflt=none | |
1750 | fi | |
1751 | ;; | |
1752 | esac | |
85e6fe83 LW |
1753 | ;; |
1754 | esac | |
1755 | ;; | |
a0d0e21e | 1756 | *) |
ecfc5424 | 1757 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 1758 | ;; |
2304df62 | 1759 | esac |
1aef975c | 1760 | |
2304df62 AD |
1761 | $cat <<EOM |
1762 | ||
1763 | You may give one or more space-separated answers, or "none" if appropriate. | |
1764 | If your OS version has no hints, DO NOT give a wrong version -- say "none". | |
1765 | ||
1766 | EOM | |
1767 | rp="Which of these apply, if any?" | |
1768 | . ../UU/myread | |
85e6fe83 LW |
1769 | tans=$ans |
1770 | for file in $tans; do | |
2304df62 AD |
1771 | if $test -f $file.sh; then |
1772 | . ./$file.sh | |
1773 | $cat $file.sh >> ../UU/config.sh | |
85e6fe83 | 1774 | elif $test X$tans = X -o X$tans = Xnone ; then |
2304df62 AD |
1775 | : nothing |
1776 | else | |
85e6fe83 LW |
1777 | : Give one chance to correct a possible typo. |
1778 | echo "$file.sh does not exist" | |
1779 | dflt=$file | |
1780 | rp="hint to use instead?" | |
1781 | . ../UU/myread | |
1782 | for file in $ans; do | |
1783 | if $test -f "$file.sh"; then | |
1784 | . ./$file.sh | |
1785 | $cat $file.sh >> ../UU/config.sh | |
1786 | elif $test X$ans = X -o X$ans = Xnone ; then | |
1787 | : nothing | |
1788 | else | |
1789 | echo "$file.sh does not exist -- ignored." | |
1790 | fi | |
1791 | done | |
2304df62 AD |
1792 | fi |
1793 | done | |
85e6fe83 | 1794 | |
2304df62 | 1795 | hint=recommended |
85e6fe83 LW |
1796 | : Remember our hint file for later. |
1797 | if $test -f "$file.sh" ; then | |
a0d0e21e | 1798 | hintfile="$file" |
85e6fe83 | 1799 | else |
a0d0e21e | 1800 | hintfile='' |
85e6fe83 LW |
1801 | fi |
1802 | ||
2304df62 AD |
1803 | cd .. |
1804 | fi | |
1805 | cd UU | |
1806 | ;; | |
1807 | *) | |
1808 | echo " " | |
1809 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
1810 | tmp_n="$n" |
1811 | tmp_c="$c" | |
2304df62 AD |
1812 | cd .. |
1813 | cp $config_sh config.sh 2>/dev/null | |
1814 | . ./config.sh | |
1815 | cd UU | |
1816 | cp ../config.sh . | |
ecfc5424 AD |
1817 | n="$tmp_n" |
1818 | c="$tmp_c" | |
2304df62 AD |
1819 | hint=previous |
1820 | ;; | |
1821 | esac | |
1aef975c AD |
1822 | test "$override" && . ./optdef.sh |
1823 | myuname="$newmyuname" | |
2304df62 AD |
1824 | |
1825 | : Restore computed paths | |
1826 | for file in $loclist $trylist; do | |
1827 | eval $file="\$_$file" | |
1828 | done | |
1829 | ||
85e6fe83 | 1830 | cat << EOM |
a0d0e21e | 1831 | |
85e6fe83 | 1832 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
1833 | The default value is probably right if the name rings a bell. Otherwise, |
1834 | since spelling matters for me, either accept the default or answer "none" | |
1835 | to leave it blank. | |
a0d0e21e | 1836 | |
85e6fe83 | 1837 | EOM |
85e6fe83 | 1838 | case "$osname" in |
a0d0e21e | 1839 | ''|' ') |
85e6fe83 | 1840 | case "$hintfile" in |
a0d0e21e | 1841 | ''|' '|none) dflt=none ;; |
ecfc5424 | 1842 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
1843 | esac |
1844 | ;; | |
1845 | *) dflt="$osname" ;; | |
1846 | esac | |
1847 | rp="Operating system name?" | |
1848 | . ./myread | |
1849 | case "$ans" in | |
ecfc5424 AD |
1850 | none) osname='' ;; |
1851 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 1852 | esac |
2304df62 AD |
1853 | : who configured the system |
1854 | cf_time=`$date 2>&1` | |
a0d0e21e LW |
1855 | (logname > .temp) >/dev/null 2>&1 |
1856 | $test -s .temp || (whoami > .temp) >/dev/null 2>&1 | |
1857 | $test -s .temp || echo unknown > .temp | |
1858 | cf_by=`$cat .temp` | |
1859 | $rm -f .temp | |
2304df62 AD |
1860 | |
1861 | : determine where manual pages are on this system | |
1862 | echo " " | |
1863 | case "$sysman" in | |
1864 | '') | |
a0d0e21e | 1865 | syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' |
2304df62 AD |
1866 | syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" |
1867 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" | |
1868 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
a0d0e21e LW |
1869 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" |
1870 | sysman=`./loc . /usr/man/man1 $syspath` | |
2304df62 AD |
1871 | ;; |
1872 | esac | |
1873 | if $test -d "$sysman"; then | |
1874 | echo "System manual is in $sysman." >&4 | |
1875 | else | |
1876 | echo "Could not find manual pages in source form." >&4 | |
1877 | fi | |
1878 | ||
1879 | : see what memory models we can support | |
1880 | case "$models" in | |
1881 | '') | |
1882 | $cat >pdp11.c <<'EOP' | |
1883 | main() { | |
1884 | #ifdef pdp11 | |
1885 | exit(0); | |
1886 | #else | |
1887 | exit(1); | |
1888 | #endif | |
1889 | } | |
1890 | EOP | |
1891 | cc -o pdp11 pdp11.c >/dev/null 2>&1 | |
1892 | if ./pdp11 2>/dev/null; then | |
1893 | dflt='unsplit split' | |
1894 | else | |
1895 | tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` | |
1896 | case "$tans" in | |
1897 | X) dflt='none';; | |
1898 | *) if $test -d /lib/small || $test -d /usr/lib/small; then | |
1899 | dflt='small' | |
1900 | else | |
1901 | dflt='' | |
1902 | fi | |
1903 | if $test -d /lib/medium || $test -d /usr/lib/medium; then | |
1904 | dflt="$dflt medium" | |
1905 | fi | |
1906 | if $test -d /lib/large || $test -d /usr/lib/large; then | |
1907 | dflt="$dflt large" | |
1908 | fi | |
1909 | if $test -d /lib/huge || $test -d /usr/lib/huge; then | |
1910 | dflt="$dflt huge" | |
1911 | fi | |
1912 | esac | |
1913 | fi;; | |
1914 | *) dflt="$models";; | |
1915 | esac | |
1916 | $cat <<EOM | |
1917 | ||
1918 | Some systems have different model sizes. On most systems they are called | |
1919 | small, medium, large, and huge. On the PDP11 they are called unsplit and | |
1920 | split. If your system doesn't support different memory models, say "none". | |
1921 | If you wish to force everything to one memory model, say "none" here and | |
1922 | put the appropriate flags later when it asks you for other cc and ld flags. | |
1923 | Venix systems may wish to put "none" and let the compiler figure things out. | |
1924 | (In the following question multiple model names should be space separated.) | |
1925 | ||
1926 | EOM | |
1927 | rp="Which memory models are supported?" | |
1928 | . ./myread | |
1929 | models="$ans" | |
1930 | ||
1931 | case "$models" in | |
1932 | none) | |
1933 | small='' | |
1934 | medium='' | |
1935 | large='' | |
1936 | huge='' | |
1937 | unsplit='' | |
1938 | split='' | |
1939 | ;; | |
1940 | *split) | |
1941 | case "$split" in | |
1942 | '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \ | |
1943 | $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then | |
1944 | dflt='-i' | |
1945 | else | |
1946 | dflt='none' | |
1947 | fi;; | |
1948 | *) dflt="$split";; | |
1949 | esac | |
1950 | rp="What flag indicates separate I and D space?" | |
1951 | . ./myread | |
1952 | tans="$ans" | |
1953 | case "$tans" in | |
1954 | none) tans='';; | |
1955 | esac | |
1956 | split="$tans" | |
1957 | unsplit='';; | |
1958 | *large*|*small*|*medium*|*huge*) | |
1959 | case "$models" in | |
1960 | *large*) | |
1961 | case "$large" in | |
1962 | '') dflt='-Ml';; | |
1963 | *) dflt="$large";; | |
1964 | esac | |
1965 | rp="What flag indicates large model?" | |
1966 | . ./myread | |
1967 | tans="$ans" | |
1968 | case "$tans" in | |
1969 | none) tans=''; | |
1970 | esac | |
1971 | large="$tans";; | |
1972 | *) large='';; | |
1973 | esac | |
1974 | case "$models" in | |
1975 | *huge*) case "$huge" in | |
1976 | '') dflt='-Mh';; | |
1977 | *) dflt="$huge";; | |
1978 | esac | |
1979 | rp="What flag indicates huge model?" | |
1980 | . ./myread | |
1981 | tans="$ans" | |
1982 | case "$tans" in | |
1983 | none) tans=''; | |
1984 | esac | |
1985 | huge="$tans";; | |
1986 | *) huge="$large";; | |
1987 | esac | |
1988 | case "$models" in | |
1989 | *medium*) case "$medium" in | |
1990 | '') dflt='-Mm';; | |
1991 | *) dflt="$medium";; | |
1992 | esac | |
1993 | rp="What flag indicates medium model?" | |
1994 | . ./myread | |
1995 | tans="$ans" | |
1996 | case "$tans" in | |
1997 | none) tans=''; | |
1998 | esac | |
1999 | medium="$tans";; | |
2000 | *) medium="$large";; | |
2001 | esac | |
2002 | case "$models" in | |
2003 | *small*) case "$small" in | |
2004 | '') dflt='none';; | |
2005 | *) dflt="$small";; | |
2006 | esac | |
2007 | rp="What flag indicates small model?" | |
2008 | . ./myread | |
2009 | tans="$ans" | |
2010 | case "$tans" in | |
2011 | none) tans=''; | |
2012 | esac | |
2013 | small="$tans";; | |
2014 | *) small='';; | |
2015 | esac | |
2016 | ;; | |
2017 | *) | |
2018 | echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 | |
2019 | ;; | |
2020 | esac | |
2021 | ||
2022 | : make some quick guesses about what we are up against | |
2023 | echo " " | |
2024 | $echo $n "Hmm... $c" | |
2025 | echo exit 1 >bsd | |
2026 | echo exit 1 >usg | |
2027 | echo exit 1 >v7 | |
2028 | echo exit 1 >osf1 | |
2029 | echo exit 1 >eunice | |
2030 | echo exit 1 >xenix | |
2031 | echo exit 1 >venix | |
ecfc5424 | 2032 | d_bsd="$undef" |
2304df62 AD |
2033 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null |
2034 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
2035 | then | |
2036 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
2037 | echo exit 0 >osf1 | |
2038 | elif test `echo abc | tr a-z A-Z` = Abc ; then | |
2039 | xxx=`./loc addbib blurfl $pth` | |
2040 | if $test -f $xxx; then | |
2041 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
2042 | echo exit 0 >bsd | |
2043 | echo exit 0 >usg | |
2044 | else | |
2045 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2046 | echo "Looks kind of like an extended USG system, but we'll see..." | |
2047 | else | |
2048 | echo "Looks kind of like a USG system, but we'll see..." | |
2049 | fi | |
2050 | echo exit 0 >usg | |
2051 | fi | |
2052 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2053 | echo "Looks kind of like a BSD system, but we'll see..." | |
ecfc5424 | 2054 | d_bsd="$define" |
2304df62 AD |
2055 | echo exit 0 >bsd |
2056 | else | |
2057 | echo "Looks kind of like a Version 7 system, but we'll see..." | |
2058 | echo exit 0 >v7 | |
2059 | fi | |
2060 | case "$eunicefix" in | |
2061 | *unixtovms*) | |
2062 | $cat <<'EOI' | |
2063 | There is, however, a strange, musty smell in the air that reminds me of | |
2064 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
2065 | EOI | |
2066 | echo exit 0 >eunice | |
2067 | d_eunice="$define" | |
2068 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
2069 | ;; | |
2070 | *) | |
2071 | echo " " | |
2072 | echo "Congratulations. You aren't running Eunice." | |
2073 | d_eunice="$undef" | |
2074 | ;; | |
2075 | esac | |
2076 | if test -f /xenix; then | |
2077 | echo "Actually, this looks more like a XENIX system..." | |
2078 | echo exit 0 >xenix | |
2079 | d_xenix="$define" | |
2080 | else | |
2081 | echo " " | |
2082 | echo "It's not Xenix..." | |
2083 | d_xenix="$undef" | |
2084 | fi | |
2085 | chmod +x xenix | |
2086 | $eunicefix xenix | |
2087 | if test -f /venix; then | |
2088 | echo "Actually, this looks more like a VENIX system..." | |
2089 | echo exit 0 >venix | |
2090 | else | |
2091 | echo " " | |
ecfc5424 | 2092 | if ./xenix; then |
2304df62 AD |
2093 | : null |
2094 | else | |
2095 | echo "Nor is it Venix..." | |
2096 | fi | |
2097 | fi | |
2098 | chmod +x bsd usg v7 osf1 eunice xenix venix | |
2099 | $eunicefix bsd usg v7 osf1 eunice xenix venix | |
2100 | $rm -f foo | |
2101 | ||
2102 | : see if we need a special compiler | |
2103 | echo " " | |
ecfc5424 | 2104 | if ./usg; then |
2304df62 AD |
2105 | case "$cc" in |
2106 | '') case "$Mcc" in | |
2107 | /*) dflt='Mcc';; | |
2108 | *) case "$large" in | |
2109 | -M*) dflt='cc';; | |
2110 | *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then | |
2111 | if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then | |
2112 | dflt='cc' | |
2113 | else | |
2114 | dflt='cc -M' | |
2115 | fi | |
2116 | else | |
2117 | dflt='cc' | |
2118 | fi;; | |
2119 | esac;; | |
2120 | esac;; | |
2121 | *) dflt="$cc";; | |
2122 | esac | |
2123 | $cat <<'EOM' | |
2124 | On some systems the default C compiler will not resolve multiple global | |
2125 | references that happen to have the same name. On some such systems the "Mcc" | |
2126 | command may be used to force these to be resolved. On other systems a "cc -M" | |
2127 | command is required. (Note that the -M flag on other systems indicates a | |
2128 | memory model to use!) If you have the Gnu C compiler, you might wish to use | |
2129 | that instead. | |
2130 | ||
2131 | EOM | |
2132 | rp="What command will force resolution on this system?" | |
2133 | . ./myread | |
2134 | cc="$ans" | |
2135 | else | |
2136 | case "$cc" in | |
2137 | '') dflt=cc;; | |
2138 | *) dflt="$cc";; | |
2139 | esac | |
2140 | rp="Use which C compiler?" | |
2141 | . ./myread | |
2142 | cc="$ans" | |
2143 | fi | |
ecfc5424 AD |
2144 | echo " " |
2145 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
2304df62 AD |
2146 | $cat >gccvers.c <<EOM |
2147 | #include <stdio.h> | |
a0d0e21e | 2148 | int main() { |
2304df62 | 2149 | #ifdef __GNUC__ |
a0d0e21e | 2150 | #ifdef __VERSION__ |
ecfc5424 | 2151 | printf("%s\n", __VERSION__); |
2304df62 | 2152 | #else |
ecfc5424 | 2153 | printf("%s\n", "1"); |
2304df62 | 2154 | #endif |
a0d0e21e | 2155 | #endif |
ecfc5424 | 2156 | exit(0); |
2304df62 AD |
2157 | } |
2158 | EOM | |
a0d0e21e LW |
2159 | if $cc -o gccvers gccvers.c >/dev/null 2>&1; then |
2160 | gccversion=`./gccvers` | |
2161 | case "$gccversion" in | |
2162 | '') echo "You are not using GNU cc." ;; | |
2163 | *) echo "You are using GNU cc $gccversion." ;; | |
2164 | esac | |
2165 | else | |
16d20bd9 AD |
2166 | echo " " |
2167 | echo "*** WHOA THERE!!! ***" >&4 | |
2168 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
2169 | case "$knowitall" in | |
2170 | '') | |
2171 | echo " You'd better start hunting for one and let me know about it." >&4 | |
2172 | exit 1 | |
2173 | ;; | |
2174 | esac | |
a0d0e21e LW |
2175 | fi |
2176 | $rm -f gccvers* | |
2177 | case "$gccversion" in | |
2178 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
2304df62 | 2179 | esac |
a0d0e21e | 2180 | |
8e07c86e | 2181 | : decide how portable to be. Allow command line overrides. |
2304df62 | 2182 | case "$d_portable" in |
8e07c86e AD |
2183 | "$undef") ;; |
2184 | *) d_portable="$define" ;; | |
2304df62 AD |
2185 | esac |
2186 | ||
2187 | : set up shell script to do ~ expansion | |
2188 | cat >filexp <<EOSS | |
2189 | $startsh | |
2190 | : expand filename | |
2191 | case "\$1" in | |
2192 | ~/*|~) | |
2193 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
2194 | ;; | |
2195 | ~*) | |
2196 | if $test -f /bin/csh; then | |
2197 | /bin/csh -f -c "glob \$1" | |
a0d0e21e | 2198 | failed=\$? |
2304df62 AD |
2199 | echo "" |
2200 | exit \$failed | |
2201 | else | |
2202 | name=\`$expr x\$1 : '..\([^/]*\)'\` | |
2203 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
2204 | if $test ! -d "\$dir"; then | |
2205 | me=\`basename \$0\` | |
2206 | echo "\$me: can't locate home directory for: \$name" >&2 | |
2207 | exit 1 | |
2208 | fi | |
2209 | case "\$1" in | |
2210 | */*) | |
2211 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
2212 | ;; | |
2213 | *) | |
2214 | echo \$dir | |
2215 | ;; | |
2216 | esac | |
2217 | fi | |
2218 | ;; | |
2219 | *) | |
2220 | echo \$1 | |
2221 | ;; | |
2222 | esac | |
2223 | EOSS | |
2224 | chmod +x filexp | |
2225 | $eunicefix filexp | |
2226 | ||
2227 | : now set up to get a file name | |
2228 | cat <<'EOSC' >getfile | |
2229 | tilde='' | |
2230 | fullpath='' | |
2231 | already='' | |
2232 | skip='' | |
2233 | none_ok='' | |
2234 | exp_file='' | |
a0d0e21e | 2235 | nopath_ok='' |
2304df62 AD |
2236 | orig_rp="$rp" |
2237 | orig_dflt="$dflt" | |
2238 | ||
2239 | case "$fn" in | |
ecfc5424 AD |
2240 | *\(*) |
2241 | expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok | |
2242 | fn=`echo $fn | sed 's/(.*)//'` | |
2243 | ;; | |
2244 | esac | |
2245 | ||
2246 | case "$fn" in | |
a0d0e21e LW |
2247 | *:*) |
2248 | loc_file=`expr $fn : '.*:\(.*\)'` | |
2249 | fn=`expr $fn : '\(.*\):.*'` | |
2250 | ;; | |
2251 | esac | |
2252 | ||
2253 | case "$fn" in | |
2304df62 AD |
2254 | *~*) tilde=true;; |
2255 | esac | |
2256 | case "$fn" in | |
2257 | */*) fullpath=true;; | |
2258 | esac | |
2259 | case "$fn" in | |
2260 | *+*) skip=true;; | |
2261 | esac | |
2262 | case "$fn" in | |
2263 | *n*) none_ok=true;; | |
2264 | esac | |
2265 | case "$fn" in | |
2266 | *e*) exp_file=true;; | |
2267 | esac | |
a0d0e21e LW |
2268 | case "$fn" in |
2269 | *p*) nopath_ok=true;; | |
2270 | esac | |
2304df62 AD |
2271 | |
2272 | case "$fn" in | |
2273 | *f*) type='File';; | |
2274 | *d*) type='Directory';; | |
a0d0e21e | 2275 | *l*) type='Locate';; |
2304df62 AD |
2276 | esac |
2277 | ||
2278 | what="$type" | |
2279 | case "$what" in | |
2280 | Locate) what='File';; | |
2281 | esac | |
2282 | ||
2283 | case "$exp_file" in | |
2284 | '') | |
2285 | case "$d_portable" in | |
2286 | "$define") ;; | |
2287 | *) exp_file=true;; | |
2288 | esac | |
2289 | ;; | |
2290 | esac | |
2291 | ||
2292 | cd .. | |
2293 | while test "$type"; do | |
2294 | redo='' | |
2295 | rp="$orig_rp" | |
2296 | dflt="$orig_dflt" | |
2297 | case "$tilde" in | |
2298 | true) rp="$rp (~name ok)";; | |
2299 | esac | |
2300 | . UU/myread | |
ecfc5424 AD |
2301 | if test -f UU/getfile.ok && \ |
2302 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
2303 | then | |
2304 | value="$ans" | |
2305 | ansexp="$ans" | |
2306 | break | |
2307 | fi | |
2304df62 AD |
2308 | case "$ans" in |
2309 | none) | |
2310 | value='' | |
2311 | ansexp='' | |
2312 | case "$none_ok" in | |
2313 | true) type='';; | |
2314 | esac | |
2315 | ;; | |
2316 | *) | |
2317 | case "$tilde" in | |
2318 | '') value="$ans" | |
2319 | ansexp="$ans";; | |
2320 | *) | |
2321 | value=`UU/filexp $ans` | |
2322 | case $? in | |
2323 | 0) | |
2324 | if test "$ans" != "$value"; then | |
ecfc5424 | 2325 | echo "(That expands to $value on this system.)" |
2304df62 AD |
2326 | fi |
2327 | ;; | |
2328 | *) value="$ans";; | |
2329 | esac | |
2330 | ansexp="$value" | |
2331 | case "$exp_file" in | |
2332 | '') value="$ans";; | |
2333 | esac | |
2334 | ;; | |
2335 | esac | |
2336 | case "$fullpath" in | |
2337 | true) | |
2338 | case "$ansexp" in | |
2339 | /*) value="$ansexp" ;; | |
2340 | *) | |
2341 | redo=true | |
2342 | case "$already" in | |
2343 | true) | |
2344 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
2345 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
2346 | ;; | |
2347 | *) | |
2348 | echo "Please give a full path name, starting with slash." >&4 | |
2349 | case "$tilde" in | |
2350 | true) | |
2351 | echo "Note that using ~name is ok provided it expands well." >&4 | |
2352 | already=true | |
2353 | ;; | |
2354 | esac | |
2355 | esac | |
2356 | ;; | |
2357 | esac | |
2358 | ;; | |
2359 | esac | |
2360 | case "$redo" in | |
2361 | '') | |
2362 | case "$type" in | |
2363 | File) | |
2364 | if test -f "$ansexp"; then | |
2365 | type='' | |
2366 | elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 | |
2367 | then | |
2368 | echo "($value is not a plain file, but that's ok.)" | |
2369 | type='' | |
2370 | fi | |
2371 | ;; | |
2372 | Directory) | |
2373 | if test -d "$ansexp"; then | |
2374 | type='' | |
2375 | fi | |
2376 | ;; | |
2377 | Locate) | |
40000a8c | 2378 | if test -d "$ansexp"; then |
a0d0e21e LW |
2379 | echo "(Looking for $loc_file in directory $value.)" |
2380 | value="$value/$loc_file" | |
40000a8c | 2381 | ansexp="$ansexp/$loc_file" |
2304df62 | 2382 | fi |
40000a8c | 2383 | if test -f "$ansexp"; then |
2304df62 AD |
2384 | type='' |
2385 | fi | |
a0d0e21e LW |
2386 | case "$nopath_ok" in |
2387 | true) case "$value" in | |
2388 | */*) ;; | |
2389 | *) echo "Assuming $value will be in people's path." | |
2390 | type='' | |
2391 | ;; | |
2392 | esac | |
2393 | ;; | |
2394 | esac | |
2304df62 AD |
2395 | ;; |
2396 | esac | |
2397 | ||
2398 | case "$skip" in | |
2399 | true) type=''; | |
2400 | esac | |
2401 | ||
2402 | case "$type" in | |
2403 | '') ;; | |
2404 | *) | |
2405 | if test "$fastread" = yes; then | |
2406 | dflt=y | |
2407 | else | |
2408 | dflt=n | |
2409 | fi | |
2410 | rp="$what $value doesn't exist. Use that name anyway?" | |
2411 | . UU/myread | |
2412 | dflt='' | |
2413 | case "$ans" in | |
2414 | y*) type='';; | |
2415 | *) echo " ";; | |
2416 | esac | |
2417 | ;; | |
2418 | esac | |
2419 | ;; | |
2420 | esac | |
2421 | ;; | |
2422 | esac | |
2423 | done | |
2424 | cd UU | |
2425 | ans="$value" | |
2426 | rp="$orig_rp" | |
2427 | dflt="$orig_dflt" | |
ecfc5424 | 2428 | rm -f getfile.ok |
2304df62 AD |
2429 | EOSC |
2430 | ||
2431 | : What should the include directory be ? | |
2432 | echo " " | |
2433 | $echo $n "Hmm... $c" | |
a0d0e21e | 2434 | dflt='/usr/include' |
2304df62 AD |
2435 | incpath='' |
2436 | mips_type='' | |
2437 | if $test -f /bin/mips && /bin/mips; then | |
2438 | echo "Looks like a MIPS system..." | |
2439 | $cat >usr.c <<'EOCP' | |
2440 | #ifdef SYSTYPE_BSD43 | |
2441 | /bsd43 | |
2442 | #endif | |
2443 | EOCP | |
2444 | if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then | |
2445 | dflt='/bsd43/usr/include' | |
2446 | incpath='/bsd43' | |
2447 | mips_type='BSD 4.3' | |
2448 | else | |
2449 | mips_type='System V' | |
2450 | fi | |
2451 | $rm -f usr.c usr.out | |
2452 | echo "and you're compiling with the $mips_type compiler and libraries." | |
8e07c86e | 2453 | xxx_prompt=y |
40000a8c | 2454 | echo "exit 0" >mips |
2304df62 AD |
2455 | else |
2456 | echo "Doesn't look like a MIPS system." | |
8e07c86e | 2457 | xxx_prompt=n |
2304df62 | 2458 | echo "exit 1" >mips |
2304df62 | 2459 | fi |
40000a8c AD |
2460 | chmod +x mips |
2461 | $eunicefix mips | |
2304df62 | 2462 | echo " " |
a0d0e21e LW |
2463 | case "$usrinc" in |
2464 | '') ;; | |
2465 | *) dflt="$usrinc";; | |
2466 | esac | |
8e07c86e AD |
2467 | case "$xxx_prompt" in |
2468 | y) fn=d/ | |
2469 | rp='Where are the include files you want to use?' | |
2470 | . ./getfile | |
2471 | usrinc="$ans" | |
2472 | ;; | |
2473 | *) usrinc="$dflt" | |
2474 | ;; | |
2475 | esac | |
2304df62 | 2476 | |
a0d0e21e LW |
2477 | : see how we invoke the C preprocessor |
2478 | echo " " | |
2479 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 | |
2480 | cat <<'EOT' >testcpp.c | |
2481 | #define ABC abc | |
2482 | #define XYZ xyz | |
2483 | ABC.XYZ | |
2484 | EOT | |
2485 | cd .. | |
2486 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
2487 | chmod 755 cppstdin | |
2488 | wrapper=`pwd`/cppstdin | |
2489 | ok='false' | |
2490 | cd UU | |
2304df62 | 2491 | |
a0d0e21e LW |
2492 | if $test "X$cppstdin" != "X" && \ |
2493 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
2494 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
2495 | then | |
2496 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
2497 | case "$cpprun" in | |
2498 | '') echo "But let's see if we can live without a wrapper..." ;; | |
2499 | *) | |
2500 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
2501 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
2304df62 | 2502 | then |
a0d0e21e LW |
2503 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" |
2504 | ok='true' | |
2505 | else | |
2506 | echo "(However, $cpprun $cpplast does not work, let's see...)" | |
2304df62 AD |
2507 | fi |
2508 | ;; | |
2509 | esac | |
2304df62 | 2510 | else |
a0d0e21e LW |
2511 | case "$cppstdin" in |
2512 | '') ;; | |
2513 | *) | |
2514 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
2515 | ;; | |
2516 | esac | |
2304df62 | 2517 | fi |
2304df62 | 2518 | |
a0d0e21e LW |
2519 | if $ok; then |
2520 | : nothing | |
2521 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
2522 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
2523 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2524 | echo "Yup, it does." | |
2525 | x_cpp="$cc -E" | |
2526 | x_minus=''; | |
2527 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
2528 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
2529 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2530 | echo "Yup, it does." | |
2531 | x_cpp="$cc -E" | |
2532 | x_minus='-'; | |
2533 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
2534 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
2535 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2536 | echo "Yipee, that works!" | |
2537 | x_cpp="$cc -P" | |
2538 | x_minus=''; | |
2539 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
2540 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
2541 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2542 | echo "At long last!" | |
2543 | x_cpp="$cc -P" | |
2544 | x_minus='-'; | |
2545 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
2546 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
2547 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2548 | echo "It works!" | |
2549 | x_cpp="$cpp" | |
2550 | x_minus=''; | |
2551 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
2552 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
2553 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2554 | echo "Hooray, it works! I was beginning to wonder." | |
2555 | x_cpp="$cpp" | |
2556 | x_minus='-'; | |
2557 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
2558 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
2559 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2560 | x_cpp="$wrapper" | |
2561 | x_minus='' | |
2562 | echo "Eureka!" | |
2563 | else | |
2564 | dflt='' | |
2565 | rp="No dice. I can't find a C preprocessor. Name one:" | |
2566 | . ./myread | |
2567 | x_cpp="$ans" | |
2568 | x_minus='' | |
2569 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
2570 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
2571 | echo "OK, that will do." >&4 | |
2572 | else | |
2573 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
2574 | exit 1 | |
2575 | fi | |
2576 | fi | |
2577 | ||
2578 | case "$ok" in | |
2579 | false) | |
2580 | cppstdin="$x_cpp" | |
2581 | cppminus="$x_minus" | |
2582 | cpprun="$x_cpp" | |
2583 | cpplast="$x_minus" | |
2584 | set X $x_cpp | |
2585 | shift | |
2586 | case "$1" in | |
2587 | "$cpp") | |
2588 | echo "Perhaps can we force $cc -E using a wrapper..." | |
2589 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
2590 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
2591 | then | |
2592 | echo "Yup, we can." | |
2593 | cppstdin="$wrapper" | |
2594 | cppminus=''; | |
2595 | else | |
2596 | echo "Nope, we'll have to live without it..." | |
2597 | fi | |
2598 | ;; | |
2599 | esac | |
2600 | case "$cpprun" in | |
2601 | "$wrapper") | |
2602 | cpprun='' | |
2603 | cpplast='' | |
2604 | ;; | |
2605 | esac | |
2606 | ;; | |
2607 | esac | |
2608 | ||
2609 | case "$cppstdin" in | |
2610 | "$wrapper") ;; | |
2611 | *) $rm -f $wrapper;; | |
2612 | esac | |
2613 | $rm -f testcpp.c testcpp.out | |
2614 | ||
8e07c86e AD |
2615 | : Set private lib path |
2616 | case "$plibpth" in | |
2617 | '') if ./mips; then | |
2618 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
2619 | fi;; | |
2620 | esac | |
2621 | case "$libpth" in | |
2622 | ' ') dlist='';; | |
2623 | '') dlist="$loclibpth $plibpth $glibpth";; | |
2624 | *) dlist="$libpth";; | |
a0d0e21e | 2625 | esac |
a0d0e21e | 2626 | |
8e07c86e AD |
2627 | : Now check and see which directories actually exist, avoiding duplicates |
2628 | libpth='' | |
2629 | for xxx in $dlist | |
2630 | do | |
2631 | if $test -d $xxx; then | |
2632 | case " $libpth " in | |
2633 | *" $xxx "*) ;; | |
2634 | *) libpth="$libpth $xxx";; | |
2635 | esac | |
2636 | fi | |
2637 | done | |
2638 | $cat <<'EOM' | |
a0d0e21e | 2639 | |
8e07c86e AD |
2640 | Some systems have incompatible or broken versions of libraries. Among |
2641 | the directories listed in the question below, please remove any you | |
2642 | know not to be holding relevant libraries, and add any that are needed. | |
2643 | Say "none" for none. | |
2644 | ||
2645 | EOM | |
2646 | case "$libpth" in | |
2647 | '') dflt='none';; | |
2648 | *) | |
2649 | set X $libpth | |
2650 | shift | |
2651 | dflt=${1+"$@"} | |
2652 | ;; | |
2653 | esac | |
2654 | rp="Directories to use for library searches?" | |
a0d0e21e | 2655 | . ./myread |
8e07c86e AD |
2656 | case "$ans" in |
2657 | none) libpth=' ';; | |
2658 | *) libpth="$ans";; | |
a0d0e21e LW |
2659 | esac |
2660 | ||
8e07c86e AD |
2661 | : determine root of directory hierarchy where package will be installed. |
2662 | case "$prefix" in | |
2663 | '') | |
2664 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
2665 | ;; | |
2666 | *) | |
2667 | dflt="$prefix" | |
a0d0e21e LW |
2668 | ;; |
2669 | esac | |
8e07c86e | 2670 | $cat <<EOM |
a0d0e21e | 2671 | |
8e07c86e AD |
2672 | By default, $package will be installed in $dflt/bin, manual |
2673 | pages under $dflt/man, etc..., i.e. with $dflt as prefix for | |
2674 | all installation directories. Typically set to /usr/local, but you | |
2675 | may choose /usr if you wish to install $package among your system | |
2676 | binaries. If you wish to have binaries under /bin but manual pages | |
2677 | under /usr/local/man, that's ok: you will be prompted separately | |
2678 | for each of the installation directories, the prefix being only used | |
2679 | to set the defaults. | |
2680 | ||
2681 | EOM | |
2682 | fn=d~ | |
2683 | rp='Installation prefix to use?' | |
2684 | . ./getfile | |
2685 | oldprefix='' | |
2686 | case "$prefix" in | |
a0d0e21e | 2687 | '') ;; |
8e07c86e AD |
2688 | *) |
2689 | case "$ans" in | |
2690 | "$prefix") ;; | |
2691 | *) oldprefix="$prefix";; | |
2692 | esac | |
2693 | ;; | |
a0d0e21e | 2694 | esac |
8e07c86e AD |
2695 | prefix="$ans" |
2696 | prefixexp="$ansexp" | |
a0d0e21e | 2697 | |
8e07c86e AD |
2698 | : set the prefixit variable, to compute a suitable default value |
2699 | prefixit='case "$3" in | |
2700 | ""|none) | |
2701 | case "$oldprefix" in | |
2702 | "") eval "$1=\"\$$2\"";; | |
2703 | *) | |
2704 | case "$3" in | |
2705 | "") eval "$1=";; | |
2706 | none) | |
2707 | eval "tp=\"\$$2\""; | |
2708 | case "$tp" in | |
2709 | ""|" ") eval "$1=\"\$$2\"";; | |
2710 | *) eval "$1=";; | |
2711 | esac;; | |
2712 | esac;; | |
2713 | esac;; | |
2714 | *) | |
2715 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; | |
2716 | case "$tp" in | |
2717 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; | |
2718 | /*-$oldprefix/*|\~*-$oldprefix/*) | |
2719 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; | |
2720 | *) eval "$1=\"\$$2\"";; | |
2721 | esac;; | |
2722 | esac' | |
a0d0e21e | 2723 | |
8e07c86e AD |
2724 | : is AFS running? |
2725 | echo " " | |
2726 | if test -d /afs; then | |
2727 | echo "AFS may be running... I'll be extra cautious then..." >&4 | |
2728 | afs=true | |
a0d0e21e | 2729 | else |
8e07c86e AD |
2730 | echo "AFS does not seem to be running..." >&4 |
2731 | afs=false | |
a0d0e21e | 2732 | fi |
a0d0e21e | 2733 | |
8e07c86e AD |
2734 | : determine where public executables go |
2735 | echo " " | |
2736 | set dflt bin bin | |
2737 | eval $prefixit | |
2738 | fn=d~ | |
2739 | rp='Pathname where the public executables will reside?' | |
2740 | . ./getfile | |
2741 | if $test "X$ansexp" != "X$binexp"; then | |
2742 | installbin='' | |
2743 | fi | |
2744 | bin="$ans" | |
2745 | binexp="$ansexp" | |
2746 | if $afs; then | |
2747 | $cat <<EOM | |
2304df62 | 2748 | |
8e07c86e AD |
2749 | Since you are running AFS, I need to distinguish the directory in which |
2750 | executables reside from the directory in which they are installed (and from | |
2751 | which they are presumably copied to the former directory by occult means). | |
a0d0e21e | 2752 | |
8e07c86e AD |
2753 | EOM |
2754 | case "$installbin" in | |
2755 | '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;; | |
2756 | *) dflt="$installbin";; | |
2757 | esac | |
2758 | fn=de~ | |
2759 | rp='Where will public executables be installed?' | |
2760 | . ./getfile | |
2761 | installbin="$ans" | |
2762 | else | |
2763 | installbin="$binexp" | |
2764 | fi | |
2304df62 | 2765 | |
8e07c86e AD |
2766 | : set the prefixup variable, to restore leading tilda escape |
2767 | prefixup='case "$prefixexp" in | |
2768 | "$prefix") ;; | |
2769 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; | |
2770 | esac' | |
2771 | ||
2772 | : determine where public executable scripts go | |
2773 | set scriptdir scriptdir | |
2774 | eval $prefixit | |
2775 | case "$scriptdir" in | |
2776 | '') | |
2777 | dflt="$bin" | |
2778 | : guess some guesses | |
2779 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
2780 | $test -d /usr/share/bin && dflt=/usr/share/bin | |
2781 | $test -d /usr/local/script && dflt=/usr/local/script | |
2782 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
2783 | set dflt | |
2784 | eval $prefixup | |
2785 | ;; | |
2786 | *) dflt="$scriptdir" | |
2787 | ;; | |
2788 | esac | |
2789 | $cat <<EOM | |
2790 | ||
2791 | Some installations have a separate directory just for executable scripts so | |
2792 | that they can mount it across multiple architectures but keep the scripts in | |
2793 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
2794 | Or you might just lump your scripts in with all your other executables. | |
2795 | ||
2796 | EOM | |
2797 | fn=d~ | |
2798 | rp='Where do you keep publicly executable scripts?' | |
2799 | . ./getfile | |
2800 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
2801 | installscript='' | |
2802 | fi | |
2803 | scriptdir="$ans" | |
2804 | scriptdirexp="$ansexp" | |
2805 | if $afs; then | |
2806 | $cat <<EOM | |
2807 | ||
2808 | Since you are running AFS, I need to distinguish the directory in which | |
2809 | scripts reside from the directory in which they are installed (and from | |
2810 | which they are presumably copied to the former directory by occult means). | |
2811 | ||
2812 | EOM | |
2813 | case "$installscript" in | |
2814 | '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;; | |
2815 | *) dflt="$installscript";; | |
2816 | esac | |
2817 | fn=de~ | |
2818 | rp='Where will public scripts be installed?' | |
2819 | . ./getfile | |
2820 | installscript="$ans" | |
2821 | else | |
2822 | installscript="$scriptdirexp" | |
2823 | fi | |
2824 | ||
2825 | : determine where private executables go | |
2826 | set dflt privlib lib/$package | |
2827 | eval $prefixit | |
2828 | $cat <<EOM | |
2829 | ||
2830 | There are some auxiliary files for $package that need to be put into a | |
2831 | private library directory that is accessible by everyone. | |
2832 | ||
2833 | EOM | |
2834 | fn=d~+ | |
2835 | rp='Pathname where the private library files will reside?' | |
2836 | . ./getfile | |
2837 | if $test "X$privlibexp" != "X$ansexp"; then | |
2838 | installprivlib='' | |
2839 | fi | |
2840 | privlib="$ans" | |
2841 | privlibexp="$ansexp" | |
2842 | if $afs; then | |
2843 | $cat <<EOM | |
2844 | ||
2845 | Since you are running AFS, I need to distinguish the directory in which | |
2846 | private files reside from the directory in which they are installed (and from | |
2847 | which they are presumably copied to the former directory by occult means). | |
2848 | ||
2849 | EOM | |
2850 | case "$installprivlib" in | |
2851 | '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2852 | *) dflt="$installprivlib";; | |
2853 | esac | |
2854 | fn=de~ | |
2855 | rp='Where will private files be installed?' | |
2856 | . ./getfile | |
2857 | installprivlib="$ans" | |
2858 | else | |
2859 | installprivlib="$privlibexp" | |
2860 | fi | |
2861 | ||
2862 | : determine the architecture name | |
2863 | echo " " | |
2864 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then | |
2865 | tarch=`arch`"-$osname" | |
2866 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
2867 | if uname -m > tmparch 2>&1 ; then | |
2868 | tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch` | |
2869 | else | |
2870 | tarch="$osname" | |
2871 | fi | |
2872 | $rm -f tmparch | |
2873 | else | |
2874 | tarch="$osname" | |
2875 | fi | |
2876 | case "$myarchname" in | |
2877 | ''|"$tarch") ;; | |
2878 | *) | |
2879 | echo "(Your architecture name used to be $myarchname.)" | |
2880 | archname='' | |
2881 | ;; | |
2882 | esac | |
2883 | case "$archname" in | |
2884 | '') dflt="$tarch";; | |
2885 | *) dflt="$archname";; | |
2886 | esac | |
2887 | rp='What is your architecture name' | |
2888 | . ./myread | |
2889 | archname="$ans" | |
2890 | myarchname="$tarch" | |
2891 | ||
2892 | : determine where public architecture dependent libraries go | |
2893 | set archlib archlib | |
2894 | eval $prefixit | |
2895 | case "$archlib" in | |
2896 | '') | |
2897 | case "$privlib" in | |
2898 | '') | |
2899 | dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` | |
2900 | set dflt | |
2901 | eval $prefixup | |
2902 | ;; | |
2903 | *) dflt="$privlib/$archname";; | |
2904 | esac | |
2905 | ;; | |
2906 | *) dflt="$archlib";; | |
2907 | esac | |
2908 | cat <<EOM | |
2909 | ||
2910 | $spackage contains architecture-dependent library files. If you are | |
2911 | sharing libraries in a heterogeneous environment, you might store | |
2912 | these files in a separate location. Otherwise, you can just include | |
2913 | them with the rest of the public library files. | |
2914 | ||
2915 | EOM | |
2916 | fn=d~ | |
2917 | rp='Where do you want to put the public architecture-dependent libraries?' | |
2918 | . ./getfile | |
2919 | archlib="$ans" | |
2920 | archlibexp="$ansexp" | |
2921 | ||
2922 | if $afs; then | |
2923 | $cat <<EOM | |
2924 | ||
2925 | Since you are running AFS, I need to distinguish the directory in which | |
2926 | private files reside from the directory in which they are installed (and from | |
2927 | which they are presumably copied to the former directory by occult means). | |
2928 | ||
2929 | EOM | |
2930 | case "$installarchlib" in | |
2931 | '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2932 | *) dflt="$installarchlib";; | |
2933 | esac | |
2934 | fn=de~ | |
2935 | rp='Where will architecture-dependent library files be installed?' | |
2936 | . ./getfile | |
2937 | installarchlib="$ans" | |
2938 | else | |
2939 | installarchlib="$archlibexp" | |
2940 | fi | |
2941 | if $test X"$archlib" = X"$privlib"; then | |
2942 | d_archlib="$undef" | |
2943 | else | |
2944 | d_archlib="$define" | |
2945 | fi | |
2946 | ||
2947 | : determine whether the user wants to include a site-specific library | |
2948 | : in addition to privlib. | |
2949 | $cat <<EOM | |
2950 | ||
2951 | Some sites may wish to specify a local directory for $package | |
2952 | to search by default in addition to $privlib. | |
2953 | If you don't want to use such an additional directory, answer 'none'. | |
2954 | ||
2955 | EOM | |
2956 | case "$sitelib" in | |
2957 | '') dflt=none ;; | |
2958 | *) dflt="$sitelib" ;; | |
2959 | esac | |
2960 | fn=d~+n | |
2961 | rp='Local directory for additional library files?' | |
2962 | . ./getfile | |
2963 | if $test "X$sitelibexp" != "X$ansexp"; then | |
2964 | installsitelib='' | |
2965 | fi | |
2966 | sitelib="$ans" | |
2967 | sitelibexp="$ansexp" | |
2968 | if $afs; then | |
2969 | case "$sitelib" in | |
2970 | '') installsitelib="$sitelibexp" | |
2971 | ;; | |
2972 | *) $cat <<EOM | |
2973 | ||
2974 | Since you are running AFS, I need to distinguish the directory in which | |
2975 | private files reside from the directory in which they are installed (and from | |
2976 | which they are presumably copied to the former directory by occult means). | |
2977 | ||
2978 | EOM | |
2979 | case "$installsitelib" in | |
2980 | '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;; | |
2981 | *) dflt="$installsitelib";; | |
2982 | esac | |
2983 | fn=de~ | |
2984 | rp='Where will additional local files be installed?' | |
2985 | . ./getfile | |
2986 | installsitelib="$ans" | |
2987 | ;; | |
2988 | esac | |
2989 | else | |
2990 | installsitelib="$sitelibexp" | |
2991 | fi | |
2992 | ||
2993 | case "$sitelibexp" in | |
2994 | '') d_sitelib=undef ;; | |
2995 | *) d_sitelib=define ;; | |
2996 | esac | |
2997 | ||
2998 | : determine where manual pages go | |
2999 | set man1dir man1dir none | |
3000 | eval $prefixit | |
3001 | $cat <<EOM | |
3002 | ||
3003 | $spackage has manual pages available in source form. | |
3004 | EOM | |
3005 | case "$nroff" in | |
3006 | nroff) | |
3007 | echo "However, you don't have nroff, so they're probably useless to you." | |
3008 | case "$man1dir" in | |
3009 | '') man1dir="none";; | |
3010 | esac;; | |
3011 | esac | |
3012 | echo "If you don't want the manual sources installed, answer 'none'." | |
3013 | case "$man1dir" in | |
3014 | '') | |
3015 | lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1" | |
3016 | lookpath="$lookpath $prefixexp/man/l_man/man1" | |
3017 | lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl" | |
3018 | lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1" | |
3019 | lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
3020 | lookpath="$lookpath /usr/man/man.L" | |
3021 | man1dir=`./loc . $prefixexp/man/man1 $lookpath` | |
3022 | if $test -d "$man1dir"; then | |
3023 | dflt="$man1dir" | |
3024 | else | |
3025 | dflt="$sysman" | |
3026 | fi | |
3027 | set dflt | |
3028 | eval $prefixup | |
3029 | ;; | |
3030 | ' ') dflt=none;; | |
3031 | *) dflt="$man1dir" | |
3032 | ;; | |
3033 | esac | |
3034 | echo " " | |
3035 | fn=dn~ | |
3036 | rp="Where do the main $spackage manual pages (source) go?" | |
3037 | . ./getfile | |
3038 | if test "X$man1direxp" != "X$ansexp"; then | |
3039 | installman1dir='' | |
3040 | fi | |
3041 | man1dir="$ans" | |
3042 | man1direxp="$ansexp" | |
3043 | case "$man1dir" in | |
3044 | '') man1dir=' ' | |
3045 | installman1dir='';; | |
3046 | esac | |
3047 | if $afs; then | |
3048 | $cat <<EOM | |
3049 | ||
3050 | Since you are running AFS, I need to distinguish the directory in which | |
3051 | manual pages reside from the directory in which they are installed (and from | |
3052 | which they are presumably copied to the former directory by occult means). | |
3053 | ||
3054 | EOM | |
3055 | case "$installman1dir" in | |
3056 | '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;; | |
3057 | *) dflt="$installman1dir";; | |
3058 | esac | |
3059 | fn=de~ | |
3060 | rp='Where will man pages be installed?' | |
3061 | . ./getfile | |
3062 | installman1dir="$ans" | |
3063 | else | |
3064 | installman1dir="$man1direxp" | |
3065 | fi | |
3066 | ||
3067 | : What suffix to use on installed man pages | |
3068 | ||
3069 | case "$man1dir" in | |
3070 | ' ') | |
3071 | man1ext='0' | |
3072 | ;; | |
3073 | *) | |
3074 | rp="What suffix should be used for the main $spackage man pages?" | |
3075 | case "$man1dir" in | |
3076 | *1) dflt=1 ;; | |
3077 | *1p) dflt=1p ;; | |
3078 | *1pm) dflt=1pm ;; | |
3079 | *l) dflt=l;; | |
3080 | *n) dflt=n;; | |
3081 | *o) dflt=o;; | |
3082 | *p) dflt=p;; | |
3083 | *C) dflt=C;; | |
3084 | *L) dflt=L;; | |
3085 | *L1) dflt=L1;; | |
3086 | *) dflt=1;; | |
3087 | esac | |
3088 | . ./myread | |
3089 | man1ext="$ans" | |
3090 | ;; | |
3091 | esac | |
3092 | ||
3093 | : set up the script used to warn in case of inconsistency | |
3094 | cat <<'EOSC' >whoa | |
3095 | dflt=y | |
3096 | echo " " | |
3097 | echo "*** WHOA THERE!!! ***" >&4 | |
3098 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
3099 | rp=" Keep the $hint value?" | |
3100 | . ./myread | |
3101 | case "$ans" in | |
3102 | y) td=$was; tu=$was;; | |
3103 | esac | |
3104 | EOSC | |
3105 | ||
3106 | : function used to set $1 to $val | |
3107 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
3108 | case "$val$was" in | |
3109 | $define$undef) . ./whoa; eval "$var=\$td";; | |
3110 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
3111 | *) eval "$var=$val";; | |
3112 | esac' | |
3113 | ||
3114 | : see if we can have long filenames | |
3115 | echo " " | |
3116 | rmlist="$rmlist /tmp/cf$$" | |
3117 | $test -d /tmp/cf$$ || mkdir /tmp/cf$$ | |
3118 | first=123456789abcdef | |
3119 | second=/tmp/cf$$/$first | |
3120 | $rm -f $first $second | |
3121 | if (echo hi >$first) 2>/dev/null; then | |
3122 | if $test -f 123456789abcde; then | |
3123 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
3124 | val="$undef" | |
3125 | else | |
3126 | if (echo hi >$second) 2>/dev/null; then | |
3127 | if $test -f /tmp/cf$$/123456789abcde; then | |
3128 | $cat <<'EOM' | |
3129 | That's peculiar... You can have filenames longer than 14 characters, but only | |
3130 | on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems | |
3131 | I shall consider your system cannot support long filenames at all. | |
3132 | EOM | |
3133 | val="$undef" | |
3134 | else | |
3135 | echo 'You can have filenames longer than 14 characters.' >&4 | |
3136 | val="$define" | |
3137 | fi | |
3138 | else | |
3139 | $cat <<'EOM' | |
3140 | How confusing! Some of your filesystems are sane enough to allow filenames | |
3141 | longer than 14 characters but some others like /tmp can't even think about them. | |
3142 | So, for now on, I shall assume your kernel does not allow them at all. | |
3143 | EOM | |
3144 | val="$undef" | |
3145 | fi | |
3146 | fi | |
3147 | else | |
3148 | $cat <<'EOM' | |
3149 | You can't have filenames longer than 14 chars. You can't even think about them! | |
3150 | EOM | |
3151 | val="$undef" | |
3152 | fi | |
3153 | set d_flexfnam | |
3154 | eval $setvar | |
3155 | $rm -rf /tmp/cf$$ 123456789abcde* | |
3156 | ||
3157 | : determine where library module manual pages go | |
3158 | set man3dir man3dir none | |
3159 | eval $prefixit | |
3160 | $cat <<EOM | |
3161 | ||
3162 | $spackage has manual pages for many of the library modules. | |
3163 | EOM | |
3164 | ||
3165 | case "$nroff" in | |
3166 | nroff) | |
3167 | $cat <<'EOM' | |
3168 | However, you don't have nroff, so they're probably useless to you. | |
3169 | You can use the supplied perldoc script instead. | |
3170 | EOM | |
3171 | case "$man3dir" in | |
3172 | '') man3dir="none";; | |
3173 | esac;; | |
3174 | esac | |
3175 | ||
3176 | case "$d_flexfnam" in | |
3177 | undef) | |
3178 | $cat <<'EOM' | |
3179 | However, your system can't handle the long file names like File::Basename.3. | |
3180 | You can use the supplied perldoc script instead. | |
3181 | EOM | |
3182 | case "$man3dir" in | |
3183 | '') man3dir="none";; | |
3184 | esac;; | |
3185 | esac | |
3186 | ||
3187 | echo "If you don't want the manual sources installed, answer 'none'." | |
3188 | case "$man3dir" in | |
3189 | '') dflt="$privlib/man/man3" ;; | |
3190 | ' ') dflt=none;; | |
3191 | *) dflt="$man3dir" ;; | |
3192 | esac | |
3193 | echo " " | |
3194 | ||
3195 | fn=dn~ | |
3196 | rp="Where do the $spackage library man pages (source) go?" | |
3197 | . ./getfile | |
3198 | if test "X$man3direxp" != "X$ansexp"; then | |
3199 | installman3dir='' | |
3200 | fi | |
3201 | ||
3202 | man3dir="$ans" | |
3203 | man3direxp="$ansexp" | |
3204 | case "$man3dir" in | |
3205 | '') man3dir=' ' | |
3206 | installman3dir='';; | |
3207 | esac | |
3208 | if $afs; then | |
3209 | $cat <<EOM | |
3210 | ||
3211 | Since you are running AFS, I need to distinguish the directory in which | |
3212 | manual pages reside from the directory in which they are installed (and from | |
3213 | which they are presumably copied to the former directory by occult means). | |
3214 | ||
3215 | EOM | |
3216 | case "$installman3dir" in | |
3217 | '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;; | |
3218 | *) dflt="$installman3dir";; | |
3219 | esac | |
3220 | fn=de~ | |
3221 | rp='Where will man pages be installed?' | |
3222 | . ./getfile | |
3223 | installman3dir="$ans" | |
3224 | else | |
3225 | installman3dir="$man3direxp" | |
3226 | fi | |
3227 | ||
3228 | : What suffix to use on installed man pages | |
3229 | ||
3230 | case "$man3dir" in | |
3231 | ' ') | |
3232 | man3ext='0' | |
3233 | ;; | |
3234 | *) | |
3235 | rp="What suffix should be used for the $spackage library man pages?" | |
3236 | case "$man3dir" in | |
3237 | *3) dflt=3 ;; | |
3238 | *3p) dflt=3p ;; | |
3239 | *3pm) dflt=3pm ;; | |
3240 | *l) dflt=l;; | |
3241 | *n) dflt=n;; | |
3242 | *o) dflt=o;; | |
3243 | *p) dflt=p;; | |
3244 | *C) dflt=C;; | |
3245 | *L) dflt=L;; | |
3246 | *L3) dflt=L3;; | |
3247 | *) dflt=3;; | |
3248 | esac | |
3249 | . ./myread | |
3250 | man3ext="$ans" | |
3251 | ;; | |
3252 | esac | |
3253 | ||
3254 | : see if we have to deal with yellow pages, now NIS. | |
3255 | if $test -d /usr/etc/yp || $test -d /etc/yp; then | |
3256 | if $test -f /usr/etc/nibindd; then | |
3257 | echo " " | |
3258 | echo "I'm fairly confident you're on a NeXT." | |
3259 | echo " " | |
3260 | rp='Do you get the hosts file via NetInfo?' | |
3261 | dflt=y | |
3262 | case "$hostcat" in | |
3263 | nidump*) ;; | |
3264 | '') ;; | |
3265 | *) dflt=n;; | |
3266 | esac | |
3267 | . ./myread | |
3268 | case "$ans" in | |
3269 | y*) hostcat='nidump hosts .';; | |
3270 | *) case "$hostcat" in | |
3271 | nidump*) hostcat='';; | |
3272 | esac | |
3273 | ;; | |
3274 | esac | |
3275 | fi | |
3276 | case "$hostcat" in | |
3277 | nidump*) ;; | |
3278 | *) | |
3279 | case "$hostcat" in | |
3280 | *ypcat*) dflt=y;; | |
3281 | '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then | |
3282 | dflt=y | |
3283 | else | |
3284 | dflt=n | |
3285 | fi;; | |
3286 | *) dflt=n;; | |
3287 | esac | |
3288 | echo " " | |
3289 | rp='Are you getting the hosts file via yellow pages?' | |
3290 | . ./myread | |
3291 | case "$ans" in | |
3292 | y*) hostcat='ypcat hosts';; | |
3293 | *) hostcat='cat /etc/hosts';; | |
3294 | esac | |
3295 | ;; | |
3296 | esac | |
3297 | fi | |
3298 | ||
3299 | : now get the host name | |
3300 | echo " " | |
3301 | echo "Figuring out host name..." >&4 | |
3302 | case "$myhostname" in | |
3303 | '') cont=true | |
3304 | echo 'Maybe "hostname" will work...' | |
3305 | if tans=`sh -c hostname 2>&1` ; then | |
3306 | myhostname=$tans | |
3307 | phostname=hostname | |
3308 | cont='' | |
3309 | fi | |
3310 | ;; | |
3311 | *) cont='';; | |
3312 | esac | |
3313 | if $test "$cont"; then | |
3314 | if ./xenix; then | |
3315 | echo 'Oh, dear. Maybe "/etc/systemid" is the key...' | |
3316 | if tans=`cat /etc/systemid 2>&1` ; then | |
3317 | myhostname=$tans | |
3318 | phostname='cat /etc/systemid' | |
3319 | echo "Whadyaknow. Xenix always was a bit strange..." | |
3320 | cont='' | |
3321 | fi | |
3322 | elif $test -r /etc/systemid; then | |
3323 | echo "(What is a non-Xenix system doing with /etc/systemid?)" | |
3324 | fi | |
3325 | fi | |
3326 | if $test "$cont"; then | |
3327 | echo 'No, maybe "uuname -l" will work...' | |
3328 | if tans=`sh -c 'uuname -l' 2>&1` ; then | |
3329 | myhostname=$tans | |
3330 | phostname='uuname -l' | |
3331 | else | |
3332 | echo 'Strange. Maybe "uname -n" will work...' | |
3333 | if tans=`sh -c 'uname -n' 2>&1` ; then | |
3334 | myhostname=$tans | |
3335 | phostname='uname -n' | |
3336 | else | |
3337 | echo 'Oh well, maybe I can mine it out of whoami.h...' | |
3338 | if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then | |
3339 | myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'` | |
3340 | phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h" | |
3341 | else | |
3342 | case "$myhostname" in | |
3343 | '') echo "Does this machine have an identity crisis or something?" | |
3344 | phostname='';; | |
3345 | *) | |
3346 | echo "Well, you said $myhostname before..." | |
3347 | phostname='echo $myhostname';; | |
3348 | esac | |
3349 | fi | |
3350 | fi | |
3351 | fi | |
3352 | fi | |
3353 | : you do not want to know about this | |
3354 | set $myhostname | |
3355 | myhostname=$1 | |
3356 | ||
3357 | : verify guess | |
3358 | if $test "$myhostname" ; then | |
3359 | dflt=y | |
3360 | rp='Your host name appears to be "'$myhostname'".'" Right?" | |
3361 | . ./myread | |
3362 | case "$ans" in | |
3363 | y*) ;; | |
3364 | *) myhostname='';; | |
3365 | esac | |
3366 | fi | |
3367 | ||
3368 | : bad guess or no guess | |
3369 | while $test "X$myhostname" = X ; do | |
3370 | dflt='' | |
3371 | rp="Please type the (one word) name of your host:" | |
3372 | . ./myread | |
3373 | myhostname="$ans" | |
3374 | done | |
3375 | ||
3376 | : translate upper to lower if necessary | |
3377 | case "$myhostname" in | |
3378 | *[A-Z]*) | |
3379 | echo "(Normalizing case in your host name)" | |
3380 | myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'` | |
3381 | ;; | |
3382 | esac | |
3383 | ||
3384 | case "$myhostname" in | |
3385 | *.*) | |
3386 | dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"` | |
3387 | myhostname=`expr "X$myhostname" : "X\([^.]*\)\."` | |
3388 | echo "(Trimming domain name from host name--host name is now $myhostname)" | |
3389 | ;; | |
3390 | *) case "$mydomain" in | |
3391 | '') | |
3392 | $hostcat >hosts | |
3393 | dflt=.`$awk "/[0-9].*$myhostname/ {for(i=2; i<=NF;i++) print \\\$i}" \ | |
3394 | hosts | $sort | $uniq | \ | |
3395 | $sed -n -e "s/$myhostname\.\([a-zA-Z_.]\)/\1/p"` | |
3396 | case "$dflt" in | |
3397 | .) echo "(You do not have fully-qualified names in /etc/hosts)" | |
3398 | tans=`./loc resolv.conf X /etc /usr/etc` | |
3399 | if $test -f "$tans"; then | |
3400 | echo "(Attempting domain name extraction from $tans)" | |
3401 | dflt=.`egrep '^domain' $tans | $sed 's/domain[ ]*\(.*\)/\1/' \ | |
3402 | | ./tr '[A-Z]' '[a-z]' 2>/dev/null` | |
3403 | fi | |
3404 | ;; | |
3405 | esac | |
3406 | case "$dflt" in | |
3407 | .) echo "(No help from resolv.conf either -- attempting clever guess)" | |
3408 | dflt=.`sh -c domainname 2>/dev/null` | |
3409 | case "$dflt" in | |
3410 | '') dflt='.';; | |
3411 | .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;; | |
3412 | esac | |
3413 | ;; | |
3414 | esac | |
3415 | case "$dflt" in | |
3416 | .) echo "(Lost all hope -- silly guess then)" | |
3417 | dflt='.uucp' | |
3418 | ;; | |
3419 | esac | |
3420 | $rm -f hosts | |
3421 | ;; | |
3422 | *) dflt="$mydomain";; | |
3423 | esac;; | |
3424 | esac | |
3425 | echo " " | |
3426 | rp="What is your domain name?" | |
3427 | . ./myread | |
3428 | tans="$ans" | |
3429 | case "$ans" in | |
3430 | '') ;; | |
3431 | .*) ;; | |
3432 | *) tans=".$tans";; | |
3433 | esac | |
3434 | mydomain="$tans" | |
3435 | ||
3436 | : translate upper to lower if necessary | |
3437 | case "$mydomain" in | |
3438 | *[A-Z]*) | |
3439 | echo "(Normalizing case in your domain name)" | |
3440 | mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'` | |
3441 | ;; | |
3442 | esac | |
3443 | ||
3444 | : a little sanity check here | |
3445 | case "$phostname" in | |
3446 | '') ;; | |
3447 | *) | |
3448 | case `$phostname | ./tr '[A-Z]' '[a-z]'` in | |
3449 | $myhostname$mydomain|$myhostname) ;; | |
3450 | *) | |
3451 | case "$phostname" in | |
3452 | sed*) | |
3453 | echo "(That doesn't agree with your whoami.h file, by the way.)" | |
3454 | ;; | |
3455 | *) | |
3456 | echo "(That doesn't agree with your $phostname command, by the way.)" | |
3457 | ;; | |
3458 | esac | |
3459 | ;; | |
3460 | esac | |
3461 | ;; | |
3462 | esac | |
3463 | ||
3464 | $cat <<EOM | |
3465 | ||
3466 | I need to get your e-mail address in Internet format if possible, i.e. | |
3467 | something like user@host.domain. Please answer accurately since I have | |
3468 | no easy means to double check it. The default value provided below | |
3469 | is most probably close to the reality but may not be valid from outside | |
3470 | your organization... | |
3471 | ||
3472 | EOM | |
3473 | cont=x | |
3474 | while test "$cont"; do | |
3475 | case "$cf_email" in | |
3476 | '') dflt="$cf_by@$myhostname$mydomain";; | |
3477 | *) dflt="$cf_email";; | |
3478 | esac | |
3479 | rp='What is your e-mail address?' | |
3480 | . ./myread | |
3481 | cf_email="$ans" | |
3482 | case "$cf_email" in | |
3483 | *@*.*) cont='' ;; | |
3484 | *) | |
3485 | rp='Address does not look like an Internet one. Use it anyway?' | |
3486 | case "$fastread" in | |
3487 | yes) dflt=y ;; | |
3488 | *) dflt=n ;; | |
3489 | esac | |
3490 | . ./myread | |
3491 | case "$ans" in | |
3492 | y*) cont='' ;; | |
3493 | *) echo " " ;; | |
3494 | esac | |
3495 | ;; | |
3496 | esac | |
3497 | done | |
3498 | ||
3499 | $cat <<EOM | |
3500 | ||
3501 | If you or somebody else will be maintaining perl at your site, please | |
3502 | fill in the correct e-mail address here so that they may be contacted | |
3503 | if necessary. Currently, the "perlbug" program included with perl | |
3504 | will send mail to this address in addition to perlbug@perl.com. You may | |
3505 | enter "none" for no administrator. | |
3506 | ||
3507 | EOM | |
3508 | case "$perladmin" in | |
3509 | '') dflt="$cf_email";; | |
3510 | *) dflt="$perladmin";; | |
3511 | esac | |
3512 | rp='Perl administrator e-mail address' | |
3513 | . ./myread | |
3514 | perladmin="$ans" | |
3515 | ||
3516 | ||
3517 | : determine optimize, if desired, or use for debug flag also | |
3518 | case "$optimize" in | |
3519 | ' ') dflt='none';; | |
3520 | '') dflt='-O';; | |
3521 | *) dflt="$optimize";; | |
3522 | esac | |
3523 | $cat <<EOH | |
3524 | ||
3525 | Some C compilers have problems with their optimizers, by default, $package | |
3526 | compiles with the -O flag to use the optimizer. Alternately, you might want | |
3527 | to use the symbolic debugger, which uses the -g flag (on traditional Unix | |
3528 | systems). Either flag can be specified here. To use neither flag, specify | |
3529 | the word "none". | |
3530 | ||
3531 | EOH | |
3532 | rp="What optimizer/debugger flag should be used?" | |
3533 | . ./myread | |
3534 | optimize="$ans" | |
3535 | case "$optimize" in | |
3536 | 'none') optimize=" ";; | |
3537 | esac | |
3538 | ||
3539 | dflt='' | |
3540 | case "$ccflags" in | |
3541 | '') | |
3542 | case "$gccversion" in | |
3543 | 1*) dflt='-fpcc-struct-return' ;; | |
3544 | esac | |
3545 | case "$optimize" in | |
3546 | *-g*) dflt="$dflt -DDEBUGGING";; | |
3547 | esac | |
3548 | case "$gccversion" in | |
3549 | 2*) if test -d /etc/conf/kconfig.d && | |
3550 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
3551 | then | |
3552 | dflt="$dflt -posix" | |
3553 | fi | |
3554 | ;; | |
3555 | esac | |
3556 | ;; | |
3557 | esac | |
3558 | ||
3559 | case "$mips_type" in | |
3560 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
3561 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
3562 | esac | |
3563 | for thisincl in $inclwanted; do | |
3564 | if $test -d $thisincl; then | |
3565 | if $test x$thisincl != x$usrinc; then | |
3566 | case "$dflt" in | |
3567 | *$thisincl*);; | |
3568 | *) dflt="$dflt -I$thisincl";; | |
3569 | esac | |
3570 | fi | |
3571 | fi | |
3572 | done | |
3573 | ||
3574 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then | |
3575 | xxx=true; | |
3576 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
3577 | xxx=true; | |
3578 | else | |
3579 | xxx=false; | |
3580 | fi; | |
3581 | if $xxx; then | |
3582 | case "$dflt" in | |
3583 | *$2*);; | |
3584 | *) dflt="$dflt -D$2";; | |
3585 | esac; | |
3586 | fi' | |
3587 | ||
3588 | if ./osf1; then | |
3589 | set signal.h __LANGUAGE_C__; eval $inctest | |
3590 | else | |
3591 | set signal.h LANGUAGE_C; eval $inctest | |
3592 | fi | |
3593 | set signal.h NO_PROTOTYPE; eval $inctest | |
3594 | set signal.h _NO_PROTO; eval $inctest | |
3595 | ||
3596 | case "$dflt" in | |
3597 | '') dflt=none;; | |
3598 | esac | |
3599 | case "$ccflags" in | |
3600 | '') ;; | |
3601 | *) dflt="$ccflags";; | |
3602 | esac | |
3603 | $cat <<EOH | |
3604 | ||
3605 | Your C compiler may want other flags. For this question you should include | |
3606 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
3607 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
3608 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
3609 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE, | |
3610 | -DHIDEMYMALLOC or -DCRIPPLED_CC. | |
3611 | ||
3612 | To use no flags, specify the word "none". | |
3613 | ||
3614 | EOH | |
3615 | set X $dflt | |
3616 | shift | |
3617 | dflt=${1+"$@"} | |
3618 | rp="Any additional cc flags?" | |
3619 | . ./myread | |
3620 | case "$ans" in | |
3621 | none) ccflags='';; | |
3622 | *) ccflags="$ans";; | |
3623 | esac | |
2304df62 AD |
3624 | |
3625 | : the following weeds options from ccflags that are of no interest to cpp | |
3626 | cppflags="$ccflags" | |
a0d0e21e LW |
3627 | case "$gccversion" in |
3628 | 1*) cppflags="$cppflags -D__GNUC__" | |
2304df62 AD |
3629 | esac |
3630 | case "$mips_type" in | |
3631 | '');; | |
3632 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
3633 | esac | |
3634 | case "$cppflags" in | |
3635 | '');; | |
a0d0e21e LW |
3636 | *) |
3637 | echo " " | |
3638 | echo "Let me guess what the preprocessor flags are..." >&4 | |
3639 | set X $cppflags | |
3640 | shift | |
2304df62 | 3641 | cppflags='' |
a0d0e21e LW |
3642 | $cat >cpp.c <<'EOM' |
3643 | #define BLURFL foo | |
3644 | ||
3645 | BLURFL xx LFRULB | |
3646 | EOM | |
3647 | previous='' | |
3648 | for flag in $* | |
2304df62 | 3649 | do |
a0d0e21e LW |
3650 | case "$flag" in |
3651 | -*) ftry="$flag";; | |
3652 | *) ftry="$previous $flag";; | |
2304df62 | 3653 | esac |
a0d0e21e LW |
3654 | if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \ |
3655 | >cpp1.out 2>/dev/null && \ | |
3656 | $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \ | |
3657 | >cpp2.out 2>/dev/null && \ | |
3658 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
3659 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
3660 | then | |
3661 | cppflags="$cppflags $ftry" | |
3662 | previous='' | |
3663 | else | |
3664 | previous="$flag" | |
3665 | fi | |
2304df62 | 3666 | done |
a0d0e21e LW |
3667 | set X $cppflags |
3668 | shift | |
3669 | cppflags=${1+"$@"} | |
2304df62 | 3670 | case "$cppflags" in |
a0d0e21e | 3671 | *-*) echo "They appear to be: $cppflags";; |
2304df62 | 3672 | esac |
a0d0e21e | 3673 | $rm -f cpp.c cpp?.out |
2304df62 AD |
3674 | ;; |
3675 | esac | |
3676 | ||
3677 | : flags used in final linking phase | |
8e07c86e | 3678 | |
2304df62 | 3679 | case "$ldflags" in |
ecfc5424 | 3680 | '') if ./venix; then |
2304df62 AD |
3681 | dflt='-i -z' |
3682 | else | |
a0d0e21e | 3683 | dflt='' |
2304df62 | 3684 | fi |
a0d0e21e LW |
3685 | case "$ccflags" in |
3686 | *-posix*) dflt="$dflt -posix" ;; | |
3687 | esac | |
2304df62 AD |
3688 | ;; |
3689 | *) dflt="$ldflags";; | |
3690 | esac | |
8e07c86e AD |
3691 | |
3692 | : Try to guess additional flags to pick up local libraries. | |
3693 | for thislibdir in $libpth; do | |
3694 | case " $loclibpth " in | |
3695 | *" $thislibdir "*) | |
3696 | case "$dflt " in | |
3697 | "-L$thislibdir ") ;; | |
3698 | *) dflt="$dflt -L$thislibdir" ;; | |
3699 | esac | |
3700 | ;; | |
3701 | esac | |
3702 | done | |
3703 | ||
3704 | case "$dflt" in | |
3705 | '') dflt='none' ;; | |
3706 | esac | |
3707 | ||
3708 | $cat <<EOH | |
3709 | ||
3710 | Your C linker may need flags. For this question you should | |
3711 | include -L/whatever and any other flags used by the C linker, but you | |
3712 | should NOT include libraries like -lwhatever. | |
3713 | ||
3714 | Make sure you include the appropriate -L/path flags if your C linker | |
3715 | does not normally search all of the directories you specified above, | |
3716 | namely | |
3717 | $libpth | |
3718 | To use no flags, specify the word "none". | |
3719 | ||
3720 | EOH | |
3721 | ||
2304df62 AD |
3722 | rp="Any additional ld flags (NOT including libraries)?" |
3723 | . ./myread | |
3724 | case "$ans" in | |
3725 | none) ldflags='';; | |
3726 | *) ldflags="$ans";; | |
3727 | esac | |
3728 | rmlist="$rmlist pdp11" | |
3729 | ||
16d20bd9 AD |
3730 | : coherency check |
3731 | echo " " | |
3732 | echo "Checking your choice of C compiler and flags for coherency..." >&4 | |
8e07c86e | 3733 | set X $cc $optimize $ccflags $ldflags try.c -o try |
16d20bd9 AD |
3734 | shift |
3735 | $cat >try.msg <<EOM | |
3736 | I've tried to compile and run a simple program with: | |
3737 | ||
3738 | $* | |
3739 | ./try | |
3740 | ||
3741 | and I got the following output: | |
3742 | ||
3743 | EOM | |
3744 | $cat > try.c <<'EOF' | |
3745 | #include <stdio.h> | |
3746 | main() { exit(0); } | |
3747 | EOF | |
3748 | dflt=y | |
3749 | if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then | |
3750 | if sh -c './try' >>try.msg 2>&1; then | |
3751 | dflt=n | |
3752 | else | |
3753 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
3754 | rp="You have a problem. Shall I abort Configure" | |
3755 | dflt=y | |
3756 | fi | |
3757 | else | |
3758 | echo "I can't compile the test program." >>try.msg | |
3759 | rp="You have a BIG problem. Shall I abort Configure" | |
3760 | dflt=y | |
3761 | fi | |
3762 | case "$dflt" in | |
3763 | y) | |
3764 | $cat try.msg | |
3765 | case "$knowitall" in | |
3766 | '') | |
3767 | echo "(The supplied flags might be incorrect with this C compiler.)" | |
3768 | ;; | |
3769 | *) dflt=n;; | |
3770 | esac | |
3771 | echo " " | |
3772 | . ./myread | |
3773 | case "$ans" in | |
3774 | n*|N*) ;; | |
3775 | *) echo "Ok. Stopping Configure." >&4 | |
3776 | exit 1 | |
3777 | ;; | |
3778 | esac | |
3779 | ;; | |
3780 | n) echo "OK, that should do.";; | |
3781 | esac | |
3782 | $rm -f try try.* core | |
3783 | ||
a0d0e21e LW |
3784 | : compute shared library extension |
3785 | case "$so" in | |
3786 | '') | |
3787 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
3788 | dflt='sl' | |
3789 | else | |
3790 | dflt='so' | |
3791 | fi | |
3792 | ;; | |
3793 | *) dflt="$so";; | |
3794 | esac | |
ecfc5424 | 3795 | $cat <<EOM |
a0d0e21e LW |
3796 | |
3797 | On some systems, shared libraries may be available. Answer 'none' if | |
ecfc5424 AD |
3798 | you want to suppress searching of shared libraries for the remaining |
3799 | of this configuration. | |
3800 | ||
a0d0e21e LW |
3801 | EOM |
3802 | rp='What is the file extension used for shared libraries?' | |
3803 | . ./myread | |
3804 | so="$ans" | |
3805 | ||
2304df62 AD |
3806 | : Looking for optional libraries |
3807 | echo " " | |
3808 | echo "Checking for optional libraries..." >&4 | |
3809 | case "$libs" in | |
3810 | ' '|'') dflt='';; | |
3811 | *) dflt="$libs";; | |
3812 | esac | |
3813 | case "$libswanted" in | |
3814 | '') libswanted='c_s';; | |
3815 | esac | |
3816 | for thislib in $libswanted; do | |
a0d0e21e LW |
3817 | |
3818 | if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then | |
3819 | echo "Found -l$thislib (shared)." | |
3820 | case " $dflt " in | |
3821 | *"-l$thislib "*);; | |
3822 | *) dflt="$dflt -l$thislib";; | |
3823 | esac | |
3824 | elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then | |
3825 | echo "Found -l$thislib (shared)." | |
3826 | case " $dflt " in | |
3827 | *"-l$thislib "*);; | |
3828 | *) dflt="$dflt -l$thislib";; | |
3829 | esac | |
3830 | elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then | |
2304df62 | 3831 | echo "Found -l$thislib." |
a0d0e21e LW |
3832 | case " $dflt " in |
3833 | *"-l$thislib "*);; | |
2304df62 AD |
3834 | *) dflt="$dflt -l$thislib";; |
3835 | esac | |
8e07c86e AD |
3836 | elif xxx=`./loc $thislib.a X $libpth`; $test -f "$xxx"; then |
3837 | echo "Found -l$thislib." | |
3838 | case " $dflt " in | |
3839 | *"-l$thislib "*);; | |
3840 | *) dflt="$dflt -l$thislib";; | |
3841 | esac | |
a0d0e21e LW |
3842 | elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then |
3843 | echo "Found -l${thislib}_s." | |
3844 | case " $dflt " in | |
3845 | *"-l$thislib "*);; | |
3846 | *) dflt="$dflt -l${thislib}_s";; | |
2304df62 | 3847 | esac |
a0d0e21e LW |
3848 | elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then |
3849 | echo "Found -l$thislib." | |
3850 | case " $dflt " in | |
3851 | *"-l$thislib "*);; | |
2304df62 AD |
3852 | *) dflt="$dflt -l$thislib";; |
3853 | esac | |
3854 | else | |
a0d0e21e | 3855 | echo "No -l$thislib." |
2304df62 AD |
3856 | fi |
3857 | done | |
3858 | set X $dflt | |
3859 | shift | |
3860 | dflt="$*" | |
3861 | case "$libs" in | |
3862 | '') dflt="$dflt";; | |
3863 | *) dflt="$libs";; | |
3864 | esac | |
3865 | case "$dflt" in | |
3866 | ' '|'') dflt='none';; | |
3867 | esac | |
3868 | ||
3869 | $cat <<EOM | |
3870 | ||
3871 | Some versions of Unix support shared libraries, which make executables smaller | |
3872 | but make load time slightly longer. | |
3873 | ||
3874 | On some systems, mostly newer Unix System V's, the shared library is included | |
3875 | by putting the option "-lc_s" as the last thing on the cc command line when | |
3876 | linking. Other systems use shared libraries by default. There may be other | |
3877 | libraries needed to compile $package on your machine as well. If your system | |
3878 | needs the "-lc_s" option, include it here. Include any other special libraries | |
3879 | here as well. Say "none" for none. | |
3880 | EOM | |
3881 | ||
3882 | echo " " | |
3883 | rp="Any additional libraries?" | |
3884 | . ./myread | |
3885 | case "$ans" in | |
3886 | none) libs=' ';; | |
3887 | *) libs="$ans";; | |
3888 | esac | |
3889 | ||
3890 | : see if nm is to be used to determine whether a symbol is defined or not | |
3891 | case "$usenm" in | |
3892 | '') | |
3893 | dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` | |
3894 | if $test $dflt -gt 20; then | |
3895 | dflt=y | |
3896 | else | |
3897 | dflt=n | |
3898 | fi | |
3899 | ;; | |
3900 | *) | |
3901 | case "$usenm" in | |
3902 | true) dflt=y;; | |
3903 | *) dflt=n;; | |
3904 | esac | |
3905 | ;; | |
3906 | esac | |
3907 | $cat <<EOM | |
3908 | ||
3909 | I can use 'nm' to extract the symbols from your C libraries. This is a time | |
3910 | consuming task which may generate huge output on the disk (up to 3 megabytes) | |
3911 | but that should make the symbols extraction faster. The alternative is to skip | |
3912 | the 'nm' extraction part and to compile a small test program instead to | |
3913 | determine whether each symbol is present. If you have a fast C compiler and/or | |
3914 | if your 'nm' output cannot be parsed, this may be the best solution. | |
3915 | ||
3916 | EOM | |
3917 | rp='Shall I use nm to extract C symbols from the libraries?' | |
3918 | . ./myread | |
3919 | case "$ans" in | |
3920 | n|N) usenm=false;; | |
3921 | *) usenm=true;; | |
3922 | esac | |
3923 | ||
3924 | runnm=$usenm | |
3925 | case "$reuseval" in | |
3926 | true) runnm=false;; | |
3927 | esac | |
3928 | ||
3929 | : nm options which may be necessary | |
3930 | case "$nm_opt" in | |
3931 | '') if $test -f /mach_boot; then | |
3932 | nm_opt='' | |
3933 | elif $test -d /usr/ccs/lib; then | |
3934 | nm_opt='-p' | |
3935 | elif $test -f /dgux; then | |
3936 | nm_opt='-p' | |
3937 | else | |
3938 | nm_opt='' | |
3939 | fi;; | |
3940 | esac | |
3941 | ||
3942 | case "$runnm" in | |
3943 | true) | |
3944 | : get list of predefined functions in a handy place | |
3945 | echo " " | |
3946 | case "$libc" in | |
3947 | '') libc=unknown | |
3948 | case "$libs" in | |
3949 | *-lc_s*) libc=`./loc libc_s.a $libc $libpth` | |
3950 | esac | |
3951 | ;; | |
3952 | esac | |
2304df62 AD |
3953 | libnames=''; |
3954 | case "$libs" in | |
3955 | '') ;; | |
3956 | *) for thislib in $libs; do | |
3957 | case "$thislib" in | |
a0d0e21e LW |
3958 | -lc|-lc_s) |
3959 | : Handle C library specially below. | |
3960 | ;; | |
2304df62 | 3961 | -l*) |
ecfc5424 | 3962 | thislib=`echo $thislib | $sed -e 's/^-l//'` |
a0d0e21e LW |
3963 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then |
3964 | : | |
3965 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then | |
3966 | : | |
3967 | elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then | |
3968 | : | |
3969 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then | |
3970 | : | |
3971 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then | |
3972 | : | |
3973 | elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then | |
3974 | : | |
3975 | else | |
3976 | try='' | |
2304df62 AD |
3977 | fi |
3978 | libnames="$libnames $try" | |
3979 | ;; | |
3980 | *) libnames="$libnames $thislib" ;; | |
3981 | esac | |
3982 | done | |
3983 | ;; | |
3984 | esac | |
3985 | xxx=normal | |
3986 | case "$libc" in | |
3987 | unknown) | |
a0d0e21e LW |
3988 | set /usr/ccs/lib/libc.$so |
3989 | $test -r $1 || set /usr/lib/libc.$so | |
3990 | $test -r $1 || set /usr/shlib/libc.$so | |
16d20bd9 AD |
3991 | $test -r $1 || \ |
3992 | set `echo blurfl; echo /usr/lib/libc.$so.[0-9]* | \ | |
3993 | tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e ' | |
3994 | h | |
3995 | s/[0-9][0-9]*/0000&/g | |
3996 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g | |
3997 | G | |
3998 | s/\n/ /' | \ | |
3999 | sort | $sed -e 's/^.* //'` | |
4000 | eval set \$$# | |
a0d0e21e | 4001 | $test -r $1 || set /lib/libc.$so |
2304df62 | 4002 | $test -r $1 || set /lib/libsys_s.a |
2304df62 AD |
4003 | ;; |
4004 | *) | |
4005 | set blurfl | |
4006 | ;; | |
4007 | esac | |
4008 | if $test -r "$1"; then | |
4009 | echo "Your (shared) C library seems to be in $1." | |
4010 | libc="$1" | |
4011 | elif $test -r /lib/libc && $test -r /lib/clib; then | |
4012 | echo "Your C library seems to be in both /lib/clib and /lib/libc." | |
4013 | xxx=apollo | |
4014 | libc='/lib/clib /lib/libc' | |
4015 | if $test -r /lib/syslib; then | |
4016 | echo "(Your math library is in /lib/syslib.)" | |
4017 | libc="$libc /lib/syslib" | |
4018 | fi | |
4019 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
4020 | echo "Your C library seems to be in $libc, as you said before." | |
4021 | elif $test -r $incpath/usr/lib/libc.a; then | |
4022 | libc=$incpath/usr/lib/libc.a; | |
4023 | echo "Your C library seems to be in $libc. That's fine." | |
4024 | elif $test -r /lib/libc.a; then | |
4025 | libc=/lib/libc.a; | |
4026 | echo "Your C library seems to be in $libc. You're normal." | |
4027 | else | |
4028 | if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then | |
4029 | : | |
4030 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then | |
4031 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` | |
4032 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then | |
4033 | : | |
4034 | elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then | |
4035 | : | |
4036 | elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then | |
4037 | : | |
4038 | else | |
4039 | tans=`./loc Llibc.a blurfl/dyick $xlibpth` | |
4040 | fi | |
4041 | if $test -r "$tans"; then | |
4042 | echo "Your C library seems to be in $tans, of all places." | |
4043 | libc=$tans | |
4044 | else | |
4045 | libc='blurfl' | |
4046 | fi | |
4047 | fi | |
4048 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
4049 | dflt="$libc" | |
4050 | cat <<EOM | |
4051 | ||
4052 | If the guess above is wrong (which it might be if you're using a strange | |
4053 | compiler, or your machine supports multiple models), you can override it here. | |
4054 | ||
4055 | EOM | |
4056 | else | |
4057 | dflt='' | |
4058 | echo $libpth | tr ' ' '\012' | sort | uniq > libpath | |
4059 | cat >&4 <<EOM | |
4060 | I can't seem to find your C library. I've looked in the following places: | |
4061 | ||
4062 | EOM | |
4063 | $sed 's/^/ /' libpath | |
4064 | cat <<EOM | |
4065 | ||
4066 | None of these seems to contain your C library. I need to get its name... | |
4067 | ||
4068 | EOM | |
4069 | fi | |
4070 | fn=f | |
4071 | rp='Where is your C library?' | |
4072 | . ./getfile | |
4073 | libc="$ans" | |
4074 | ||
4075 | echo " " | |
4076 | echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames | |
4077 | set X `cat libnames` | |
4078 | shift | |
4079 | xxx=files | |
4080 | case $# in 1) xxx=file; esac | |
4081 | echo "Extracting names from the following $xxx for later perusal:" >&4 | |
4082 | echo " " | |
4083 | $sed 's/^/ /' libnames >&4 | |
4084 | echo " " | |
4085 | $echo $n "This may take a while...$c" >&4 | |
ecfc5424 | 4086 | |
2304df62 AD |
4087 | nm $nm_opt $* 2>/dev/null >libc.tmp |
4088 | $echo $n ".$c" | |
4089 | $grep fprintf libc.tmp > libc.ptf | |
4090 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' | |
4091 | xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4' | |
16d20bd9 AD |
4092 | xxx='[ADTSIW]' |
4093 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\ | |
2304df62 AD |
4094 | eval $xscan;\ |
4095 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4096 | eval $xrun | |
4097 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ | |
4098 | eval $xscan;\ | |
4099 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4100 | eval $xrun | |
4101 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ | |
4102 | eval $xscan;\ | |
4103 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4104 | eval $xrun | |
4105 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ | |
4106 | eval $xscan;\ | |
4107 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4108 | eval $xrun | |
4109 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ | |
4110 | eval $xscan;\ | |
4111 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4112 | eval $xrun | |
4113 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ | |
4114 | eval $xscan;\ | |
4115 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4116 | eval $xrun | |
4117 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ | |
4118 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ | |
4119 | eval $xscan;\ | |
4120 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4121 | eval $xrun | |
4122 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ | |
4123 | eval $xscan;\ | |
4124 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4125 | eval $xrun | |
4126 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ | |
4127 | eval $xscan;\ | |
4128 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4129 | eval $xrun | |
a0d0e21e LW |
4130 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
4131 | eval $xscan;\ | |
4132 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4133 | eval $xrun | |
8e07c86e AD |
4134 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ |
4135 | eval $xscan;\ | |
4136 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4137 | eval $xrun | |
2304df62 AD |
4138 | else |
4139 | nm -p $* 2>/dev/null >libc.tmp | |
16d20bd9 AD |
4140 | $grep fprintf libc.tmp > libc.ptf |
4141 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ | |
4142 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 | |
4143 | then | |
2304df62 | 4144 | nm_opt='-p' |
16d20bd9 | 4145 | eval $xrun |
2304df62 AD |
4146 | else |
4147 | echo " " | |
4148 | echo "nm didn't seem to work right. Trying ar instead..." >&4 | |
4149 | com='' | |
4150 | if ar t $libc > libc.tmp; then | |
4151 | for thisname in $libnames; do | |
4152 | ar t $thisname >>libc.tmp | |
4153 | done | |
4154 | $sed -e 's/\.o$//' < libc.tmp > libc.list | |
4155 | echo "Ok." >&4 | |
4156 | else | |
4157 | echo "ar didn't seem to work right." >&4 | |
4158 | echo "Maybe this is a Cray...trying bld instead..." >&4 | |
16d20bd9 AD |
4159 | if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list |
4160 | then | |
2304df62 AD |
4161 | for thisname in $libnames; do |
4162 | bld t $libnames | \ | |
4163 | $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list | |
4164 | ar t $thisname >>libc.tmp | |
4165 | done | |
4166 | echo "Ok." >&4 | |
4167 | else | |
4168 | echo "That didn't work either. Giving up." >&4 | |
4169 | exit 1 | |
4170 | fi | |
4171 | fi | |
4172 | fi | |
4173 | fi | |
4174 | nm_extract="$com" | |
4175 | if $test -f /lib/syscalls.exp; then | |
4176 | echo " " | |
4177 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 | |
4178 | $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list | |
4179 | fi | |
4180 | ;; | |
4181 | esac | |
4182 | $rm -f libnames libpath | |
4183 | ||
4184 | : is a C symbol defined? | |
4185 | csym='tlook=$1; | |
4186 | case "$3" in | |
4187 | -v) tf=libc.tmp; tc=""; tdc="";; | |
8e07c86e | 4188 | -a) tf=libc.tmp; tc="[0]"; tdc="[]";; |
2304df62 AD |
4189 | *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; |
4190 | esac; | |
4191 | tx=yes; | |
4192 | case "$reuseval-$4" in | |
4193 | true-) ;; | |
4194 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; | |
4195 | esac; | |
4196 | case "$tx" in | |
4197 | yes) | |
4198 | case "$runnm" in | |
4199 | true) | |
4200 | if $contains $tlook $tf >/dev/null 2>&1; | |
4201 | then tval=true; | |
4202 | else tval=false; | |
4203 | fi;; | |
4204 | *) | |
16d20bd9 | 4205 | echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; |
8e07c86e | 4206 | if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; |
2304df62 AD |
4207 | then tval=true; |
4208 | else tval=false; | |
4209 | fi; | |
4210 | $rm -f t t.c;; | |
4211 | esac;; | |
4212 | *) | |
8e07c86e AD |
4213 | case "$tval" in |
4214 | $define) tval=true;; | |
4215 | *) tval=false;; | |
4216 | esac;; | |
4217 | esac; | |
4218 | eval "$2=$tval"' | |
2304df62 AD |
4219 | |
4220 | : define an is-in-libc? function | |
4221 | inlibc='echo " "; td=$define; tu=$undef; | |
4222 | sym=$1; var=$2; eval "was=\$$2"; | |
4223 | tx=yes; | |
4224 | case "$reuseval$was" in | |
4225 | true) ;; | |
4226 | true*) tx=no;; | |
4227 | esac; | |
4228 | case "$tx" in | |
4229 | yes) | |
4230 | set $sym tres -f; | |
4231 | eval $csym; | |
4232 | case "$tres" in | |
4233 | true) | |
4234 | echo "$sym() found." >&4; | |
ecfc5424 | 4235 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; |
2304df62 AD |
4236 | *) |
4237 | echo "$sym() NOT found." >&4; | |
ecfc5424 | 4238 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; |
2304df62 AD |
4239 | esac;; |
4240 | *) | |
4241 | case "$was" in | |
4242 | $define) echo "$sym() found." >&4;; | |
4243 | *) echo "$sym() NOT found." >&4;; | |
4244 | esac;; | |
4245 | esac' | |
4246 | ||
8e07c86e AD |
4247 | : Check how to convert floats to strings. |
4248 | echo " " | |
4249 | echo "Checking for an efficient way to convert floats to strings." | |
4250 | $cat >try.c <<'EOP' | |
4251 | #ifdef TRY_gconvert | |
4252 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) | |
4253 | #endif | |
4254 | #ifdef TRY_gcvt | |
4255 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) | |
4256 | #endif | |
4257 | #ifdef TRY_sprintf | |
4258 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) | |
4259 | #endif | |
a0d0e21e | 4260 | main() { |
ecfc5424 | 4261 | char buf[64]; |
8e07c86e | 4262 | Gconvert(1.0, 8, 0, buf); |
ecfc5424 AD |
4263 | if (buf[0] != '1' || buf[1] != '\0') |
4264 | exit(1); | |
8e07c86e | 4265 | Gconvert(0.0, 8, 0, buf); |
ecfc5424 AD |
4266 | if (buf[0] != '0' || buf[1] != '\0') |
4267 | exit(1); | |
8e07c86e | 4268 | Gconvert(-1.0, 8, 0, buf); |
ecfc5424 AD |
4269 | if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0') |
4270 |