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