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