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