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