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