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