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