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