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