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