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