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