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