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