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