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