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