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