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