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