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