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