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