correctly clone eval context frames
[perl.git] / Configure
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 package (which contains metaconfig) is available via SVN:
17 #     svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
18 #
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
23 #
24 # The metaunits are also available from the public git repository:
25 #     http://perl5.git.perl.org/metaconfig.git/ or
26 #     $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
27 #
28 # See Porting/pumpkin.pod for more information on metaconfig.
29 #
30
31 # Generated on Thu Feb 16 16:57:30 CET 2012 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
33
34 cat >c1$$ <<EOF
35 ARGGGHHHH!!!!!
36
37 SCO csh still thinks true is false.  Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
39
40 (Actually, Configure ought to just patch csh in place.  Hmm.  Hmmmmm.  All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
42
43 [End of diatribe. We now return you to your regularly scheduled programming...]
44 EOF
45 cat >c2$$ <<EOF
46
47 OOPS!  You naughty creature!  You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
49 EOF
50
51 true || cat c1$$ c2$$
52 true || exec sh $0 $argv:q
53
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
56 rm -f c1$$ c2$$
57
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59         cat <<EOF
60 ***
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well.  (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
65 ***
66 EOF
67         exit 1
68 fi
69
70 if test ! -c /dev/null ; then
71         cat <<EOF
72 ***
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
75 *** in /dev.
76 *** Cannot continue, aborting.
77 ***
78 EOF
79         exit 1
80 fi
81
82 : compute my invocation name
83 me=$0
84 case "$0" in
85 */*)
86         me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
87         test "$me" || me=$0
88         ;;
89 esac
90
91 : Proper separator for the PATH environment variable
92 p_=:
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95         if test -n "$OS2_SHELL"; then
96                 p_=\;
97                 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98                 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
99                 is_os2=yes
100         elif test -n "$DJGPP"; then
101                 case "X${MACHTYPE:-nonesuchmach}" in
102                 *cygwin) ;;
103                 *) p_=\; ;;
104                 esac
105         fi
106 fi
107
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
118
119 for p in $paths
120 do
121         case "$p_$PATH$p_" in
122         *$p_$p$p_*) ;;
123         *) test -d $p && PATH=$PATH$p_$p ;;
124         esac
125 done
126
127 PATH=.$p_$PATH
128 export PATH
129
130 : shall we be using ksh?
131 inksh=''
132 needksh=''
133 avoidksh=''
134 newsh=/bin/ksh
135 changesh=''
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
137                 inksh=true
138 fi
139 if test -f /hp-ux -a -f /bin/ksh; then
140         needksh='to avoid sh bug in "here document" expansion'
141 fi
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143         if test X`/usr/bin/uname -v` = X4; then
144                 avoidksh="to avoid AIX 4's /bin/sh"
145                 newsh=/usr/bin/bsh
146         fi
147 fi
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149         if test X`/usr/bin/uname -s` = XOSF1; then
150                 avoidksh="to avoid Digital UNIX' ksh"
151                 newsh=/bin/sh
152                 unset BIN_SH
153         fi
154 fi
155 case "$inksh/$needksh" in
156 /[a-z]*)
157                 ENV=''
158                 changesh=true
159                 reason="$needksh"
160         ;;
161 esac
162 case "$inksh/$avoidksh" in
163 true/[a-z]*)
164         changesh=true
165         reason="$avoidksh"
166         ;;
167 esac
168 case "$inksh/$needksh-$avoidksh-" in
169 true/--)
170                 cat <<EOM
171 (I see you are using the Korn shell.  Some ksh's blow up on $me,
172 mainly on older exotic systems.  If yours does, try the Bourne shell instead.)
173 EOM
174         ;;
175 esac
176 case "$changesh" in
177 true)
178         export newsh
179         echo "(Feeding myself to $newsh $reason.)"
180         case "$0" in
181         Configure|*/Configure) exec $newsh $0 "$@";;
182         *) exec $newsh Configure "$@";;
183         esac
184         ;;
185 esac
186 test -x "${newsh}" || unset newsh
187
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
190 case "$CDPATH" in
191 '')     ;;
192 *)      case "$SHELL" in
193         *bash*) CDPATH='.' ;;
194         *) CDPATH='' ;;
195         esac
196         ;;
197 esac
198
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
201 cd UU && rm -f ./*
202
203 ccname=''
204 ccversion=''
205 ccsymbols=''
206 cppccsymbols=''
207 cppsymbols=''
208 from=''
209 run=''
210 targetarch=''
211 to=''
212 usecrosscompile=''
213 extern_C=''
214 mistrustnm=''
215 usedevel=''
216 perllibs=''
217 dynamic_ext=''
218 extensions=''
219 known_extensions=''
220 nonxs_ext=''
221 static_ext=''
222 useopcode=''
223 useposix=''
224 extras=''
225 d_bsd=''
226 d_eunice=''
227 d_xenix=''
228 eunicefix=''
229 ar=''
230 awk=''
231 bash=''
232 bison=''
233 byacc=''
234 cat=''
235 chgrp=''
236 chmod=''
237 chown=''
238 comm=''
239 compress=''
240 cp=''
241 cpio=''
242 cpp=''
243 csh=''
244 date=''
245 echo=''
246 egrep=''
247 emacs=''
248 expr=''
249 find=''
250 flex=''
251 gmake=''
252 grep=''
253 gzip=''
254 inews=''
255 ksh=''
256 less=''
257 line=''
258 lint=''
259 ln=''
260 lp=''
261 lpr=''
262 ls=''
263 mail=''
264 mailx=''
265 make=''
266 mkdir=''
267 more=''
268 mv=''
269 nm=''
270 nroff=''
271 perl=''
272 pg=''
273 pmake=''
274 pr=''
275 rm=''
276 rmail=''
277 sed=''
278 sendmail=''
279 shar=''
280 sleep=''
281 smail=''
282 sort=''
283 submit=''
284 tail=''
285 tar=''
286 tbl=''
287 tee=''
288 test=''
289 touch=''
290 tr=''
291 troff=''
292 uname=''
293 uniq=''
294 uuname=''
295 vi=''
296 zcat=''
297 zip=''
298 full_ar=''
299 full_sed=''
300 libswanted=''
301 hint=''
302 myuname=''
303 osname=''
304 osvers=''
305 Author=''
306 Date=''
307 Header=''
308 Id=''
309 Locker=''
310 Log=''
311 RCSfile=''
312 Revision=''
313 Source=''
314 State=''
315 _a=''
316 _exe=''
317 _o=''
318 archobjs=''
319 exe_ext=''
320 firstmakefile=''
321 lib_ext=''
322 obj_ext=''
323 path_sep=''
324 rm_try=''
325 afs=''
326 afsroot=''
327 alignbytes=''
328 ansi2knr=''
329 archlib=''
330 archlibexp=''
331 d_archlib=''
332 installarchlib=''
333 archname=''
334 myarchname=''
335 d_atolf=''
336 d_atoll=''
337 baserev=''
338 bin=''
339 binexp=''
340 initialinstalllocation=''
341 installbin=''
342 userelocatableinc=''
343 byteorder=''
344 cc=''
345 ccflags=''
346 cppflags=''
347 ldflags=''
348 lkflags=''
349 locincpth=''
350 optimize=''
351 cf_email=''
352 cf_by=''
353 cf_time=''
354 charbits=''
355 charsize=''
356 contains=''
357 cpp_stuff=''
358 cpplast=''
359 cppminus=''
360 cpprun=''
361 cppstdin=''
362 d__fwalk=''
363 d_access=''
364 d_accessx=''
365 d_aintl=''
366 d_alarm=''
367 asctime_r_proto=''
368 d_asctime_r=''
369 d_attribute_deprecated=''
370 d_attribute_format=''
371 d_attribute_malloc=''
372 d_attribute_nonnull=''
373 d_attribute_noreturn=''
374 d_attribute_pure=''
375 d_attribute_unused=''
376 d_attribute_warn_unused_result=''
377 d_printf_format_null=''
378 d_bcmp=''
379 d_bcopy=''
380 d_builtin_choose_expr=''
381 d_builtin_expect=''
382 d_bzero=''
383 d_c99_variadic_macros=''
384 d_casti32=''
385 castflags=''
386 d_castneg=''
387 d_chown=''
388 d_chroot=''
389 d_chsize=''
390 d_class=''
391 d_clearenv=''
392 d_closedir=''
393 d_void_closedir=''
394 d_cmsghdr_s=''
395 d_const=''
396 d_copysignl=''
397 d_cplusplus=''
398 cryptlib=''
399 d_crypt=''
400 crypt_r_proto=''
401 d_crypt_r=''
402 d_csh=''
403 full_csh=''
404 d_ctermid=''
405 ctermid_r_proto=''
406 d_ctermid_r=''
407 ctime_r_proto=''
408 d_ctime_r=''
409 d_cuserid=''
410 d_dbl_dig=''
411 d_dbminitproto=''
412 d_difftime=''
413 d_dir_dd_fd=''
414 d_dirfd=''
415 d_dlerror=''
416 d_dlopen=''
417 d_dlsymun=''
418 d_dosuid=''
419 d_suidsafe=''
420 d_drand48_r=''
421 drand48_r_proto=''
422 d_drand48proto=''
423 d_dup2=''
424 d_eaccess=''
425 d_endgrent=''
426 d_endgrent_r=''
427 endgrent_r_proto=''
428 d_endhent=''
429 d_endhostent_r=''
430 endhostent_r_proto=''
431 d_endnent=''
432 d_endnetent_r=''
433 endnetent_r_proto=''
434 d_endpent=''
435 d_endprotoent_r=''
436 endprotoent_r_proto=''
437 d_endpwent=''
438 d_endpwent_r=''
439 endpwent_r_proto=''
440 d_endsent=''
441 d_endservent_r=''
442 endservent_r_proto=''
443 d_faststdio=''
444 d_fchdir=''
445 d_fchmod=''
446 d_fchown=''
447 d_fcntl=''
448 d_fcntl_can_lock=''
449 d_fd_macros=''
450 d_fd_set=''
451 d_fds_bits=''
452 d_fgetpos=''
453 d_finite=''
454 d_finitel=''
455 d_flexfnam=''
456 d_flock=''
457 d_flockproto=''
458 d_fork=''
459 d_fp_class=''
460 d_fpclass=''
461 d_fpclassify=''
462 d_fpclassl=''
463 d_fpos64_t=''
464 d_frexpl=''
465 d_fs_data_s=''
466 d_fseeko=''
467 d_fsetpos=''
468 d_fstatfs=''
469 d_fsync=''
470 d_ftello=''
471 d_ftime=''
472 d_gettimeod=''
473 d_futimes=''
474 d_Gconvert=''
475 d_getaddrinfo=''
476 d_getcwd=''
477 d_getespwnam=''
478 d_getfsstat=''
479 d_getgrent=''
480 d_getgrent_r=''
481 getgrent_r_proto=''
482 d_getgrgid_r=''
483 getgrgid_r_proto=''
484 d_getgrnam_r=''
485 getgrnam_r_proto=''
486 d_getgrps=''
487 d_gethbyaddr=''
488 d_gethbyname=''
489 d_gethent=''
490 aphostname=''
491 d_gethname=''
492 d_phostname=''
493 d_uname=''
494 d_gethostbyaddr_r=''
495 gethostbyaddr_r_proto=''
496 d_gethostbyname_r=''
497 gethostbyname_r_proto=''
498 d_gethostent_r=''
499 gethostent_r_proto=''
500 d_gethostprotos=''
501 d_getitimer=''
502 d_getlogin=''
503 d_getlogin_r=''
504 getlogin_r_proto=''
505 d_getmnt=''
506 d_getmntent=''
507 d_getnameinfo=''
508 d_getnbyaddr=''
509 d_getnbyname=''
510 d_getnent=''
511 d_getnetbyaddr_r=''
512 getnetbyaddr_r_proto=''
513 d_getnetbyname_r=''
514 getnetbyname_r_proto=''
515 d_getnetent_r=''
516 getnetent_r_proto=''
517 d_getnetprotos=''
518 d_getpagsz=''
519 d_getpent=''
520 d_getpgid=''
521 d_getpgrp2=''
522 d_bsdgetpgrp=''
523 d_getpgrp=''
524 d_getppid=''
525 d_getprior=''
526 d_getpbyname=''
527 d_getpbynumber=''
528 d_getprotobyname_r=''
529 getprotobyname_r_proto=''
530 d_getprotobynumber_r=''
531 getprotobynumber_r_proto=''
532 d_getprotoent_r=''
533 getprotoent_r_proto=''
534 d_getprotoprotos=''
535 d_getprpwnam=''
536 d_getpwent=''
537 d_getpwent_r=''
538 getpwent_r_proto=''
539 d_getpwnam_r=''
540 getpwnam_r_proto=''
541 d_getpwuid_r=''
542 getpwuid_r_proto=''
543 d_getsent=''
544 d_getservbyname_r=''
545 getservbyname_r_proto=''
546 d_getservbyport_r=''
547 getservbyport_r_proto=''
548 d_getservent_r=''
549 getservent_r_proto=''
550 d_getservprotos=''
551 d_getspnam=''
552 d_getspnam_r=''
553 getspnam_r_proto=''
554 d_getsbyname=''
555 d_getsbyport=''
556 d_gmtime_r=''
557 gmtime_r_proto=''
558 d_gnulibc=''
559 gnulibc_version=''
560 d_hasmntopt=''
561 d_htonl=''
562 d_ilogbl=''
563 d_inetaton=''
564 d_inetntop=''
565 d_inetpton=''
566 d_int64_t=''
567 d_isascii=''
568 d_isblank=''
569 d_isfinite=''
570 d_isinf=''
571 d_isnan=''
572 d_isnanl=''
573 d_killpg=''
574 d_lchown=''
575 d_ldbl_dig=''
576 d_libm_lib_version=''
577 d_link=''
578 d_localtime_r=''
579 d_localtime_r_needs_tzset=''
580 localtime_r_proto=''
581 d_locconv=''
582 d_lockf=''
583 d_longdbl=''
584 longdblsize=''
585 d_longlong=''
586 longlongsize=''
587 d_lseekproto=''
588 d_lstat=''
589 d_madvise=''
590 d_malloc_good_size=''
591 d_malloc_size=''
592 d_mblen=''
593 d_mbstowcs=''
594 d_mbtowc=''
595 d_memchr=''
596 d_memcmp=''
597 d_memcpy=''
598 d_memmove=''
599 d_memset=''
600 d_mkdir=''
601 d_mkdtemp=''
602 d_mkfifo=''
603 d_mkstemp=''
604 d_mkstemps=''
605 d_mktime=''
606 d_mmap=''
607 mmaptype=''
608 d_modfl=''
609 d_modfl_pow32_bug=''
610 d_modflproto=''
611 d_mprotect=''
612 d_msg=''
613 d_msgctl=''
614 d_msgget=''
615 d_msghdr_s=''
616 d_msgrcv=''
617 d_msgsnd=''
618 d_msync=''
619 d_munmap=''
620 d_nice=''
621 d_nl_langinfo=''
622 d_off64_t=''
623 d_open3=''
624 d_fpathconf=''
625 d_pathconf=''
626 d_pause=''
627 d_pipe=''
628 d_poll=''
629 d_portable=''
630 d_prctl=''
631 d_prctl_set_name=''
632 d_procselfexe=''
633 procselfexe=''
634 d_old_pthread_create_joinable=''
635 old_pthread_create_joinable=''
636 d_pthread_atfork=''
637 d_pthread_attr_setscope=''
638 d_pthread_yield=''
639 d_sched_yield=''
640 sched_yield=''
641 d_qgcvt=''
642 d_random_r=''
643 random_r_proto=''
644 d_readdir64_r=''
645 readdir64_r_proto=''
646 d_readdir=''
647 d_rewinddir=''
648 d_seekdir=''
649 d_telldir=''
650 d_readdir_r=''
651 readdir_r_proto=''
652 d_readlink=''
653 d_readv=''
654 d_recvmsg=''
655 d_rename=''
656 d_rmdir=''
657 d_safebcpy=''
658 d_safemcpy=''
659 d_sanemcmp=''
660 d_sbrkproto=''
661 d_scalbnl=''
662 d_select=''
663 d_sem=''
664 d_semctl=''
665 d_semget=''
666 d_semop=''
667 d_sendmsg=''
668 d_setegid=''
669 d_seteuid=''
670 d_setgrent=''
671 d_setgrent_r=''
672 setgrent_r_proto=''
673 d_setgrps=''
674 d_sethent=''
675 d_sethostent_r=''
676 sethostent_r_proto=''
677 d_setitimer=''
678 d_setlinebuf=''
679 d_setlocale=''
680 d_setlocale_r=''
681 setlocale_r_proto=''
682 d_setnent=''
683 d_setnetent_r=''
684 setnetent_r_proto=''
685 d_setpent=''
686 d_setpgid=''
687 d_setpgrp2=''
688 d_bsdsetpgrp=''
689 d_setpgrp=''
690 d_setprior=''
691 d_setproctitle=''
692 d_setprotoent_r=''
693 setprotoent_r_proto=''
694 d_setpwent=''
695 d_setpwent_r=''
696 setpwent_r_proto=''
697 d_setregid=''
698 d_setresgid=''
699 d_setresuid=''
700 d_setreuid=''
701 d_setrgid=''
702 d_setruid=''
703 d_setsent=''
704 d_setservent_r=''
705 setservent_r_proto=''
706 d_setsid=''
707 d_setvbuf=''
708 d_sfio=''
709 usesfio=''
710 d_shm=''
711 d_shmat=''
712 d_shmatprototype=''
713 shmattype=''
714 d_shmctl=''
715 d_shmdt=''
716 d_shmget=''
717 d_sigaction=''
718 d_signbit=''
719 d_sigprocmask=''
720 d_sigsetjmp=''
721 usesitecustomize=''
722 d_snprintf=''
723 d_vsnprintf=''
724 d_sockatmark=''
725 d_sockatmarkproto=''
726 d_ipv6_mreq=''
727 d_msg_ctrunc=''
728 d_msg_dontroute=''
729 d_msg_oob=''
730 d_msg_peek=''
731 d_msg_proxy=''
732 d_oldsock=''
733 d_scm_rights=''
734 d_sin6_scope_id=''
735 d_sockaddr_in6=''
736 d_sockaddr_sa_len=''
737 d_socket=''
738 d_sockpair=''
739 sockethdr=''
740 socketlib=''
741 d_socklen_t=''
742 d_socks5_init=''
743 d_sprintf_returns_strlen=''
744 d_sqrtl=''
745 d_srand48_r=''
746 srand48_r_proto=''
747 d_srandom_r=''
748 srandom_r_proto=''
749 d_sresgproto=''
750 d_sresuproto=''
751 d_statblks=''
752 d_statfs_f_flags=''
753 d_statfs_s=''
754 d_static_inline=''
755 perl_static_inline=''
756 d_fstatvfs=''
757 d_statvfs=''
758 d_stdio_cnt_lval=''
759 d_stdio_ptr_lval=''
760 d_stdio_ptr_lval_nochange_cnt=''
761 d_stdio_ptr_lval_sets_cnt=''
762 d_stdiobase=''
763 d_stdstdio=''
764 stdio_base=''
765 stdio_bufsiz=''
766 stdio_cnt=''
767 stdio_filbuf=''
768 stdio_ptr=''
769 d_index=''
770 d_strchr=''
771 d_strcoll=''
772 d_strctcpy=''
773 d_strerrm=''
774 d_strerror=''
775 d_sysernlst=''
776 d_syserrlst=''
777 d_strerror_r=''
778 strerror_r_proto=''
779 d_strftime=''
780 d_strlcat=''
781 d_strlcpy=''
782 d_strtod=''
783 d_strtol=''
784 d_strtold=''
785 d_strtoll=''
786 d_strtoq=''
787 d_strtoul=''
788 d_strtoull=''
789 d_strtouq=''
790 d_strxfrm=''
791 d_symlink=''
792 d_syscall=''
793 d_syscallproto=''
794 d_sysconf=''
795 d_system=''
796 d_tcgetpgrp=''
797 d_tcsetpgrp=''
798 d_telldirproto=''
799 d_time=''
800 timetype=''
801 d_asctime64=''
802 d_ctime64=''
803 d_difftime64=''
804 d_gmtime64=''
805 d_localtime64=''
806 d_mktime64=''
807 d_timegm=''
808 clocktype=''
809 d_times=''
810 d_tmpnam_r=''
811 tmpnam_r_proto=''
812 d_truncate=''
813 d_ttyname_r=''
814 ttyname_r_proto=''
815 d_tzname=''
816 d_u32align=''
817 d_ualarm=''
818 d_umask=''
819 d_semctl_semid_ds=''
820 d_semctl_semun=''
821 d_union_semun=''
822 d_unordered=''
823 d_unsetenv=''
824 d_usleep=''
825 d_usleepproto=''
826 d_ustat=''
827 d_pseudofork=''
828 d_vfork=''
829 usevfork=''
830 d_voidsig=''
831 signal_t=''
832 d_volatile=''
833 d_charvspr=''
834 d_vprintf=''
835 d_wait4=''
836 d_waitpid=''
837 d_wcstombs=''
838 d_wctomb=''
839 d_writev=''
840 dlext=''
841 bin_ELF=''
842 cccdlflags=''
843 ccdlflags=''
844 dlsrc=''
845 ld=''
846 lddlflags=''
847 usedl=''
848 doublesize=''
849 ebcdic=''
850 fflushNULL=''
851 fflushall=''
852 fpossize=''
853 fpostype=''
854 gccansipedantic=''
855 gccosandvers=''
856 gccversion=''
857 gidformat=''
858 gidsign=''
859 gidsize=''
860 gidtype=''
861 groupstype=''
862 h_fcntl=''
863 h_sysfile=''
864 html1dir=''
865 html1direxp=''
866 installhtml1dir=''
867 html3dir=''
868 html3direxp=''
869 installhtml3dir=''
870 i_arpainet=''
871 i_assert=''
872 i_crypt=''
873 db_hashtype=''
874 db_prefixtype=''
875 db_version_major=''
876 db_version_minor=''
877 db_version_patch=''
878 i_db=''
879 i_dbm=''
880 i_rpcsvcdbm=''
881 d_dirnamlen=''
882 direntrytype=''
883 i_dirent=''
884 i_dld=''
885 i_dlfcn=''
886 i_fcntl=''
887 i_float=''
888 i_fp=''
889 i_fp_class=''
890 i_gdbm=''
891 d_grpasswd=''
892 i_grp=''
893 i_ieeefp=''
894 i_inttypes=''
895 i_langinfo=''
896 i_libutil=''
897 i_limits=''
898 i_locale=''
899 i_machcthr=''
900 i_malloc=''
901 i_mallocmalloc=''
902 i_math=''
903 i_memory=''
904 i_mntent=''
905 d_gdbm_ndbm_h_uses_prototypes=''
906 d_gdbmndbm_h_uses_prototypes=''
907 d_ndbm=''
908 d_ndbm_h_uses_prototypes=''
909 i_gdbm_ndbm=''
910 i_gdbmndbm=''
911 i_ndbm=''
912 i_netdb=''
913 i_neterrno=''
914 i_netinettcp=''
915 i_niin=''
916 i_sysin=''
917 i_poll=''
918 i_prot=''
919 i_pthread=''
920 d_pwage=''
921 d_pwchange=''
922 d_pwclass=''
923 d_pwcomment=''
924 d_pwexpire=''
925 d_pwgecos=''
926 d_pwpasswd=''
927 d_pwquota=''
928 i_pwd=''
929 i_sfio=''
930 i_shadow=''
931 i_socks=''
932 i_stdbool=''
933 i_stddef=''
934 i_stdlib=''
935 i_string=''
936 strings=''
937 i_sunmath=''
938 i_sysaccess=''
939 i_sysdir=''
940 i_sysfile=''
941 d_voidtty=''
942 i_bsdioctl=''
943 i_sysfilio=''
944 i_sysioctl=''
945 i_syssockio=''
946 i_syslog=''
947 i_sysmman=''
948 i_sysmode=''
949 i_sysmount=''
950 i_sysndir=''
951 i_sysparam=''
952 i_syspoll=''
953 i_sysresrc=''
954 i_syssecrt=''
955 i_sysselct=''
956 i_sysstat=''
957 i_sysstatfs=''
958 i_sysstatvfs=''
959 i_systimes=''
960 i_systypes=''
961 i_sysuio=''
962 i_sysun=''
963 i_sysutsname=''
964 i_sysvfs=''
965 i_syswait=''
966 i_sgtty=''
967 i_termio=''
968 i_termios=''
969 d_tm_tm_gmtoff=''
970 d_tm_tm_zone=''
971 i_systime=''
972 i_systimek=''
973 i_time=''
974 timeincl=''
975 i_unistd=''
976 i_ustat=''
977 i_utime=''
978 i_values=''
979 i_stdarg=''
980 i_varargs=''
981 i_varhdr=''
982 i_vfork=''
983 d_inc_version_list=''
984 inc_version_list=''
985 inc_version_list_init=''
986 installprefix=''
987 installprefixexp=''
988 installstyle=''
989 installusrbinperl=''
990 intsize=''
991 longsize=''
992 shortsize=''
993 issymlink=''
994 libc=''
995 ldlibpthname=''
996 libperl=''
997 shrpenv=''
998 useshrplib=''
999 glibpth=''
1000 libpth=''
1001 loclibpth=''
1002 plibpth=''
1003 xlibpth=''
1004 ignore_versioned_solibs=''
1005 libs=''
1006 libsdirs=''
1007 libsfiles=''
1008 libsfound=''
1009 libspath=''
1010 lns=''
1011 d_PRIEUldbl=''
1012 d_PRIFUldbl=''
1013 d_PRIGUldbl=''
1014 d_PRIeldbl=''
1015 d_PRIfldbl=''
1016 d_PRIgldbl=''
1017 d_SCNfldbl=''
1018 sPRIEUldbl=''
1019 sPRIFUldbl=''
1020 sPRIGUldbl=''
1021 sPRIeldbl=''
1022 sPRIfldbl=''
1023 sPRIgldbl=''
1024 sSCNfldbl=''
1025 lseeksize=''
1026 lseektype=''
1027 mad=''
1028 madlyh=''
1029 madlyobj=''
1030 madlysrc=''
1031 make_set_make=''
1032 d_mymalloc=''
1033 freetype=''
1034 mallocobj=''
1035 mallocsrc=''
1036 malloctype=''
1037 usemallocwrap=''
1038 usemymalloc=''
1039 installman1dir=''
1040 man1dir=''
1041 man1direxp=''
1042 man1ext=''
1043 installman3dir=''
1044 man3dir=''
1045 man3direxp=''
1046 man3ext=''
1047 modetype=''
1048 multiarch=''
1049 mydomain=''
1050 myhostname=''
1051 phostname=''
1052 c=''
1053 n=''
1054 d_eofnblk=''
1055 eagain=''
1056 o_nonblock=''
1057 rd_nodata=''
1058 need_va_copy=''
1059 netdb_hlen_type=''
1060 netdb_host_type=''
1061 netdb_name_type=''
1062 netdb_net_type=''
1063 groupcat=''
1064 hostcat=''
1065 passcat=''
1066 orderlib=''
1067 ranlib=''
1068 d_perl_otherlibdirs=''
1069 otherlibdirs=''
1070 package=''
1071 spackage=''
1072 pager=''
1073 api_revision=''
1074 api_subversion=''
1075 api_version=''
1076 api_versionstring=''
1077 patchlevel=''
1078 perl_patchlevel=''
1079 revision=''
1080 subversion=''
1081 version=''
1082 version_patchlevel_string=''
1083 perl5=''
1084 perladmin=''
1085 perlpath=''
1086 d_nv_preserves_uv=''
1087 d_nv_zero_is_allbits_zero=''
1088 i16size=''
1089 i16type=''
1090 i32size=''
1091 i32type=''
1092 i64size=''
1093 i64type=''
1094 i8size=''
1095 i8type=''
1096 ivsize=''
1097 ivtype=''
1098 nv_overflows_integers_at=''
1099 nv_preserves_uv_bits=''
1100 nvsize=''
1101 nvtype=''
1102 u16size=''
1103 u16type=''
1104 u32size=''
1105 u32type=''
1106 u64size=''
1107 u64type=''
1108 u8size=''
1109 u8type=''
1110 uvsize=''
1111 uvtype=''
1112 ivdformat=''
1113 nvEUformat=''
1114 nvFUformat=''
1115 nvGUformat=''
1116 nveformat=''
1117 nvfformat=''
1118 nvgformat=''
1119 uvXUformat=''
1120 uvoformat=''
1121 uvuformat=''
1122 uvxformat=''
1123 pidtype=''
1124 prefix=''
1125 prefixexp=''
1126 installprivlib=''
1127 privlib=''
1128 privlibexp=''
1129 prototype=''
1130 ptrsize=''
1131 d_PRIXU64=''
1132 d_PRId64=''
1133 d_PRIi64=''
1134 d_PRIo64=''
1135 d_PRIu64=''
1136 d_PRIx64=''
1137 sPRIXU64=''
1138 sPRId64=''
1139 sPRIi64=''
1140 sPRIo64=''
1141 sPRIu64=''
1142 sPRIx64=''
1143 d_quad=''
1144 quadkind=''
1145 quadtype=''
1146 uquadtype=''
1147 drand01=''
1148 randbits=''
1149 randfunc=''
1150 randseedtype=''
1151 seedfunc=''
1152 installscript=''
1153 scriptdir=''
1154 scriptdirexp=''
1155 selectminbits=''
1156 selecttype=''
1157 sh=''
1158 sig_count=''
1159 sig_name=''
1160 sig_name_init=''
1161 sig_num=''
1162 sig_num_init=''
1163 sig_size=''
1164 d_sitearch=''
1165 installsitearch=''
1166 sitearch=''
1167 sitearchexp=''
1168 installsitebin=''
1169 sitebin=''
1170 sitebinexp=''
1171 installsitehtml1dir=''
1172 sitehtml1dir=''
1173 sitehtml1direxp=''
1174 installsitehtml3dir=''
1175 sitehtml3dir=''
1176 sitehtml3direxp=''
1177 installsitelib=''
1178 sitelib=''
1179 sitelib_stem=''
1180 sitelibexp=''
1181 installsiteman1dir=''
1182 siteman1dir=''
1183 siteman1direxp=''
1184 installsiteman3dir=''
1185 siteman3dir=''
1186 siteman3direxp=''
1187 siteprefix=''
1188 siteprefixexp=''
1189 installsitescript=''
1190 sitescript=''
1191 sitescriptexp=''
1192 sizesize=''
1193 sizetype=''
1194 so=''
1195 socksizetype=''
1196 sharpbang=''
1197 shsharp=''
1198 spitshell=''
1199 src=''
1200 ssizetype=''
1201 st_ino_sign=''
1202 st_ino_size=''
1203 startperl=''
1204 startsh=''
1205 stdchar=''
1206 d_stdio_stream_array=''
1207 stdio_stream_array=''
1208 sysman=''
1209 sGMTIME_max=''
1210 sGMTIME_min=''
1211 sLOCALTIME_max=''
1212 sLOCALTIME_min=''
1213 trnl=''
1214 uidformat=''
1215 uidsign=''
1216 uidsize=''
1217 uidtype=''
1218 archname64=''
1219 use64bitall=''
1220 use64bitint=''
1221 dtrace=''
1222 usedtrace=''
1223 usefaststdio=''
1224 usekernprocpathname=''
1225 ccflags_uselargefiles=''
1226 ldflags_uselargefiles=''
1227 libswanted_uselargefiles=''
1228 uselargefiles=''
1229 uselongdouble=''
1230 usemorebits=''
1231 usemultiplicity=''
1232 nm_opt=''
1233 nm_so_opt=''
1234 runnm=''
1235 usenm=''
1236 usensgetexecutablepath=''
1237 useperlio=''
1238 usesocks=''
1239 d_oldpthreads=''
1240 use5005threads=''
1241 useithreads=''
1242 usereentrant=''
1243 usethreads=''
1244 incpath=''
1245 mips_type=''
1246 usrinc=''
1247 vaproto=''
1248 d_vendorarch=''
1249 installvendorarch=''
1250 vendorarch=''
1251 vendorarchexp=''
1252 d_vendorbin=''
1253 installvendorbin=''
1254 vendorbin=''
1255 vendorbinexp=''
1256 installvendorhtml1dir=''
1257 vendorhtml1dir=''
1258 vendorhtml1direxp=''
1259 installvendorhtml3dir=''
1260 vendorhtml3dir=''
1261 vendorhtml3direxp=''
1262 d_vendorlib=''
1263 installvendorlib=''
1264 vendorlib=''
1265 vendorlib_stem=''
1266 vendorlibexp=''
1267 installvendorman1dir=''
1268 vendorman1dir=''
1269 vendorman1direxp=''
1270 installvendorman3dir=''
1271 vendorman3dir=''
1272 vendorman3direxp=''
1273 usevendorprefix=''
1274 vendorprefix=''
1275 vendorprefixexp=''
1276 d_vendorscript=''
1277 installvendorscript=''
1278 vendorscript=''
1279 vendorscriptexp=''
1280 versiononly=''
1281 defvoidused=''
1282 voidflags=''
1283 yacc=''
1284 yaccflags=''
1285 CONFIG=''
1286
1287 : Detect odd OSs
1288 define='define'
1289 undef='undef'
1290 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1291 rmlist=''
1292
1293 : We must find out about Eunice early
1294 eunicefix=':'
1295 if test -f /etc/unixtovms; then
1296         eunicefix=/etc/unixtovms
1297 fi
1298 if test -f /etc/unixtovms.exe; then
1299         eunicefix=/etc/unixtovms.exe
1300 fi
1301
1302 : Set executable suffix now -- needed before hints available
1303 if test -f "/libs/version.library"; then
1304 : Amiga OS
1305     _exe=""
1306 elif test -f "/system/gnu_library/bin/ar.pm"; then
1307 : Stratus VOS
1308     _exe=".pm"
1309 elif test -n "$DJGPP"; then
1310 : DOS DJGPP
1311     _exe=".exe"
1312 elif test -d c:/. -o -n "$is_os2" ; then
1313 : OS/2 or cygwin
1314     _exe=".exe"
1315 fi
1316
1317 groupstype=''
1318 i_whoami=''
1319 : Trailing extension.  Override this in a hint file, if needed.
1320 : Extra object files, if any, needed on this platform.
1321 archobjs=''
1322 archname=''
1323 : Possible local include directories to search.
1324 : Set locincpth to "" in a hint file to defeat local include searches.
1325 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1326 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1327 :
1328 : no include file wanted by default
1329 inclwanted=''
1330
1331 : Enable -DEBUGGING and -DDEBUGGING from the command line
1332 EBUGGING=''
1333 DEBUGGING=''
1334
1335 libnames=''
1336 : change the next line if compiling for Xenix/286 on Xenix/386
1337 xlibpth='/usr/lib/386 /lib/386'
1338 : Possible local library directories to search.
1339 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1340 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1341
1342 : general looking path for locating libraries
1343 glibpth="/lib /usr/lib $xlibpth"
1344 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1345 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1346 test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
1347 test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1348
1349 : Private path used by Configure to find libraries.  Its value
1350 : is prepended to libpth. This variable takes care of special
1351 : machines, like the mips.  Usually, it should be empty.
1352 plibpth=''
1353
1354 : default library list
1355 libswanted=''
1356 : some systems want to use only the non-versioned libso:s
1357 ignore_versioned_solibs=''
1358 : set usethreads on the Configure command line to enable threads.
1359 usereentrant='undef'
1360 : full support for void wanted by default
1361 defvoidused=15
1362
1363 ccname=''
1364 ccversion=''
1365 perllibs=''
1366 : set useposix=false in your hint file to disable the POSIX extension.
1367 useposix=true
1368 : set useopcode=false in your hint file to disable the Opcode extension.
1369 useopcode=true
1370 archname64=''
1371 ccflags_uselargefiles=''
1372 ldflags_uselargefiles=''
1373 libswanted_uselargefiles=''
1374 : set usemultiplicity on the Configure command line to enable multiplicity.
1375 : set usesocks on the Configure command line to enable socks.
1376 : List of libraries we want.
1377 : If anyone needs extra -lxxx, put those in a hint file.
1378 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1379 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1380 : We probably want to search /usr/shlib before most other libraries.
1381 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1382 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1383 glibpth="/usr/shlib $glibpth"
1384 : Do not use vfork unless overridden by a hint file.
1385 usevfork=false
1386
1387 : Find the basic shell for Bourne shell scripts
1388 case "$sh" in
1389 '')
1390         case "$SYSTYPE" in
1391         *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1392         *) xxx='/bin/sh';;
1393         esac
1394         if test -f "$xxx"; then
1395                 sh="$xxx"
1396         else
1397                 : Build up a list and do a single loop so we can 'break' out.
1398                 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1399                 for xxx in sh bash ksh pdksh ash; do
1400                         for p in $pth; do
1401                                 try="$try ${p}/${xxx}"
1402                         done
1403                 done
1404                 for xxx in $try; do
1405                         if test -f "$xxx"; then
1406                                 sh="$xxx";
1407                                 break
1408                         elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1409                                 sh="$xxx";
1410                                 break
1411                         elif test -f "$xxx.exe"; then
1412                                 sh="$xxx";
1413                                 break
1414                         fi
1415                 done
1416         fi
1417         ;;
1418 esac
1419
1420 case "$sh" in
1421 '')     cat >&2 <<EOM
1422 $me:  Fatal Error:  I can't find a Bourne Shell anywhere.  
1423
1424 Usually it's in /bin/sh.  How did you even get this far?
1425 Please contact me (Perl Maintainers) at perlbug@perl.org and 
1426 we'll try to straighten this all out.
1427 EOM
1428         exit 1
1429         ;;
1430 esac
1431
1432 : see if sh knows # comments
1433 if `$sh -c '#' >/dev/null 2>&1`; then
1434         shsharp=true
1435         spitshell=cat
1436         xcat=/bin/cat
1437         test -f $xcat$_exe || xcat=/usr/bin/cat
1438         if test ! -f $xcat$_exe; then
1439                 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1440                         if test -f $p/cat$_exe; then
1441                                 xcat=$p/cat
1442                                 break
1443                         fi
1444                 done
1445                 if test ! -f $xcat$_exe; then
1446                         echo "Can't find cat anywhere!"
1447                         exit 1
1448                 fi
1449         fi
1450         echo "#!$xcat" >sharp
1451         $eunicefix sharp
1452         chmod +x sharp
1453         ./sharp > today 2>/dev/null
1454         if test -s today; then
1455                 sharpbang='#!'
1456         else
1457                 echo "#! $xcat" > sharp
1458                 $eunicefix sharp
1459                 chmod +x sharp
1460                 ./sharp > today 2>/dev/null
1461                 if test -s today; then
1462                         sharpbang='#! '
1463                 else
1464                         sharpbang=': use '
1465                 fi
1466         fi
1467 else
1468         echo " "
1469         echo "Your $sh doesn't grok # comments--I will strip them later on."
1470         shsharp=false
1471         cd ..
1472         echo "exec grep -v '^[  ]*#'" >spitshell
1473         chmod +x spitshell
1474         $eunicefix spitshell
1475         spitshell=`pwd`/spitshell
1476         cd UU
1477         echo "I presume that if # doesn't work, #! won't work either!"
1478         sharpbang=': use '
1479 fi
1480 rm -f sharp today
1481
1482 : figure out how to guarantee sh startup
1483 case "$startsh" in
1484 '') startsh=${sharpbang}${sh} ;;
1485 *)
1486 esac
1487 cat >sharp <<EOSS
1488 $startsh
1489 set abc
1490 test "$?abc" != 1
1491 EOSS
1492
1493 chmod +x sharp
1494 $eunicefix sharp
1495 if ./sharp; then
1496         : echo "Yup, it does."
1497 else
1498         echo "Hmm... '$startsh' does not guarantee sh startup..."
1499         echo "You may have to fix up the shell scripts to make sure $sh runs them."
1500 fi
1501 rm -f sharp
1502
1503 : Save command line options in file UU/cmdline.opt for later use in
1504 : generating config.sh.
1505 cat > cmdline.opt <<EOSH
1506 : Configure command line arguments.
1507 config_arg0='$0'
1508 config_args='$*'
1509 config_argc=$#
1510 EOSH
1511 argn=1
1512 args_exp=''
1513 args_sep=''
1514 for arg in "$@"; do
1515         cat >>cmdline.opt <<EOSH
1516 config_arg$argn='$arg'
1517 EOSH
1518         cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1519 $arg
1520 EOC
1521         arg_exp=`cat cmdl.opt`
1522         args_exp="$args_exp$args_sep'$arg_exp'"
1523         argn=`expr $argn + 1`
1524         args_sep=' '
1525 done
1526 rm -f cmdl.opt
1527
1528 : produce awk script to parse command line options
1529 cat >options.awk <<'EOF'
1530 BEGIN {
1531         optstr = "A:dD:eEf:hKOrsSU:V";  # getopt-style specification
1532
1533         len = length(optstr);
1534         for (i = 1; i <= len; i++) {
1535                 c = substr(optstr, i, 1);
1536                 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1537                 if (a == ":") {
1538                         arg[c] = 1;
1539                         i++;
1540                 }
1541                 opt[c] = 1;
1542         }
1543 }
1544 {
1545         expect = 0;
1546         str = $0;
1547         if (substr(str, 1, 1) != "-") {
1548                 printf("'%s'\n", str);
1549                 next;
1550         }
1551         len = length($0);
1552         for (i = 2; i <= len; i++) {
1553                 c = substr(str, i, 1);
1554                 if (!opt[c]) {
1555                         printf("-%s\n", substr(str, i));
1556                         next;
1557                 }
1558                 printf("-%s\n", c);
1559                 if (arg[c]) {
1560                         if (i < len)
1561                                 printf("'%s'\n", substr(str, i + 1));
1562                         else
1563                                 expect = 1;
1564                         next;
1565                 }
1566         }
1567 }
1568 END {
1569         if (expect)
1570                 print "?";
1571 }
1572 EOF
1573
1574 : process the command line options
1575 set X `for arg in "$@"; do echo "X$arg"; done |
1576         sed -e s/X// | awk -f options.awk`
1577 eval "set $*"
1578 shift
1579 rm -f options.awk
1580
1581 : set up default values
1582 fastread=''
1583 reuseval=false
1584 config_sh=''
1585 alldone=''
1586 error=''
1587 silent=''
1588 extractsh=''
1589 override=''
1590 knowitall=''
1591 rm -f optdef.sh posthint.sh
1592 cat >optdef.sh <<EOS
1593 $startsh
1594 EOS
1595
1596
1597 : option parsing
1598 while test $# -gt 0; do
1599         case "$1" in
1600         -d) shift; fastread=yes;;
1601         -e) shift; alldone=cont;;
1602         -f)
1603                 shift
1604                 cd ..
1605                 if test -r "$1"; then
1606                         config_sh="$1"
1607                 else
1608                         echo "$me: cannot read config file $1." >&2
1609                         error=true
1610                 fi
1611                 cd UU
1612                 shift;;
1613         --help|\
1614         -h) shift; error=true;;
1615         -r) shift; reuseval=true;;
1616         -s) shift; silent=true; realsilent=true;;
1617         -E) shift; alldone=exit;;
1618         -K) shift; knowitall=true;;
1619         -O) shift; override=true;;
1620         -S) shift; silent=true; extractsh=true;;
1621         -D)
1622                 shift
1623                 case "$1" in
1624                 *=)
1625                         echo "$me: use '-U symbol=', not '-D symbol='." >&2
1626                         echo "$me: ignoring -D $1" >&2
1627                         ;;
1628                 *=*) echo "$1" | \
1629                                 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1630                 *) echo "$1='define'" >> optdef.sh;;
1631                 esac
1632                 shift
1633                 ;;
1634         -U)
1635                 shift
1636                 case "$1" in
1637                 *=) echo "$1" >> optdef.sh;;
1638                 *=*)
1639                         echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1640                         echo "$me: ignoring -U $1" >&2
1641                         ;;
1642                 *) echo "$1='undef'" >> optdef.sh;;
1643                 esac
1644                 shift
1645                 ;;
1646         -A)
1647             shift
1648             xxx=''
1649             yyy="$1"
1650             zzz=''
1651             uuu=undef
1652             case "$yyy" in
1653             *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1654                  case "$zzz" in
1655                  *:*) zzz='' ;;
1656                  *)   xxx=append
1657                       zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1658                       yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1659                  esac
1660                  ;;
1661             esac
1662             case "$xxx" in
1663             '')  case "$yyy" in
1664                  *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1665                       yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1666                       zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1667                       yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1668                  *)   xxx=`echo "$yyy"|sed 's!:.*!!'`
1669                       yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1670                  esac
1671                  ;;
1672             esac
1673             case "$xxx" in
1674             append)
1675                 echo "$yyy=\"\${$yyy}$zzz\""    >> posthint.sh ;;
1676             clear)
1677                 echo "$yyy=''"                  >> posthint.sh ;;
1678             define)
1679                 case "$zzz" in
1680                 '') zzz=define ;;
1681                 esac
1682                 echo "$yyy='$zzz'"              >> posthint.sh ;;
1683             eval)
1684                 echo "eval \"$yyy=$zzz\""       >> posthint.sh ;;
1685             prepend)
1686                 echo "$yyy=\"$zzz\${$yyy}\""    >> posthint.sh ;;
1687             undef)
1688                 case "$zzz" in
1689                 '') zzz="$uuu" ;;
1690                 esac
1691                 echo "$yyy=$zzz"                >> posthint.sh ;;
1692             *)  echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1693             esac
1694             shift
1695             ;;
1696         -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1697             exit 0;;
1698         --) break;;
1699         -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1700         *) break;;
1701         esac
1702 done
1703
1704 case "$error" in
1705 true)
1706         cat >&2 <<EOM
1707 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1708                  [-U symbol] [-U symbol=] [-A command:symbol...]
1709   -d : use defaults for all answers.
1710   -e : go on without questioning past the production of config.sh.
1711   -f : specify an alternate default configuration file.
1712   -h : print this help message and exit (with an error status).
1713   -r : reuse C symbols value if possible (skips costly nm extraction).
1714   -s : silent mode, only echoes questions and essential information.
1715   -D : define symbol to have some value:
1716          -D symbol         symbol gets the value 'define'
1717          -D symbol=value   symbol gets the value 'value'
1718        common used examples (see INSTALL for more info):
1719          -Duse64bitint            use 64bit integers
1720          -Duse64bitall            use 64bit integers and pointers
1721          -Dusethreads             use thread support
1722          -Dinc_version_list=none  do not include older perl trees in @INC
1723          -DEBUGGING=none          DEBUGGING options
1724          -Dcc=gcc                 choose your compiler
1725          -Dprefix=/opt/perl5      choose your destination
1726   -E : stop at the end of questions, after having produced config.sh.
1727   -K : do not use unless you know what you are doing.
1728   -O : let -D and -U override definitions from loaded configuration file.
1729   -S : perform variable substitutions on all .SH files (can mix with -f)
1730   -U : undefine symbol:
1731          -U symbol    symbol gets the value 'undef'
1732          -U symbol=   symbol gets completely empty
1733        e.g.:  -Uversiononly
1734   -A : manipulate symbol after the platform specific hints have been applied:
1735          -A append:symbol=value   append value to symbol
1736          -A symbol=value          like append:, but with a separating space
1737          -A define:symbol=value   define symbol to have value
1738          -A clear:symbol          define symbol to be ''
1739          -A define:symbol         define symbol to be 'define'
1740          -A eval:symbol=value     define symbol to be eval of value
1741          -A prepend:symbol=value  prepend value to symbol
1742          -A undef:symbol          define symbol to be 'undef'
1743          -A undef:symbol=         define symbol to be ''
1744        e.g.:  -A prepend:libswanted='cl pthread '
1745               -A ccflags=-DSOME_MACRO
1746   -V : print version number and exit (with a zero status).
1747 EOM
1748         exit 1
1749         ;;
1750 esac
1751
1752 : Sanity checks
1753 case "$fastread$alldone" in
1754 yescont|yesexit) ;;
1755 *)
1756         case "$extractsh" in
1757         true) ;;
1758         *)
1759                 if test ! -t 0; then
1760                         echo "Say 'sh Configure', not 'sh <Configure'"
1761                         exit 1
1762                 fi
1763                 ;;
1764         esac
1765         ;;
1766 esac
1767
1768 exec 4>&1
1769 case "$silent" in
1770 true) exec 1>/dev/null;;
1771 esac
1772
1773 : run the defines and the undefines, if any, but leave the file out there...
1774 touch optdef.sh
1775 . ./optdef.sh
1776 : create the posthint manipulation script and leave the file out there...
1777 touch posthint.sh
1778
1779 : set package name
1780 package='perl5'
1781 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1782 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1783 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1784 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1785 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1786 esac
1787
1788 : Some greps do not return status, grrr.
1789 echo "grimblepritz" >grimble
1790 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1791         contains=contains
1792 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1793         contains=grep
1794 else
1795         contains=contains
1796 fi
1797 rm -f grimble
1798 : the following should work in any shell
1799 case "$contains" in
1800 contains*)
1801         echo " "
1802         echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
1803         cat >contains <<'EOSS'
1804 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1805 EOSS
1806 chmod +x contains
1807 esac
1808
1809 : Find the path to the source tree
1810 case "$src" in
1811 '') case "$0" in
1812     */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1813          case "$src" in
1814          /*)    ;;
1815          .)     ;;
1816          *)     src=`cd ../$src && pwd` ;;
1817          esac
1818          ;;
1819     *)   src='.';;
1820     esac;;
1821 esac
1822 case "$src" in
1823 '')     src=/
1824         rsrc=/
1825         ;;
1826 /*)     rsrc="$src";;
1827 *)      rsrc="../$src";;
1828 esac
1829 if test -f $rsrc/Configure && \
1830         $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1831 then
1832    : found it, so we are ok.
1833 else
1834         rsrc=''
1835         for src in . .. ../.. ../../.. ../../../..; do
1836                 if test -f ../$src/Configure && \
1837                         $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1838                 then
1839                         rsrc=../$src
1840                         break
1841                 fi
1842         done
1843 fi
1844 case "$rsrc" in
1845 '')
1846         cat <<EOM >&4
1847
1848 Sorry, I can't seem to locate the source dir for $package.  Please start
1849 Configure with an explicit path -- i.e. /some/path/Configure.
1850
1851 EOM
1852         exit 1
1853         ;;
1854 ../.)   rsrc='..';;
1855 *)
1856         echo " "
1857         echo "Sources for $package found in \"$src\"." >&4
1858         ;;
1859 esac
1860
1861 : script used to extract .SH files with variable substitutions
1862 cat >extract <<'EOS'
1863 PERL_CONFIG_SH=true
1864 echo "Doing variable substitutions on .SH files..."
1865 if test -f MANIFEST; then
1866         set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1867 else
1868         echo "(Looking for .SH files under the source directory.)"
1869         set x `(cd "$src"; find . -name "*.SH" -print)`
1870 fi
1871 shift
1872 case $# in
1873 0) set x `(cd "$src"; echo *.SH)`; shift;;
1874 esac
1875 if test ! -f "$src/$1"; then
1876         shift
1877 fi
1878 mkdir_p='
1879 name=$1;
1880 create="";
1881 while test $name; do
1882         if test ! -d "$name"; then
1883                 create="$name $create";
1884                 name=`echo $name | sed -e "s|^[^/]*$||"`;
1885                 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1886         else
1887                 name="";
1888         fi;
1889 done;
1890 for file in $create; do
1891         mkdir $file;
1892 done
1893 '
1894 for file in $*; do
1895         case "$src" in
1896         ".")
1897                 case "$file" in
1898                 */*)
1899                         dir=`expr X$file : 'X\(.*\)/'`
1900                         file=`expr X$file : 'X.*/\(.*\)'`
1901                         (cd "$dir" && . ./$file)
1902                         ;;
1903                 *)
1904                         . ./$file
1905                         ;;
1906                 esac
1907                 ;;
1908         *)
1909                 case "$file" in
1910                 */*)
1911                         dir=`expr X$file : 'X\(.*\)/'`
1912                         file=`expr X$file : 'X.*/\(.*\)'`
1913                         (set x $dir; shift; eval $mkdir_p)
1914                         sh <"$src/$dir/$file"
1915                         ;;
1916                 *)
1917                         sh <"$src/$file"
1918                         ;;
1919                 esac
1920                 ;;
1921         esac
1922 done
1923 if test -f "$src/config_h.SH"; then
1924         if test ! -f config.h; then
1925         : oops, they left it out of MANIFEST, probably, so do it anyway.
1926         . "$src/config_h.SH"
1927         fi
1928 fi
1929 EOS
1930
1931 : extract files and exit if asked to do so
1932 case "$extractsh" in
1933 true)
1934         case "$realsilent" in
1935         true) ;;
1936         *) exec 1>&4;;
1937         esac
1938         case "$config_sh" in
1939         '') config_sh='config.sh';;
1940         esac
1941         echo " "
1942         echo "Fetching answers from $config_sh..."
1943         cd ..
1944         . $config_sh
1945         test "$override" && . ./optdef.sh
1946         echo " "
1947         . UU/extract
1948         rm -rf UU
1949         echo "Extraction done."
1950         exit 0
1951         ;;
1952 esac
1953
1954 : Eunice requires " " instead of "", can you believe it
1955 echo " "
1956 : Here we go...
1957 echo "Beginning of configuration questions for $package."
1958
1959 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1960
1961 : first determine how to suppress newline on echo command
1962 echo " "
1963 echo "Checking echo to see how to suppress newlines..."
1964 (echo "hi there\c" ; echo " ") >.echotmp
1965 if $contains c .echotmp >/dev/null 2>&1 ; then
1966         echo "...using -n."
1967         n='-n'
1968         c=''
1969 else
1970         cat <<'EOM'
1971 ...using \c
1972 EOM
1973         n=''
1974         c='\c'
1975 fi
1976 echo $n "The star should be here-->$c"
1977 echo '*'
1978 rm -f .echotmp
1979
1980 : Now test for existence of everything in MANIFEST
1981 echo " "
1982 if test -f "$rsrc/MANIFEST"; then
1983         echo "First let's make sure your kit is complete.  Checking..." >&4
1984         awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1985                 (split -l 50 2>/dev/null || split -50)
1986         rm -f missing
1987         tmppwd=`pwd`
1988         for filelist in x??; do
1989                 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1990                         >/dev/null 2>>"$tmppwd/missing")
1991         done
1992         if test -s missing; then
1993                 cat missing >&4
1994                 cat >&4 <<'EOM'
1995
1996 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1997
1998 You have the option of continuing the configuration process, despite the
1999 distinct possibility that your kit is damaged, by typing 'y'es.  If you
2000 do, don't blame me if something goes wrong.  I advise you to type 'n'o
2001 and contact the author (perlbug@perl.org).
2002
2003 EOM
2004                 echo $n "Continue? [n] $c" >&4
2005                 read ans
2006                 case "$ans" in
2007                 y*)
2008                         echo "Continuing..." >&4
2009                         rm -f missing
2010                         ;;
2011                 *)
2012                         echo "ABORTING..." >&4
2013                         kill $$
2014                         ;;
2015                 esac
2016         else
2017                 echo "Looks good..."
2018         fi
2019 else
2020         echo "There is no MANIFEST file.  I hope your kit is complete !"
2021 fi
2022 rm -f missing x??
2023
2024 : Find the appropriate value for a newline for tr
2025 echo " "
2026 if test -n "$DJGPP"; then
2027        trnl='\012'
2028 fi
2029 if test X"$trnl" = X; then
2030         case "`echo foo|tr '\n' x 2>/dev/null`" in
2031         foox) trnl='\n' ;;
2032         esac
2033 fi
2034 if test X"$trnl" = X; then
2035         case "`echo foo|tr '\012' x 2>/dev/null`" in
2036         foox) trnl='\012' ;;
2037         esac
2038 fi
2039 if test X"$trnl" = X; then
2040        case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2041        fooxy) trnl='\n\r' ;;
2042        esac
2043 fi
2044 if test X"$trnl" = X; then
2045         cat <<EOM >&2
2046
2047 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2048
2049 EOM
2050         exit 1
2051 fi
2052
2053 : compute the number of columns on the terminal for proper question formatting
2054 case "$COLUMNS" in
2055 '') COLUMNS='80';;
2056 esac
2057
2058 : set up the echo used in my read
2059 myecho="case \"\$xxxm\" in
2060 '') echo $n \"\$rp $c\" >&4;;
2061 *) case \"\$rp\" in
2062         '') echo $n \"[\$xxxm] $c\";;
2063         *)
2064                 if test \`echo \"\$rp [\$xxxm]  \" | wc -c\` -ge $COLUMNS; then
2065                         echo \"\$rp\" >&4
2066                         echo $n \"[\$xxxm] $c\" >&4
2067                 else
2068                         echo $n \"\$rp [\$xxxm] $c\" >&4
2069                 fi
2070                 ;;
2071         esac;;
2072 esac"
2073
2074 : now set up to do reads with possible shell escape and default assignment
2075 cat <<EOSC >myread
2076 $startsh
2077 xxxm=\$dflt
2078 $myecho
2079 ans='!'
2080 case "\$fastread" in
2081 yes) case "\$dflt" in
2082         '') ;;
2083         *) ans='';
2084                 case "\$silent-\$rp" in
2085                 true-) ;;
2086                 *) echo " " >&4;;
2087                 esac;;
2088         esac;;
2089 *) case "\$silent" in
2090         true) case "\$rp" in
2091                 '') ans='';;
2092                 esac;;
2093         esac;;
2094 esac
2095 while expr "X\$ans" : "X!" >/dev/null; do
2096         read answ
2097         set x \$xxxm
2098         shift
2099         aok=''; eval "ans=\\"\$answ\\"" && aok=y
2100         case  "\$answ" in
2101         "!")
2102                 sh 1>&4
2103                 echo " "
2104                 $myecho
2105                 ;;
2106         !*)
2107                 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2108                 shift
2109                 sh 1>&4 -c "\$*"
2110                 echo " "
2111                 $myecho
2112                 ;;
2113         "\$ans")
2114                 case "\$ans" in
2115                 \\&*)
2116                         set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2117                         shift
2118                         case "\$1" in
2119                         -d)
2120                                 fastread=yes
2121                                 echo "(OK, I'll run with -d after this question.)" >&4
2122                                 ;;
2123                         -*)
2124                                 echo "*** Sorry, \$1 not supported yet." >&4
2125                                 ;;
2126                         esac
2127                         $myecho
2128                         ans=!
2129                         ;;
2130                 esac;;
2131         *)
2132                 case "\$aok" in
2133                 y)
2134                         echo "*** Substitution done -- please confirm."
2135                         xxxm="\$ans"
2136                         ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2137                         xxxm="\$ans"
2138                         ans=!
2139                         ;;
2140                 *)
2141                         echo "*** Error -- try again."
2142                         ans=!
2143                         ;;
2144                 esac
2145                 $myecho
2146                 ;;
2147         esac
2148         case "\$ans\$xxxm\$nostick" in
2149         '')
2150                 ans=!
2151                 $myecho
2152                 ;;
2153         esac
2154 done
2155 case "\$ans" in
2156 '') ans="\$xxxm";;
2157 esac
2158 EOSC
2159
2160 : create .config dir to save info across Configure sessions
2161 test -d ../.config || mkdir ../.config
2162 cat >../.config/README <<EOF
2163 This directory created by Configure to save information that should
2164 persist across sessions for $package.
2165
2166 You may safely delete it if you wish.
2167 EOF
2168
2169 : See if we are using a devel version and want that
2170 xversion=`awk '/define[         ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2171 case "$usedevel" in
2172 $define|true|[yY]*)
2173     usedevel="$define" ;;
2174 *) case "$xversion" in
2175    *[13579])
2176         cat >&4 <<EOH
2177 *** WHOA THERE!!! ***
2178
2179     This is an UNSTABLE DEVELOPMENT release.
2180     The version of this $package distribution is $xversion, that is, odd,
2181     (as opposed to even) and that signifies a development release.
2182     If you want a maintenance release, you want an even-numbered version.
2183
2184     Do ***NOT*** install this into production use.
2185     Data corruption and crashes are possible.
2186
2187     It is most seriously suggested that you do not continue any further
2188     unless you want to help in developing and debugging Perl.
2189
2190     If you *still* want to build perl, you can answer 'y' now,
2191     or pass -Dusedevel to Configure.
2192
2193 EOH
2194         rp='Do you really want to continue?'
2195         dflt='n'
2196         . ./myread
2197         case "$ans" in
2198         [yY]) echo >&4 "Okay, continuing."
2199               usedevel="$define" ;;
2200         *) echo >&4 "Okay, bye."
2201            exit 1
2202            ;;
2203         esac
2204         ;;
2205     esac
2206     usedevel="$undef"
2207     ;;
2208 esac
2209 case "$usedevel" in
2210 $define|true|[yY]*)
2211         case "$versiononly" in
2212         '') versiononly="$define" ;;
2213         esac
2214         case "$installusrbinperl" in
2215         '') installusrbinperl="$undef" ;;
2216         esac
2217         ;;
2218 esac
2219
2220 : general instructions
2221 needman=true
2222 firsttime=true
2223 user=`(logname) 2>/dev/null`
2224 case "$user" in
2225 '') user=`whoami 2>&1`;;
2226 esac
2227 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2228         firsttime=false
2229         echo " "
2230         rp='Would you like to see the instructions?'
2231         dflt=n
2232         . ./myread
2233         case "$ans" in
2234         [yY]*) ;;
2235         *) needman=false;;
2236         esac
2237 fi
2238 if $needman; then
2239         cat <<EOH
2240
2241 This installation shell script will examine your system and ask you questions
2242 to determine how the perl5 package should be installed. If you get
2243 stuck on a question, you may use a ! shell escape to start a subshell or
2244 execute a command.  Many of the questions will have default answers in square
2245 brackets; typing carriage return will give you the default.
2246
2247 On some of the questions which ask for file or directory names you are allowed
2248 to use the ~name construct to specify the login directory belonging to "name",
2249 even if you don't have a shell which knows about that.  Questions where this is
2250 allowed will be marked "(~name ok)".
2251
2252 EOH
2253         rp=''
2254         dflt='Type carriage return to continue'
2255         . ./myread
2256         cat <<'EOH'
2257
2258 The prompter used in this script allows you to use shell variables and
2259 backticks in your answers.  You may use $1, $2, etc...  to refer to the words
2260 in the default answer, as if the default line was a set of arguments given to a
2261 script shell.  This means you may also use $* to repeat the whole default line,
2262 so you do not have to re-type everything to add something to the default.
2263
2264 Every time there is a substitution, you will have to confirm.  If there is an
2265 error (e.g. an unmatched backtick), the default answer will remain unchanged
2266 and you will be prompted again.
2267
2268 If you are in a hurry, you may run 'Configure -d'.  This will bypass nearly all
2269 the questions and use the computed defaults (or the previous answers if there
2270 was already a config.sh file). Type 'Configure -h' for a list of options.
2271 You may also start interactively and then answer '& -d' at any prompt to turn
2272 on the non-interactive behaviour for the remainder of the execution.
2273
2274 EOH
2275         . ./myread
2276         cat <<EOH
2277
2278 Much effort has been expended to ensure that this shell script will run on any
2279 Unix system.  If despite that it blows up on yours, your best bet is to edit
2280 Configure and run it again.  If you can't run Configure for some reason,
2281 you'll have to generate a config.sh file by hand.  Whatever problems you
2282 have, let me (perlbug@perl.org) know how I blew it.
2283
2284 This installation script affects things in two ways:
2285
2286 1) it may do direct variable substitutions on some of the files included
2287    in this kit.
2288 2) it builds a config.h file for inclusion in C programs.  You may edit
2289    any of these files as the need arises after running this script.
2290
2291 If you make a mistake on a question, there is no easy way to back up to it
2292 currently.  The easiest thing to do is to edit config.sh and rerun all the SH
2293 files.  Configure will offer to let you do this before it runs the SH files.
2294
2295 EOH
2296         dflt='Type carriage return to continue'
2297         . ./myread
2298         case "$firsttime" in
2299         true) echo $user >>../.config/instruct;;
2300         esac
2301 fi
2302
2303 : find out where common programs are
2304 echo " "
2305 echo "Locating common programs..." >&4
2306 cat <<EOSC >loc
2307 $startsh
2308 case \$# in
2309 0) exit 1;;
2310 esac
2311 thing=\$1
2312 shift
2313 dflt=\$1
2314 shift
2315 for dir in \$*; do
2316         case "\$thing" in
2317         .)
2318         if test -d \$dir/\$thing; then
2319                 echo \$dir
2320                 exit 0
2321         fi
2322         ;;
2323         *)
2324         for thisthing in \$dir/\$thing; do
2325                 : just loop through to pick last item
2326         done
2327         if test -f \$thisthing; then
2328                 echo \$thisthing
2329                 exit 0
2330         elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2331                 echo \$thisthing
2332                 exit 0
2333         elif test -f \$dir/\$thing.exe; then
2334                 if test -n "$DJGPP"; then
2335                         echo \$dir/\$thing.exe
2336                 elif test "$eunicefix" != ":"; then
2337                         : on Eunice apparently
2338                         echo \$dir/\$thing
2339                 fi
2340                 exit 0
2341         fi
2342         ;;
2343         esac
2344 done
2345 echo \$dflt
2346 exit 1
2347 EOSC
2348 chmod +x loc
2349 $eunicefix loc
2350 loclist="
2351 awk
2352 cat
2353 chmod
2354 comm
2355 cp
2356 echo
2357 expr
2358 grep
2359 ls
2360 mkdir
2361 rm
2362 sed
2363 sort
2364 touch
2365 tr
2366 uniq
2367 "
2368 trylist="
2369 ar
2370 bison
2371 byacc
2372 cpp
2373 csh
2374 date
2375 egrep
2376 gmake
2377 gzip
2378 less
2379 ln
2380 make
2381 more
2382 nm
2383 nroff
2384 perl
2385 pg
2386 test
2387 uname
2388 zip
2389 "
2390 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2391 pth="$pth /lib /usr/lib"
2392 for file in $loclist; do
2393         eval xxx=\$$file
2394         case "$xxx" in
2395         /*|?:[\\/]*)
2396                 if test -f "$xxx"; then
2397                         : ok
2398                 else
2399                         echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2400                         xxx=`./loc $file $file $pth`
2401                 fi
2402                 ;;
2403         '') xxx=`./loc $file $file $pth`;;
2404         *) xxx=`./loc $xxx $xxx $pth`;;
2405         esac
2406         eval $file=$xxx$_exe
2407         eval _$file=$xxx
2408         case "$xxx" in
2409         /*)
2410                 echo $file is in $xxx.
2411                 ;;
2412         ?:[\\/]*)
2413                 echo $file is in $xxx.
2414                 ;;
2415         *)
2416                 echo "I don't know where '$file' is, and my life depends on it." >&4
2417                 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2418                 exit 1
2419                 ;;
2420         esac
2421 done
2422 echo " "
2423 echo "Don't worry if any of the following aren't found..."
2424 say=offhand
2425 for file in $trylist; do
2426         eval xxx=\$$file
2427         case "$xxx" in
2428         /*|?:[\\/]*)
2429                 if test -f "$xxx"; then
2430                         : ok
2431                 else
2432                         echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2433                         xxx=`./loc $file $file $pth`
2434                 fi
2435                 ;;
2436         '') xxx=`./loc $file $file $pth`;;
2437         *) xxx=`./loc $xxx $xxx $pth`;;
2438         esac
2439         eval $file=$xxx$_exe
2440         eval _$file=$xxx
2441         case "$xxx" in
2442         /*)
2443                 echo $file is in $xxx.
2444                 ;;
2445         ?:[\\/]*)
2446                 echo $file is in $xxx.
2447                 ;;
2448         *)
2449                 echo "I don't see $file out there, $say."
2450                 say=either
2451                 ;;
2452         esac
2453 done
2454 case "$egrep" in
2455 egrep)
2456         echo "Substituting grep for egrep."
2457         egrep=$grep
2458         _egrep=$grep
2459         ;;
2460 esac
2461 case "$less" in
2462 '')     ;;
2463 *)      if $less -R </dev/null >/dev/null; then
2464                echo "Substituting less -R for less."
2465                less="$less -R"
2466                _less=$less
2467         fi
2468         ;;
2469 esac
2470 case "$ln" in
2471 ln)
2472         echo "Substituting cp for ln."
2473         ln=$cp
2474         _ln=$cp
2475         ;;
2476 esac
2477 case "$make" in
2478 make)
2479         case "$gmake" in
2480         gmake)
2481         echo "I can't find make or gmake, and my life depends on it." >&4
2482         echo "Go find a public domain implementation or fix your PATH setting!" >&4
2483         exit 1
2484         ;;
2485         esac
2486         ;;
2487 esac
2488 case "$gmake" in
2489 gmake)  ;;
2490 *)      # We can't have osname yet.
2491         if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2492                 # Assume that gmake, if found, is definitely GNU make
2493                 # and prefer it over the system make.
2494                 echo "Substituting gmake for make."
2495                 make=$gmake
2496                 _make=$gmake
2497         fi
2498         ;;
2499 esac
2500 case "$test" in
2501 test)
2502         echo "Hopefully test is built into your sh."
2503         ;;
2504 *)
2505         if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2506                 echo "Using the test built into your sh."
2507                 test=test
2508                 _test=test
2509         fi
2510         ;;
2511 esac
2512 case "$echo" in
2513 echo)
2514         echo "Hopefully echo is built into your sh."
2515         ;;
2516 '') ;;
2517 *)
2518         echo " "
2519 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2520         $echo $n "hi there$c" >foo1
2521         echo $n "hi there$c" >foo2
2522         if cmp foo1 foo2 >/dev/null 2>&1; then
2523                 echo "They are compatible.  In fact, they may be identical."
2524         else
2525                 case "$n" in
2526                 '-n') n='' c='\c';;
2527                 *) n='-n' c='';;
2528                 esac
2529                 cat <<FOO
2530 They are not compatible!  You are probably running ksh on a non-USG system.
2531 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2532 have echo built in and we may have to run some Bourne shell scripts.  That
2533 means I'll have to use '$n$c' to suppress newlines now.  Life is ridiculous.
2534
2535 FOO
2536                 $echo $n "The star should be here-->$c"
2537                 $echo "*"
2538         fi
2539         $rm -f foo1 foo2
2540         ;;
2541 esac
2542
2543 # This question was auctioned at YAPC::Europe-2007 in Vienna
2544 # I never promised you could answer it. I only auctioned the question.
2545 cat <<FOO
2546 The following message is sponsored by
2547
2548   Dresden.pm<--The stars should be here.
2549
2550 Dear Perl user, system administrator or package
2551 maintainer, the Perl community sends greetings to
2552 you. Do you (emblematical) greet back [Y/n]? n
2553
2554 FOO
2555
2556 : Check what type of C compiler we use
2557 cat <<EOS >trygcc
2558 $startsh
2559 EOS
2560 cat <<'EOSC' >>trygcc
2561 case "$cc" in
2562 '') ;;
2563 *)  $rm -f try try.*
2564     $cat >try.c <<EOM
2565 int main(int argc, char *argv[]) {
2566   return 0;
2567 }
2568 EOM
2569     if $cc -o try $ccflags $ldflags try.c; then
2570        :
2571     else
2572         echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2573         despair=yes
2574         trygcc=yes
2575         case "$cc" in
2576         *gcc*) trygcc=no ;;
2577         esac
2578         # Skip this test because it gives a false match on output like:
2579         #    ./trygcc: line 23: cc: command not found
2580         # case "`$cc -v -c try.c 2>&1`" in
2581         # *gcc*) trygcc=no ;;
2582         # esac
2583         if $test X"$trygcc" = Xyes; then
2584             if gcc -o try -c try.c; then
2585                 echo " "
2586                 echo "You seem to have a working gcc, though." >&4
2587                 # Switching compilers may undo the work of hints files.
2588                 # The most common problem is -D_REENTRANT for threads.
2589                 # This heuristic catches that case, but gets false positives
2590                 # if -Dusethreads was not actually specified.  Better to
2591                 # bail out here with a useful message than fail 
2592                 # mysteriously later. Should we perhaps just try to
2593                 # re-invoke Configure -Dcc=gcc config_args ?
2594                 if $test -f usethreads.cbu; then
2595                         $cat >&4 <<EOM 
2596
2597 *** However, any setting of the C compiler flags (e.g. for thread support)
2598 *** will be lost.  It may be necessary for you to restart Configure and
2599 *** add -Dcc=gcc to your Configure command line.
2600
2601 EOM
2602                         rp="Would you like to go ahead and try gcc anyway?"
2603                         dflt=n
2604                 else
2605                         rp="Would you like to use it?"
2606                         dflt=y
2607                 fi
2608                 if $test -f myread; then
2609                     . ./myread
2610                 else
2611                     if $test -f UU/myread; then
2612                         . ./UU/myread
2613                     else
2614                         echo "Cannot find myread, sorry.  Aborting." >&2
2615                         exit 1
2616                     fi
2617                 fi  
2618                 case "$ans" in
2619                 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2620                 esac
2621             fi
2622         fi
2623     fi
2624     $rm -f try try.*
2625     ;;
2626 esac
2627 EOSC
2628
2629 cat <<EOS >checkcc
2630 $startsh
2631 EOS
2632 cat <<'EOSC' >>checkcc
2633 case "$cc" in        
2634 '') ;;
2635 *)  $rm -f try try.*              
2636     $cat >try.c <<EOM
2637 int main(int argc, char *argv[]) {
2638   return 0;
2639 }
2640 EOM
2641     if $cc -o try $ccflags $ldflags try.c; then
2642        :
2643     else
2644         if $test X"$despair" = Xyes; then
2645            echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2646         fi
2647         $cat >&4 <<EOM         
2648 You need to find a working C compiler.
2649 Either (purchase and) install the C compiler supplied by your OS vendor,
2650 or for a free C compiler try http://gcc.gnu.org/
2651 I cannot continue any further, aborting.
2652 EOM
2653         exit 1
2654     fi
2655     $rm -f try try.*
2656     ;;
2657 esac
2658 EOSC
2659
2660 : determine whether symbolic links are supported
2661 echo " "
2662 $touch blurfl
2663 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2664         echo "Symbolic links are supported." >&4
2665         lns="$ln -s"
2666 else
2667         echo "Symbolic links are NOT supported." >&4
2668         lns="$ln"
2669 fi
2670 $rm -f blurfl sym
2671
2672 : determine whether symbolic links are supported
2673 echo " "
2674 case "$lns" in
2675 *"ln"*" -s")
2676         echo "Checking how to test for symbolic links..." >&4
2677         $lns blurfl sym
2678         if $test "X$issymlink" = X; then
2679                 case "$newsh" in
2680                 '') sh     -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2681                 *)  $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2682                 esac
2683                 if test $? = 0; then
2684                         issymlink="test -h"
2685                 else
2686                         echo "Your builtin 'test -h' may be broken." >&4
2687                         case "$test" in
2688                         /*)     ;;
2689                         *)      pth=`echo $PATH | sed -e "s/$p_/ /g"`
2690                                 for p in $pth
2691                                 do
2692                                         if test -f "$p/$test"; then
2693                                                 test="$p/$test"
2694                                                 break
2695                                         fi
2696                                 done
2697                                 ;;
2698                         esac
2699                         case "$test" in
2700                         /*)
2701                                 echo "Trying external '$test -h'." >&4
2702                                 issymlink="$test -h"
2703                                 if $test ! -h sym >/dev/null 2>&1; then
2704                                         echo "External '$test -h' is broken, too." >&4
2705                                         issymlink=''
2706                                 fi
2707                                 ;;
2708                         *)      issymlink='' ;;
2709                         esac
2710                 fi              
2711         fi
2712         if $test "X$issymlink" = X; then
2713                 if $test -L sym 2>/dev/null; then
2714                         issymlink="$test -L"
2715                         echo "The builtin '$test -L' worked." >&4
2716                 fi
2717         fi
2718         if $test "X$issymlink" != X; then
2719                 echo "You can test for symbolic links with '$issymlink'." >&4
2720         else
2721                 echo "I do not know how you can test for symbolic links." >&4
2722         fi
2723         $rm -f blurfl sym
2724         ;;
2725 *)      echo "No symbolic links, so not testing for their testing..." >&4
2726         ;;
2727 esac
2728 echo " "
2729
2730 : Make symlinks util
2731 case "$mksymlinks" in
2732 $define|true|[yY]*)
2733         case "$src" in
2734         ''|'.') echo "Cannot create symlinks in the original directory." >&4
2735                 exit 1
2736                 ;;
2737         *)      case "$lns:$issymlink" in
2738                 *"ln"*" -s:"*"test -"?)
2739                         echo "Creating the symbolic links..." >&4
2740                         echo "(First creating the subdirectories...)" >&4
2741                         cd ..
2742                         awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2743                                 read directory
2744                                 test -z "$directory" && break
2745                                 mkdir -p $directory
2746                         done
2747                         # Sanity check 1.
2748                         if test ! -d t/base; then
2749                                 echo "Failed to create the subdirectories.  Aborting." >&4
2750                                 exit 1
2751                         fi
2752                         echo "(Then creating the symlinks...)" >&4
2753                         awk '{print $1}' $src/MANIFEST | while true; do
2754                                 read filename
2755                                 test -z "$filename" && break
2756                                 if test -f $filename; then
2757                                         if $issymlink $filename; then
2758                                                 rm -f $filename
2759                                         fi
2760                                 fi
2761                                 if test -f $filename; then
2762                                         echo "$filename already exists, not symlinking."
2763                                 else
2764                                         ln -s $src/$filename $filename
2765                                 fi
2766                         done
2767                         # Sanity check 2.
2768                         if test ! -f t/base/lex.t; then
2769                                 echo "Failed to create the symlinks (t/base/lex.t missing).  Aborting." >&4
2770                                 exit 1
2771                         fi
2772                         cd UU
2773                         ;;
2774                 *)      echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2775                         ;;
2776                 esac
2777                 ;;
2778         esac
2779         ;;
2780 esac
2781
2782 : Check for Cross-Compilation
2783 case "$usecrosscompile" in
2784 $define|true|[yY]*)
2785         $echo "Cross-compiling..."
2786         croak=''
2787         case "$cc" in
2788         *-*-gcc) # A cross-compiling gcc, probably.
2789             targetarch=`$echo $cc|$sed 's/-gcc$//'`
2790             ar=$targetarch-ar
2791             # leave out ld, choosing it is more complex
2792             nm=$targetarch-nm
2793             ranlib=$targetarch-ranlib
2794             $echo 'extern int foo;' > try.c
2795             set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2796             shift
2797             if $test $# -gt 0; then
2798                 incpth="$incpth $*"
2799                 incpth="`$echo $incpth|$sed 's/^ //'`"
2800                 echo "Guessing incpth '$incpth'." >&4
2801                 for i in $*; do
2802                     j="`$echo $i|$sed 's,/include$,/lib,'`"
2803                     if $test -d $j; then
2804                         libpth="$libpth $j"
2805                     fi
2806                 done   
2807                 libpth="`$echo $libpth|$sed 's/^ //'`"
2808                 echo "Guessing libpth '$libpth'." >&4
2809             fi
2810             $rm -f try.c
2811             ;;
2812         esac
2813         case "$targetarch" in
2814         '') echo "Targetarch not defined." >&4; croak=y ;;
2815         *)  echo "Using targetarch $targetarch." >&4 ;;
2816         esac
2817         case "$incpth" in
2818         '') echo "Incpth not defined." >&4; croak=y ;;
2819         *)  echo "Using incpth '$incpth'." >&4 ;;
2820         esac
2821         case "$libpth" in
2822         '') echo "Libpth not defined." >&4; croak=y ;;
2823         *)  echo "Using libpth '$libpth'." >&4 ;;
2824         esac
2825         case "$usrinc" in
2826         '') for i in $incpth; do
2827                 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2828                     usrinc=$i
2829                     echo "Guessing usrinc $usrinc." >&4
2830                     break
2831                 fi
2832             done
2833             case "$usrinc" in
2834             '') echo "Usrinc not defined." >&4; croak=y ;;
2835             esac
2836             ;;
2837         *)  echo "Using usrinc $usrinc." >&4 ;;
2838         esac
2839         case "$targethost" in
2840         '') echo "Targethost not defined." >&4; croak=y ;;
2841         *)  echo "Using targethost $targethost." >&4
2842         esac
2843         locincpth=' '
2844         loclibpth=' '
2845         case "$croak" in
2846         y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2847         esac
2848         case "$src" in
2849         /*) run=$src/Cross/run
2850             targetmkdir=$src/Cross/mkdir
2851             to=$src/Cross/to
2852             from=$src/Cross/from
2853             ;;
2854         *)  pwd=`$test -f ../Configure & cd ..; pwd`
2855             run=$pwd/Cross/run
2856             targetmkdir=$pwd/Cross/mkdir
2857             to=$pwd/Cross/to
2858             from=$pwd/Cross/from
2859             ;;
2860         esac
2861         case "$targetrun" in
2862         '') targetrun=ssh ;;
2863         esac
2864         case "$targetto" in
2865         '') targetto=scp ;;
2866         esac
2867         case "$targetfrom" in
2868         '') targetfrom=scp ;;
2869         esac
2870         run=$run-$targetrun
2871         to=$to-$targetto
2872         from=$from-$targetfrom
2873         case "$targetdir" in
2874         '')  targetdir=/tmp
2875              echo "Guessing targetdir $targetdir." >&4
2876              ;;
2877         esac
2878         case "$targetuser" in
2879         '')  targetuser=root
2880              echo "Guessing targetuser $targetuser." >&4
2881              ;;
2882         esac
2883         case "$targetfrom" in
2884         scp)    q=-q ;;
2885         *)      q='' ;;
2886         esac
2887         case "$targetrun" in
2888         ssh|rsh)
2889             cat >$run <<EOF
2890 #!/bin/sh
2891 case "\$1" in
2892 -cwd)
2893   shift
2894   cwd=\$1
2895   shift
2896   ;;
2897 esac
2898 case "\$cwd" in
2899 '') cwd=$targetdir ;;
2900 esac
2901 exe=\$1
2902 shift
2903 if $test ! -f \$exe.xok; then
2904   $to \$exe
2905   $touch \$exe.xok
2906 fi
2907 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2908 EOF
2909             ;;
2910         *)  echo "Unknown targetrun '$targetrun'" >&4
2911             exit 1
2912             ;;
2913         esac
2914         case "$targetmkdir" in
2915         */Cross/mkdir)
2916             cat >$targetmkdir <<EOF
2917 #!/bin/sh
2918 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2919 EOF
2920             $chmod a+rx $targetmkdir
2921             ;;
2922         *)  echo "Unknown targetmkdir '$targetmkdir'" >&4
2923             exit 1
2924             ;;
2925         esac
2926         case "$targetto" in
2927         scp|rcp)
2928             cat >$to <<EOF
2929 #!/bin/sh
2930 for f in \$@
2931 do
2932   case "\$f" in
2933   /*)
2934     $targetmkdir \`dirname \$f\`
2935     $targetto $q \$f $targetuser@$targethost:\$f            || exit 1
2936     ;;
2937   *)
2938     $targetmkdir $targetdir/\`dirname \$f\`
2939     $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2940     ;;
2941   esac
2942 done
2943 exit 0
2944 EOF
2945             ;;
2946         cp) cat >$to <<EOF
2947 #!/bin/sh
2948 for f in \$@
2949 do
2950   case "\$f" in
2951   /*)
2952     $mkdir -p $targetdir/\`dirname \$f\`
2953     $cp \$f $targetdir/\$f || exit 1
2954     ;;
2955   *)
2956     $targetmkdir $targetdir/\`dirname \$f\`
2957     $cp \$f $targetdir/\$f || exit 1
2958     ;;
2959   esac
2960 done
2961 exit 0
2962 EOF
2963             ;;
2964         *)  echo "Unknown targetto '$targetto'" >&4
2965             exit 1
2966             ;;
2967         esac
2968         case "$targetfrom" in
2969         scp|rcp)
2970           cat >$from <<EOF
2971 #!/bin/sh
2972 for f in \$@
2973 do
2974   $rm -f \$f
2975   $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2976 done
2977 exit 0
2978 EOF
2979             ;;
2980         cp) cat >$from <<EOF
2981 #!/bin/sh
2982 for f in \$@
2983 do
2984   $rm -f \$f
2985   cp $targetdir/\$f . || exit 1
2986 done
2987 exit 0
2988 EOF
2989             ;;
2990         *)  echo "Unknown targetfrom '$targetfrom'" >&4
2991             exit 1
2992             ;;
2993         esac
2994         if $test ! -f $run; then
2995             echo "Target 'run' script '$run' not found." >&4
2996         else
2997             $chmod a+rx $run
2998         fi
2999         if $test ! -f $to; then
3000             echo "Target 'to' script '$to' not found." >&4
3001         else
3002             $chmod a+rx $to
3003         fi
3004         if $test ! -f $from; then
3005             echo "Target 'from' script '$from' not found." >&4
3006         else
3007             $chmod a+rx $from
3008         fi
3009         if $test ! -f $run -o ! -f $to -o ! -f $from; then
3010             exit 1
3011         fi
3012         cat >&4 <<EOF
3013 Using '$run' for remote execution,
3014 and '$from' and '$to'
3015 for remote file transfer.
3016 EOF
3017         ;;
3018 *)      run=''
3019         to=:
3020         from=:
3021         usecrosscompile='undef'
3022         targetarch=''
3023         ;;
3024 esac
3025
3026 : see whether [:lower:] and [:upper:] are supported character classes
3027 echo " "
3028 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3029 ABYZ)
3030         echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3031         up='[:upper:]'
3032         low='[:lower:]'
3033         ;;
3034 *)      # There is a discontinuity in EBCDIC between 'R' and 'S'
3035         # (0xd9 and 0xe2), therefore that is a nice testing point.
3036         if test "X$up" = X -o "X$low" = X; then
3037             case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3038             rs) up='[A-Z]'
3039                 low='[a-z]'
3040                 ;;
3041             esac
3042         fi
3043         if test "X$up" = X -o "X$low" = X; then
3044             case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3045             rs) up='A-Z'
3046                 low='a-z'
3047                 ;;
3048             esac
3049         fi
3050         if test "X$up" = X -o "X$low" = X; then
3051             case "`echo RS | od -x 2>/dev/null`" in
3052             *D9E2*|*d9e2*)
3053                 echo "Hey, this might be EBCDIC." >&4
3054                 if test "X$up" = X -o "X$low" = X; then
3055                     case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3056                     rs) up='[A-IJ-RS-Z]'
3057                         low='[a-ij-rs-z]'
3058                         ;;
3059                     esac
3060                 fi
3061                 if test "X$up" = X -o "X$low" = X; then
3062                     case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3063                     rs) up='A-IJ-RS-Z'
3064                         low='a-ij-rs-z'
3065                         ;;
3066                     esac
3067                 fi
3068                 ;;
3069             esac
3070         fi
3071 esac
3072 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3073 rs)
3074     echo "Using $up and $low to convert case." >&4
3075     ;;
3076 *)
3077     echo "I don't know how to translate letters from upper to lower case." >&4
3078     echo "Your tr is not acting any way I know of." >&4
3079     exit 1
3080     ;;
3081 esac
3082 : set up the translation script tr, must be called with ./tr of course
3083 cat >tr <<EOSC
3084 $startsh
3085 case "\$1\$2" in
3086 '[A-Z][a-z]') exec $tr '$up' '$low';;
3087 '[a-z][A-Z]') exec $tr '$low' '$up';;
3088 esac
3089 exec $tr "\$@"
3090 EOSC
3091 chmod +x tr
3092 $eunicefix tr
3093
3094 : Try to determine whether config.sh was made on this system
3095 case "$config_sh" in
3096 '')
3097 myuname=`$uname -a 2>/dev/null`
3098 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3099 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3100 # because the A-Z/a-z are not consecutive.
3101 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3102         ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3103 newmyuname="$myuname"
3104 dflt=n
3105 case "$knowitall" in
3106 '')
3107         if test -f ../config.sh; then
3108                 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3109                         eval "`grep myuname= ../config.sh`"
3110                 fi
3111                 if test "X$myuname" = "X$newmyuname"; then
3112                         dflt=y
3113                 fi
3114         fi
3115         ;;
3116 *) dflt=y;;
3117 esac
3118
3119 : Get old answers from old config file if Configure was run on the
3120 : same system, otherwise use the hints.
3121 hint=default
3122 cd ..
3123 if test -f config.sh; then
3124         echo " "
3125         rp="I see a config.sh file.  Shall I use it to set the defaults?"
3126         . UU/myread
3127         case "$ans" in
3128         n*|N*) echo "OK, I'll ignore it."
3129                 mv config.sh config.sh.old
3130                 myuname="$newmyuname"
3131                 ;;
3132         *)  echo "Fetching default answers from your old config.sh file..." >&4
3133                 tmp_n="$n"
3134                 tmp_c="$c"
3135                 tmp_sh="$sh"
3136                 . ./config.sh
3137                 cp config.sh UU
3138                 n="$tmp_n"
3139                 c="$tmp_c"
3140                 : Older versions did not always set $sh.  Catch re-use of such
3141                 : an old config.sh.
3142                 case "$sh" in
3143                 '') sh="$tmp_sh" ;;
3144                 esac
3145                 hint=previous
3146                 ;;
3147         esac
3148 fi
3149 . ./UU/checkcc
3150 if test ! -f config.sh; then
3151         $cat <<EOM
3152
3153 First time through, eh?  I have some defaults handy for some systems
3154 that need some extra help getting the Configure answers right:
3155
3156 EOM
3157         (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/   /g' >&4
3158         dflt=''
3159         : Half the following guesses are probably wrong... If you have better
3160         : tests or hints, please send them to perlbug@perl.org
3161         : The metaconfig authors would also appreciate a copy...
3162         $test -f /irix && osname=irix
3163         $test -f /xenix && osname=sco_xenix
3164         $test -f /dynix && osname=dynix
3165         $test -f /dnix && osname=dnix
3166         $test -f /lynx.os && osname=lynxos
3167         $test -f /unicos && osname=unicos && osvers=`$uname -r`
3168         $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3169         $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3170         $test -f /bin/mips && /bin/mips && osname=mips
3171         $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3172                 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3173         $test -d /usr/apollo/bin && osname=apollo
3174         $test -f /etc/saf/_sactab && osname=svr4
3175         $test -d /usr/include/minix && osname=minix
3176         $test -f /system/gnu_library/bin/ar.pm && osname=vos
3177         if $test -d /MachTen -o -d /MachTen_Folder; then
3178                 osname=machten
3179                 if $test -x /sbin/version; then
3180                         osvers=`/sbin/version | $awk '{print $2}' |
3181                         $sed -e 's/[A-Za-z]$//'`
3182                 elif $test -x /usr/etc/version; then
3183                         osvers=`/usr/etc/version | $awk '{print $2}' |
3184                         $sed -e 's/[A-Za-z]$//'`
3185                 else
3186                         osvers="$2.$3"
3187                 fi
3188         fi
3189
3190         $test -f /sys/posix.dll &&
3191                 $test -f /usr/bin/what &&
3192                 set X `/usr/bin/what /sys/posix.dll` &&
3193                 $test "$3" = UWIN &&
3194                 osname=uwin &&
3195                 osvers="$5"
3196
3197         if $test -f $uname; then
3198                 set X $myuname
3199                 shift
3200
3201                 case "$5" in
3202                 fps*) osname=fps ;;
3203                 mips*)
3204                         case "$4" in
3205                         umips) osname=umips ;;
3206                         *) osname=mips ;;
3207                         esac;;
3208                 [23]100) osname=mips ;;
3209                 next*) osname=next ;;
3210                 i386*)
3211                         tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3212                         if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3213                                 osname='sco'
3214                                 osvers=$tmp
3215                         elif $test -f /etc/kconfig; then
3216                                 osname=isc
3217                                 if test "$lns" = "$ln -s"; then
3218                                         osvers=4
3219                                 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3220                                         osvers=3
3221                                 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3222                                         osvers=2
3223                                 fi
3224                         fi
3225                         tmp=''
3226                         ;;
3227                 pc*)
3228                         if test -n "$DJGPP"; then
3229                                 osname=dos
3230                                 osvers=djgpp
3231                         fi
3232                         ;;
3233                 esac
3234
3235                 case "$1" in
3236                 aix) osname=aix
3237                         tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3238                         case "$tmp" in
3239                         # oslevel can fail with:
3240                         # oslevel: Unable to acquire lock.
3241                         *not\ found) osvers="$4"."$3" ;;
3242                         '<3240'|'<>3240') osvers=3.2.0 ;;
3243                         '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3244                         '=3250'|'>3250') osvers=3.2.5 ;;
3245                         *) osvers=$tmp;;
3246                         esac
3247                         ;;
3248                 bsd386) osname=bsd386
3249                         osvers=`$uname -r`
3250                         ;;
3251                 cygwin*) osname=cygwin
3252                         osvers="$3"
3253                         ;;
3254                 *dc.osx) osname=dcosx
3255                         osvers="$3"
3256                         ;;
3257                 dnix) osname=dnix
3258                         osvers="$3"
3259                         ;;
3260                 domainos) osname=apollo
3261                         osvers="$3"
3262                         ;;
3263                 dgux)   osname=dgux
3264                         osvers="$3"
3265                         ;;
3266                 dragonfly) osname=dragonfly
3267                         osvers="$3"
3268                         ;;
3269                 dynixptx*) osname=dynixptx
3270                         osvers=`echo "$4"|sed 's/^v//'`
3271                         ;;
3272                 freebsd) osname=freebsd
3273                         osvers="$3" ;;
3274                 genix)  osname=genix ;;
3275                 gnu)    osname=gnu
3276                         osvers="$3" ;;
3277                 hp*)    osname=hpux
3278                         osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3279                         ;;
3280                 irix*)  osname=irix
3281                         case "$3" in
3282                         4*) osvers=4 ;;
3283                         5*) osvers=5 ;;
3284                         *)      osvers="$3" ;;
3285                         esac
3286                         ;;
3287                 linux)  osname=linux
3288                         case "$3" in
3289                         *)      osvers="$3" ;;
3290                         esac
3291                         ;;
3292                 MiNT)   osname=mint
3293                         ;;
3294                 netbsd*) osname=netbsd
3295                         osvers="$3"
3296                         ;;
3297                 news-os) osvers="$3"
3298                         case "$3" in
3299                         4*) osname=newsos4 ;;
3300                         *) osname=newsos ;;
3301                         esac
3302                         ;;
3303                 next*) osname=next ;;
3304                 nonstop-ux) osname=nonstopux ;;
3305                 openbsd) osname=openbsd
3306                         osvers="$3"
3307                         ;;
3308                 os2)    osname=os2
3309                         osvers="$4"
3310                         ;;
3311                 POSIX-BC | posix-bc ) osname=posix-bc
3312                         osvers="$3"
3313                         ;;
3314                 powerux | power_ux | powermax_os | powermaxos | \
3315                 powerunix | power_unix) osname=powerux
3316                         osvers="$3"
3317                         ;;
3318                 qnx) osname=qnx
3319                         osvers="$4"
3320                         ;;
3321                 solaris) osname=solaris
3322                         case "$3" in
3323                         5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3324                         *)      osvers="$3" ;;
3325                         esac
3326                         ;;
3327                 sunos) osname=sunos
3328                         case "$3" in
3329                         5*) osname=solaris
3330                                 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3331                         *)      osvers="$3" ;;
3332                         esac
3333                         ;;
3334                 titanos) osname=titanos
3335                         case "$3" in
3336                         1*) osvers=1 ;;
3337                         2*) osvers=2 ;;
3338                         3*) osvers=3 ;;
3339                         4*) osvers=4 ;;
3340                         *)      osvers="$3" ;;
3341                         esac
3342                         ;;
3343                 ultrix) osname=ultrix
3344                         osvers="$3"
3345                         ;;
3346                 osf1|mls+)      case "$5" in
3347                                 alpha)
3348                                         osname=dec_osf
3349                                         osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' |  tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3350                                         case "$osvers" in
3351                                         [1-9].[0-9]*) ;;
3352                                         *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3353                                         esac
3354                                         ;;
3355                         hp*)    osname=hp_osf1  ;;
3356                         mips)   osname=mips_osf1 ;;
3357                         esac
3358                         ;;
3359                 # UnixWare 7.1.2 is known as Open UNIX 8
3360                 openunix|unixware) osname=svr5
3361                         osvers="$4"
3362                         ;;
3363                 uts)    osname=uts
3364                         osvers="$3"
3365                         ;;
3366                 vos) osvers="$3"
3367                         ;;
3368                 $2) case "$osname" in
3369                         *isc*) ;;
3370                         *freebsd*) ;;
3371                         svr*)
3372                                 : svr4.x or possibly later
3373                                 case "svr$3" in
3374                                 ${osname}*)
3375                                         osname=svr$3
3376                                         osvers=$4
3377                                         ;;
3378                                 esac
3379                                 case "$osname" in
3380                                 svr4.0)
3381                                         : Check for ESIX
3382                                         if test -f /stand/boot ; then
3383                                                 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3384                                                 if test -n "$INITPROG" -a -f "$INITPROG"; then
3385                         isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3386                                                         if test -n "$isesix"; then
3387                                                                 osname=esix4
3388                                                         fi
3389                                                 fi
3390                                         fi
3391                                         ;;
3392                                 esac
3393                                 ;;
3394                         *)      if test -f /etc/systemid; then
3395                                         osname=sco
3396                                         set `echo $3 | $sed 's/\./ /g'` $4
3397                                         if $test -f $src/hints/sco_$1_$2_$3.sh; then
3398                                                 osvers=$1.$2.$3
3399                                         elif $test -f $src/hints/sco_$1_$2.sh; then
3400                                                 osvers=$1.$2
3401                                         elif $test -f $src/hints/sco_$1.sh; then
3402                                                 osvers=$1
3403                                         fi
3404                                 else
3405                                         case "$osname" in
3406                                         '') : Still unknown.  Probably a generic Sys V.
3407                                                 osname="sysv"
3408                                                 osvers="$3"
3409                                                 ;;
3410                                         esac
3411                                 fi
3412                                 ;;
3413                         esac
3414                         ;;
3415                 *)      case "$osname" in
3416                         '') : Still unknown.  Probably a generic BSD.
3417                                 osname="$1"
3418                                 osvers="$3"
3419                                 ;;
3420                         esac
3421                         ;;
3422                 esac
3423         else
3424                 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3425                         (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3426                         if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3427                                 osname=news_os
3428                         fi
3429                         $rm -f UU/kernel.what
3430                 elif test -d c:/. -o -n "$is_os2" ; then
3431                         set X $myuname
3432                         osname=os2
3433                         osvers="$5"
3434                 fi
3435         fi
3436
3437         case "$targetarch" in
3438         '') ;;
3439         *)  hostarch=$osname
3440             osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3441             osvers=''
3442             ;;
3443         esac
3444
3445         : Now look for a hint file osname_osvers, unless one has been
3446         : specified already.
3447         case "$hintfile" in
3448         ''|' ')
3449                 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3450                 : Also try without trailing minor version numbers.
3451                 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3452                 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3453                 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3454                 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3455                 case "$file" in
3456                 '') dflt=none ;;
3457                 *)  case "$osvers" in
3458                         '') dflt=$file
3459                                 ;;
3460                         *)  if $test -f $src/hints/$file.sh ; then
3461                                         dflt=$file
3462                                 elif $test -f $src/hints/$xfile.sh ; then
3463                                         dflt=$xfile
3464                                 elif $test -f $src/hints/$xxfile.sh ; then
3465                                         dflt=$xxfile
3466                                 elif $test -f $src/hints/$xxxfile.sh ; then
3467                                         dflt=$xxxfile
3468                                 elif $test -f $src/hints/$xxxxfile.sh ; then
3469                                         dflt=$xxxxfile
3470                                 elif $test -f "$src/hints/${osname}.sh" ; then
3471                                         dflt="${osname}"
3472                                 else
3473                                         dflt=none
3474                                 fi
3475                                 ;;
3476                         esac
3477                         ;;
3478                 esac
3479                 if $test -f Policy.sh ; then
3480                         case "$dflt" in
3481                         *Policy*) ;;
3482                         none) dflt="Policy" ;;
3483                         *) dflt="Policy $dflt" ;;
3484                         esac
3485                 fi
3486                 ;;
3487         *)
3488                 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3489                 ;;
3490         esac
3491
3492         if $test -f Policy.sh ; then
3493                 $cat <<EOM
3494
3495 There's also a Policy hint file available, which should make the
3496 site-specific (policy) questions easier to answer.
3497 EOM
3498
3499         fi
3500
3501         $cat <<EOM
3502
3503 You may give one or more space-separated answers, or "none" if appropriate.
3504 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3505 previous run of Configure, you may specify it as well as or instead of
3506 OS-specific hints.  If hints are provided for your OS, you should use them:
3507 although Perl can probably be built without hints on many platforms, using
3508 hints often improve performance and may enable features that Configure can't
3509 set up on its own. If there are no hints that match your OS, specify "none";
3510 DO NOT give a wrong version or a wrong OS.
3511
3512 EOM
3513
3514         rp="Which of these apply, if any?"
3515         . UU/myread
3516         tans=$ans
3517         for file in $tans; do
3518                 if $test X$file = XPolicy -a -f Policy.sh; then
3519                         . Policy.sh
3520                         $cat Policy.sh >> UU/config.sh
3521                 elif $test -f $src/hints/$file.sh; then
3522                         . $src/hints/$file.sh
3523                         $cat $src/hints/$file.sh >> UU/config.sh
3524                 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3525                         : nothing
3526                 else
3527                         : Give one chance to correct a possible typo.
3528                         echo "$file.sh does not exist"
3529                         dflt=$file
3530                         rp="hint to use instead?"
3531                         . UU/myread
3532                         for file in $ans; do
3533                                 if $test -f "$src/hints/$file.sh"; then
3534                                         . $src/hints/$file.sh
3535                                         $cat $src/hints/$file.sh >> UU/config.sh
3536                                 elif $test X$ans = X -o X$ans = Xnone ; then
3537                                         : nothing
3538                                 else
3539                                         echo "$file.sh does not exist -- ignored."
3540                                 fi
3541                         done
3542                 fi
3543         done
3544
3545         hint=recommended
3546         : Remember our hint file for later.
3547         if $test -f "$src/hints/$file.sh" ; then
3548                 hintfile="$file"
3549         else
3550                 hintfile=''
3551         fi
3552 fi
3553 cd UU
3554 ;;
3555 *)
3556         echo " "
3557         echo "Fetching default answers from $config_sh..." >&4
3558         tmp_n="$n"
3559         tmp_c="$c"
3560         cd ..
3561         cp $config_sh config.sh 2>/dev/null
3562         chmod +w config.sh
3563         . ./config.sh
3564         cd UU
3565         cp ../config.sh .
3566         n="$tmp_n"
3567         c="$tmp_c"
3568         hint=previous
3569         ;;
3570 esac
3571 test "$override" && . ./optdef.sh
3572
3573 : Restore computed paths
3574 for file in $loclist $trylist; do
3575         eval $file="\$_$file"
3576 done
3577
3578 cat << EOM
3579
3580 Configure uses the operating system name and version to set some defaults.
3581 The default value is probably right if the name rings a bell. Otherwise,
3582 since spelling matters for me, either accept the default or answer "none"
3583 to leave it blank.
3584
3585 EOM
3586 case "$osname" in
3587         ''|' ')
3588                 case "$hintfile" in
3589                 ''|' '|none) dflt=none ;;
3590                 *)  dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3591                 esac
3592                 ;;
3593         *) dflt="$osname" ;;
3594 esac
3595 rp="Operating system name?"
3596 . ./myread
3597 case "$ans" in
3598 none)  osname='' ;;
3599 *) osname=`echo "$ans" | $sed -e 's/[   ][      ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3600 esac
3601 echo " "
3602 case "$osvers" in
3603         ''|' ')
3604                 case "$hintfile" in
3605                 ''|' '|none) dflt=none ;;
3606                 *)      dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3607                         dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3608                         case "$dflt" in
3609                         ''|' ') dflt=none ;;
3610                         esac
3611                         ;;
3612                 esac
3613                 ;;
3614         *) dflt="$osvers" ;;
3615 esac
3616 rp="Operating system version?"
3617 . ./myread
3618 case "$ans" in
3619 none)  osvers='' ;;
3620 *) osvers="$ans" ;;
3621 esac
3622
3623
3624 . ./posthint.sh
3625
3626 : who configured the system
3627 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3628 case "$cf_by" in
3629 "")
3630         cf_by=`(logname) 2>/dev/null`
3631         case "$cf_by" in
3632         "")
3633                 cf_by=`(whoami) 2>/dev/null`
3634                 case "$cf_by" in
3635                 "") cf_by=unknown ;;
3636                 esac ;;
3637         esac ;;
3638 esac
3639
3640 : decide how portable to be.  Allow command line overrides.
3641 case "$d_portable" in
3642 "$undef") ;;
3643 *)      d_portable="$define" ;;
3644 esac
3645
3646 : set up shell script to do ~ expansion
3647 cat >filexp <<EOSS
3648 $startsh
3649 : expand filename
3650 case "\$1" in
3651  \~/*|\~)
3652         echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3653         ;;
3654  \~*)
3655         if $test -f /bin/csh; then
3656                 /bin/csh -f -c "glob \$1"
3657                 failed=\$?
3658                 echo ""
3659                 exit \$failed
3660         else
3661                 name=\`$expr x\$1 : '..\([^/]*\)'\`
3662                 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3663                 if $test ! -d "\$dir"; then
3664                         me=\`basename \$0\`
3665                         echo "\$me: can't locate home directory for: \$name" >&2
3666                         exit 1
3667                 fi
3668                 case "\$1" in
3669                 */*)
3670                         echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3671                         ;;
3672                 *)
3673                         echo \$dir
3674                         ;;
3675                 esac
3676         fi
3677         ;;
3678 *)
3679         echo \$1
3680         ;;
3681 esac
3682 EOSS
3683 chmod +x filexp
3684 $eunicefix filexp
3685
3686 : now set up to get a file name
3687 cat <<EOS >getfile
3688 $startsh
3689 EOS
3690 cat <<'EOSC' >>getfile
3691 tilde=''
3692 fullpath=''
3693 already=''
3694 skip=''
3695 none_ok=''
3696 exp_file=''
3697 nopath_ok=''
3698 orig_rp="$rp"
3699 orig_dflt="$dflt"
3700 case "$gfpth" in
3701 '') gfpth='.' ;;
3702 esac
3703
3704 case "$fn" in
3705 *\(*)
3706         : getfile will accept an answer from the comma-separated list
3707         : enclosed in parentheses even if it does not meet other criteria.
3708         expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3709         fn=`echo $fn | sed 's/(.*)//'`
3710         ;;
3711 esac
3712
3713 case "$fn" in
3714 *:*)
3715         loc_file=`expr $fn : '.*:\(.*\)'`
3716         fn=`expr $fn : '\(.*\):.*'`
3717         ;;
3718 esac
3719
3720 case "$fn" in
3721 *~*) tilde=true;;
3722 esac
3723 case "$fn" in
3724 */*) fullpath=true;;
3725 esac
3726 case "$fn" in
3727 *+*) skip=true;;
3728 esac
3729 case "$fn" in
3730 *n*) none_ok=true;;
3731 esac
3732 case "$fn" in
3733 *e*) exp_file=true;;
3734 esac
3735 case "$fn" in
3736 *p*) nopath_ok=true;;
3737 esac
3738
3739 case "$fn" in
3740 *f*) type='File';;
3741 *d*) type='Directory';;
3742 *l*) type='Locate';;
3743 esac
3744
3745 what="$type"
3746 case "$what" in
3747 Locate) what='File';;
3748 esac
3749
3750 case "$exp_file" in
3751 '')
3752         case "$d_portable" in
3753         "$define") ;;
3754         *) exp_file=true;;
3755         esac
3756         ;;
3757 esac
3758
3759 cd ..
3760 while test "$type"; do
3761         redo=''
3762         rp="$orig_rp"
3763         dflt="$orig_dflt"
3764         case "$tilde" in
3765         true) rp="$rp (~name ok)";;
3766         esac
3767         . UU/myread
3768         if test -f UU/getfile.ok && \
3769                 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3770         then
3771                 value="$ans"
3772                 ansexp="$ans"
3773                 break
3774         fi
3775         case "$ans" in
3776         none)
3777                 value=''
3778                 ansexp=''
3779                 case "$none_ok" in
3780                 true) type='';;
3781                 esac
3782                 ;;
3783         *)
3784                 case "$tilde" in
3785                 '') value="$ans"
3786                         ansexp="$ans";;
3787                 *)
3788                         value=`UU/filexp $ans`
3789                         case $? in
3790                         0)
3791                                 if test "$ans" != "$value"; then
3792                                         echo "(That expands to $value on this system.)"
3793                                 fi
3794                                 ;;
3795                         *) value="$ans";;
3796                         esac
3797                         ansexp="$value"
3798                         case "$exp_file" in
3799                         '') value="$ans";;
3800                         esac
3801                         ;;
3802                 esac
3803                 case "$fullpath" in
3804                 true)
3805                         case "$ansexp" in
3806                         /*) value="$ansexp" ;;
3807                         [a-zA-Z]:/*) value="$ansexp" ;;
3808                         *)
3809                                 redo=true
3810                                 case "$already" in
3811                                 true)
3812                                 echo "I shall only accept a full path name, as in /bin/ls." >&4
3813                                 echo "Use a ! shell escape if you wish to check pathnames." >&4
3814                                         ;;
3815                                 *)
3816                                 echo "Please give a full path name, starting with slash." >&4
3817                                         case "$tilde" in
3818                                         true)
3819                                 echo "Note that using ~name is ok provided it expands well." >&4
3820                                                 already=true
3821                                                 ;;
3822                                         esac
3823                                 esac
3824                                 ;;
3825                         esac
3826                         ;;
3827                 esac
3828                 case "$redo" in
3829                 '')
3830                         case "$type" in
3831                         File)
3832                                 for fp in $gfpth; do
3833                                         if test "X$fp" = X.; then
3834                                             pf="$ansexp"
3835                                         else    
3836                                             pf="$fp/$ansexp"
3837                                         fi
3838                                         if test -f "$pf"; then
3839                                                 type=''
3840                                         elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3841                                         then
3842                                                 echo "($value is not a plain file, but that's ok.)"
3843                                                 type=''
3844                                         fi
3845                                         if test X"$type" = X; then
3846                                             value="$pf"
3847                                             break
3848                                         fi
3849                                 done
3850                                 ;;
3851                         Directory)
3852                                 for fp in $gfpth; do
3853                                         if test "X$fp" = X.; then
3854                                             dir="$ans"
3855                                             direxp="$ansexp"
3856                                         else    
3857                                             dir="$fp/$ansexp"
3858                                             direxp="$fp/$ansexp"
3859                                         fi
3860                                         if test -d "$direxp"; then
3861                                                 type=''
3862                                                 value="$dir"
3863                                                 break
3864                                         fi
3865                                 done
3866                                 ;;
3867                         Locate)
3868                                 if test -d "$ansexp"; then
3869                                         echo "(Looking for $loc_file in directory $value.)"
3870                                         value="$value/$loc_file"
3871                                         ansexp="$ansexp/$loc_file"
3872                                 fi
3873                                 if test -f "$ansexp"; then
3874                                         type=''
3875                                 fi
3876                                 case "$nopath_ok" in
3877                                 true)   case "$value" in
3878                                         */*) ;;
3879                                         *)      echo "Assuming $value will be in people's path."
3880                                                 type=''
3881                                                 ;;
3882                                         esac
3883                                         ;;
3884                                 esac
3885                                 ;;
3886                         esac
3887
3888                         case "$skip" in
3889                         true) type='';
3890                         esac
3891
3892                         case "$type" in
3893                         '') ;;
3894                         *)
3895                                 if test "$fastread" = yes; then
3896                                         dflt=y
3897                                 else
3898                                         dflt=n
3899                                 fi
3900                                 rp="$what $value doesn't exist.  Use that name anyway?"
3901                                 . UU/myread
3902                                 dflt=''
3903                                 case "$ans" in
3904                                 y*) type='';;
3905                                 *) echo " ";;
3906                                 esac
3907                                 ;;
3908                         esac
3909                         ;;
3910                 esac
3911                 ;;
3912         esac
3913 done
3914 cd UU
3915 ans="$value"
3916 rp="$orig_rp"
3917 dflt="$orig_dflt"
3918 rm -f getfile.ok
3919 test "X$gfpthkeep" != Xy && gfpth=""
3920 EOSC
3921
3922 : determine root of directory hierarchy where package will be installed.
3923 case "$prefix" in
3924 '')
3925         dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3926         ;;
3927 *?/)
3928         dflt=`echo "$prefix" | sed 's/.$//'`
3929         ;;
3930 *)
3931         dflt="$prefix"
3932         ;;
3933 esac
3934 $cat <<EOM
3935
3936 By default, $package will be installed in $dflt/bin, manual pages
3937 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3938 installation directories. Typically this is something like /usr/local.
3939 If you wish to have binaries under /usr/bin but other parts of the
3940 installation under /usr/local, that's ok: you will be prompted
3941 separately for each of the installation directories, the prefix being
3942 only used to set the defaults.
3943
3944 EOM
3945 fn=d~
3946 rp='Installation prefix to use?'
3947 . ./getfile
3948 oldprefix=''
3949 case "$prefix" in
3950 '') ;;
3951 *)
3952         case "$ans" in
3953         "$prefix") ;;
3954         *) oldprefix="$prefix";;
3955         esac
3956         ;;
3957 esac
3958 prefix="$ans"
3959 prefixexp="$ansexp"
3960
3961 : allow them to override the AFS root
3962 case "$afsroot" in
3963 '')     afsroot=/afs ;;
3964 *)      afsroot=$afsroot ;;
3965 esac
3966
3967 : is AFS running?
3968 echo " "
3969 case "$afs" in
3970 $define|true)   afs=true ;;
3971 $undef|false)   afs=false ;;
3972 *)      if $test -d $afsroot; then
3973                 afs=true
3974         else
3975                 afs=false
3976         fi
3977         ;;
3978 esac
3979 if $afs; then
3980         echo "AFS may be running... I'll be extra cautious then..." >&4
3981 else
3982         echo "AFS does not seem to be running..." >&4
3983 fi
3984
3985 : determine installation prefix for where package is to be installed.
3986 if $afs; then 
3987 $cat <<EOM
3988
3989 Since you are running AFS, I need to distinguish the directory in which
3990 files will reside from the directory in which they are installed (and from
3991 which they are presumably copied to the former directory by occult means).
3992
3993 EOM
3994         case "$installprefix" in
3995         '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3996         *) dflt="$installprefix";;
3997         esac
3998 else
3999 $cat <<EOM
4000
4001 In some special cases, particularly when building $package for distribution,
4002 it is convenient to distinguish the directory in which files should be
4003 installed from the directory ($prefix) in which they will
4004 eventually reside.  For most users, these two directories are the same.
4005
4006 EOM
4007         case "$installprefix" in
4008         '') dflt=$prefix ;;
4009         *) dflt=$installprefix;;
4010         esac
4011 fi
4012 fn=d~
4013 rp='What installation prefix should I use for installing files?'
4014 . ./getfile
4015 installprefix="$ans"
4016 installprefixexp="$ansexp"
4017
4018 : Perform the prefixexp/installprefixexp correction if necessary
4019 cat <<EOS >installprefix
4020 $startsh
4021 EOS
4022 cat <<'EOSC' >>installprefix
4023 : Change installation prefix, if necessary.
4024 if $test X"$prefix" != X"$installprefix"; then
4025     eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4026 else
4027     eval "install${prefixvar}=\"\$${prefixvar}exp\""
4028 fi
4029 EOSC
4030 chmod +x installprefix
4031 $eunicefix installprefix
4032
4033 : Set variables such as privlib and privlibexp from the output of ./getfile
4034 : performing the prefixexp/installprefixexp correction if necessary.
4035 cat <<EOS >setprefixvar
4036 $startsh
4037 EOS
4038 cat <<'EOSC' >>setprefixvar
4039 eval "${prefixvar}=\"\$ans\""
4040 eval "${prefixvar}exp=\"\$ansexp\""
4041 . ./installprefix
4042 EOSC
4043 chmod +x setprefixvar
4044 $eunicefix setprefixvar
4045
4046 : set up the script used to warn in case of inconsistency
4047 cat <<EOS >whoa
4048 $startsh
4049 EOS
4050 cat <<'EOSC' >>whoa
4051 dflt=y
4052 case "$hint" in
4053     recommended)
4054         case "$hintfile" in
4055         '')     echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4056                 ;;
4057         *)      echo "Hmm.  Based on the hints in hints/$hintfile.sh, " >&4
4058                 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4059                 ;;
4060         esac
4061         ;;
4062     *)  echo " "
4063         echo "*** WHOA THERE!!! ***" >&4
4064         echo "    The $hint value for \$$var on this machine was \"$was\"!" >&4
4065         ;;
4066 esac
4067 rp="    Keep the $hint value?"
4068 . ./myread
4069 case "$ans" in
4070 y) td=$was; tu=$was;;
4071 esac
4072 EOSC
4073
4074 : function used to set '$1' to '$val'
4075 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4076 case "$val$was" in
4077 $define$undef) . ./whoa; eval "$var=\$td";;
4078 $undef$define) . ./whoa; eval "$var=\$tu";;
4079 *) eval "$var=$val";;
4080 esac'
4081
4082 : get the patchlevel
4083 echo " "
4084 echo "Getting the current patchlevel..." >&4
4085 if $test -r $rsrc/patchlevel.h;then
4086         revision=`awk '/define[         ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4087         patchlevel=`awk '/define[       ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4088         subversion=`awk '/define[       ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4089         api_revision=`awk '/define[     ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4090         api_version=`awk '/define[      ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4091         api_subversion=`awk '/define[   ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4092         perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4093 else
4094         revision=0
4095         patchlevel=0
4096         subversion=0
4097         api_revision=0
4098         api_version=0
4099         api_subversion=0
4100         perl_patchlevel=0
4101         $echo "(You do not have patchlevel.h.  Eek.)"
4102 fi
4103 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4104 version_patchlevel_string="version $patchlevel subversion $subversion"
4105 case "$perl_patchlevel" in
4106 0|'') ;;
4107 *)  perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4108     version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4109     ;;
4110 esac
4111
4112 $echo "(You have $package $version_patchlevel_string.)"
4113
4114 case "$osname" in
4115 dos|vms)
4116         : XXX Should be a Configure test for double-dots in filenames.
4117         version=`echo $revision $patchlevel $subversion | \
4118                  $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4119         api_versionstring=`echo $api_revision $api_version $api_subversion | \
4120                  $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4121         ;;
4122 *)
4123         version=`echo $revision $patchlevel $subversion | \
4124                  $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4125         api_versionstring=`echo $api_revision $api_version $api_subversion | \
4126                  $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4127         ;;
4128 esac
4129 : Special case the 5.005_xx maintenance series, which used 5.005
4130 : without any subversion label as a subdirectory in $sitelib
4131 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4132         api_versionstring='5.005'
4133 fi
4134
4135 : Do we want threads support and if so, what type
4136 case "$usethreads" in
4137 $define|true|[yY]*)     dflt='y';;
4138 *)     # Catch case where user specified ithreads or 5005threads but
4139        # forgot -Dusethreads (A.D. 4/2002)
4140        case "$useithreads$use5005threads" in
4141        *$define*)       dflt='y';;
4142        *)               dflt='n';;
4143        esac
4144        ;;
4145 esac
4146 cat <<EOM
4147
4148 Perl can be built to take advantage of threads on some systems.
4149 To do so, Configure can be run with -Dusethreads.
4150
4151 Note that Perl built with threading support runs slightly slower
4152 and uses more memory than plain Perl. The current implementation
4153 is believed to be stable, but it is fairly new, and so should be
4154 treated with caution.
4155
4156 If this doesn't make any sense to you, just accept the default '$dflt'.
4157 EOM
4158 rp='Build a threading Perl?'
4159 . ./myread
4160 case "$ans" in
4161 y|Y)    val="$define" ;;
4162 *)      val="$undef" ;;
4163 esac
4164 set usethreads
4165 eval $setvar
4166
4167 if $test $patchlevel -lt 9; then
4168     case "$usethreads" in
4169     $define)
4170         $cat <<EOM
4171
4172 Since release 5.6, Perl has had two different threading implementations,
4173 the newer interpreter-based version (ithreads) with one interpreter per
4174 thread, and the older 5.005 version (5005threads).
4175 The 5005threads version is effectively unmaintained and will probably be
4176 removed in Perl 5.10, so there should be no need to build a Perl using it
4177 unless needed for backwards compatibility with some existing 5.005threads
4178 code.
4179
4180 EOM
4181         : Default to ithreads unless overridden on command line or with
4182         : old config.sh
4183         dflt='y'
4184         case "$use5005threads" in
4185                 $define|true|[yY]*) dflt='n';;
4186         esac
4187         case "$useithreads" in
4188                 $undef|false|[nN]*) dflt='n';;
4189         esac
4190         rp='Use the newer interpreter-based ithreads?'
4191         . ./myread
4192         case "$ans" in
4193         y|Y)    val="$define" ;;
4194         *)      val="$undef" ;;
4195         esac
4196         set useithreads
4197         eval $setvar
4198         : Now set use5005threads to the opposite value.
4199         case "$useithreads" in
4200         $define) val="$undef" ;;
4201         *) val="$define" ;;
4202         esac
4203         set use5005threads
4204         eval $setvar
4205         ;;
4206     *)
4207         useithreads="$undef"
4208         use5005threads="$undef"
4209         ;;
4210     esac
4211
4212     case "$useithreads$use5005threads" in
4213     "$define$define")
4214         $cat >&4 <<EOM
4215
4216 You cannot have both the ithreads and the 5.005 threads enabled
4217 at the same time.  Disabling the 5.005 threads since they are
4218 much less stable than the ithreads.
4219
4220 EOM
4221         use5005threads="$undef"
4222         ;;
4223     esac
4224
4225 else
4226 : perl-5.9.x and later
4227
4228     if test X"$usethreads" = "X$define"; then
4229         case "$use5005threads" in
4230             $define|true|[yY]*)
4231                 $cat >&4 <<EOM
4232
4233 5.005 threads has been removed for 5.10.  Perl will be built using ithreads.
4234
4235 EOM
4236             ;;
4237         esac
4238     fi
4239
4240     use5005threads="$undef"
4241     useithreads="$usethreads"
4242 fi
4243
4244 case "$d_oldpthreads" in
4245 '')     : Configure tests would be welcome here.  For now, assume undef.
4246         val="$undef" ;;
4247 *)      val="$d_oldpthreads" ;;
4248 esac
4249 set d_oldpthreads
4250 eval $setvar
4251
4252
4253 : Look for a hint-file generated 'call-back-unit'.  If the
4254 : user has specified that a threading perl is to be built,
4255 : we may need to set or change some other defaults.
4256 if $test -f usethreads.cbu; then
4257     echo "Your platform has some specific hints regarding threaded builds, using them..."
4258     . ./usethreads.cbu
4259 else
4260     case "$usethreads" in
4261         "$define"|true|[yY]*)
4262                 $cat <<EOM
4263 (Your platform does not have any specific hints for threaded builds.
4264  Assuming POSIX threads, then.)
4265 EOM
4266         ;;
4267     esac
4268 fi
4269
4270 : Check if multiplicity is required
4271 cat <<EOM
4272
4273 Perl can be built so that multiple Perl interpreters can coexist
4274 within the same Perl executable.
4275 EOM
4276
4277 case "$useithreads" in
4278 $define)
4279         cat <<EOM
4280 This multiple interpreter support is required for interpreter-based threads.
4281 EOM
4282         val="$define"
4283         ;;
4284 *)      case "$usemultiplicity" in
4285         $define|true|[yY]*)     dflt='y';;
4286         *) dflt='n';;
4287         esac
4288         echo " "
4289         echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4290         rp='Build Perl for multiplicity?'
4291         . ./myread
4292         case "$ans" in
4293         y|Y)    val="$define" ;;
4294         *)      val="$undef" ;;
4295         esac
4296         ;;
4297 esac
4298 set usemultiplicity
4299 eval $setvar
4300
4301 : Check if morebits is requested
4302 case "$usemorebits" in
4303 "$define"|true|[yY]*)
4304         use64bitint="$define"
4305         uselongdouble="$define"
4306         usemorebits="$define"
4307         ;;
4308 *)      usemorebits="$undef"
4309         ;;
4310 esac
4311
4312 : Determine the C compiler to be used
4313 echo " "
4314 case "$cc" in
4315 '') dflt=cc;;
4316 *) dflt="$cc";;
4317 esac
4318 rp="Use which C compiler?"
4319 . ./myread
4320 cc="$ans"
4321
4322 : See whether they have no cc but they do have gcc
4323 . ./trygcc
4324 if $test -f cc.cbu; then
4325     . ./cc.cbu
4326 fi
4327 . ./checkcc
4328
4329 : make some quick guesses about what we are up against
4330 echo " "
4331 $echo $n "Hmm...  $c"
4332 echo exit 1 >bsd
4333 echo exit 1 >usg
4334 echo exit 1 >v7
4335 echo exit 1 >osf1
4336 echo exit 1 >eunice
4337 echo exit 1 >xenix
4338 echo exit 1 >venix
4339 echo exit 1 >os2
4340 d_bsd="$undef"
4341 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4342 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4343 then
4344         echo "Looks kind of like an OSF/1 system, but we'll see..."
4345         echo exit 0 >osf1
4346 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4347         xxx=`./loc addbib blurfl $pth`
4348         if $test -f $xxx; then
4349         echo "Looks kind of like a USG system with BSD features, but we'll see..."
4350                 echo exit 0 >bsd
4351                 echo exit 0 >usg
4352         else
4353                 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4354                         echo "Looks kind of like an extended USG system, but we'll see..."
4355                 else
4356                         echo "Looks kind of like a USG system, but we'll see..."
4357                 fi
4358                 echo exit 0 >usg
4359         fi
4360 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4361         echo "Looks kind of like a BSD system, but we'll see..."
4362         d_bsd="$define"
4363         echo exit 0 >bsd
4364 else
4365         echo "Looks kind of like a Version 7 system, but we'll see..."
4366         echo exit 0 >v7
4367 fi
4368 case "$eunicefix" in
4369 *unixtovms*)
4370         $cat <<'EOI'
4371 There is, however, a strange, musty smell in the air that reminds me of
4372 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4373 EOI
4374         echo exit 0 >eunice
4375         d_eunice="$define"
4376 : it so happens the Eunice I know will not run shell scripts in Unix format
4377         ;;
4378 *)
4379         echo " "
4380         echo "Congratulations.  You aren't running Eunice."
4381         d_eunice="$undef"
4382         ;;
4383 esac
4384 : Detect OS2.  The p_ variable is set above in the Head.U unit.
4385 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4386 : semicolon as a patch separator
4387 case "$p_" in
4388 :) ;;
4389 *)
4390         $cat <<'EOI'
4391 I have the feeling something is not exactly right, however...don't tell me...
4392 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4393 (Or you may be running DOS with DJGPP.)
4394 EOI
4395         echo exit 0 >os2
4396         ;;
4397 esac
4398 if test -f /xenix; then
4399         echo "Actually, this looks more like a XENIX system..."
4400         echo exit 0 >xenix
4401         d_xenix="$define"
4402 else
4403         echo " "
4404         echo "It's not Xenix..."
4405         d_xenix="$undef"
4406 fi
4407 chmod +x xenix
4408 $eunicefix xenix
4409 if test -f /venix; then
4410         echo "Actually, this looks more like a VENIX system..."
4411         echo exit 0 >venix
4412 else
4413         echo " "
4414         if ./xenix; then
4415                 : null
4416         else
4417                 echo "Nor is it Venix..."
4418         fi
4419 fi
4420 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4421 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4422 $rm -f foo
4423
4424 : Check if we are using GNU gcc and what its version is
4425 echo " "
4426 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4427 $cat >try.c <<EOM
4428 #include <stdio.h>
4429 int main() {
4430 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4431 #ifdef __VERSION__
4432         printf("%s\n", __VERSION__);
4433 #else
4434         printf("%s\n", "1");
4435 #endif
4436 #endif
4437         return(0);
4438 }
4439 EOM
4440 if $cc -o try $ccflags $ldflags try.c; then
4441         gccversion=`$run ./try`
4442         case "$gccversion" in
4443         '') echo "You are not using GNU cc." ;;
4444         *)  echo "You are using GNU cc $gccversion."
4445             ccname=gcc
4446             ;;
4447         esac
4448 else
4449         echo " "
4450         echo "*** WHOA THERE!!! ***" >&4
4451         echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
4452         case "$knowitall" in
4453         '')
4454         echo "    You'd better start hunting for one and let me know about it." >&4
4455                 exit 1
4456                 ;;
4457         esac
4458 fi
4459 $rm -f try try.*
4460 case "$gccversion" in
4461 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4462 esac
4463 case "$gccversion" in
4464 '') gccosandvers='' ;;
4465 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4466    gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4467    gccshortvers=''
4468    case "$gccosandvers" in
4469    $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4470    $osname$osvers) ;; # looking good
4471    $osname*) cat <<EOM >&4
4472
4473 *** WHOA THERE!!! ***
4474
4475     Your gcc has not been compiled for the exact release of
4476     your operating system ($gccosandvers versus $osname$osvers).
4477
4478     In general it is a good idea to keep gcc synchronized with
4479     the operating system because otherwise serious problems
4480     may ensue when trying to compile software, like Perl.
4481
4482     I'm trying to be optimistic here, though, and will continue.
4483     If later during the configuration and build icky compilation
4484     problems appear (headerfile conflicts being the most common
4485     manifestation), I suggest reinstalling the gcc to match
4486     your operating system release.
4487
4488 EOM
4489       ;;
4490    *) gccosandvers='' ;; # failed to parse, better be silent
4491    esac
4492    ;;
4493 esac
4494 case "$ccname" in
4495 '') ccname="$cc" ;;
4496 esac
4497
4498 # gcc 3.* complain about adding -Idirectories that they already know about,
4499 # so we will take those off from locincpth.
4500 case "$gccversion" in
4501 3*)
4502     echo "main(){}">try.c
4503     for incdir in $locincpth; do
4504        warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4505              grep '^c[cp]p*[01]: warning: changing search order '`
4506        if test "X$warn" != X; then
4507            locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4508        fi
4509     done
4510     $rm -f try try.*
4511 esac
4512
4513 : What should the include directory be ?
4514 echo " "
4515 $echo $n "Hmm...  $c"
4516 dflt='/usr/include'
4517 incpath=''
4518 mips_type=''
4519 if $test -f /bin/mips && /bin/mips; then
4520         echo "Looks like a MIPS system..."
4521         $cat >usr.c <<'EOCP'
4522 #ifdef SYSTYPE_BSD43
4523 /bsd43
4524 #endif
4525 EOCP
4526         if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4527                 dflt='/bsd43/usr/include'
4528                 incpath='/bsd43'
4529                 mips_type='BSD 4.3'
4530         else
4531                 mips_type='System V'
4532         fi
4533         $rm -f usr.c usr.out
4534         echo "and you're compiling with the $mips_type compiler and libraries."
4535         xxx_prompt=y
4536         echo "exit 0" >mips
4537 else
4538         echo "Doesn't look like a MIPS system."
4539         xxx_prompt=n
4540         echo "exit 1" >mips
4541 fi
4542 chmod +x mips
4543 $eunicefix mips
4544 case "$usrinc" in
4545 '') ;;
4546 *) dflt="$usrinc";;
4547 esac
4548 case "$xxx_prompt" in
4549 y)      fn=d/
4550         echo " "
4551         rp='Where are the include files you want to use?'
4552         . ./getfile
4553         usrinc="$ans"
4554         ;;
4555 *)      usrinc="$dflt"
4556         ;;
4557 esac
4558
4559 : see how we invoke the C preprocessor
4560 echo " "
4561 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4562 cat <<'EOT' >testcpp.c
4563 #define ABC abc
4564 #define XYZ xyz
4565 ABC.XYZ
4566 EOT
4567 cd ..
4568 if test ! -f cppstdin; then
4569         if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4570                 # AIX cc -E doesn't show the absolute headerfile
4571                 # locations but we'll cheat by using the -M flag.
4572                 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
4573         else
4574                 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4575         fi
4576 else
4577         echo "Keeping your $hint cppstdin wrapper."
4578 fi
4579 chmod 755 cppstdin
4580 wrapper=`pwd`/cppstdin
4581 ok='false'
4582 cd UU
4583
4584 if $test "X$cppstdin" != "X" && \
4585         $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4586         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4587 then
4588         echo "You used to use $cppstdin $cppminus so we'll use that again."
4589         case "$cpprun" in
4590         '') echo "But let's see if we can live without a wrapper..." ;;
4591         *)
4592                 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4593                         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4594                 then
4595                         echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4596                         ok='true'
4597                 else
4598                         echo "(However, $cpprun $cpplast does not work, let's see...)"
4599                 fi
4600                 ;;
4601         esac
4602 else
4603         case "$cppstdin" in
4604         '') ;;
4605         *)
4606                 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4607                 ;;
4608         esac
4609 fi
4610
4611 if $ok; then
4612         : nothing
4613 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4614         $cc -E <testcpp.c >testcpp.out 2>&1; \
4615         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4616         echo "Yup, it does."
4617         x_cpp="$cc -E"
4618         x_minus='';
4619 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4620         $cc -E - <testcpp.c >testcpp.out 2>&1; \
4621         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4622         echo "Yup, it does."
4623         x_cpp="$cc -E"
4624         x_minus='-';
4625 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4626         $cc -P <testcpp.c >testcpp.out 2>&1; \
4627         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4628         echo "Yipee, that works!"
4629         x_cpp="$cc -P"
4630         x_minus='';
4631 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4632         $cc -P - <testcpp.c >testcpp.out 2>&1; \
4633         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4634         echo "At long last!"
4635         x_cpp="$cc -P"
4636         x_minus='-';
4637 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4638         $cpp <testcpp.c >testcpp.out 2>&1; \
4639         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4640         echo "It works!"
4641         x_cpp="$cpp"
4642         x_minus='';
4643 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4644         $cpp - <testcpp.c >testcpp.out 2>&1; \
4645         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4646         echo "Hooray, it works!  I was beginning to wonder."
4647         x_cpp="$cpp"
4648         x_minus='-';
4649 elif echo 'Uh-uh.  Time to get fancy.  Trying a wrapper...'; \
4650         $wrapper <testcpp.c >testcpp.out 2>&1; \
4651         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4652         x_cpp="$wrapper"
4653         x_minus=''
4654         echo "Eureka!"
4655 else
4656         dflt=''
4657         rp="No dice.  I can't find a C preprocessor.  Name one:"
4658         . ./myread
4659         x_cpp="$ans"
4660         x_minus=''
4661         $x_cpp <testcpp.c >testcpp.out 2>&1
4662         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4663                 echo "OK, that will do." >&4
4664         else
4665 echo "Sorry, I can't get that to work.  Go find one and rerun Configure." >&4
4666                 exit 1
4667         fi
4668 fi
4669
4670 case "$ok" in
4671 false)
4672         cppstdin="$x_cpp"
4673         cppminus="$x_minus"
4674         cpprun="$x_cpp"
4675         cpplast="$x_minus"
4676         set X $x_cpp
4677         shift
4678         case "$1" in
4679         "$cpp")
4680                 echo "Perhaps can we force $cc -E using a wrapper..."
4681                 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4682                         $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4683                 then
4684                         echo "Yup, we can."
4685                         cppstdin="$wrapper"
4686                         cppminus='';
4687                 else
4688                         echo "Nope, we'll have to live without it..."
4689                 fi
4690                 ;;
4691         esac
4692         case "$cpprun" in
4693         "$wrapper")
4694                 cpprun=''
4695                 cpplast=''
4696                 ;;
4697         esac
4698         ;;
4699 esac
4700
4701 case "$cppstdin" in
4702 "$wrapper"|'cppstdin') ;;
4703 *) $rm -f $wrapper;;
4704 esac
4705 $rm -f testcpp.c testcpp.out
4706
4707 : Set private lib path
4708 case "$plibpth" in
4709 '') if ./mips; then
4710                 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4711         fi;;
4712 esac
4713 case "$libpth" in
4714 ' ') dlist='';;
4715 '') dlist="$loclibpth $plibpth $glibpth";;
4716 *) dlist="$libpth";;
4717 esac
4718
4719 : Now check and see which directories actually exist, avoiding duplicates
4720 libpth=''
4721 for xxx in $dlist
4722 do
4723     if $test -d $xxx; then
4724                 case " $libpth " in
4725                 *" $xxx "*) ;;
4726                 *) libpth="$libpth $xxx";;
4727                 esac
4728     fi
4729 done
4730 $cat <<'EOM'
4731
4732 Some systems have incompatible or broken versions of libraries.  Among
4733 the directories listed in the question below, please remove any you
4734 know not to be holding relevant libraries, and add any that are needed.
4735 Say "none" for none.
4736
4737 EOM
4738 case "$libpth" in
4739 '') dflt='none';;
4740 *)
4741         set X $libpth
4742         shift
4743         dflt=${1+"$@"}
4744         ;;
4745 esac
4746 rp="Directories to use for library searches?"
4747 . ./myread
4748 case "$ans" in
4749 none) libpth=' ';;
4750 *) libpth="$ans";;
4751 esac
4752
4753 : compute shared library extension
4754 case "$so" in
4755 '')
4756         if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4757                 dflt='sl'
4758         else
4759                 dflt='so'
4760         fi
4761         ;;
4762 *) dflt="$so";;
4763 esac
4764 $cat <<EOM
4765
4766 On some systems, shared libraries may be available.  Answer 'none' if
4767 you want to suppress searching of shared libraries for the remainder
4768 of this configuration.
4769
4770 EOM
4771 rp='What is the file extension used for shared libraries?'
4772 . ./myread
4773 so="$ans"
4774
4775 : Define several unixisms.
4776 : Hints files or command line option can be used to override them.
4777 : The convoluted testing is in case hints files set either the old
4778 : or the new name.
4779 case "$_exe" in
4780 '')     case "$exe_ext" in
4781         '')     ;;
4782         *)      _exe="$exe_ext" ;;
4783         esac
4784         ;;
4785 esac
4786 case "$_a" in
4787 '')     case "$lib_ext" in
4788     '') _a='.a';;
4789         *)      _a="$lib_ext" ;;
4790         esac
4791         ;;
4792 esac
4793 case "$_o" in
4794 '') case "$obj_ext" in
4795         '')     _o='.o';;
4796         *)      _o="$obj_ext";;
4797         esac
4798         ;;
4799 esac
4800 case "$p_" in
4801 '') case "$path_sep" in
4802         '')     p_=':';;
4803         *)      p_="$path_sep";;
4804         esac
4805         ;;
4806 esac
4807 exe_ext=$_exe
4808 lib_ext=$_a
4809 obj_ext=$_o
4810 path_sep=$p_
4811
4812 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4813
4814 : Which makefile gets called first.  This is used by make depend.
4815 case "$firstmakefile" in
4816 '') firstmakefile='makefile';;
4817 esac
4818
4819 : Check is we will use socks
4820 case "$usesocks" in
4821 $define|true|[yY]*)     dflt='y';;
4822 *) dflt='n';;
4823 esac
4824 cat <<EOM
4825
4826 Perl can be built to use the SOCKS proxy protocol library.  To do so,
4827 Configure must be run with -Dusesocks.  If you use SOCKS you also need
4828 to use the PerlIO abstraction layer, this will be implicitly selected.
4829
4830 If this doesn't make any sense to you, just accept the default '$dflt'.
4831 EOM
4832 rp='Build Perl for SOCKS?'
4833 . ./myread
4834 case "$ans" in
4835 y|Y)    val="$define" ;;
4836 *)      val="$undef" ;;
4837 esac
4838 set usesocks
4839 eval $setvar
4840
4841 : Check for uselongdouble support
4842 case "$ccflags" in
4843 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4844 esac
4845
4846 case "$uselongdouble" in
4847 $define|true|[yY]*)     dflt='y';;
4848 *) dflt='n';;
4849 esac
4850 cat <<EOM
4851
4852 Perl can be built to take advantage of long doubles which
4853 (if available) may give more accuracy and range for floating point numbers.
4854
4855 If this doesn't make any sense to you, just accept the default '$dflt'.
4856 EOM
4857 rp='Try to use long doubles if available?'
4858 . ./myread
4859 case "$ans" in
4860 y|Y)    val="$define"   ;;
4861 *)      val="$undef"    ;;
4862 esac
4863 set uselongdouble
4864 eval $setvar
4865
4866 case "$uselongdouble" in
4867 true|[yY]*) uselongdouble="$define" ;;
4868 esac