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