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