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