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