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