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