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