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