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