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