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 | # |
37120919 | 23 | # Generated on Fri Dec 8 11:19:33 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 | |
85e6fe83 | 1346 | touch |
2304df62 AD |
1347 | tr |
1348 | uniq | |
1349 | " | |
1350 | trylist=" | |
1351 | Mcc | |
2304df62 AD |
1352 | byacc |
1353 | cpp | |
1354 | csh | |
1355 | date | |
1356 | egrep | |
2304df62 AD |
1357 | line |
1358 | nroff | |
1359 | perl | |
1360 | test | |
1361 | uname | |
1362 | " | |
8e07c86e | 1363 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
1364 | pth="$pth /lib /usr/lib" |
1365 | for file in $loclist; do | |
1366 | xxx=`./loc $file $file $pth` | |
1367 | eval $file=$xxx | |
1368 | eval _$file=$xxx | |
1369 | case "$xxx" in | |
1370 | /*) | |
1371 | echo $file is in $xxx. | |
1372 | ;; | |
8e07c86e AD |
1373 | ?:[\\/]*) |
1374 | echo $file is in $xxx. | |
1375 | ;; | |
2304df62 | 1376 | *) |
25f94b33 AD |
1377 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
1378 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
4633a7c4 | 1379 | exit 1 |
2304df62 AD |
1380 | ;; |
1381 | esac | |
1382 | done | |
1383 | echo " " | |
1384 | echo "Don't worry if any of the following aren't found..." | |
1385 | say=offhand | |
1386 | for file in $trylist; do | |
1387 | xxx=`./loc $file $file $pth` | |
1388 | eval $file=$xxx | |
1389 | eval _$file=$xxx | |
1390 | case "$xxx" in | |
1391 | /*) | |
1392 | echo $file is in $xxx. | |
1393 | ;; | |
8e07c86e AD |
1394 | ?:[\\/]*) |
1395 | echo $file is in $xxx. | |
1396 | ;; | |
2304df62 AD |
1397 | *) |
1398 | echo "I don't see $file out there, $say." | |
1399 | say=either | |
1400 | ;; | |
1401 | esac | |
1402 | done | |
1403 | case "$egrep" in | |
1404 | egrep) | |
1405 | echo "Substituting grep for egrep." | |
1406 | egrep=$grep | |
1407 | ;; | |
1408 | esac | |
1409 | case "$test" in | |
1410 | test) | |
1411 | echo "Hopefully test is built into your sh." | |
1412 | ;; | |
1413 | *) | |
ecfc5424 | 1414 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
2304df62 AD |
1415 | echo "Using the test built into your sh." |
1416 | test=test | |
1417 | _test=test | |
1418 | fi | |
1419 | ;; | |
1420 | esac | |
1421 | case "$echo" in | |
1422 | echo) | |
1423 | echo "Hopefully echo is built into your sh." | |
1424 | ;; | |
1425 | '') ;; | |
1426 | *) | |
1427 | echo " " | |
1428 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
1429 | $echo $n "hi there$c" >foo1 | |
1430 | echo $n "hi there$c" >foo2 | |
1431 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
1432 | echo "They are compatible. In fact, they may be identical." | |
1433 | else | |
1434 | case "$n" in | |
1435 | '-n') n='' c='\c';; | |
1436 | *) n='-n' c='';; | |
1437 | esac | |
1438 | cat <<FOO | |
1439 | They are not compatible! You are probably running ksh on a non-USG system. | |
1440 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
1441 | have echo built in and we may have to run some Bourne shell scripts. That | |
1442 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
1443 | ||
1444 | FOO | |
1445 | $echo $n "The star should be here-->$c" | |
1446 | $echo "*" | |
1447 | fi | |
1448 | $rm -f foo1 foo2 | |
1449 | ;; | |
1450 | esac | |
1451 | ||
a0d0e21e LW |
1452 | : determine whether symbolic links are supported |
1453 | echo " " | |
1454 | $touch blurfl | |
1455 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
1456 | echo "Symbolic links are supported." >&4 | |
1457 | lns="$ln -s" | |
1458 | else | |
1459 | echo "Symbolic links are NOT supported." >&4 | |
1460 | lns="$ln" | |
1461 | fi | |
1462 | $rm -f blurfl sym | |
1463 | ||
ecfc5424 AD |
1464 | : see whether [:lower:] and [:upper:] are supported character classes |
1465 | echo " " | |
1466 | up='[A-Z]' | |
1467 | low='[a-z]' | |
1468 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1469 | ABYZ) | |
1470 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
1471 | up='[:upper:]' | |
1472 | low='[:lower:]' | |
1473 | ;; | |
1474 | *) | |
1475 | echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4 | |
1476 | ;; | |
1477 | esac | |
1478 | : set up the translation script tr, must be called with ./tr of course | |
1479 | cat >tr <<EOSC | |
1480 | $startsh | |
1481 | case "\$1\$2" in | |
1482 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
1483 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
1484 | esac | |
1485 | exec $tr "\$@" | |
1486 | EOSC | |
1487 | chmod +x tr | |
1488 | $eunicefix tr | |
1489 | ||
2304df62 AD |
1490 | : Try to determine whether config.sh was made on this system |
1491 | case "$config_sh" in | |
1492 | '') | |
1493 | myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` | |
a0d0e21e | 1494 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
ecfc5424 | 1495 | ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` |
1aef975c | 1496 | newmyuname="$myuname" |
2304df62 | 1497 | dflt=n |
16d20bd9 AD |
1498 | case "$knowitall" in |
1499 | '') | |
1500 | if test -f ../config.sh; then | |
1501 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
1502 | eval "`grep myuname= ../config.sh`" | |
1503 | fi | |
1504 | if test "X$myuname" = "X$newmyuname"; then | |
1505 | dflt=y | |
1506 | fi | |
2304df62 | 1507 | fi |
16d20bd9 AD |
1508 | ;; |
1509 | *) dflt=y;; | |
1510 | esac | |
2304df62 AD |
1511 | |
1512 | : Get old answers from old config file if Configure was run on the | |
1513 | : same system, otherwise use the hints. | |
1514 | hint=default | |
1515 | cd .. | |
1516 | if test -f config.sh; then | |
16d20bd9 AD |
1517 | echo " " |
1518 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
1519 | . UU/myread |
1520 | case "$ans" in | |
1521 | n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;; | |
1522 | *) echo "Fetching default answers from your old config.sh file..." >&4 | |
ecfc5424 AD |
1523 | tmp_n="$n" |
1524 | tmp_c="$c" | |
2304df62 AD |
1525 | . ./config.sh |
1526 | cp config.sh UU | |
ecfc5424 AD |
1527 | n="$tmp_n" |
1528 | c="$tmp_c" | |
2304df62 AD |
1529 | hint=previous |
1530 | ;; | |
1531 | esac | |
1532 | fi | |
1533 | if test ! -f config.sh; then | |
1534 | $cat <<EOM | |
1535 | ||
1536 | First time through, eh? I have some defaults handy for the following systems: | |
1537 | ||
1538 | EOM | |
1539 | cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4 | |
1540 | dflt='' | |
1541 | : Half the following guesses are probably wrong... If you have better | |
1542 | : tests or hints, please send them to lwall@netlabs.com | |
1543 | : The metaconfig authors would also appreciate a copy... | |
a0d0e21e | 1544 | $test -f /irix && osname=irix |
85e6fe83 LW |
1545 | $test -f /xenix && osname=sco_xenix |
1546 | $test -f /dynix && osname=dynix | |
1547 | $test -f /dnix && osname=dnix | |
a0d0e21e | 1548 | $test -f /unicos && osname=unicos && osvers=`$uname -r` |
85e6fe83 | 1549 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
1550 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
1551 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
1552 | $test -d /usr/apollo/bin && osname=apollo |
1553 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 1554 | $test -d /usr/include/minix && osname=minix |
4633a7c4 LW |
1555 | if $test -d /MachTen; then |
1556 | osname=machten | |
1557 | if $test -x /sbin/version; then | |
1558 | osvers=`/sbin/version | $awk '{print $2}' | | |
1559 | $sed -e 's/[A-Za-z]$//'` | |
1560 | elif $test -x /usr/etc/version; then | |
1561 | osvers=`/usr/etc/version | $awk '{print $2}' | | |
1562 | $sed -e 's/[A-Za-z]$//'` | |
1563 | else | |
1564 | osvers="$2.$3" | |
1565 | fi | |
1566 | fi | |
2304df62 AD |
1567 | if $test -f $uname; then |
1568 | set X $myuname | |
1569 | shift | |
1570 | ||
2304df62 | 1571 | case "$5" in |
85e6fe83 | 1572 | fps*) osname=fps ;; |
2304df62 AD |
1573 | mips*) |
1574 | case "$4" in | |
85e6fe83 LW |
1575 | umips) osname=umips ;; |
1576 | *) osname=mips ;; | |
2304df62 | 1577 | esac;; |
85e6fe83 LW |
1578 | [23]100) osname=mips ;; |
1579 | next*) osname=next ;; | |
1580 | news*) osname=news ;; | |
ecfc5424 AD |
1581 | i386*) |
1582 | if $test -f /etc/kconfig; then | |
1583 | osname=isc | |
a0d0e21e LW |
1584 | if test "$lns" = "ln -s"; then |
1585 | osvers=4 | |
1586 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
1587 | osvers=3 | |
2304df62 | 1588 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 1589 | osvers=2 |
ecfc5424 AD |
1590 | fi |
1591 | fi | |
1592 | ;; | |
2304df62 AD |
1593 | esac |
1594 | ||
1595 | case "$1" in | |
a0d0e21e LW |
1596 | aix) osname=aix |
1597 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
1598 | case "$tmp" in | |
1aef975c | 1599 | 'not found') osvers="$4"."$3" ;; |
a0d0e21e LW |
1600 | '<3240'|'<>3240') osvers=3.2.0 ;; |
1601 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
1602 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 1603 | *) osvers=$tmp;; |
a0d0e21e LW |
1604 | esac |
1605 | ;; | |
1606 | dnix) osname=dnix | |
1607 | osvers="$3" | |
1608 | ;; | |
1609 | domainos) osname=apollo | |
1610 | osvers="$3" | |
1611 | ;; | |
1612 | dgux) osname=dgux | |
1613 | osvers="$3" | |
1614 | ;; | |
1615 | freebsd) osname=freebsd | |
1616 | osvers="$3" ;; | |
1617 | genix) osname=genix ;; | |
1618 | hp*) osname=hpux | |
1619 | case "$3" in | |
1620 | *.08.*) osvers=9 ;; | |
1621 | *.09.*) osvers=9 ;; | |
1622 | *.10.*) osvers=10 ;; | |
ecfc5424 | 1623 | *) osvers="$3" ;; |
a0d0e21e LW |
1624 | esac |
1625 | ;; | |
1626 | irix) osname=irix | |
1627 | case "$3" in | |
1628 | 4*) osvers=4 ;; | |
1629 | 5*) osvers=5 ;; | |
ecfc5424 | 1630 | *) osvers="$3" ;; |
a0d0e21e LW |
1631 | esac |
1632 | ;; | |
1633 | linux) osname=linux | |
1634 | case "$3" in | |
1635 | 1*) osvers=1 ;; | |
1636 | *) osvers="$3" ;; | |
1637 | esac | |
1638 | ;; | |
1639 | netbsd*) osname=netbsd | |
ecfc5424 AD |
1640 | osvers="$3" |
1641 | ;; | |
a0d0e21e LW |
1642 | bsd386) osname=bsd386 |
1643 | osvers=`$uname -r` | |
1644 | ;; | |
1645 | next*) osname=next ;; | |
1646 | solaris) osname=solaris | |
1647 | case "$3" in | |
1648 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 1649 | *) osvers="$3" ;; |
a0d0e21e LW |
1650 | esac |
1651 | ;; | |
85e6fe83 LW |
1652 | sunos) osname=sunos |
1653 | case "$3" in | |
85e6fe83 LW |
1654 | 5*) osname=solaris |
1655 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 1656 | *) osvers="$3" ;; |
2304df62 AD |
1657 | esac |
1658 | ;; | |
a0d0e21e | 1659 | titanos) osname=titanos |
85e6fe83 | 1660 | case "$3" in |
a0d0e21e LW |
1661 | 1*) osvers=1 ;; |
1662 | 2*) osvers=2 ;; | |
1663 | 3*) osvers=3 ;; | |
1664 | 4*) osvers=4 ;; | |
ecfc5424 | 1665 | *) osvers="$3" ;; |
2304df62 AD |
1666 | esac |
1667 | ;; | |
85e6fe83 | 1668 | ultrix) osname=ultrix |
ecfc5424 | 1669 | osvers="$3" |
2304df62 | 1670 | ;; |
85e6fe83 | 1671 | osf1) case "$5" in |
fed7345c AD |
1672 | alpha) |
1673 | osname=dec_osf | |
1674 | osvers=`echo "$3" | sed 's/^[vt]//'` | |
ecfc5424 AD |
1675 | ;; |
1676 | hp*) osname=hp_osf1 ;; | |
1677 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
1678 | esac |
1679 | ;; | |
a0d0e21e LW |
1680 | uts) osname=uts |
1681 | osvers="$3" | |
1682 | ;; | |
85e6fe83 | 1683 | $2) case "$osname" in |
2304df62 | 1684 | *isc*) ;; |
a0d0e21e LW |
1685 | *freebsd*) ;; |
1686 | svr*) | |
1687 | : svr4.x or possibly later | |
1688 | case "svr$3" in | |
1689 | ${osname}*) | |
1690 | osname=svr$3 | |
1691 | osvers=$4 | |
1692 | ;; | |
1693 | esac | |
1694 | case "$osname" in | |
1695 | svr4.0) | |
1696 | : Check for ESIX | |
1697 | if test -f /stand/boot ; then | |
1698 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
1699 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
1700 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
1701 | if test -n "$isesix"; then | |
a0d0e21e LW |
1702 | osname=esix4 |
1703 | fi | |
1704 | fi | |
1705 | fi | |
1706 | ;; | |
1707 | esac | |
1708 | ;; | |
2304df62 | 1709 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
1710 | osname=sco |
1711 | set `echo $3 | $sed 's/\./ /g'` $4 | |
2304df62 | 1712 | if $test -f sco_$1_$2_$3.sh; then |
85e6fe83 | 1713 | osvers=$1.$2.$3 |
2304df62 | 1714 | elif $test -f sco_$1_$2.sh; then |
85e6fe83 | 1715 | osvers=$1.$2 |
2304df62 | 1716 | elif $test -f sco_$1.sh; then |
85e6fe83 | 1717 | osvers=$1 |
2304df62 | 1718 | fi |
a0d0e21e LW |
1719 | else |
1720 | case "$osname" in | |
1721 | '') : Still unknown. Probably a generic Sys V. | |
1722 | osname="sysv" | |
1723 | osvers="$3" | |
1724 | ;; | |
1725 | esac | |
2304df62 AD |
1726 | fi |
1727 | ;; | |
1728 | esac | |
1729 | ;; | |
a0d0e21e LW |
1730 | *) case "$osname" in |
1731 | '') : Still unknown. Probably a generic BSD. | |
1732 | osname="$1" | |
1733 | osvers="$3" | |
1734 | ;; | |
1735 | esac | |
1736 | ;; | |
2304df62 AD |
1737 | esac |
1738 | else | |
1739 | if test -f /vmunix -a -f news_os.sh; then | |
ecfc5424 | 1740 | (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1 |
2304df62 | 1741 | if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then |
85e6fe83 | 1742 | osname=news_os |
2304df62 AD |
1743 | fi |
1744 | $rm -f ../UU/kernel.what | |
8e07c86e AD |
1745 | elif test -d c:/.; then |
1746 | set X $myuname | |
1747 | osname=os2 | |
1748 | osvers="$5" | |
2304df62 AD |
1749 | fi |
1750 | fi | |
85e6fe83 | 1751 | |
a0d0e21e LW |
1752 | : Now look for a hint file osname_osvers, unless one has been |
1753 | : specified already. | |
1754 | case "$hintfile" in | |
1755 | ''|' ') | |
ecfc5424 | 1756 | file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'` |
a0d0e21e | 1757 | : Also try without trailing minor version numbers. |
ecfc5424 AD |
1758 | xfile=`echo $file | $sed -e 's@_[^_]*$@@'` |
1759 | xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'` | |
1760 | xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'` | |
1761 | xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'` | |
a0d0e21e LW |
1762 | case "$file" in |
1763 | '') dflt=none ;; | |
1764 | *) case "$osvers" in | |
1765 | '') dflt=$file | |
1766 | ;; | |
1767 | *) if $test -f $file.sh ; then | |
1768 | dflt=$file | |
1769 | elif $test -f $xfile.sh ; then | |
1770 | dflt=$xfile | |
1771 | elif $test -f $xxfile.sh ; then | |
1772 | dflt=$xxfile | |
1773 | elif $test -f $xxxfile.sh ; then | |
1774 | dflt=$xxxfile | |
1775 | elif $test -f $xxxxfile.sh ; then | |
1776 | dflt=$xxxxfile | |
1777 | elif $test -f "${osname}.sh" ; then | |
1778 | dflt="${osname}" | |
1779 | else | |
1780 | dflt=none | |
1781 | fi | |
1782 | ;; | |
1783 | esac | |
85e6fe83 LW |
1784 | ;; |
1785 | esac | |
1786 | ;; | |
a0d0e21e | 1787 | *) |
ecfc5424 | 1788 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 1789 | ;; |
2304df62 | 1790 | esac |
1aef975c | 1791 | |
2304df62 AD |
1792 | $cat <<EOM |
1793 | ||
1794 | You may give one or more space-separated answers, or "none" if appropriate. | |
1795 | If your OS version has no hints, DO NOT give a wrong version -- say "none". | |
1796 | ||
1797 | EOM | |
1798 | rp="Which of these apply, if any?" | |
1799 | . ../UU/myread | |
85e6fe83 LW |
1800 | tans=$ans |
1801 | for file in $tans; do | |
2304df62 AD |
1802 | if $test -f $file.sh; then |
1803 | . ./$file.sh | |
1804 | $cat $file.sh >> ../UU/config.sh | |
85e6fe83 | 1805 | elif $test X$tans = X -o X$tans = Xnone ; then |
2304df62 AD |
1806 | : nothing |
1807 | else | |
85e6fe83 LW |
1808 | : Give one chance to correct a possible typo. |
1809 | echo "$file.sh does not exist" | |
1810 | dflt=$file | |
1811 | rp="hint to use instead?" | |
1812 | . ../UU/myread | |
1813 | for file in $ans; do | |
1814 | if $test -f "$file.sh"; then | |
1815 | . ./$file.sh | |
1816 | $cat $file.sh >> ../UU/config.sh | |
1817 | elif $test X$ans = X -o X$ans = Xnone ; then | |
1818 | : nothing | |
1819 | else | |
1820 | echo "$file.sh does not exist -- ignored." | |
1821 | fi | |
1822 | done | |
2304df62 AD |
1823 | fi |
1824 | done | |
85e6fe83 | 1825 | |
2304df62 | 1826 | hint=recommended |
85e6fe83 LW |
1827 | : Remember our hint file for later. |
1828 | if $test -f "$file.sh" ; then | |
a0d0e21e | 1829 | hintfile="$file" |
85e6fe83 | 1830 | else |
a0d0e21e | 1831 | hintfile='' |
85e6fe83 LW |
1832 | fi |
1833 | ||
2304df62 AD |
1834 | cd .. |
1835 | fi | |
1836 | cd UU | |
1837 | ;; | |
1838 | *) | |
1839 | echo " " | |
1840 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
1841 | tmp_n="$n" |
1842 | tmp_c="$c" | |
2304df62 AD |
1843 | cd .. |
1844 | cp $config_sh config.sh 2>/dev/null | |
1845 | . ./config.sh | |
1846 | cd UU | |
1847 | cp ../config.sh . | |
ecfc5424 AD |
1848 | n="$tmp_n" |
1849 | c="$tmp_c" | |
2304df62 AD |
1850 | hint=previous |
1851 | ;; | |
1852 | esac | |
1aef975c AD |
1853 | test "$override" && . ./optdef.sh |
1854 | myuname="$newmyuname" | |
2304df62 AD |
1855 | |
1856 | : Restore computed paths | |
1857 | for file in $loclist $trylist; do | |
1858 | eval $file="\$_$file" | |
1859 | done | |
1860 | ||
85e6fe83 | 1861 | cat << EOM |
a0d0e21e | 1862 | |
85e6fe83 | 1863 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
1864 | The default value is probably right if the name rings a bell. Otherwise, |
1865 | since spelling matters for me, either accept the default or answer "none" | |
1866 | to leave it blank. | |
a0d0e21e | 1867 | |
85e6fe83 | 1868 | EOM |
85e6fe83 | 1869 | case "$osname" in |
a0d0e21e | 1870 | ''|' ') |
85e6fe83 | 1871 | case "$hintfile" in |
a0d0e21e | 1872 | ''|' '|none) dflt=none ;; |
ecfc5424 | 1873 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
1874 | esac |
1875 | ;; | |
1876 | *) dflt="$osname" ;; | |
1877 | esac | |
1878 | rp="Operating system name?" | |
1879 | . ./myread | |
1880 | case "$ans" in | |
ecfc5424 AD |
1881 | none) osname='' ;; |
1882 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 1883 | esac |
2304df62 AD |
1884 | : who configured the system |
1885 | cf_time=`$date 2>&1` | |
a0d0e21e LW |
1886 | (logname > .temp) >/dev/null 2>&1 |
1887 | $test -s .temp || (whoami > .temp) >/dev/null 2>&1 | |
1888 | $test -s .temp || echo unknown > .temp | |
1889 | cf_by=`$cat .temp` | |
1890 | $rm -f .temp | |
2304df62 | 1891 | |
4633a7c4 | 1892 | : determine the architecture name |
2304df62 | 1893 | echo " " |
4633a7c4 LW |
1894 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
1895 | tarch=`arch`"-$osname" | |
1896 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
1897 | if uname -m > tmparch 2>&1 ; then | |
1898 | tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch` | |
1899 | else | |
1900 | tarch="$osname" | |
1901 | fi | |
1902 | $rm -f tmparch | |
1903 | else | |
1904 | tarch="$osname" | |
1905 | fi | |
1906 | case "$myarchname" in | |
1907 | ''|"$tarch") ;; | |
1908 | *) | |
1909 | echo "(Your architecture name used to be $myarchname.)" | |
1910 | archname='' | |
2304df62 AD |
1911 | ;; |
1912 | esac | |
4633a7c4 LW |
1913 | case "$archname" in |
1914 | '') dflt="$tarch";; | |
1915 | *) dflt="$archname";; | |
1916 | esac | |
1917 | rp='What is your architecture name' | |
1918 | . ./myread | |
1919 | archname="$ans" | |
1920 | myarchname="$tarch" | |
1921 | ||
1922 | : is AFS running? | |
1923 | echo " " | |
1924 | if test -d /afs; then | |
1925 | echo "AFS may be running... I'll be extra cautious then..." >&4 | |
1926 | afs=true | |
2304df62 | 1927 | else |
4633a7c4 LW |
1928 | echo "AFS does not seem to be running..." >&4 |
1929 | afs=false | |
2304df62 AD |
1930 | fi |
1931 | ||
4633a7c4 LW |
1932 | : decide how portable to be. Allow command line overrides. |
1933 | case "$d_portable" in | |
1934 | "$undef") ;; | |
1935 | *) d_portable="$define" ;; | |
2304df62 | 1936 | esac |
2304df62 | 1937 | |
4633a7c4 LW |
1938 | : set up shell script to do ~ expansion |
1939 | cat >filexp <<EOSS | |
1940 | $startsh | |
1941 | : expand filename | |
1942 | case "\$1" in | |
1943 | ~/*|~) | |
1944 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
2304df62 | 1945 | ;; |
4633a7c4 LW |
1946 | ~*) |
1947 | if $test -f /bin/csh; then | |
1948 | /bin/csh -f -c "glob \$1" | |
1949 | failed=\$? | |
1950 | echo "" | |
1951 | exit \$failed | |
1952 | else | |
1953 | name=\`$expr x\$1 : '..\([^/]*\)'\` | |
1954 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
1955 | if $test ! -d "\$dir"; then | |
1956 | me=\`basename \$0\` | |
1957 | echo "\$me: can't locate home directory for: \$name" >&2 | |
1958 | exit 1 | |
1959 | fi | |
1960 | case "\$1" in | |
1961 | */*) | |
1962 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
1963 | ;; | |
1964 | *) | |
1965 | echo \$dir | |
1966 | ;; | |
2304df62 | 1967 | esac |
4633a7c4 | 1968 | fi |
2304df62 AD |
1969 | ;; |
1970 | *) | |
4633a7c4 | 1971 | echo \$1 |
2304df62 AD |
1972 | ;; |
1973 | esac | |
4633a7c4 LW |
1974 | EOSS |
1975 | chmod +x filexp | |
1976 | $eunicefix filexp | |
2304df62 AD |
1977 | |
1978 | : now set up to get a file name | |
1979 | cat <<'EOSC' >getfile | |
1980 | tilde='' | |
1981 | fullpath='' | |
1982 | already='' | |
1983 | skip='' | |
1984 | none_ok='' | |
1985 | exp_file='' | |
a0d0e21e | 1986 | nopath_ok='' |
2304df62 AD |
1987 | orig_rp="$rp" |
1988 | orig_dflt="$dflt" | |
1989 | ||
1990 | case "$fn" in | |
ecfc5424 AD |
1991 | *\(*) |
1992 | expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok | |
1993 | fn=`echo $fn | sed 's/(.*)//'` | |
1994 | ;; | |
1995 | esac | |
1996 | ||
1997 | case "$fn" in | |
a0d0e21e LW |
1998 | *:*) |
1999 | loc_file=`expr $fn : '.*:\(.*\)'` | |
2000 | fn=`expr $fn : '\(.*\):.*'` | |
2001 | ;; | |
2002 | esac | |
2003 | ||
2004 | case "$fn" in | |
2304df62 AD |
2005 | *~*) tilde=true;; |
2006 | esac | |
2007 | case "$fn" in | |
2008 | */*) fullpath=true;; | |
2009 | esac | |
2010 | case "$fn" in | |
2011 | *+*) skip=true;; | |
2012 | esac | |
2013 | case "$fn" in | |
2014 | *n*) none_ok=true;; | |
2015 | esac | |
2016 | case "$fn" in | |
2017 | *e*) exp_file=true;; | |
2018 | esac | |
a0d0e21e LW |
2019 | case "$fn" in |
2020 | *p*) nopath_ok=true;; | |
2021 | esac | |
2304df62 AD |
2022 | |
2023 | case "$fn" in | |
2024 | *f*) type='File';; | |
2025 | *d*) type='Directory';; | |
a0d0e21e | 2026 | *l*) type='Locate';; |
2304df62 AD |
2027 | esac |
2028 | ||
2029 | what="$type" | |
2030 | case "$what" in | |
2031 | Locate) what='File';; | |
2032 | esac | |
2033 | ||
2034 | case "$exp_file" in | |
2035 | '') | |
2036 | case "$d_portable" in | |
2037 | "$define") ;; | |
2038 | *) exp_file=true;; | |
2039 | esac | |
2040 | ;; | |
2041 | esac | |
2042 | ||
2043 | cd .. | |
2044 | while test "$type"; do | |
2045 | redo='' | |
2046 | rp="$orig_rp" | |
2047 | dflt="$orig_dflt" | |
2048 | case "$tilde" in | |
2049 | true) rp="$rp (~name ok)";; | |
2050 | esac | |
2051 | . UU/myread | |
ecfc5424 AD |
2052 | if test -f UU/getfile.ok && \ |
2053 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
2054 | then | |
2055 | value="$ans" | |
2056 | ansexp="$ans" | |
2057 | break | |
2058 | fi | |
2304df62 AD |
2059 | case "$ans" in |
2060 | none) | |
2061 | value='' | |
2062 | ansexp='' | |
2063 | case "$none_ok" in | |
2064 | true) type='';; | |
2065 | esac | |
2066 | ;; | |
2067 | *) | |
2068 | case "$tilde" in | |
2069 | '') value="$ans" | |
2070 | ansexp="$ans";; | |
2071 | *) | |
2072 | value=`UU/filexp $ans` | |
2073 | case $? in | |
2074 | 0) | |
2075 | if test "$ans" != "$value"; then | |
ecfc5424 | 2076 | echo "(That expands to $value on this system.)" |
2304df62 AD |
2077 | fi |
2078 | ;; | |
2079 | *) value="$ans";; | |
2080 | esac | |
2081 | ansexp="$value" | |
2082 | case "$exp_file" in | |
2083 | '') value="$ans";; | |
2084 | esac | |
2085 | ;; | |
2086 | esac | |
2087 | case "$fullpath" in | |
2088 | true) | |
2089 | case "$ansexp" in | |
2090 | /*) value="$ansexp" ;; | |
2091 | *) | |
2092 | redo=true | |
2093 | case "$already" in | |
2094 | true) | |
2095 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
2096 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
2097 | ;; | |
2098 | *) | |
2099 | echo "Please give a full path name, starting with slash." >&4 | |
2100 | case "$tilde" in | |
2101 | true) | |
2102 | echo "Note that using ~name is ok provided it expands well." >&4 | |
2103 | already=true | |
2104 | ;; | |
2105 | esac | |
2106 | esac | |
2107 | ;; | |
2108 | esac | |
2109 | ;; | |
2110 | esac | |
2111 | case "$redo" in | |
2112 | '') | |
2113 | case "$type" in | |
2114 | File) | |
2115 | if test -f "$ansexp"; then | |
2116 | type='' | |
2117 | elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1 | |
2118 | then | |
2119 | echo "($value is not a plain file, but that's ok.)" | |
2120 | type='' | |
2121 | fi | |
2122 | ;; | |
2123 | Directory) | |
2124 | if test -d "$ansexp"; then | |
2125 | type='' | |
2126 | fi | |
2127 | ;; | |
2128 | Locate) | |
40000a8c | 2129 | if test -d "$ansexp"; then |
a0d0e21e LW |
2130 | echo "(Looking for $loc_file in directory $value.)" |
2131 | value="$value/$loc_file" | |
40000a8c | 2132 | ansexp="$ansexp/$loc_file" |
2304df62 | 2133 | fi |
40000a8c | 2134 | if test -f "$ansexp"; then |
2304df62 AD |
2135 | type='' |
2136 | fi | |
a0d0e21e LW |
2137 | case "$nopath_ok" in |
2138 | true) case "$value" in | |
2139 | */*) ;; | |
2140 | *) echo "Assuming $value will be in people's path." | |
2141 | type='' | |
2142 | ;; | |
2143 | esac | |
2144 | ;; | |
2145 | esac | |
2304df62 AD |
2146 | ;; |
2147 | esac | |
2148 | ||
2149 | case "$skip" in | |
2150 | true) type=''; | |
2151 | esac | |
2152 | ||
2153 | case "$type" in | |
2154 | '') ;; | |
2155 | *) | |
2156 | if test "$fastread" = yes; then | |
2157 | dflt=y | |
2158 | else | |
2159 | dflt=n | |
2160 | fi | |
2161 | rp="$what $value doesn't exist. Use that name anyway?" | |
2162 | . UU/myread | |
2163 | dflt='' | |
2164 | case "$ans" in | |
2165 | y*) type='';; | |
2166 | *) echo " ";; | |
2167 | esac | |
2168 | ;; | |
2169 | esac | |
2170 | ;; | |
2171 | esac | |
2172 | ;; | |
2173 | esac | |
2174 | done | |
2175 | cd UU | |
2176 | ans="$value" | |
2177 | rp="$orig_rp" | |
2178 | dflt="$orig_dflt" | |
ecfc5424 | 2179 | rm -f getfile.ok |
2304df62 AD |
2180 | EOSC |
2181 | ||
4633a7c4 LW |
2182 | : determine root of directory hierarchy where package will be installed. |
2183 | case "$prefix" in | |
2184 | '') | |
2185 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` | |
8e07c86e | 2186 | ;; |
4633a7c4 LW |
2187 | *) |
2188 | dflt="$prefix" | |
8e07c86e AD |
2189 | ;; |
2190 | esac | |
4633a7c4 | 2191 | $cat <<EOM |
2304df62 | 2192 | |
4633a7c4 LW |
2193 | By default, $package will be installed in $dflt/bin, manual |
2194 | pages under $dflt/man, etc..., i.e. with $dflt as prefix for | |
2195 | all installation directories. Typically set to /usr/local, but you | |
2196 | may choose /usr if you wish to install $package among your system | |
2197 | binaries. If you wish to have binaries under /bin but manual pages | |
2198 | under /usr/local/man, that's ok: you will be prompted separately | |
2199 | for each of the installation directories, the prefix being only used | |
2200 | to set the defaults. | |
8e07c86e AD |
2201 | |
2202 | EOM | |
2203 | fn=d~ | |
2204 | rp='Installation prefix to use?' | |
2205 | . ./getfile | |
2206 | oldprefix='' | |
2207 | case "$prefix" in | |
a0d0e21e | 2208 | '') ;; |
8e07c86e AD |
2209 | *) |
2210 | case "$ans" in | |
2211 | "$prefix") ;; | |
2212 | *) oldprefix="$prefix";; | |
2213 | esac | |
2214 | ;; | |
a0d0e21e | 2215 | esac |
8e07c86e AD |
2216 | prefix="$ans" |
2217 | prefixexp="$ansexp" | |
a0d0e21e | 2218 | |
8e07c86e AD |
2219 | : set the prefixit variable, to compute a suitable default value |
2220 | prefixit='case "$3" in | |
2221 | ""|none) | |
2222 | case "$oldprefix" in | |
2223 | "") eval "$1=\"\$$2\"";; | |
2224 | *) | |
2225 | case "$3" in | |
2226 | "") eval "$1=";; | |
2227 | none) | |
2228 | eval "tp=\"\$$2\""; | |
2229 | case "$tp" in | |
2230 | ""|" ") eval "$1=\"\$$2\"";; | |
2231 | *) eval "$1=";; | |
2232 | esac;; | |
2233 | esac;; | |
2234 | esac;; | |
2235 | *) | |
2236 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; | |
2237 | case "$tp" in | |
2238 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; | |
2239 | /*-$oldprefix/*|\~*-$oldprefix/*) | |
2240 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; | |
2241 | *) eval "$1=\"\$$2\"";; | |
2242 | esac;; | |
2243 | esac' | |
a0d0e21e | 2244 | |
4633a7c4 LW |
2245 | : determine where private library files go |
2246 | : Usual default is /usr/local/lib/perl5. Also allow things like | |
2247 | : /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant. | |
2248 | case "$prefix" in | |
2249 | *perl*) set dflt privlib lib ;; | |
2250 | *) set dflt privlib lib/$package ;; | |
2251 | esac | |
8e07c86e | 2252 | eval $prefixit |
4633a7c4 LW |
2253 | $cat <<EOM |
2254 | ||
2255 | There are some auxiliary files for $package that need to be put into a | |
2256 | private library directory that is accessible by everyone. | |
2257 | ||
2258 | EOM | |
2259 | fn=d~+ | |
2260 | rp='Pathname where the private library files will reside?' | |
8e07c86e | 2261 | . ./getfile |
4633a7c4 LW |
2262 | if $test "X$privlibexp" != "X$ansexp"; then |
2263 | installprivlib='' | |
8e07c86e | 2264 | fi |
4633a7c4 LW |
2265 | privlib="$ans" |
2266 | privlibexp="$ansexp" | |
8e07c86e AD |
2267 | if $afs; then |
2268 | $cat <<EOM | |
2304df62 | 2269 | |
8e07c86e | 2270 | Since you are running AFS, I need to distinguish the directory in which |
4633a7c4 | 2271 | private files reside from the directory in which they are installed (and from |
8e07c86e | 2272 | which they are presumably copied to the former directory by occult means). |
a0d0e21e | 2273 | |
8e07c86e | 2274 | EOM |
4633a7c4 LW |
2275 | case "$installprivlib" in |
2276 | '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2277 | *) dflt="$installprivlib";; | |
8e07c86e AD |
2278 | esac |
2279 | fn=de~ | |
4633a7c4 | 2280 | rp='Where will private files be installed?' |
8e07c86e | 2281 | . ./getfile |
4633a7c4 | 2282 | installprivlib="$ans" |
8e07c86e | 2283 | else |
4633a7c4 LW |
2284 | installprivlib="$privlibexp" |
2285 | fi | |
2286 | ||
2287 | : set the base revision | |
2288 | baserev=5.0 | |
2289 | ||
2290 | : get the patchlevel | |
2291 | echo " " | |
2292 | echo "Getting the current patchlevel..." >&4 | |
2293 | if $test -r ../patchlevel.h;then | |
2294 | patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h` | |
2295 | else | |
2296 | patchlevel=0 | |
8e07c86e | 2297 | fi |
4633a7c4 | 2298 | echo "(You have $package $baserev PL$patchlevel.)" |
2304df62 | 2299 | |
8e07c86e AD |
2300 | : set the prefixup variable, to restore leading tilda escape |
2301 | prefixup='case "$prefixexp" in | |
2302 | "$prefix") ;; | |
2303 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; | |
2304 | esac' | |
2305 | ||
4633a7c4 LW |
2306 | : determine where public architecture dependent libraries go |
2307 | set archlib archlib | |
8e07c86e | 2308 | eval $prefixit |
4633a7c4 | 2309 | case "$archlib" in |
8e07c86e | 2310 | '') |
4633a7c4 LW |
2311 | case "$privlib" in |
2312 | '') | |
2313 | dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib` | |
2314 | set dflt | |
2315 | eval $prefixup | |
2316 | ;; | |
2317 | *) version=`echo $baserev $patchlevel | $awk '{print $1 + $2/1000.0}'` | |
2318 | dflt="$privlib/$archname/$version" | |
2319 | ;; | |
2320 | esac | |
8e07c86e | 2321 | ;; |
4633a7c4 | 2322 | *) dflt="$archlib";; |
8e07c86e | 2323 | esac |
4633a7c4 LW |
2324 | cat <<EOM |
2325 | ||
2326 | $spackage contains architecture-dependent library files. If you are | |
2327 | sharing libraries in a heterogeneous environment, you might store | |
2328 | these files in a separate location. Otherwise, you can just include | |
2329 | them with the rest of the public library files. | |
2330 | ||
8e07c86e | 2331 | EOM |
4633a7c4 LW |
2332 | fn=d+~ |
2333 | rp='Where do you want to put the public architecture-dependent libraries?' | |
8e07c86e | 2334 | . ./getfile |
4633a7c4 LW |
2335 | archlib="$ans" |
2336 | archlibexp="$ansexp" | |
2337 | ||
8e07c86e AD |
2338 | if $afs; then |
2339 | $cat <<EOM | |
2340 | ||
2341 | Since you are running AFS, I need to distinguish the directory in which | |
4633a7c4 | 2342 | private files reside from the directory in which they are installed (and from |
8e07c86e AD |
2343 | which they are presumably copied to the former directory by occult means). |
2344 | ||
2345 | EOM | |
4633a7c4 LW |
2346 | case "$installarchlib" in |
2347 | '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;; | |
2348 | *) dflt="$installarchlib";; | |
8e07c86e AD |
2349 | esac |
2350 | fn=de~ | |
4633a7c4 | 2351 | rp='Where will architecture-dependent library files be installed?' |
8e07c86e | 2352 | . ./getfile |
4633a7c4 | 2353 | installarchlib="$ans" |
8e07c86e | 2354 | else |
4633a7c4 LW |
2355 | installarchlib="$archlibexp" |
2356 | fi | |
2357 | if $test X"$archlib" = X"$privlib"; then | |
2358 | d_archlib="$undef" | |
2359 | else | |
2360 | d_archlib="$define" | |
8e07c86e AD |
2361 | fi |
2362 | ||
37120919 AD |
2363 | : determine where site specific libraries go. |
2364 | set sitelib sitelib | |
2365 | eval $prefixit | |
2366 | case "$sitelib" in | |
2367 | '') dflt="$privlib/site_perl" ;; | |
2368 | *) dflt="$sitelib" ;; | |
2369 | esac | |
2370 | $cat <<EOM | |
2371 | ||
2372 | The installation process will also create a directory for | |
2373 | site-specific extensions and modules. Some users find it convenient | |
2374 | to place all local files in this directory rather than in the main | |
2375 | distribution directory. | |
2376 | ||
2377 | EOM | |
2378 | fn=d~+ | |
2379 | rp='Pathname for the site-specific library files?' | |
2380 | . ./getfile | |
2381 | if $test "X$sitelibexp" != "X$ansexp"; then | |
2382 | installsitelib='' | |
2383 | fi | |
2384 | sitelib="$ans" | |
2385 | sitelibexp="$ansexp" | |
2386 | if $afs; then | |
2387 | $cat <<EOM | |
2388 | ||
2389 | Since you are running AFS, I need to distinguish the directory in which | |
2390 | private files reside from the directory in which they are installed (and from | |
2391 | which they are presumably copied to the former directory by occult means). | |
2392 | ||
2393 | EOM | |
2394 | case "$installsitelib" in | |
2395 | '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;; | |
2396 | *) dflt="$installsitelib";; | |
2397 | esac | |
2398 | fn=de~ | |
2399 | rp='Where will private files be installed?' | |
2400 | . ./getfile | |
2401 | installsitelib="$ans" | |
2402 | else | |
2403 | installsitelib="$sitelibexp" | |
2404 | fi | |
4633a7c4 | 2405 | |
37120919 AD |
2406 | : determine where site specific architecture-dependent libraries go. |
2407 | xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'` | |
2408 | : xxx is usuually lib/site_perl/archname. | |
2409 | set sitearch sitearch none | |
8e07c86e | 2410 | eval $prefixit |
37120919 AD |
2411 | case "$sitearch" in |
2412 | '') dflt="$sitelib/$archname" ;; | |
2413 | *) dflt="$sitearch" ;; | |
2414 | esac | |
8e07c86e AD |
2415 | $cat <<EOM |
2416 | ||
4633a7c4 LW |
2417 | The installation process will also create a directory for |
2418 | architecture-dependent site-specific extensions and modules. | |
8e07c86e AD |
2419 | |
2420 | EOM | |
4633a7c4 LW |
2421 | fn=nd~+ |
2422 | rp='Pathname for the site-specific architecture-dependent library files?' | |
8e07c86e | 2423 | . ./getfile |
4633a7c4 LW |
2424 | if $test "X$sitearchexp" != "X$ansexp"; then |
2425 | installsitearch='' | |
8e07c86e | 2426 | fi |
4633a7c4 LW |
2427 | sitearch="$ans" |
2428 | sitearchexp="$ansexp" | |
8e07c86e AD |
2429 | if $afs; then |
2430 | $cat <<EOM | |
2431 | ||
2432 | Since you are running AFS, I need to distinguish the directory in which | |
2433 | private files reside from the directory in which they are installed (and from | |
2434 | which they are presumably copied to the former directory by occult means). | |
2435 | ||
2436 | EOM | |
4633a7c4 LW |
2437 | case "$installsitearch" in |
2438 | '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;; | |
2439 | *) dflt="$installsitearch";; | |
8e07c86e AD |
2440 | esac |
2441 | fn=de~ | |
2442 | rp='Where will private files be installed?' | |
2443 | . ./getfile | |
4633a7c4 | 2444 | installsitearch="$ans" |
8e07c86e | 2445 | else |
4633a7c4 | 2446 | installsitearch="$sitearchexp" |
8e07c86e AD |
2447 | fi |
2448 | ||
4633a7c4 LW |
2449 | : set up the script used to warn in case of inconsistency |
2450 | cat <<'EOSC' >whoa | |
2451 | dflt=y | |
8e07c86e | 2452 | echo " " |
4633a7c4 LW |
2453 | echo "*** WHOA THERE!!! ***" >&4 |
2454 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
2455 | rp=" Keep the $hint value?" | |
8e07c86e | 2456 | . ./myread |
4633a7c4 LW |
2457 | case "$ans" in |
2458 | y) td=$was; tu=$was;; | |
2459 | esac | |
2460 | EOSC | |
8e07c86e | 2461 | |
4633a7c4 LW |
2462 | : function used to set $1 to $val |
2463 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
2464 | case "$val$was" in | |
2465 | $define$undef) . ./whoa; eval "$var=\$td";; | |
2466 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
2467 | *) eval "$var=$val";; | |
2468 | esac' | |
2469 | ||
2470 | : determine where old public architecture dependent libraries might be | |
2471 | case "$oldarchlib" in | |
2472 | '') case "$privlib" in | |
2473 | '') ;; | |
2474 | *) dflt="$privlib/$archname" | |
8e07c86e | 2475 | ;; |
8e07c86e AD |
2476 | esac |
2477 | ;; | |
4633a7c4 LW |
2478 | *) dflt="$oldarchlib" |
2479 | ;; | |
8e07c86e | 2480 | esac |
4633a7c4 LW |
2481 | if $test ! -d "$dflt/auto"; then |
2482 | dflt=none | |
2483 | fi | |
8e07c86e AD |
2484 | cat <<EOM |
2485 | ||
4633a7c4 LW |
2486 | In 5.001, Perl stored architecutre-dependent library files in a library |
2487 | with a name such as $privlib/$archname, | |
2488 | and this directory contained files from the standard extensions and | |
2489 | files from any additional extensions you might have added. Starting | |
2490 | with version 5.002, all the architecture-dependent standard extensions | |
2491 | will go into $archlib, | |
2492 | while locally-added extensions will go into | |
2493 | $sitearch. | |
2494 | ||
2495 | If you wish Perl to continue to search the old architecture-dependent | |
2496 | library for your local extensions, give the path to that directory. | |
2497 | If you do not wish to use your old architecture-dependent library | |
2498 | files, answer 'none'. | |
8e07c86e AD |
2499 | |
2500 | EOM | |
4633a7c4 LW |
2501 | fn=dn~ |
2502 | rp='Directory for your old 5.001 architecture-dependent libraries?' | |
8e07c86e | 2503 | . ./getfile |
4633a7c4 LW |
2504 | oldarchlib="$ans" |
2505 | oldarchlibexp="$ansexp" | |
2506 | case "$oldarchlib" in | |
2507 | ''|' ') val="$undef" ;; | |
2508 | *) val="$define" ;; | |
2509 | esac | |
2510 | set d_oldarchlib | |
2511 | eval $setvar | |
8e07c86e | 2512 | |
4633a7c4 LW |
2513 | : determine where public executables go |
2514 | echo " " | |
2515 | set dflt bin bin | |
2516 | eval $prefixit | |
2517 | fn=d~ | |
2518 | rp='Pathname where the public executables will reside?' | |
2519 | . ./getfile | |
2520 | if $test "X$ansexp" != "X$binexp"; then | |
2521 | installbin='' | |
2522 | fi | |
2523 | bin="$ans" | |
2524 | binexp="$ansexp" | |
8e07c86e AD |
2525 | if $afs; then |
2526 | $cat <<EOM | |
2527 | ||
2528 | Since you are running AFS, I need to distinguish the directory in which | |
4633a7c4 | 2529 | executables reside from the directory in which they are installed (and from |
8e07c86e AD |
2530 | which they are presumably copied to the former directory by occult means). |
2531 | ||
2532 | EOM | |
4633a7c4 LW |
2533 | case "$installbin" in |
2534 | '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;; | |
2535 | *) dflt="$installbin";; | |
8e07c86e AD |
2536 | esac |
2537 | fn=de~ | |
4633a7c4 | 2538 | rp='Where will public executables be installed?' |
8e07c86e | 2539 | . ./getfile |
4633a7c4 | 2540 | installbin="$ans" |
8e07c86e | 2541 | else |
4633a7c4 | 2542 | installbin="$binexp" |
8e07c86e AD |
2543 | fi |
2544 | ||
8e07c86e AD |
2545 | : determine where manual pages go |
2546 | set man1dir man1dir none | |
2547 | eval $prefixit | |
2548 | $cat <<EOM | |
2549 | ||
2550 | $spackage has manual pages available in source form. | |
2551 | EOM | |
2552 | case "$nroff" in | |
2553 | nroff) | |
2554 | echo "However, you don't have nroff, so they're probably useless to you." | |
2555 | case "$man1dir" in | |
2556 | '') man1dir="none";; | |
2557 | esac;; | |
2558 | esac | |
2559 | echo "If you don't want the manual sources installed, answer 'none'." | |
2560 | case "$man1dir" in | |
2561 | '') | |
25f94b33 AD |
2562 | lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1" |
2563 | lookpath="$lookpath $prefixexp/man/p_man/man1" | |
2564 | lookpath="$lookpath $prefixexp/man/u_man/man1" | |
2565 | : If prefix contains 'perl' then we want to keep the man pages | |
2566 | : under the prefix directory. Otherwise, look in a variety of | |
2567 | : other possible places. This is debatable, but probably a | |
2568 | : good compromise. | |
2569 | case "$prefix" in | |
2570 | *perl*) ;; | |
2571 | *) lookpath="$lookpath /usr/local/man/man1" | |
2572 | lookpath="$lookpath /opt/local/man/man1" | |
2573 | lookpath="$lookpath /usr/local/man/man.1" | |
2574 | lookpath="$lookpath /opt/local/man/man.1" | |
2575 | lookpath="$lookpath /usr/man/local/man1" | |
2576 | lookpath="$lookpath /usr/man/l_man/man1" | |
2577 | lookpath="$lookpath /usr/man/p_man/man1" | |
2578 | lookpath="$lookpath /usr/man/u_man/man1" | |
2579 | lookpath="$lookpath /usr/man/man.L" | |
2580 | lookpath="$lookpath /usr/man/man.l" | |
2581 | ;; | |
2582 | esac | |
2583 | dflt=`./loc . $prefixexp/man/man1 $lookpath` | |
8e07c86e AD |
2584 | set dflt |
2585 | eval $prefixup | |
2586 | ;; | |
2587 | ' ') dflt=none;; | |
2588 | *) dflt="$man1dir" | |
2589 | ;; | |
2590 | esac | |
2591 | echo " " | |
4633a7c4 | 2592 | fn=dn+~ |
8e07c86e AD |
2593 | rp="Where do the main $spackage manual pages (source) go?" |
2594 | . ./getfile | |
25f94b33 | 2595 | if $test "X$man1direxp" != "X$ansexp"; then |
8e07c86e AD |
2596 | installman1dir='' |
2597 | fi | |
2598 | man1dir="$ans" | |
2599 | man1direxp="$ansexp" | |
2600 | case "$man1dir" in | |
2601 | '') man1dir=' ' | |
2602 | installman1dir='';; | |
2603 | esac | |
2604 | if $afs; then | |
2605 | $cat <<EOM | |
2606 | ||
2607 | Since you are running AFS, I need to distinguish the directory in which | |
2608 | manual pages reside from the directory in which they are installed (and from | |
2609 | which they are presumably copied to the former directory by occult means). | |
2610 | ||
2611 | EOM | |
2612 | case "$installman1dir" in | |
2613 | '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;; | |
2614 | *) dflt="$installman1dir";; | |
2615 | esac | |
2616 | fn=de~ | |
2617 | rp='Where will man pages be installed?' | |
2618 | . ./getfile | |
2619 | installman1dir="$ans" | |
2620 | else | |
2621 | installman1dir="$man1direxp" | |
2622 | fi | |
2623 | ||
2624 | : What suffix to use on installed man pages | |
2625 | ||
2626 | case "$man1dir" in | |
2627 | ' ') | |
2628 | man1ext='0' | |
2629 | ;; | |
2630 | *) | |
2631 | rp="What suffix should be used for the main $spackage man pages?" | |
2632 | case "$man1dir" in | |
2633 | *1) dflt=1 ;; | |
2634 | *1p) dflt=1p ;; | |
2635 | *1pm) dflt=1pm ;; | |
2636 | *l) dflt=l;; | |
2637 | *n) dflt=n;; | |
2638 | *o) dflt=o;; | |
2639 | *p) dflt=p;; | |
2640 | *C) dflt=C;; | |
2641 | *L) dflt=L;; | |
2642 | *L1) dflt=L1;; | |
2643 | *) dflt=1;; | |
2644 | esac | |
2645 | . ./myread | |
2646 | man1ext="$ans" | |
2647 | ;; | |
2648 | esac | |
2649 | ||
8e07c86e AD |
2650 | : see if we can have long filenames |
2651 | echo " " | |
2652 | rmlist="$rmlist /tmp/cf$$" | |
2653 | $test -d /tmp/cf$$ || mkdir /tmp/cf$$ | |
2654 | first=123456789abcdef | |
2655 | second=/tmp/cf$$/$first | |
2656 | $rm -f $first $second | |
2657 | if (echo hi >$first) 2>/dev/null; then | |
2658 | if $test -f 123456789abcde; then | |
2659 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
2660 | val="$undef" | |
2661 | else | |
2662 | if (echo hi >$second) 2>/dev/null; then | |
2663 | if $test -f /tmp/cf$$/123456789abcde; then | |
2664 | $cat <<'EOM' | |
2665 | That's peculiar... You can have filenames longer than 14 characters, but only | |
2666 | on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems | |
2667 | I shall consider your system cannot support long filenames at all. | |
2668 | EOM | |
2669 | val="$undef" | |
2670 | else | |
2671 | echo 'You can have filenames longer than 14 characters.' >&4 | |
2672 | val="$define" | |
2673 | fi | |
2674 | else | |
2675 | $cat <<'EOM' | |
2676 | How confusing! Some of your filesystems are sane enough to allow filenames | |
2677 | longer than 14 characters but some others like /tmp can't even think about them. | |
2678 | So, for now on, I shall assume your kernel does not allow them at all. | |
2679 | EOM | |
2680 | val="$undef" | |
2681 | fi | |
2682 | fi | |
2683 | else | |
2684 | $cat <<'EOM' | |
2685 | You can't have filenames longer than 14 chars. You can't even think about them! | |
2686 | EOM | |
2687 | val="$undef" | |
2688 | fi | |
2689 | set d_flexfnam | |
2690 | eval $setvar | |
2691 | $rm -rf /tmp/cf$$ 123456789abcde* | |
2692 | ||
2693 | : determine where library module manual pages go | |
2694 | set man3dir man3dir none | |
2695 | eval $prefixit | |
2696 | $cat <<EOM | |
2697 | ||
2698 | $spackage has manual pages for many of the library modules. | |
2699 | EOM | |
2700 | ||
2701 | case "$nroff" in | |
2702 | nroff) | |
2703 | $cat <<'EOM' | |
2704 | However, you don't have nroff, so they're probably useless to you. | |
2705 | You can use the supplied perldoc script instead. | |
2706 | EOM | |
2707 | case "$man3dir" in | |
2708 | '') man3dir="none";; | |
2709 | esac;; | |
2710 | esac | |
2711 | ||
2712 | case "$d_flexfnam" in | |
2713 | undef) | |
2714 | $cat <<'EOM' | |
2715 | However, your system can't handle the long file names like File::Basename.3. | |
2716 | You can use the supplied perldoc script instead. | |
2717 | EOM | |
2718 | case "$man3dir" in | |
2719 | '') man3dir="none";; | |
2720 | esac;; | |
2721 | esac | |
2722 | ||
2723 | echo "If you don't want the manual sources installed, answer 'none'." | |
4633a7c4 LW |
2724 | : We dont use /usr/local/man/man3 because some man programs will |
2725 | : only show the /usr/local/man/man3 contents, and not the system ones, | |
2726 | : thus man less will show the perl module less.pm, but not the system | |
2727 | : less command. We might also conflict with TCL man pages. | |
2728 | : However, something like /opt/perl/man/man3 is fine. | |
8e07c86e | 2729 | case "$man3dir" in |
4633a7c4 LW |
2730 | '') case "$prefix" in |
2731 | *perl*) dflt=`echo $man1dir | $sed 's/man1/man3/g'` ;; | |
2732 | *) dflt="$privlib/man/man3" ;; | |
2733 | esac | |
2734 | ;; | |
8e07c86e AD |
2735 | ' ') dflt=none;; |
2736 | *) dflt="$man3dir" ;; | |
2737 | esac | |
2738 | echo " " | |
2739 | ||
4633a7c4 | 2740 | fn=dn+~ |
8e07c86e AD |
2741 | rp="Where do the $spackage library man pages (source) go?" |
2742 | . ./getfile | |
2743 | if test "X$man3direxp" != "X$ansexp"; then | |
2744 | installman3dir='' | |
2745 | fi | |
2746 | ||
2747 | man3dir="$ans" | |
2748 | man3direxp="$ansexp" | |
2749 | case "$man3dir" in | |
2750 | '') man3dir=' ' | |
2751 | installman3dir='';; | |
2752 | esac | |
2753 | if $afs; then | |
2754 | $cat <<EOM | |
2755 | ||
2756 | Since you are running AFS, I need to distinguish the directory in which | |
2757 | manual pages reside from the directory in which they are installed (and from | |
2758 | which they are presumably copied to the former directory by occult means). | |
2759 | ||
2760 | EOM | |
2761 | case "$installman3dir" in | |
2762 | '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;; | |
2763 | *) dflt="$installman3dir";; | |
2764 | esac | |
2765 | fn=de~ | |
2766 | rp='Where will man pages be installed?' | |
2767 | . ./getfile | |
2768 | installman3dir="$ans" | |
2769 | else | |
2770 | installman3dir="$man3direxp" | |
2771 | fi | |
2772 | ||
2773 | : What suffix to use on installed man pages | |
2774 | ||
2775 | case "$man3dir" in | |
2776 | ' ') | |
2777 | man3ext='0' | |
2778 | ;; | |
2779 | *) | |
2780 | rp="What suffix should be used for the $spackage library man pages?" | |
2781 | case "$man3dir" in | |
2782 | *3) dflt=3 ;; | |
2783 | *3p) dflt=3p ;; | |
2784 | *3pm) dflt=3pm ;; | |
2785 | *l) dflt=l;; | |
2786 | *n) dflt=n;; | |
2787 | *o) dflt=o;; | |
2788 | *p) dflt=p;; | |
2789 | *C) dflt=C;; | |
2790 | *L) dflt=L;; | |
2791 | *L3) dflt=L3;; | |
2792 | *) dflt=3;; | |
2793 | esac | |
2794 | . ./myread | |
2795 | man3ext="$ans" | |
2796 | ;; | |
2797 | esac | |
2798 | ||
4633a7c4 LW |
2799 | : determine where public executable scripts go |
2800 | set scriptdir scriptdir | |
2801 | eval $prefixit | |
2802 | case "$scriptdir" in | |
2803 | '') | |
2804 | dflt="$bin" | |
2805 | : guess some guesses | |
2806 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
2807 | $test -d /usr/share/bin && dflt=/usr/share/bin | |
2808 | $test -d /usr/local/script && dflt=/usr/local/script | |
2809 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
2810 | set dflt | |
2811 | eval $prefixup | |
2812 | ;; | |
2813 | *) dflt="$scriptdir" | |
8e07c86e | 2814 | ;; |
8e07c86e | 2815 | esac |
4633a7c4 LW |
2816 | $cat <<EOM |
2817 | ||
2818 | Some installations have a separate directory just for executable scripts so | |
2819 | that they can mount it across multiple architectures but keep the scripts in | |
2820 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
2821 | Or you might just lump your scripts in with all your other executables. | |
2822 | ||
2823 | EOM | |
2824 | fn=d~ | |
2825 | rp='Where do you keep publicly executable scripts?' | |
2826 | . ./getfile | |
2827 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
2828 | installscript='' | |
8e07c86e | 2829 | fi |
4633a7c4 LW |
2830 | scriptdir="$ans" |
2831 | scriptdirexp="$ansexp" | |
2832 | if $afs; then | |
2833 | $cat <<EOM | |
8e07c86e | 2834 | |
4633a7c4 LW |
2835 | Since you are running AFS, I need to distinguish the directory in which |
2836 | scripts reside from the directory in which they are installed (and from | |
2837 | which they are presumably copied to the former directory by occult means). | |
2838 | ||
2839 | EOM | |
2840 | case "$installscript" in | |
2841 | '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;; | |
2842 | *) dflt="$installscript";; | |
8e07c86e | 2843 | esac |
4633a7c4 LW |
2844 | fn=de~ |
2845 | rp='Where will public scripts be installed?' | |
2846 | . ./getfile | |
2847 | installscript="$ans" | |
2848 | else | |
2849 | installscript="$scriptdirexp" | |
8e07c86e AD |
2850 | fi |
2851 | ||
4633a7c4 LW |
2852 | : determine perl absolute location |
2853 | case "$perlpath" in | |
2854 | '') perlpath=$binexp/perl ;; | |
8e07c86e AD |
2855 | esac |
2856 | ||
4633a7c4 LW |
2857 | : figure out how to guarantee perl startup |
2858 | case "$startperl" in | |
2859 | '') | |
2860 | case "$sharpbang" in | |
2861 | *!) | |
2862 | $cat <<EOH | |
8e07c86e | 2863 | |
4633a7c4 LW |
2864 | I can use the #! construct to start perl on your system. This will |
2865 | make startup of perl scripts faster, but may cause problems if you | |
2866 | want to share those scripts and perl is not in a standard place | |
2867 | ($perlpath) on all your platforms. The alternative is to force | |
2868 | a shell by starting the script with a single ':' character. | |
8e07c86e | 2869 | |
4633a7c4 | 2870 | EOH |
37120919 AD |
2871 | dflt=$perlpath |
2872 | rp='What shall I put after the #! to start up perl ("none" to not use #!)?' | |
8e07c86e AD |
2873 | . ./myread |
2874 | case "$ans" in | |
37120919 AD |
2875 | none) startperl=": # use perl";; |
2876 | *) startperl="#!$ans";; | |
8e07c86e AD |
2877 | esac |
2878 | ;; | |
4633a7c4 LW |
2879 | *) startperl=": # use perl" |
2880 | ;; | |
8e07c86e | 2881 | esac |
4633a7c4 LW |
2882 | ;; |
2883 | esac | |
2884 | echo "I'll use $startperl to start perl scripts." | |
8e07c86e | 2885 | |
25f94b33 AD |
2886 | : determine where manual pages are on this system |
2887 | echo " " | |
2888 | case "$sysman" in | |
2889 | '') | |
2890 | syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1' | |
2891 | syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1" | |
2892 | syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1" | |
2893 | syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1" | |
2894 | syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1" | |
2895 | sysman=`./loc . /usr/man/man1 $syspath` | |
2896 | ;; | |
2897 | esac | |
2898 | if $test -d "$sysman"; then | |
2899 | echo "System manual is in $sysman." >&4 | |
2900 | else | |
2901 | echo "Could not find manual pages in source form." >&4 | |
2902 | fi | |
2903 | ||
4633a7c4 LW |
2904 | : see what memory models we can support |
2905 | case "$models" in | |
2906 | '') | |
2907 | $cat >pdp11.c <<'EOP' | |
2908 | main() { | |
2909 | #ifdef pdp11 | |
2910 | exit(0); | |
2911 | #else | |
2912 | exit(1); | |
2913 | #endif | |
2914 | } | |
2915 | EOP | |
2916 | cc -o pdp11 pdp11.c >/dev/null 2>&1 | |
2917 | if ./pdp11 2>/dev/null; then | |
2918 | dflt='unsplit split' | |
2919 | else | |
2920 | tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge` | |
2921 | case "$tans" in | |
2922 | X) dflt='none';; | |
2923 | *) if $test -d /lib/small || $test -d /usr/lib/small; then | |
2924 | dflt='small' | |
2925 | else | |
2926 | dflt='' | |
2927 | fi | |
2928 | if $test -d /lib/medium || $test -d /usr/lib/medium; then | |
2929 | dflt="$dflt medium" | |
2930 | fi | |
2931 | if $test -d /lib/large || $test -d /usr/lib/large; then | |
2932 | dflt="$dflt large" | |
2933 | fi | |
2934 | if $test -d /lib/huge || $test -d /usr/lib/huge; then | |
2935 | dflt="$dflt huge" | |
2936 | fi | |
2937 | esac | |
2938 | fi;; | |
2939 | *) dflt="$models";; | |
8e07c86e | 2940 | esac |
4633a7c4 LW |
2941 | $cat <<EOM |
2942 | ||
2943 | Some systems have different model sizes. On most systems they are called | |
2944 | small, medium, large, and huge. On the PDP11 they are called unsplit and | |
2945 | split. If your system doesn't support different memory models, say "none". | |
2946 | If you wish to force everything to one memory model, say "none" here and | |
2947 | put the appropriate flags later when it asks you for other cc and ld flags. | |
2948 | Venix systems may wish to put "none" and let the compiler figure things out. | |
2949 | (In the following question multiple model names should be space separated.) | |
8e07c86e | 2950 | |
4633a7c4 LW |
2951 | EOM |
2952 | rp="Which memory models are supported?" | |
8e07c86e | 2953 | . ./myread |
4633a7c4 | 2954 | models="$ans" |
8e07c86e | 2955 | |
4633a7c4 LW |
2956 | case "$models" in |
2957 | none) | |
2958 | small='' | |
2959 | medium='' | |
2960 | large='' | |
2961 | huge='' | |
2962 | unsplit='' | |
2963 | split='' | |
2964 | ;; | |
2965 | *split) | |
2966 | case "$split" in | |
2967 | '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \ | |
2968 | $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then | |
2969 | dflt='-i' | |
2970 | else | |
2971 | dflt='none' | |
2972 | fi;; | |
2973 | *) dflt="$split";; | |
8e07c86e | 2974 | esac |
4633a7c4 LW |
2975 | rp="What flag indicates separate I and D space?" |
2976 | . ./myread | |
2977 | tans="$ans" | |
2978 | case "$tans" in | |
2979 | none) tans='';; | |
8e07c86e | 2980 | esac |
4633a7c4 LW |
2981 | split="$tans" |
2982 | unsplit='';; | |
2983 | *large*|*small*|*medium*|*huge*) | |
2984 | case "$models" in | |
2985 | *large*) | |
2986 | case "$large" in | |
2987 | '') dflt='-Ml';; | |
2988 | *) dflt="$large";; | |
2989 | esac | |
2990 | rp="What flag indicates large model?" | |
2991 | . ./myread | |
2992 | tans="$ans" | |
2993 | case "$tans" in | |
2994 | none) tans=''; | |
2995 | esac | |
2996 | large="$tans";; | |
2997 | *) large='';; | |
8e07c86e | 2998 | esac |
4633a7c4 LW |
2999 | case "$models" in |
3000 | *huge*) case "$huge" in | |
3001 | '') dflt='-Mh';; | |
3002 | *) dflt="$huge";; | |
3003 | esac | |
3004 | rp="What flag indicates huge model?" | |
3005 | . ./myread | |
3006 | tans="$ans" | |
3007 | case "$tans" in | |
3008 | none) tans=''; | |
3009 | esac | |
3010 | huge="$tans";; | |
3011 | *) huge="$large";; | |
3012 | esac | |
3013 | case "$models" in | |
3014 | *medium*) case "$medium" in | |
3015 | '') dflt='-Mm';; | |
3016 | *) dflt="$medium";; | |
3017 | esac | |
3018 | rp="What flag indicates medium model?" | |
3019 | . ./myread | |
3020 | tans="$ans" | |
3021 | case "$tans" in | |
3022 | none) tans=''; | |
3023 | esac | |
3024 | medium="$tans";; | |
3025 | *) medium="$large";; | |
3026 | esac | |
3027 | case "$models" in | |
3028 | *small*) case "$small" in | |
3029 | '') dflt='none';; | |
3030 | *) dflt="$small";; | |
3031 | esac | |
3032 | rp="What flag indicates small model?" | |
3033 | . ./myread | |
3034 | tans="$ans" | |
3035 | case "$tans" in | |
3036 | none) tans=''; | |
3037 | esac | |
3038 | small="$tans";; | |
3039 | *) small='';; | |
3040 | esac | |
3041 | ;; | |
3042 | *) | |
3043 | echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4 | |
8e07c86e AD |
3044 | ;; |
3045 | esac | |
3046 | ||
4633a7c4 LW |
3047 | : make some quick guesses about what we are up against |
3048 | echo " " | |
3049 | $echo $n "Hmm... $c" | |
3050 | echo exit 1 >bsd | |
3051 | echo exit 1 >usg | |
3052 | echo exit 1 >v7 | |
3053 | echo exit 1 >osf1 | |
3054 | echo exit 1 >eunice | |
3055 | echo exit 1 >xenix | |
3056 | echo exit 1 >venix | |
3057 | d_bsd="$undef" | |
3058 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null | |
3059 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
3060 | then | |
3061 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
3062 | echo exit 0 >osf1 | |
3063 | elif test `echo abc | tr a-z A-Z` = Abc ; then | |
3064 | xxx=`./loc addbib blurfl $pth` | |
3065 | if $test -f $xxx; then | |
3066 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
3067 | echo exit 0 >bsd | |
3068 | echo exit 0 >usg | |
3069 | else | |
3070 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
3071 | echo "Looks kind of like an extended USG system, but we'll see..." | |
3072 | else | |
3073 | echo "Looks kind of like a USG system, but we'll see..." | |
8e07c86e | 3074 | fi |
4633a7c4 | 3075 | echo exit 0 >usg |
8e07c86e | 3076 | fi |
4633a7c4 LW |
3077 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then |
3078 | echo "Looks kind of like a BSD system, but we'll see..." | |
3079 | d_bsd="$define" | |
3080 | echo exit 0 >bsd | |
8e07c86e | 3081 | else |
4633a7c4 LW |
3082 | echo "Looks kind of like a Version 7 system, but we'll see..." |
3083 | echo exit 0 >v7 | |
8e07c86e | 3084 | fi |
4633a7c4 LW |
3085 | case "$eunicefix" in |
3086 | *unixtovms*) | |
3087 | $cat <<'EOI' | |
3088 | There is, however, a strange, musty smell in the air that reminds me of | |
3089 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
3090 | EOI | |
3091 | echo exit 0 >eunice | |
3092 | d_eunice="$define" | |
3093 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
3094 | ;; | |
a0d0e21e LW |
3095 | *) |
3096 | echo " " | |
4633a7c4 LW |
3097 | echo "Congratulations. You aren't running Eunice." |
3098 | d_eunice="$undef" | |
2304df62 AD |
3099 | ;; |
3100 | esac | |
4633a7c4 LW |
3101 | if test -f /xenix; then |
3102 | echo "Actually, this looks more like a XENIX system..." | |
3103 | echo exit 0 >xenix | |
3104 | d_xenix="$define" | |
3105 | else | |
3106 | echo " " | |
3107 | echo "It's not Xenix..." | |
3108 | d_xenix="$undef" | |
3109 | fi | |
3110 | chmod +x xenix | |
3111 | $eunicefix xenix | |
3112 | if test -f /venix; then | |
3113 | echo "Actually, this looks more like a VENIX system..." | |
3114 | echo exit 0 >venix | |
3115 | else | |
3116 | echo " " | |
3117 | if ./xenix; then | |
3118 | : null | |
2304df62 | 3119 | else |
4633a7c4 | 3120 | echo "Nor is it Venix..." |
2304df62 | 3121 | fi |
4633a7c4 LW |
3122 | fi |
3123 | chmod +x bsd usg v7 osf1 eunice xenix venix | |
3124 | $eunicefix bsd usg v7 osf1 eunice xenix venix | |
3125 | $rm -f foo | |
2304df62 | 3126 | |
4633a7c4 | 3127 | : see if we need a special compiler |
16d20bd9 | 3128 | echo " " |
4633a7c4 LW |
3129 | if ./usg; then |
3130 | case "$cc" in | |
3131 | '') case "$Mcc" in | |
3132 | /*) dflt='Mcc';; | |
3133 | *) case "$large" in | |
3134 | -M*) dflt='cc';; | |
3135 | *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then | |
3136 | if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then | |
3137 | dflt='cc' | |
3138 | else | |
3139 | dflt='cc -M' | |
3140 | fi | |
3141 | else | |
3142 | dflt='cc' | |
3143 | fi;; | |
3144 | esac;; | |
3145 | esac;; | |
3146 | *) dflt="$cc";; | |
3147 | esac | |
3148 | $cat <<'EOM' | |
3149 | On some systems the default C compiler will not resolve multiple global | |
3150 | references that happen to have the same name. On some such systems the "Mcc" | |
3151 | command may be used to force these to be resolved. On other systems a "cc -M" | |
3152 | command is required. (Note that the -M flag on other systems indicates a | |
3153 | memory model to use!) If you have the Gnu C compiler, you might wish to use | |
3154 | that instead. | |
16d20bd9 AD |
3155 | |
3156 | EOM | |
4633a7c4 LW |
3157 | rp="What command will force resolution on this system?" |
3158 | . ./myread | |
3159 | cc="$ans" | |
16d20bd9 | 3160 | else |
4633a7c4 LW |
3161 | case "$cc" in |
3162 | '') dflt=cc;; | |
3163 | *) dflt="$cc";; | |
3164 | esac | |
3165 | rp="Use which C compiler?" | |
3166 | . ./myread | |
3167 | cc="$ans" | |
16d20bd9 | 3168 | fi |
4633a7c4 LW |
3169 | echo " " |
3170 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
3171 | $cat >gccvers.c <<EOM | |
3172 | #include <stdio.h> | |
3173 | int main() { | |
3174 | #ifdef __GNUC__ | |
3175 | #ifdef __VERSION__ | |
3176 | printf("%s\n", __VERSION__); | |
3177 | #else | |
3178 | printf("%s\n", "1"); | |
3179 | #endif | |
3180 | #endif | |
3181 | exit(0); | |
3182 | } | |
3183 | EOM | |
3184 | if $cc -o gccvers gccvers.c >/dev/null 2>&1; then | |
3185 | gccversion=`./gccvers` | |
3186 | case "$gccversion" in | |
3187 | '') echo "You are not using GNU cc." ;; | |
3188 | *) echo "You are using GNU cc $gccversion." ;; | |
16d20bd9 | 3189 | esac |
4633a7c4 | 3190 | else |
16d20bd9 | 3191 | echo " " |
4633a7c4 LW |
3192 | echo "*** WHOA THERE!!! ***" >&4 |
3193 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
3194 | case "$knowitall" in | |
3195 | '') | |
3196 | echo " You'd better start hunting for one and let me know about it." >&4 | |
16d20bd9 AD |
3197 | exit 1 |
3198 | ;; | |
3199 | esac | |
4633a7c4 LW |
3200 | fi |
3201 | $rm -f gccvers* | |
3202 | case "$gccversion" in | |
3203 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
16d20bd9 | 3204 | esac |
16d20bd9 | 3205 | |
4633a7c4 | 3206 | : What should the include directory be ? |
2304df62 | 3207 | echo " " |
4633a7c4 LW |
3208 | $echo $n "Hmm... $c" |
3209 | dflt='/usr/include' | |
3210 | incpath='' | |
3211 | mips_type='' | |
3212 | if $test -f /bin/mips && /bin/mips; then | |
3213 | echo "Looks like a MIPS system..." | |
3214 | $cat >usr.c <<'EOCP' | |
3215 | #ifdef SYSTYPE_BSD43 | |
3216 | /bsd43 | |
3217 | #endif | |
3218 | EOCP | |
3219 | if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then | |
3220 | dflt='/bsd43/usr/include' | |
3221 | incpath='/bsd43' | |
3222 | mips_type='BSD 4.3' | |
2304df62 | 3223 | else |
4633a7c4 | 3224 | mips_type='System V' |
2304df62 | 3225 | fi |
4633a7c4 LW |
3226 | $rm -f usr.c usr.out |
3227 | echo "and you're compiling with the $mips_type compiler and libraries." | |
3228 | xxx_prompt=y | |
3229 | echo "exit 0" >mips | |
3230 | else | |
3231 | echo "Doesn't look like a MIPS system." | |
3232 | xxx_prompt=n | |
3233 | echo "exit 1" >mips | |
3234 | fi | |
3235 | chmod +x mips | |
3236 | $eunicefix mips | |
2304df62 | 3237 | echo " " |
4633a7c4 LW |
3238 | case "$usrinc" in |
3239 | '') ;; | |
3240 | *) dflt="$usrinc";; | |
2304df62 | 3241 | esac |
4633a7c4 LW |
3242 | case "$xxx_prompt" in |
3243 | y) fn=d/ | |
3244 | rp='Where are the include files you want to use?' | |
3245 | . ./getfile | |
3246 | usrinc="$ans" | |
2304df62 | 3247 | ;; |
4633a7c4 | 3248 | *) usrinc="$dflt" |
2304df62 AD |
3249 | ;; |
3250 | esac | |
2304df62 | 3251 | |
4633a7c4 | 3252 | : see how we invoke the C preprocessor |
2304df62 | 3253 | echo " " |
4633a7c4 LW |
3254 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 |
3255 | cat <<'EOT' >testcpp.c | |
3256 | #define ABC abc | |
3257 | #define XYZ xyz | |
3258 | ABC.XYZ | |
3259 | EOT | |
3260 | cd .. | |
3261 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
3262 | chmod 755 cppstdin | |
3263 | wrapper=`pwd`/cppstdin | |
3264 | ok='false' | |
3265 | cd UU | |
3266 | ||
3267 | if $test "X$cppstdin" != "X" && \ | |
3268 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
3269 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3270 | then | |
3271 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
3272 | case "$cpprun" in | |
3273 | '') echo "But let's see if we can live without a wrapper..." ;; | |
3274 | *) | |
3275 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
3276 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3277 | then | |
3278 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" | |
3279 | ok='true' | |
a0d0e21e | 3280 | else |
4633a7c4 | 3281 | echo "(However, $cpprun $cpplast does not work, let's see...)" |
2304df62 | 3282 | fi |
2304df62 | 3283 | ;; |
2304df62 | 3284 | esac |
4633a7c4 LW |
3285 | else |
3286 | case "$cppstdin" in | |
3287 | '') ;; | |
3288 | *) | |
3289 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
3290 | ;; | |
3291 | esac | |
3292 | fi | |
3293 | ||
3294 | if $ok; then | |
3295 | : nothing | |
3296 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
3297 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
3298 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3299 | echo "Yup, it does." | |
3300 | x_cpp="$cc -E" | |
3301 | x_minus=''; | |
3302 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
3303 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
3304 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3305 | echo "Yup, it does." | |
3306 | x_cpp="$cc -E" | |
3307 | x_minus='-'; | |
3308 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
3309 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
3310 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3311 | echo "Yipee, that works!" | |
3312 | x_cpp="$cc -P" | |
3313 | x_minus=''; | |
3314 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
3315 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
3316 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3317 | echo "At long last!" | |
3318 | x_cpp="$cc -P" | |
3319 | x_minus='-'; | |
3320 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
3321 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
3322 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3323 | echo "It works!" | |
3324 | x_cpp="$cpp" | |
3325 | x_minus=''; | |
3326 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
3327 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
3328 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3329 | echo "Hooray, it works! I was beginning to wonder." | |
3330 | x_cpp="$cpp" | |
3331 | x_minus='-'; | |
3332 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
3333 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3334 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3335 | x_cpp="$wrapper" | |
3336 | x_minus='' | |
3337 | echo "Eureka!" | |
3338 | else | |
3339 | dflt='' | |
3340 | rp="No dice. I can't find a C preprocessor. Name one:" | |
3341 | . ./myread | |
3342 | x_cpp="$ans" | |
3343 | x_minus='' | |
3344 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
3345 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3346 | echo "OK, that will do." >&4 | |
3347 | else | |
3348 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
3349 | exit 1 | |
3350 | fi | |
3351 | fi | |
3352 | ||
3353 | case "$ok" in | |
3354 | false) | |
3355 | cppstdin="$x_cpp" | |
3356 | cppminus="$x_minus" | |
3357 | cpprun="$x_cpp" | |
3358 | cpplast="$x_minus" | |
3359 | set X $x_cpp | |
3360 | shift | |
3361 | case "$1" in | |
3362 | "$cpp") | |
3363 | echo "Perhaps can we force $cc -E using a wrapper..." | |
3364 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3365 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3366 | then | |
3367 | echo "Yup, we can." | |
3368 | cppstdin="$wrapper" | |
3369 | cppminus=''; | |
3370 | else | |
3371 | echo "Nope, we'll have to live without it..." | |
3372 | fi | |
3373 | ;; | |
3374 | esac | |
3375 | case "$cpprun" in | |
3376 | "$wrapper") | |
3377 | cpprun='' | |
3378 | cpplast='' | |
3379 | ;; | |
3380 | esac | |
3381 | ;; | |
3382 | esac | |
3383 | ||
3384 | case "$cppstdin" in | |
3385 | "$wrapper") ;; | |
3386 | *) $rm -f $wrapper;; | |
3387 | esac | |
3388 | $rm -f testcpp.c testcpp.out | |
3389 | ||
3390 | : Set private lib path | |
3391 | case "$plibpth" in | |
3392 | '') if ./mips; then | |
3393 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
3394 | fi;; | |
3395 | esac | |
3396 | case "$libpth" in | |
3397 | ' ') dlist='';; | |
3398 | '') dlist="$loclibpth $plibpth $glibpth";; | |
3399 | *) dlist="$libpth";; | |
3400 | esac | |
3401 | ||
3402 | : Now check and see which directories actually exist, avoiding duplicates | |
3403 | libpth='' | |
3404 | for xxx in $dlist | |
3405 | do | |
3406 | if $test -d $xxx; then | |
3407 | case " $libpth " in | |
3408 | *" $xxx "*) ;; | |
3409 | *) libpth="$libpth $xxx";; | |
3410 | esac | |
3411 | fi | |
3412 | done | |
3413 | $cat <<'EOM' | |
3414 | ||
3415 | Some systems have incompatible or broken versions of libraries. Among | |
3416 | the directories listed in the question below, please remove any you | |
3417 | know not to be holding relevant libraries, and add any that are needed. | |
3418 | Say "none" for none. | |
3419 | ||
3420 | EOM | |
3421 | case "$libpth" in | |
3422 | '') dflt='none';; | |
3423 | *) | |
3424 | set X $libpth | |
3425 | shift | |
3426 | dflt=${1+"$@"} | |
3427 | ;; | |
3428 | esac | |
3429 | rp="Directories to use for library searches?" | |
3430 | . ./myread | |
3431 | case "$ans" in | |
3432 | none) libpth=' ';; | |
3433 | *) libpth="$ans";; | |
3434 | esac | |
3435 | ||
3436 | : determine optimize, if desired, or use for debug flag also | |
3437 | case "$optimize" in | |
3438 | ' ') dflt='none';; | |
3439 | '') dflt='-O';; | |
3440 | *) dflt="$optimize";; | |
3441 | esac | |
3442 | $cat <<EOH | |
3443 | ||
3444 | Some C compilers have problems with their optimizers, by default, $package | |
3445 | compiles with the -O flag to use the optimizer. Alternately, you might want | |
3446 | to use the symbolic debugger, which uses the -g flag (on traditional Unix | |
3447 | systems). Either flag can be specified here. To use neither flag, specify | |
3448 | the word "none". | |
3449 | ||
3450 | EOH | |
3451 | rp="What optimizer/debugger flag should be used?" | |
3452 | . ./myread | |
3453 | optimize="$ans" | |
3454 | case "$optimize" in | |
3455 | 'none') optimize=" ";; | |
3456 | esac | |
3457 | ||
3458 | dflt='' | |
25f94b33 AD |
3459 | : We will not override a previous value, but we might want to |
3460 | : augment a hint file | |
3461 | case "$hint" in | |
3462 | none|recommended) | |
4633a7c4 LW |
3463 | case "$gccversion" in |
3464 | 1*) dflt='-fpcc-struct-return' ;; | |
3465 | esac | |
3466 | case "$optimize" in | |
3467 | *-g*) dflt="$dflt -DDEBUGGING";; | |
3468 | esac | |
3469 | case "$gccversion" in | |
3470 | 2*) if test -d /etc/conf/kconfig.d && | |
3471 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
3472 | then | |
3473 | dflt="$dflt -posix" | |
3474 | fi | |
3475 | ;; | |
3476 | esac | |
3477 | ;; | |
3478 | esac | |
3479 | ||
3480 | case "$mips_type" in | |
3481 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
3482 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
3483 | esac | |
3484 | for thisincl in $inclwanted; do | |
3485 | if $test -d $thisincl; then | |
3486 | if $test x$thisincl != x$usrinc; then | |
3487 | case "$dflt" in | |
3488 | *$thisincl*);; | |
3489 | *) dflt="$dflt -I$thisincl";; | |
3490 | esac | |
3491 | fi | |
3492 | fi | |
3493 | done | |
3494 | ||
3495 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then | |
3496 | xxx=true; | |
3497 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
3498 | xxx=true; | |
3499 | else | |
3500 | xxx=false; | |
3501 | fi; | |
3502 | if $xxx; then | |
3503 | case "$dflt" in | |
3504 | *$2*);; | |
3505 | *) dflt="$dflt -D$2";; | |
3506 | esac; | |
3507 | fi' | |
3508 | ||
3509 | if ./osf1; then | |
3510 | set signal.h __LANGUAGE_C__; eval $inctest | |
3511 | else | |
3512 | set signal.h LANGUAGE_C; eval $inctest | |
3513 | fi | |
3514 | set signal.h NO_PROTOTYPE; eval $inctest | |
3515 | set signal.h _NO_PROTO; eval $inctest | |
3516 | ||
25f94b33 AD |
3517 | case "$hint" in |
3518 | none|recommended) dflt="$ccflags $dflt" ;; | |
4633a7c4 LW |
3519 | *) dflt="$ccflags";; |
3520 | esac | |
25f94b33 AD |
3521 | |
3522 | case "$dflt" in | |
3523 | ''|' ') dflt=none;; | |
3524 | esac | |
4633a7c4 LW |
3525 | $cat <<EOH |
3526 | ||
3527 | Your C compiler may want other flags. For this question you should include | |
3528 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
3529 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
3530 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
3531 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE, | |
3532 | -DHIDEMYMALLOC or -DCRIPPLED_CC. | |
3533 | ||
3534 | To use no flags, specify the word "none". | |
3535 | ||
3536 | EOH | |
3537 | set X $dflt | |
3538 | shift | |
3539 | dflt=${1+"$@"} | |
3540 | rp="Any additional cc flags?" | |
3541 | . ./myread | |
3542 | case "$ans" in | |
3543 | none) ccflags='';; | |
3544 | *) ccflags="$ans";; | |
3545 | esac | |
3546 | ||
3547 | : the following weeds options from ccflags that are of no interest to cpp | |
3548 | cppflags="$ccflags" | |
3549 | case "$gccversion" in | |
3550 | 1*) cppflags="$cppflags -D__GNUC__" | |
3551 | esac | |
3552 | case "$mips_type" in | |
3553 | '');; | |
3554 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
3555 | esac | |
3556 | case "$cppflags" in | |
3557 | '');; | |
3558 | *) | |
3559 | echo " " | |
3560 | echo "Let me guess what the preprocessor flags are..." >&4 | |
3561 | set X $cppflags | |
3562 | shift | |
3563 | cppflags='' | |
3564 | $cat >cpp.c <<'EOM' | |
3565 | #define BLURFL foo | |
3566 | ||
3567 | BLURFL xx LFRULB | |
3568 | EOM | |
3569 | previous='' | |
3570 | for flag in $* | |
3571 | do | |
3572 | case "$flag" in | |
3573 | -*) ftry="$flag";; | |
3574 | *) ftry="$previous $flag";; | |
3575 | esac | |
3576 | if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \ | |
3577 | >cpp1.out 2>/dev/null && \ | |
3578 | $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \ | |
3579 | >cpp2.out 2>/dev/null && \ | |
3580 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
3581 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
3582 | then | |
3583 | cppflags="$cppflags $ftry" | |
3584 | previous='' | |
3585 | else | |
3586 | previous="$flag" | |
3587 | fi | |
3588 | done | |
3589 | set X $cppflags | |
3590 | shift | |
3591 | cppflags=${1+"$@"} | |
3592 | case "$cppflags" in | |
3593 | *-*) echo "They appear to be: $cppflags";; | |
3594 | esac | |
3595 | $rm -f cpp.c cpp?.out | |
3596 | ;; | |
3597 | esac | |
3598 | ||
3599 | : flags used in final linking phase | |
3600 | ||
3601 | case "$ldflags" in | |
3602 | '') if ./venix; then | |
3603 | dflt='-i -z' | |
3604 | else | |
3605 | dflt='' | |
3606 | fi | |
3607 | case "$ccflags" in | |
3608 | *-posix*) dflt="$dflt -posix" ;; | |
3609 | esac | |
3610 | ;; | |
3611 | *) dflt="$ldflags";; | |
3612 | esac | |
3613 | ||
3614 | : Try to guess additional flags to pick up local libraries. | |
3615 | for thislibdir in $libpth; do | |
3616 | case " $loclibpth " in | |
3617 | *" $thislibdir "*) | |
3618 | case "$dflt " in | |
25f94b33 | 3619 | *"-L$thislibdir "*) ;; |
4633a7c4 LW |
3620 | *) dflt="$dflt -L$thislibdir" ;; |
3621 | esac | |
3622 | ;; | |
3623 | esac | |
3624 | done | |
3625 | ||
3626 | case "$dflt" in | |
3627 | '') dflt='none' ;; | |
3628 | esac | |
3629 | ||
3630 | $cat <<EOH | |
3631 | ||
3632 | Your C linker may need flags. For this question you should | |
3633 | include -L/whatever and any other flags used by the C linker, but you | |
3634 | should NOT include libraries like -lwhatever. | |
3635 | ||
3636 | Make sure you include the appropriate -L/path flags if your C linker | |
3637 | does not normally search all of the directories you specified above, | |
3638 | namely | |
3639 | $libpth | |
3640 | To use no flags, specify the word "none". | |
3641 | ||
3642 | EOH | |
3643 | ||
3644 | rp="Any additional ld flags (NOT including libraries)?" | |
3645 | . ./myread | |
3646 | case "$ans" in | |
3647 | none) ldflags='';; | |
3648 | *) ldflags="$ans";; | |
3649 | esac | |
3650 | rmlist="$rmlist pdp11" | |
3651 | ||
3652 | : coherency check | |
3653 | echo " " | |
3654 | echo "Checking your choice of C compiler and flags for coherency..." >&4 | |
3655 | set X $cc $optimize $ccflags $ldflags try.c -o try | |
3656 | shift | |
3657 | $cat >try.msg <<EOM | |
3658 | I've tried to compile and run a simple program with: | |
3659 | ||
3660 | $* | |
3661 | ./try | |
3662 | ||
3663 | and I got the following output: | |
3664 | ||
3665 | EOM | |
3666 | $cat > try.c <<'EOF' | |
3667 | #include <stdio.h> | |
3668 | main() { exit(0); } | |
3669 | EOF | |
3670 | dflt=y | |
3671 | if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then | |
3672 | if sh -c './try' >>try.msg 2>&1; then | |
3673 | dflt=n | |
3674 | else | |
3675 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
3676 | rp="You have a problem. Shall I abort Configure" | |
3677 | dflt=y | |
3678 | fi | |
3679 | else | |
3680 | echo "I can't compile the test program." >>try.msg | |
3681 | rp="You have a BIG problem. Shall I abort Configure" | |
3682 | dflt=y | |
3683 | fi | |
3684 | case "$dflt" in | |
3685 | y) | |
3686 | $cat try.msg | |
3687 | case "$knowitall" in | |
3688 | '') | |
3689 | echo "(The supplied flags might be incorrect with this C compiler.)" | |
3690 | ;; | |
3691 | *) dflt=n;; | |
3692 | esac | |
3693 | echo " " | |
3694 | . ./myread | |
3695 | case "$ans" in | |
3696 | n*|N*) ;; | |
3697 | *) echo "Ok. Stopping Configure." >&4 | |
3698 | exit 1 | |
3699 | ;; | |
3700 | esac | |
3701 | ;; | |
3702 | n) echo "OK, that should do.";; | |
3703 | esac | |
3704 | $rm -f try try.* core | |
3705 | ||
3706 | : compute shared library extension | |
3707 | case "$so" in | |
3708 | '') | |
3709 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
3710 | dflt='sl' | |
3711 | else | |
3712 | dflt='so' | |
3713 | fi | |
3714 | ;; | |
3715 | *) dflt="$so";; | |
3716 | esac | |
3717 | $cat <<EOM | |
3718 | ||
3719 | On some systems, shared libraries may be available. Answer 'none' if | |
3720 | you want to suppress searching of shared libraries for the remaining | |
3721 | of this configuration. | |
3722 | ||
3723 | EOM | |
3724 | rp='What is the file extension used for shared libraries?' | |
3725 | . ./myread | |
3726 | so="$ans" | |
3727 | ||
3728 | : Looking for optional libraries | |
3729 | echo " " | |
3730 | echo "Checking for optional libraries..." >&4 | |
3731 | case "$libs" in | |
3732 | ' '|'') dflt='';; | |
3733 | *) dflt="$libs";; | |
3734 | esac | |
3735 | case "$libswanted" in | |
3736 | '') libswanted='c_s';; | |
3737 | esac | |
3738 | for thislib in $libswanted; do | |
3739 | ||
3740 | if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then | |
3741 | echo "Found -l$thislib (shared)." | |
3742 | case " $dflt " in | |
3743 | *"-l$thislib "*);; | |
3744 | *) dflt="$dflt -l$thislib";; | |
3745 | esac | |
3746 | elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then | |
3747 | echo "Found -l$thislib (shared)." | |
3748 | case " $dflt " in | |
3749 | *"-l$thislib "*);; | |
3750 | *) dflt="$dflt -l$thislib";; | |
3751 | esac | |
3752 | elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then | |
3753 | echo "Found -l$thislib." | |
3754 | case " $dflt " in | |
3755 | *"-l$thislib "*);; | |
3756 | *) dflt="$dflt -l$thislib";; | |
3757 | esac | |
3758 | elif xxx=`./loc $thislib.a X $libpth`; $test -f "$xxx"; then | |
3759 | echo "Found -l$thislib." | |
3760 | case " $dflt " in | |
3761 | *"-l$thislib "*);; | |
3762 | *) dflt="$dflt -l$thislib";; | |
3763 | esac | |
3764 | elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then | |
3765 | echo "Found -l${thislib}_s." | |
3766 | case " $dflt " in | |
3767 | *"-l$thislib "*);; | |
3768 | *) dflt="$dflt -l${thislib}_s";; | |
3769 | esac | |
3770 | elif xxx=`./loc Slib$thislib.a X $xlibpth`; $test -f "$xxx"; then | |
3771 | echo "Found -l$thislib." | |
3772 | case " $dflt " in | |
3773 | *"-l$thislib "*);; | |
3774 | *) dflt="$dflt -l$thislib";; | |
3775 | esac | |
3776 | else | |
3777 | echo "No -l$thislib." | |
3778 | fi | |
3779 | done | |
3780 | set X $dflt | |
3781 | shift | |
3782 | dflt="$*" | |
3783 | case "$libs" in | |
3784 | '') dflt="$dflt";; | |
3785 | *) dflt="$libs";; | |
3786 | esac | |
3787 | case "$dflt" in | |
3788 | ' '|'') dflt='none';; | |
3789 | esac | |
3790 | ||
3791 | $cat <<EOM | |
3792 | ||
3793 | Some versions of Unix support shared libraries, which make executables smaller | |
3794 | but make load time slightly longer. | |
3795 | ||
3796 | On some systems, mostly newer Unix System V's, the shared library is included | |
3797 | by putting the option "-lc_s" as the last thing on the cc command line when | |
3798 | linking. Other systems use shared libraries by default. There may be other | |
3799 | libraries needed to compile $package on your machine as well. If your system | |
3800 | needs the "-lc_s" option, include it here. Include any other special libraries | |
3801 | here as well. Say "none" for none. | |
3802 | EOM | |
3803 | ||
3804 | echo " " | |
3805 | rp="Any additional libraries?" | |
3806 | . ./myread | |
3807 | case "$ans" in | |
3808 | none) libs=' ';; | |
3809 | *) libs="$ans";; | |
3810 | esac | |
3811 | ||
3812 | : see if nm is to be used to determine whether a symbol is defined or not | |
3813 | case "$usenm" in | |
3814 | '') | |
3815 | dflt=`egrep 'inlibc|csym' ../Configure | wc -l 2>/dev/null` | |
3816 | if $test $dflt -gt 20; then | |
3817 | dflt=y | |
3818 | else | |
3819 | dflt=n | |
3820 | fi | |
3821 | ;; | |
3822 | *) | |
3823 | case "$usenm" in | |
3824 | true) dflt=y;; | |
3825 | *) dflt=n;; | |
3826 | esac | |
3827 | ;; | |
3828 | esac | |
3829 | $cat <<EOM | |
3830 | ||
3831 | I can use 'nm' to extract the symbols from your C libraries. This is a time | |
3832 | consuming task which may generate huge output on the disk (up to 3 megabytes) | |
3833 | but that should make the symbols extraction faster. The alternative is to skip | |
3834 | the 'nm' extraction part and to compile a small test program instead to | |
3835 | determine whether each symbol is present. If you have a fast C compiler and/or | |
3836 | if your 'nm' output cannot be parsed, this may be the best solution. | |
3837 | ||
3838 | EOM | |
3839 | rp='Shall I use nm to extract C symbols from the libraries?' | |
3840 | . ./myread | |
3841 | case "$ans" in | |
3842 | n|N) usenm=false;; | |
3843 | *) usenm=true;; | |
3844 | esac | |
3845 | ||
3846 | runnm=$usenm | |
3847 | case "$reuseval" in | |
3848 | true) runnm=false;; | |
3849 | esac | |
3850 | ||
3851 | : nm options which may be necessary | |
3852 | case "$nm_opt" in | |
3853 | '') if $test -f /mach_boot; then | |
3854 | nm_opt='' | |
3855 | elif $test -d /usr/ccs/lib; then | |
3856 | nm_opt='-p' | |
3857 | elif $test -f /dgux; then | |
3858 | nm_opt='-p' | |
3859 | else | |
3860 | nm_opt='' | |
3861 | fi;; | |
3862 | esac | |
3863 | ||
3864 | case "$runnm" in | |
3865 | true) | |
3866 | : get list of predefined functions in a handy place | |
3867 | echo " " | |
3868 | case "$libc" in | |
3869 | '') libc=unknown | |
3870 | case "$libs" in | |
3871 | *-lc_s*) libc=`./loc libc_s.a $libc $libpth` | |
3872 | esac | |
3873 | ;; | |
3874 | esac | |
3875 | libnames=''; | |
3876 | case "$libs" in | |
3877 | '') ;; | |
3878 | *) for thislib in $libs; do | |
3879 | case "$thislib" in | |
3880 | -lc|-lc_s) | |
3881 | : Handle C library specially below. | |
3882 | ;; | |
3883 | -l*) | |
3884 | thislib=`echo $thislib | $sed -e 's/^-l//'` | |
3885 | if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then | |
3886 | : | |
3887 | elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then | |
3888 | : | |
3889 | elif try=`./loc lib$thislib.a X $libpth`; $test -f "$try"; then | |
3890 | : | |
3891 | elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then | |
3892 | : | |
3893 | elif try=`./loc $thislib X $libpth`; $test -f "$try"; then | |
3894 | : | |
3895 | elif try=`./loc Slib$thislib.a X $xlibpth`; $test -f "$try"; then | |
3896 | : | |
3897 | else | |
3898 | try='' | |
3899 | fi | |
3900 | libnames="$libnames $try" | |
3901 | ;; | |
3902 | *) libnames="$libnames $thislib" ;; | |
3903 | esac | |
3904 | done | |
3905 | ;; | |
3906 | esac | |
3907 | xxx=normal | |
3908 | case "$libc" in | |
3909 | unknown) | |
3910 | set /usr/ccs/lib/libc.$so | |
3911 | $test -r $1 || set /usr/lib/libc.$so | |
a0d0e21e | 3912 | $test -r $1 || set /usr/shlib/libc.$so |
16d20bd9 AD |
3913 | $test -r $1 || \ |
3914 | set `echo blurfl; echo /usr/lib/libc.$so.[0-9]* | \ | |
3915 | tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e ' | |
3916 | h | |
3917 | s/[0-9][0-9]*/0000&/g | |
3918 | s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g | |
3919 | G | |
3920 | s/\n/ /' | \ | |
3921 | sort | $sed -e 's/^.* //'` | |
3922 | eval set \$$# | |
a0d0e21e | 3923 | $test -r $1 || set /lib/libc.$so |
2304df62 | 3924 | $test -r $1 || set /lib/libsys_s.a |
2304df62 AD |
3925 | ;; |
3926 | *) | |
3927 | set blurfl | |
3928 | ;; | |
3929 | esac | |
3930 | if $test -r "$1"; then | |
3931 | echo "Your (shared) C library seems to be in $1." | |
3932 | libc="$1" | |
3933 | elif $test -r /lib/libc && $test -r /lib/clib; then | |
3934 | echo "Your C library seems to be in both /lib/clib and /lib/libc." | |
3935 | xxx=apollo | |
3936 | libc='/lib/clib /lib/libc' | |
3937 | if $test -r /lib/syslib; then | |
3938 | echo "(Your math library is in /lib/syslib.)" | |
3939 | libc="$libc /lib/syslib" | |
3940 | fi | |
3941 | elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
3942 | echo "Your C library seems to be in $libc, as you said before." | |
3943 | elif $test -r $incpath/usr/lib/libc.a; then | |
3944 | libc=$incpath/usr/lib/libc.a; | |
3945 | echo "Your C library seems to be in $libc. That's fine." | |
3946 | elif $test -r /lib/libc.a; then | |
3947 | libc=/lib/libc.a; | |
3948 | echo "Your C library seems to be in $libc. You're normal." | |
3949 | else | |
3950 | if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then | |
3951 | : | |
3952 | elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then | |
3953 | libnames="$libnames "`./loc clib blurfl/dyick $libpth` | |
3954 | elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then | |
3955 | : | |
3956 | elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then | |
3957 | : | |
3958 | elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then | |
3959 | : | |
3960 | else | |
3961 | tans=`./loc Llibc.a blurfl/dyick $xlibpth` | |
3962 | fi | |
3963 | if $test -r "$tans"; then | |
3964 | echo "Your C library seems to be in $tans, of all places." | |
3965 | libc=$tans | |
3966 | else | |
3967 | libc='blurfl' | |
3968 | fi | |
3969 | fi | |
3970 | if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then | |
3971 | dflt="$libc" | |
3972 | cat <<EOM | |
3973 | ||
3974 | If the guess above is wrong (which it might be if you're using a strange | |
3975 | compiler, or your machine supports multiple models), you can override it here. | |
3976 | ||
3977 | EOM | |
3978 | else | |
3979 | dflt='' | |
3980 | echo $libpth | tr ' ' '\012' | sort | uniq > libpath | |
3981 | cat >&4 <<EOM | |
3982 | I can't seem to find your C library. I've looked in the following places: | |
3983 | ||
3984 | EOM | |
3985 | $sed 's/^/ /' libpath | |
3986 | cat <<EOM | |
3987 | ||
3988 | None of these seems to contain your C library. I need to get its name... | |
3989 | ||
3990 | EOM | |
3991 | fi | |
3992 | fn=f | |
3993 | rp='Where is your C library?' | |
3994 | . ./getfile | |
3995 | libc="$ans" | |
3996 | ||
3997 | echo " " | |
3998 | echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames | |
3999 | set X `cat libnames` | |
4000 | shift | |
4001 | xxx=files | |
4002 | case $# in 1) xxx=file; esac | |
4003 | echo "Extracting names from the following $xxx for later perusal:" >&4 | |
4004 | echo " " | |
4005 | $sed 's/^/ /' libnames >&4 | |
4006 | echo " " | |
4007 | $echo $n "This may take a while...$c" >&4 | |
ecfc5424 | 4008 | |
2304df62 AD |
4009 | nm $nm_opt $* 2>/dev/null >libc.tmp |
4010 | $echo $n ".$c" | |
4011 | $grep fprintf libc.tmp > libc.ptf | |
4012 | xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4' | |
4013 | xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4' | |
16d20bd9 AD |
4014 | xxx='[ADTSIW]' |
4015 | if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx //p'";\ | |
2304df62 AD |
4016 | eval $xscan;\ |
4017 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4018 | eval $xrun | |
4019 | elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\ | |
4020 | eval $xscan;\ | |
4021 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4022 | eval $xrun | |
4023 | elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\ | |
4024 | eval $xscan;\ | |
4025 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4026 | eval $xrun | |
4027 | elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\ | |
4028 | eval $xscan;\ | |
4029 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4030 | eval $xrun | |
4031 | elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\ | |
4032 | eval $xscan;\ | |
4033 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4034 | eval $xrun | |
4035 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\ | |
4036 | eval $xscan;\ | |
4037 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4038 | eval $xrun | |
4039 | elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \ | |
4040 | -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\ | |
4041 | eval $xscan;\ | |
4042 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4043 | eval $xrun | |
4044 | elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\ | |
4045 | eval $xscan;\ | |
4046 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4047 | eval $xrun | |
4048 | elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\ | |
4049 | eval $xscan;\ | |
4050 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4051 | eval $xrun | |
a0d0e21e LW |
4052 | elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\ |
4053 | eval $xscan;\ | |
4054 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4055 | eval $xrun | |
8e07c86e AD |
4056 | elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\ |
4057 | eval $xscan;\ | |
4058 | $contains '^fprintf$' libc.list >/dev/null 2>&1; then | |
4059 | eval $xrun | |
2304df62 AD |
4060 | else |
4061 | nm -p $* 2>/dev/null >libc.tmp | |
16d20bd9 AD |
4062 | $grep fprintf libc.tmp > libc.ptf |
4063 | if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\ | |
4064 | eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1 | |
4065 | then | |
2304df62 | 4066 | nm_opt='-p' |
16d20bd9 | 4067 | eval $xrun |
2304df62 AD |
4068 | else |
4069 | echo " " | |
4070 | echo "nm didn't seem to work right. Trying ar instead..." >&4 | |
4071 | com='' | |
4072 | if ar t $libc > libc.tmp; then | |
4073 | for thisname in $libnames; do | |
4074 | ar t $thisname >>libc.tmp | |
4075 | done | |
4076 | $sed -e 's/\.o$//' < libc.tmp > libc.list | |
4077 | echo "Ok." >&4 | |
4078 | else | |
4079 | echo "ar didn't seem to work right." >&4 | |
4080 | echo "Maybe this is a Cray...trying bld instead..." >&4 | |
16d20bd9 AD |
4081 | if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list |
4082 | then | |
2304df62 AD |
4083 | for thisname in $libnames; do |
4084 | bld t $libnames | \ | |
4085 | $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list | |
4086 | ar t $thisname >>libc.tmp | |
4087 | done | |
4088 | echo "Ok." >&4 | |
4089 | else | |
4090 | echo "That didn't work either. Giving up." >&4 | |
4091 | exit 1 | |
4092 | fi | |
4093 | fi | |
4094 | fi | |
4095 | fi | |
4096 | nm_extract="$com" | |
4097 | if $test -f /lib/syscalls.exp; then | |
4098 | echo " " | |
4099 | echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4 | |
4100 | $sed -n 's/^\([^ ]*\)[ ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list | |
4101 | fi | |
4102 | ;; | |
4103 | esac | |
4104 | $rm -f libnames libpath | |
4105 | ||
4106 | : is a C symbol defined? | |
4107 | csym='tlook=$1; | |
4108 | case "$3" in | |
4109 | -v) tf=libc.tmp; tc=""; tdc="";; | |
8e07c86e | 4110 | -a) tf=libc.tmp; tc="[0]"; tdc="[]";; |
2304df62 AD |
4111 | *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";; |
4112 | esac; | |
4113 | tx=yes; | |
4114 | case "$reuseval-$4" in | |
4115 | true-) ;; | |
4116 | true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;; | |
4117 | esac; | |
4118 | case "$tx" in | |
4119 | yes) | |
4120 | case "$runnm" in | |
4121 | true) | |
4122 | if $contains $tlook $tf >/dev/null 2>&1; | |
4123 | then tval=true; | |
4124 | else tval=false; | |
4125 | fi;; | |
4126 | *) | |
16d20bd9 | 4127 | echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c; |
8e07c86e | 4128 | if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1; |
2304df62 AD |
4129 | then tval=true; |
4130 | else tval=false; | |
4131 | fi; | |
4132 | $rm -f t t.c;; | |
4133 | esac;; | |
4134 | *) | |
8e07c86e AD |
4135 | case "$tval" in |
4136 | $define) tval=true;; | |
4137 | *) tval=false;; | |
4138 | esac;; | |
4139 | esac; | |
4140 | eval "$2=$tval"' | |
2304df62 AD |
4141 | |
4142 | : define an is-in-libc? function | |
4143 | inlibc='echo " "; td=$define; tu=$undef; | |
4144 | sym=$1; var=$2; eval "was=\$$2"; | |
4145 | tx=yes; | |
4146 | case "$reuseval$was" in | |
4147 | true) ;; | |
4148 | true*) tx=no;; | |
4149 | esac; | |
4150 | case "$tx" in | |
4151 | yes) | |
4152 | set $sym tres -f; | |
4153 | eval $csym; | |
4154 | case "$tres" in | |
4155 | true) | |
4156 | echo "$sym() found." >&4; | |
ecfc5424 | 4157 | case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";; |
2304df62 AD |
4158 | *) |
4159 | echo "$sym() NOT found." >&4; | |
ecfc5424 | 4160 | case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";; |
2304df62 AD |
4161 | esac;; |
4162 | *) | |
4163 | case "$was" in | |
4164 | $define) echo "$sym() found." >&4;; | |
4165 | *) echo "$sym() NOT found." >&4;; | |
4166 | esac;; | |
4167 | esac' | |
4168 | ||
8e07c86e AD |
4169 | : Check how to convert floats to strings. |
4170 | echo " " | |
4171 | echo "Checking for an efficient way to convert floats to strings." | |
4172 | $cat >try.c <<'EOP' | |
4173 | #ifdef TRY_gconvert | |
4174 | #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b)) | |
4175 | #endif | |
4176 | #ifdef TRY_gcvt | |
4177 | #define Gconvert(x,n,t,b) gcvt((x),(n),(b)) | |
4178 | #endif | |
4179 | #ifdef TRY_sprintf | |
4180 | #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) | |
4181 | #endif | |
a0d0e21e | 4182 | main() { |
ecfc5424 | 4183 | char buf[64]; |
8e07c86e | 4184 | Gconvert(1.0, 8, 0, buf); |
ecfc5424 AD |
4185 | if (buf[0] != '1' || buf[1] != '\0') |
4186 | exit(1); | |
8e07c86e | 4187 | Gconvert(0.0, 8, 0, buf); |
ecfc5424 AD |
4188 | if (buf[0] != '0' || buf[1] != '\0') |
4189 | exit(1); | |
8e07c86e | 4190 | Gconvert(-1.0, 8, 0, buf); |
ecfc5424 |