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