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