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