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