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