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