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