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