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