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