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