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