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