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