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