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