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