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