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