This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: no sigaction, no si fields
[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
MB
1319dtrace=''
1320usedtrace=''
15b61c98 1321usefaststdio=''
d78f9ffa 1322usekernprocpathname=''
b4eb6b3d
JH
1323ccflags_uselargefiles=''
1324ldflags_uselargefiles=''
1325libswanted_uselargefiles=''
1326uselargefiles=''
1327uselongdouble=''
1328usemorebits=''
1329usemultiplicity=''
2304df62 1330nm_opt=''
40a7a20a 1331nm_so_opt=''
2304df62
AD
1332runnm=''
1333usenm=''
ae60cb46 1334usensgetexecutablepath=''
b4eb6b3d 1335useperlio=''
f40bbcbf 1336usequadmath=''
29209bc5 1337usesocks=''
b4eb6b3d
JH
1338d_oldpthreads=''
1339use5005threads=''
1340useithreads=''
9514c62b 1341usereentrant=''
b4eb6b3d 1342usethreads=''
2304df62 1343incpath=''
2304df62
AD
1344mips_type=''
1345usrinc=''
d03b3b00 1346vaproto=''
b4eb6b3d
JH
1347d_vendorarch=''
1348installvendorarch=''
1349vendorarch=''
1350vendorarchexp=''
1351d_vendorbin=''
1352installvendorbin=''
1353vendorbin=''
1354vendorbinexp=''
8d2cbf27
JH
1355installvendorhtml1dir=''
1356vendorhtml1dir=''
1357vendorhtml1direxp=''
1358installvendorhtml3dir=''
1359vendorhtml3dir=''
1360vendorhtml3direxp=''
b4eb6b3d
JH
1361d_vendorlib=''
1362installvendorlib=''
1363vendorlib=''
1364vendorlib_stem=''
1365vendorlibexp=''
91e123a8
JH
1366installvendorman1dir=''
1367vendorman1dir=''
1368vendorman1direxp=''
1369installvendorman3dir=''
1370vendorman3dir=''
1371vendorman3direxp=''
b4eb6b3d
JH
1372usevendorprefix=''
1373vendorprefix=''
1374vendorprefixexp=''
6e1038e0
MB
1375d_vendorscript=''
1376installvendorscript=''
1377vendorscript=''
1378vendorscriptexp=''
d56c5707 1379versiononly=''
3659ebf1
JH
1380yacc=''
1381yaccflags=''
2304df62
AD
1382CONFIG=''
1383
34f1896b 1384: Detect odd OSs
ecfc5424
AD
1385define='define'
1386undef='undef'
1387smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1388rmlist=''
1389
1390: We must find out about Eunice early
1391eunicefix=':'
1392if test -f /etc/unixtovms; then
1393 eunicefix=/etc/unixtovms
1394fi
1395if test -f /etc/unixtovms.exe; then
1396 eunicefix=/etc/unixtovms.exe
1397fi
1398
cfb04860 1399: Set executable suffix now -- needed before hints available
6153ba32
PG
1400if test -f "/libs/version.library"; then
1401: Amiga OS
1402 _exe=""
1403elif test -f "/system/gnu_library/bin/ar.pm"; then
1404: Stratus VOS
cfb04860 1405 _exe=".pm"
6153ba32
PG
1406elif test -n "$DJGPP"; then
1407: DOS DJGPP
cfb04860 1408 _exe=".exe"
531d75b0
MB
1409elif test -f /kern/cookiejar; then
1410: MiNT
1411 _exe=""
5c728af0 1412elif test -d c:/. -o -n "$is_os2" ; then
506faf56 1413: OS/2 or cygwin
ba863942
JH
1414 _exe=".exe"
1415fi
868439a2 1416
1d8eaf8c 1417groupstype=''
b4eb6b3d 1418i_whoami=''
06501368
MB
1419: Trailing extension. Override this in a hint file, if needed.
1420: Extra object files, if any, needed on this platform.
1421archobjs=''
b8677e3b
MB
1422archname=''
1423: Possible local include directories to search.
1424: Set locincpth to "" in a hint file to defeat local include searches.
1425locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1426locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1427:
1428: no include file wanted by default
1429inclwanted=''
1430
1431: Enable -DEBUGGING and -DDEBUGGING from the command line
1432EBUGGING=''
356123f1 1433DEBUGGING=''
b8677e3b 1434
64615a5e 1435libnames=''
732c9516
JH
1436: change the next line if compiling for Xenix/286 on Xenix/386
1437xlibpth='/usr/lib/386 /lib/386'
732c9516
JH
1438: Possible local library directories to search.
1439loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1440loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1441
1442: general looking path for locating libraries
5869b1f1 1443glibpth="/lib /usr/lib $xlibpth"
732c9516 1444glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
f7dd4e7f
JH
1445test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1446test -f /shlib/libc.so && glibpth="/shlib $glibpth"
faae14e6 1447test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
732c9516
JH
1448
1449: Private path used by Configure to find libraries. Its value
1450: is prepended to libpth. This variable takes care of special
1451: machines, like the mips. Usually, it should be empty.
1452plibpth=''
1453
1cfa4ec7
GS
1454: default library list
1455libswanted=''
921b2963 1456: some systems want to use only the non-versioned libso:s
1cfa4ec7 1457ignore_versioned_solibs=''
06501368
MB
1458: set usethreads on the Configure command line to enable threads.
1459usereentrant='undef'
ed140128
AD
1460ccname=''
1461ccversion=''
1462perllibs=''
1463: set useposix=false in your hint file to disable the POSIX extension.
1464useposix=true
1465: set useopcode=false in your hint file to disable the Opcode extension.
1466useopcode=true
b4eb6b3d
JH
1467archname64=''
1468ccflags_uselargefiles=''
1469ldflags_uselargefiles=''
1470libswanted_uselargefiles=''
1471: set usemultiplicity on the Configure command line to enable multiplicity.
29209bc5 1472: set usesocks on the Configure command line to enable socks.
ecfc5424 1473: List of libraries we want.
15431986 1474: If anyone needs extra -lxxx, put those in a hint file.
4732711e 1475libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
90207ba1 1476libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
1aef975c 1477: We probably want to search /usr/shlib before most other libraries.
94b6baf5 1478: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
ecfc5424
AD
1479glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1480glibpth="/usr/shlib $glibpth"
1481: Do not use vfork unless overridden by a hint file.
1482usevfork=false
1483
8ff267be
PP
1484: Find the basic shell for Bourne shell scripts
1485case "$sh" in
1486'')
8ff267be
PP
1487 case "$SYSTYPE" in
1488 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1489 *) xxx='/bin/sh';;
1490 esac
1491 if test -f "$xxx"; then
1492 sh="$xxx"
1493 else
1494 : Build up a list and do a single loop so we can 'break' out.
1495 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1496 for xxx in sh bash ksh pdksh ash; do
1497 for p in $pth; do
1498 try="$try ${p}/${xxx}"
1499 done
1500 done
1501 for xxx in $try; do
1502 if test -f "$xxx"; then
1503 sh="$xxx";
8ff267be 1504 break
a5a94ea5
JH
1505 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1506 sh="$xxx";
1507 break
8ff267be
PP
1508 elif test -f "$xxx.exe"; then
1509 sh="$xxx";
8ff267be
PP
1510 break
1511 fi
1512 done
1513 fi
1514 ;;
1515esac
1516
1517case "$sh" in
a33c94aa 1518'') cat >&2 <<EOM
1332606d 1519$me: Fatal Error: I can't find a Bourne Shell anywhere.
dfe9444c 1520
8ff267be 1521Usually it's in /bin/sh. How did you even get this far?
1332606d 1522Please contact me (Perl Maintainers) at perlbug@perl.org and
dfe9444c 1523we'll try to straighten this all out.
8ff267be
PP
1524EOM
1525 exit 1
1526 ;;
1527esac
1528
871414da
JR
1529: When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1530: default both to the same thing, cross-compilers can then set targetsh differently if they like
1531targetsh=$sh
1532
760ac839 1533: see if sh knows # comments
73614538 1534if `$sh -c '#' >/dev/null 2>&1`; then
760ac839
LW
1535 shsharp=true
1536 spitshell=cat
760ac839 1537 xcat=/bin/cat
a931254c
JH
1538 test -f $xcat$_exe || xcat=/usr/bin/cat
1539 if test ! -f $xcat$_exe; then
4bdb8fb5 1540 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
a931254c 1541 if test -f $p/cat$_exe; then
1deb0a86 1542 xcat=$p/cat
3c728e00
JH
1543 break
1544 fi
1545 done
1deb0a86
JH
1546 if test ! -f $xcat$_exe; then
1547 echo "Can't find cat anywhere!"
3c728e00
JH
1548 exit 1
1549 fi
1550 fi
5440bc8e
JH
1551 echo "#!$xcat" >sharp
1552 $eunicefix sharp
1553 chmod +x sharp
1d8eaf8c 1554 ./sharp > today 2>/dev/null
760ac839 1555 if test -s today; then
760ac839
LW
1556 sharpbang='#!'
1557 else
5440bc8e
JH
1558 echo "#! $xcat" > sharp
1559 $eunicefix sharp
1560 chmod +x sharp
1d8eaf8c 1561 ./sharp > today 2>/dev/null
760ac839 1562 if test -s today; then
760ac839
LW
1563 sharpbang='#! '
1564 else
760ac839
LW
1565 sharpbang=': use '
1566 fi
1567 fi
1568else
dfe9444c 1569 echo " "
8ff267be 1570 echo "Your $sh doesn't grok # comments--I will strip them later on."
760ac839
LW
1571 shsharp=false
1572 cd ..
1573 echo "exec grep -v '^[ ]*#'" >spitshell
1574 chmod +x spitshell
1575 $eunicefix spitshell
1576 spitshell=`pwd`/spitshell
1577 cd UU
1578 echo "I presume that if # doesn't work, #! won't work either!"
1579 sharpbang=': use '
1580fi
5440bc8e 1581rm -f sharp today
760ac839
LW
1582
1583: figure out how to guarantee sh startup
8ff267be
PP
1584case "$startsh" in
1585'') startsh=${sharpbang}${sh} ;;
1586*)
760ac839 1587esac
5440bc8e 1588cat >sharp <<EOSS
760ac839
LW
1589$startsh
1590set abc
1591test "$?abc" != 1
1592EOSS
1593
5440bc8e
JH
1594chmod +x sharp
1595$eunicefix sharp
1596if ./sharp; then
8ff267be 1597 : echo "Yup, it does."
760ac839 1598else
dfe9444c
AD
1599 echo "Hmm... '$startsh' does not guarantee sh startup..."
1600 echo "You may have to fix up the shell scripts to make sure $sh runs them."
760ac839 1601fi
5440bc8e 1602rm -f sharp
760ac839 1603
aebf16e7
AD
1604: Save command line options in file UU/cmdline.opt for later use in
1605: generating config.sh.
1606cat > cmdline.opt <<EOSH
613d6c3e 1607: Configure command line arguments.
aebf16e7
AD
1608config_arg0='$0'
1609config_args='$*'
1610config_argc=$#
1611EOSH
1612argn=1
ee45ea83
IZ
1613args_exp=''
1614args_sep=''
aebf16e7
AD
1615for arg in "$@"; do
1616 cat >>cmdline.opt <<EOSH
1617config_arg$argn='$arg'
1618EOSH
ee45ea83
IZ
1619 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1620$arg
1621EOC
1622 arg_exp=`cat cmdl.opt`
1623 args_exp="$args_exp$args_sep'$arg_exp'"
aebf16e7 1624 argn=`expr $argn + 1`
ee45ea83 1625 args_sep=' '
aebf16e7 1626done
ee45ea83 1627rm -f cmdl.opt
aebf16e7 1628
2304df62
AD
1629: produce awk script to parse command line options
1630cat >options.awk <<'EOF'
1631BEGIN {
02e93a22 1632 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
2304df62
AD
1633
1634 len = length(optstr);
1635 for (i = 1; i <= len; i++) {
1636 c = substr(optstr, i, 1);
1637 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1638 if (a == ":") {
1639 arg[c] = 1;
1640 i++;
1641 }
1642 opt[c] = 1;
1643 }
1644}
1645{
1646 expect = 0;
1647 str = $0;
1648 if (substr(str, 1, 1) != "-") {
1649 printf("'%s'\n", str);
1650 next;
1651 }
1652 len = length($0);
1653 for (i = 2; i <= len; i++) {
1654 c = substr(str, i, 1);
1655 if (!opt[c]) {
1656 printf("-%s\n", substr(str, i));
1657 next;
1658 }
1659 printf("-%s\n", c);
1660 if (arg[c]) {
1661 if (i < len)
1662 printf("'%s'\n", substr(str, i + 1));
1663 else
1664 expect = 1;
1665 next;
1666 }
1667 }
1668}
1669END {
1670 if (expect)
1671 print "?";
1672}
1673EOF
1674
1675: process the command line options
4633a7c4
LW
1676set X `for arg in "$@"; do echo "X$arg"; done |
1677 sed -e s/X// | awk -f options.awk`
2304df62
AD
1678eval "set $*"
1679shift
1680rm -f options.awk
1681
1682: set up default values
1683fastread=''
1684reuseval=false
1685config_sh=''
1686alldone=''
1687error=''
1688silent=''
1689extractsh=''
16d20bd9 1690knowitall=''
02e93a22 1691rm -f optdef.sh posthint.sh
28757baa
PP
1692cat >optdef.sh <<EOS
1693$startsh
1694EOS
2304df62 1695
dfe9444c 1696
2304df62
AD
1697: option parsing
1698while test $# -gt 0; do
1699 case "$1" in
1700 -d) shift; fastread=yes;;
1701 -e) shift; alldone=cont;;
1702 -f)
1703 shift
1704 cd ..
1705 if test -r "$1"; then
1706 config_sh="$1"
1707 else
a0d0e21e 1708 echo "$me: cannot read config file $1." >&2
2304df62
AD
1709 error=true
1710 fi
1711 cd UU
1712 shift;;
3f30fabf 1713 --help|\
2304df62
AD
1714 -h) shift; error=true;;
1715 -r) shift; reuseval=true;;
dfe9444c 1716 -s) shift; silent=true; realsilent=true;;
2304df62 1717 -E) shift; alldone=exit;;
16d20bd9 1718 -K) shift; knowitall=true;;
41d73075 1719 -O) shift;;
dfe9444c 1720 -S) shift; silent=true; extractsh=true;;
a0d0e21e
LW
1721 -D)
1722 shift
1723 case "$1" in
1724 *=)
1725 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1726 echo "$me: ignoring -D $1" >&2
1727 ;;
ecfc5424 1728 *=*) echo "$1" | \
1aef975c
AD
1729 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1730 *) echo "$1='define'" >> optdef.sh;;
a0d0e21e
LW
1731 esac
1732 shift
1733 ;;
1734 -U)
1735 shift
1736 case "$1" in
1aef975c 1737 *=) echo "$1" >> optdef.sh;;
a0d0e21e
LW
1738 *=*)
1739 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1740 echo "$me: ignoring -U $1" >&2
1741 ;;
1aef975c 1742 *) echo "$1='undef'" >> optdef.sh;;
a0d0e21e
LW
1743 esac
1744 shift
1745 ;;
02e93a22
JH
1746 -A)
1747 shift
1748 xxx=''
1749 yyy="$1"
02e93a22 1750 zzz=''
5f83a3e9 1751 uuu=undef
02e93a22 1752 case "$yyy" in
f7c31117 1753 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
5f83a3e9
JH
1754 case "$zzz" in
1755 *:*) zzz='' ;;
1756 *) xxx=append
613d6c3e 1757 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
f7c31117 1758 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
5f83a3e9
JH
1759 esac
1760 ;;
1761 esac
1762 case "$xxx" in
1763 '') case "$yyy" in
f7c31117
JH
1764 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1765 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1766 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1767 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1768 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1769 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
5f83a3e9 1770 esac
613d6c3e 1771 ;;
5f83a3e9 1772 esac
02e93a22
JH
1773 case "$xxx" in
1774 append)
5f83a3e9 1775 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
02e93a22 1776 clear)
5f83a3e9 1777 echo "$yyy=''" >> posthint.sh ;;
02e93a22
JH
1778 define)
1779 case "$zzz" in
1780 '') zzz=define ;;
1781 esac
5f83a3e9 1782 echo "$yyy='$zzz'" >> posthint.sh ;;
02e93a22 1783 eval)
5f83a3e9 1784 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
02e93a22 1785 prepend)
5f83a3e9 1786 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
02e93a22
JH
1787 undef)
1788 case "$zzz" in
1789 '') zzz="$uuu" ;;
1790 esac
5f83a3e9
JH
1791 echo "$yyy=$zzz" >> posthint.sh ;;
1792 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
02e93a22 1793 esac
bde6b06b 1794 shift
02e93a22 1795 ;;
216dac04 1796 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
5f83a3e9 1797 exit 0;;
2304df62 1798 --) break;;
a0d0e21e 1799 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
2304df62
AD
1800 *) break;;
1801 esac
1802done
1803
1804case "$error" in
1805true)
1806 cat >&2 <<EOM
2afac517 1807Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
02e93a22 1808 [-U symbol] [-U symbol=] [-A command:symbol...]
2304df62
AD
1809 -d : use defaults for all answers.
1810 -e : go on without questioning past the production of config.sh.
1811 -f : specify an alternate default configuration file.
1812 -h : print this help message and exit (with an error status).
1813 -r : reuse C symbols value if possible (skips costly nm extraction).
1814 -s : silent mode, only echoes questions and essential information.
a0d0e21e
LW
1815 -D : define symbol to have some value:
1816 -D symbol symbol gets the value 'define'
1817 -D symbol=value symbol gets the value 'value'
3f30fabf
MB
1818 common used examples (see INSTALL for more info):
1819 -Duse64bitint use 64bit integers
b79e0b55 1820 -Duse64bitall use 64bit integers and pointers
3f30fabf 1821 -Dusethreads use thread support
b79e0b55 1822 -Dinc_version_list=none do not include older perl trees in @INC
3f30fabf
MB
1823 -DEBUGGING=none DEBUGGING options
1824 -Dcc=gcc choose your compiler
1825 -Dprefix=/opt/perl5 choose your destination
2304df62 1826 -E : stop at the end of questions, after having produced config.sh.
16d20bd9 1827 -K : do not use unless you know what you are doing.
41d73075 1828 -O : ignored for backward compatibility
2304df62 1829 -S : perform variable substitutions on all .SH files (can mix with -f)
a0d0e21e
LW
1830 -U : undefine symbol:
1831 -U symbol symbol gets the value 'undef'
1832 -U symbol= symbol gets completely empty
3f30fabf 1833 e.g.: -Uversiononly
02e93a22 1834 -A : manipulate symbol after the platform specific hints have been applied:
2ac814f3
MB
1835 -A append:symbol=value append value to symbol
1836 -A symbol=value like append:, but with a separating space
1837 -A define:symbol=value define symbol to have value
1838 -A clear:symbol define symbol to be ''
1839 -A define:symbol define symbol to be 'define'
1840 -A eval:symbol=value define symbol to be eval of value
1841 -A prepend:symbol=value prepend value to symbol
1842 -A undef:symbol define symbol to be 'undef'
1843 -A undef:symbol= define symbol to be ''
3f30fabf 1844 e.g.: -A prepend:libswanted='cl pthread '
2ac814f3 1845 -A ccflags=-DSOME_MACRO
2304df62
AD
1846 -V : print version number and exit (with a zero status).
1847EOM
1848 exit 1
1849 ;;
1850esac
1851
dfe9444c
AD
1852: Sanity checks
1853case "$fastread$alldone" in
1854yescont|yesexit) ;;
1855*)
aaeb8e51
GS
1856 case "$extractsh" in
1857 true) ;;
1858 *)
1859 if test ! -t 0; then
1860 echo "Say 'sh Configure', not 'sh <Configure'"
1861 exit 1
1862 fi
1863 ;;
1864 esac
dfe9444c
AD
1865 ;;
1866esac
1867
2304df62
AD
1868exec 4>&1
1869case "$silent" in
1870true) exec 1>/dev/null;;
1871esac
1872
ecfc5424 1873: run the defines and the undefines, if any, but leave the file out there...
1aef975c 1874touch optdef.sh
e244340e 1875grep '\\' optdef.sh >/dev/null 2>&1
e6704a40
MB
1876if test $? = 0; then
1877 echo "Configure does not support \\ in -D arguments"
1878 exit 1
1879fi
1aef975c 1880. ./optdef.sh
02e93a22
JH
1881: create the posthint manipulation script and leave the file out there...
1882touch posthint.sh
a0d0e21e 1883
2304df62 1884: set package name
34f1896b 1885package='perl5'
b4eb6b3d
JH
1886first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1887last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
e129ac51
AB
1888case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1889ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
b4eb6b3d
JH
1890*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1891esac
2304df62 1892
2304df62
AD
1893: Some greps do not return status, grrr.
1894echo "grimblepritz" >grimble
1895if grep blurfldyick grimble >/dev/null 2>&1 ; then
1896 contains=contains
1897elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1898 contains=grep
1899else
1900 contains=contains
1901fi
1902rm -f grimble
1903: the following should work in any shell
1904case "$contains" in
1905contains*)
1906 echo " "
1907 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1908 cat >contains <<'EOSS'
1909grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1910EOSS
1911chmod +x contains
1912esac
1913
dfe9444c
AD
1914: Find the path to the source tree
1915case "$src" in
1916'') case "$0" in
b233458b
JH
1917 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1918 case "$src" in
1919 /*) ;;
8504afb7 1920 .) ;;
b233458b
JH
1921 *) src=`cd ../$src && pwd` ;;
1922 esac
1923 ;;
dfe9444c
AD
1924 *) src='.';;
1925 esac;;
1926esac
1927case "$src" in
1928'') src=/
1929 rsrc=/
1930 ;;
34f1896b
MB
1931/*) rsrc="$src";;
1932*) rsrc="../$src";;
dfe9444c
AD
1933esac
1934if test -f $rsrc/Configure && \
34f1896b 1935 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
dfe9444c
AD
1936then
1937 : found it, so we are ok.
1938else
1939 rsrc=''
1940 for src in . .. ../.. ../../.. ../../../..; do
1941 if test -f ../$src/Configure && \
1942 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1943 then
1944 rsrc=../$src
1945 break
1946 fi
1947 done
1948fi
1949case "$rsrc" in
1950'')
1951 cat <<EOM >&4
1952
1953Sorry, I can't seem to locate the source dir for $package. Please start
1954Configure with an explicit path -- i.e. /some/path/Configure.
1955
1956EOM
1957 exit 1
1958 ;;
1959../.) rsrc='..';;
1960*)
1961 echo " "
1962 echo "Sources for $package found in \"$src\"." >&4
1963 ;;
1964esac
1965
1966: script used to extract .SH files with variable substitutions
1967cat >extract <<'EOS'
a02608de 1968PERL_CONFIG_SH=true
dfe9444c 1969echo "Doing variable substitutions on .SH files..."
24ccb310
JH
1970if test -f MANIFEST; then
1971 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
dfe9444c
AD
1972else
1973 echo "(Looking for .SH files under the source directory.)"
6904989c 1974 set x `(cd "$src"; find . -name "*.SH" -print)`
dfe9444c
AD
1975fi
1976shift
1977case $# in
6904989c 19780) set x `(cd "$src"; echo *.SH)`; shift;;
dfe9444c 1979esac
6904989c 1980if test ! -f "$src/$1"; then
dfe9444c
AD
1981 shift
1982fi
1983mkdir_p='
1984name=$1;
1985create="";
1986while test $name; do
1987 if test ! -d "$name"; then
1988 create="$name $create";
1989 name=`echo $name | sed -e "s|^[^/]*$||"`;
1990 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1991 else
1992 name="";
1993 fi;
1994done;
1995for file in $create; do
1996 mkdir $file;
1997done
1998'
1999for file in $*; do
2000 case "$src" in
2001 ".")
2002 case "$file" in
2003 */*)
2004 dir=`expr X$file : 'X\(.*\)/'`
2005 file=`expr X$file : 'X.*/\(.*\)'`
6904989c 2006 (cd "$dir" && . ./$file)
dfe9444c
AD
2007 ;;
2008 *)
2009 . ./$file
2010 ;;
2011 esac
2012 ;;
2013 *)
2014 case "$file" in
2015 */*)
2016 dir=`expr X$file : 'X\(.*\)/'`
2017 file=`expr X$file : 'X.*/\(.*\)'`
2018 (set x $dir; shift; eval $mkdir_p)
6904989c 2019 sh <"$src/$dir/$file"
dfe9444c
AD
2020 ;;
2021 *)
6904989c 2022 sh <"$src/$file"
dfe9444c
AD
2023 ;;
2024 esac
2025 ;;
2026 esac
2027done
6904989c 2028if test -f "$src/config_h.SH"; then
dfe9444c
AD
2029 if test ! -f config.h; then
2030 : oops, they left it out of MANIFEST, probably, so do it anyway.
6904989c 2031 . "$src/config_h.SH"
dfe9444c
AD
2032 fi
2033fi
2034EOS
2035
2036: extract files and exit if asked to do so
2037case "$extractsh" in
2038true)
2039 case "$realsilent" in
2040 true) ;;
2041 *) exec 1>&4;;
2042 esac
2043 case "$config_sh" in
2044 '') config_sh='config.sh';;
2045 esac
2046 echo " "
2047 echo "Fetching answers from $config_sh..."
2048 cd ..
2049 . $config_sh
7a4fcb3f 2050 . UU/optdef.sh
dfe9444c
AD
2051 echo " "
2052 . UU/extract
2053 rm -rf UU
24ccb310 2054 echo "Extraction done."
dfe9444c
AD
2055 exit 0
2056 ;;
2057esac
2058
2059: Eunice requires " " instead of "", can you believe it
2060echo " "
2061: Here we go...
2062echo "Beginning of configuration questions for $package."
2063
2064trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2065
2304df62
AD
2066: first determine how to suppress newline on echo command
2067echo " "
2068echo "Checking echo to see how to suppress newlines..."
2069(echo "hi there\c" ; echo " ") >.echotmp
2070if $contains c .echotmp >/dev/null 2>&1 ; then
2071 echo "...using -n."
2072 n='-n'
2073 c=''
2074else
2075 cat <<'EOM'
2076...using \c
2077EOM
2078 n=''
2079 c='\c'
2080fi
2081echo $n "The star should be here-->$c"
2082echo '*'
2083rm -f .echotmp
2084
2085: Now test for existence of everything in MANIFEST
2086echo " "
6904989c 2087if test -f "$rsrc/MANIFEST"; then
2304df62 2088 echo "First let's make sure your kit is complete. Checking..." >&4
1d8eaf8c 2089 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
776a38e3 2090 (split -l 50 2>/dev/null || split -50)
2304df62 2091 rm -f missing
dfe9444c 2092 tmppwd=`pwd`
2304df62 2093 for filelist in x??; do
776a38e3
MB
2094 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2095 >/dev/null 2>>"$tmppwd/missing")
2304df62
AD
2096 done
2097 if test -s missing; then
2098 cat missing >&4
2099 cat >&4 <<'EOM'
2100
2101THIS PACKAGE SEEMS TO BE INCOMPLETE.
2102
2103You have the option of continuing the configuration process, despite the
2104distinct possibility that your kit is damaged, by typing 'y'es. If you
2105do, don't blame me if something goes wrong. I advise you to type 'n'o
7f2de2d2 2106and contact the author (perlbug@perl.org).
2304df62
AD
2107
2108EOM
2109 echo $n "Continue? [n] $c" >&4
2110 read ans
2111 case "$ans" in
2112 y*)
2113 echo "Continuing..." >&4
2114 rm -f missing
2115 ;;
2116 *)
2117 echo "ABORTING..." >&4
2118 kill $$
2119 ;;
2120 esac
2121 else
dfe9444c 2122 echo "Looks good..."
2304df62
AD
2123 fi
2124else
2125 echo "There is no MANIFEST file. I hope your kit is complete !"
2126fi
2127rm -f missing x??
2128
5ff3f7a4 2129: Find the appropriate value for a newline for tr
613d6c3e 2130echo " "
5ff3f7a4
GS
2131if test -n "$DJGPP"; then
2132 trnl='\012'
2133fi
2134if test X"$trnl" = X; then
2135 case "`echo foo|tr '\n' x 2>/dev/null`" in
2136 foox) trnl='\n' ;;
2137 esac
2138fi
2139if test X"$trnl" = X; then
2140 case "`echo foo|tr '\012' x 2>/dev/null`" in
2141 foox) trnl='\012' ;;
2142 esac
2143fi
2144if test X"$trnl" = X; then
8be2c24c
JH
2145 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2146 fooxy) trnl='\n\r' ;;
2147 esac
2148fi
2149if test X"$trnl" = X; then
5ff3f7a4
GS
2150 cat <<EOM >&2
2151
2152$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2153
2154EOM
2155 exit 1
2156fi
2157
2304df62
AD
2158: compute the number of columns on the terminal for proper question formatting
2159case "$COLUMNS" in
2160'') COLUMNS='80';;
2161esac
2162
2163: set up the echo used in my read
2164myecho="case \"\$xxxm\" in
2165'') echo $n \"\$rp $c\" >&4;;
2166*) case \"\$rp\" in
2167 '') echo $n \"[\$xxxm] $c\";;
2168 *)
2169 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2170 echo \"\$rp\" >&4
2171 echo $n \"[\$xxxm] $c\" >&4
2172 else
2173 echo $n \"\$rp [\$xxxm] $c\" >&4
2174 fi
2175 ;;
2176 esac;;
2177esac"
2178
2179: now set up to do reads with possible shell escape and default assignment
2180cat <<EOSC >myread
28757baa 2181$startsh
2304df62
AD
2182xxxm=\$dflt
2183$myecho
2184ans='!'
2185case "\$fastread" in
2186yes) case "\$dflt" in
2187 '') ;;
2188 *) ans='';
2189 case "\$silent-\$rp" in
2190 true-) ;;
2191 *) echo " " >&4;;
2192 esac;;
2193 esac;;
2194*) case "\$silent" in
2195 true) case "\$rp" in
2196 '') ans='';;
2197 esac;;
2198 esac;;
2199esac
2200while expr "X\$ans" : "X!" >/dev/null; do
2201 read answ
2202 set x \$xxxm
2203 shift
dfe9444c 2204 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2304df62 2205 case "\$answ" in
dfe9444c
AD
2206 "!")
2207 sh 1>&4
2208 echo " "
2209 $myecho
2210 ;;
2211 !*)
2212 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2213 shift
2214 sh 1>&4 -c "\$*"
2215 echo " "
2216 $myecho
2217 ;;
2304df62
AD
2218 "\$ans")
2219 case "\$ans" in
ecfc5424
AD
2220 \\&*)
2221 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2222 shift
2223 case "\$1" in
2224 -d)
2225 fastread=yes
40a7a20a 2226 echo "(OK, I'll run with -d after this question.)" >&4
ecfc5424
AD
2227 ;;
2228 -*)
40a7a20a 2229 echo "*** Sorry, \$1 not supported yet." >&4
ecfc5424
AD
2230 ;;
2231 esac
2232 $myecho
2233 ans=!
2234 ;;
2304df62
AD
2235 esac;;
2236 *)
2237 case "\$aok" in
2238 y)
2239 echo "*** Substitution done -- please confirm."
2240 xxxm="\$ans"
c9795ab7 2241 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2304df62
AD
2242 xxxm="\$ans"
2243 ans=!
2244 ;;
2245 *)
2246 echo "*** Error -- try again."
2247 ans=!
2248 ;;
2249 esac
2250 $myecho
2251 ;;
2252 esac
2253 case "\$ans\$xxxm\$nostick" in
2254 '')
2255 ans=!
2256 $myecho
2257 ;;
2258 esac
2259done
2260case "\$ans" in
2261'') ans="\$xxxm";;
2262esac
2263EOSC
2264
2265: create .config dir to save info across Configure sessions
2266test -d ../.config || mkdir ../.config
2267cat >../.config/README <<EOF
2268This directory created by Configure to save information that should
dfe9444c 2269persist across sessions for $package.
2304df62
AD
2270
2271You may safely delete it if you wish.
2272EOF
2273
613d6c3e 2274: See if we are using a devel version and want that
9507cadf 2275xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
af960fef 2276case "$usedevel" in
1be1b388
MB
2277$define|true|[yY]*)
2278 usedevel="$define" ;;
9507cadf 2279*) case "$xversion" in
0107c034
JH
2280 *[13579])
2281 cat >&4 <<EOH
2282*** WHOA THERE!!! ***
2283
2284 This is an UNSTABLE DEVELOPMENT release.
9507cadf
JH
2285 The version of this $package distribution is $xversion, that is, odd,
2286 (as opposed to even) and that signifies a development release.
3d5d58b1 2287 If you want a maintenance release, you want an even-numbered version.
0107c034
JH
2288
2289 Do ***NOT*** install this into production use.
2290 Data corruption and crashes are possible.
2291
2292 It is most seriously suggested that you do not continue any further
2293 unless you want to help in developing and debugging Perl.
2294
6adc6a45
JH
2295 If you *still* want to build perl, you can answer 'y' now,
2296 or pass -Dusedevel to Configure.
2297
0107c034
JH
2298EOH
2299 rp='Do you really want to continue?'
2300 dflt='n'
2301 . ./myread
2302 case "$ans" in
8feeef0e
JH
2303 [yY]) echo >&4 "Okay, continuing."
2304 usedevel="$define" ;;
0107c034
JH
2305 *) echo >&4 "Okay, bye."
2306 exit 1
2307 ;;
2308 esac
2309 ;;
2310 esac
1be1b388 2311 usedevel="$undef"
0107c034
JH
2312 ;;
2313esac
8feeef0e
JH
2314case "$usedevel" in
2315$define|true|[yY]*)
2316 case "$versiononly" in
2317 '') versiononly="$define" ;;
2318 esac
2319 case "$installusrbinperl" in
2320 '') installusrbinperl="$undef" ;;
2321 esac
2322 ;;
2323esac
0107c034 2324
2304df62
AD
2325: general instructions
2326needman=true
2327firsttime=true
760ac839 2328user=`(logname) 2>/dev/null`
dfe9444c
AD
2329case "$user" in
2330'') user=`whoami 2>&1`;;
760ac839 2331esac
2304df62
AD
2332if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2333 firsttime=false
2334 echo " "
2335 rp='Would you like to see the instructions?'
2336 dflt=n
2337 . ./myread
2338 case "$ans" in
2339 [yY]*) ;;
2340 *) needman=false;;
2341 esac
2342fi
2343if $needman; then
2344 cat <<EOH
4e2a5f63 2345
2304df62 2346This installation shell script will examine your system and ask you questions
a0d0e21e 2347to determine how the perl5 package should be installed. If you get
2304df62
AD
2348stuck on a question, you may use a ! shell escape to start a subshell or
2349execute a command. Many of the questions will have default answers in square
2350brackets; typing carriage return will give you the default.
2351
2352On some of the questions which ask for file or directory names you are allowed
2353to use the ~name construct to specify the login directory belonging to "name",
2354even if you don't have a shell which knows about that. Questions where this is
2355allowed will be marked "(~name ok)".
2356
2357EOH
2358 rp=''
2359 dflt='Type carriage return to continue'
2360 . ./myread
2361 cat <<'EOH'
2362
2363The prompter used in this script allows you to use shell variables and
2364backticks in your answers. You may use $1, $2, etc... to refer to the words
2365in the default answer, as if the default line was a set of arguments given to a
2366script shell. This means you may also use $* to repeat the whole default line,
2367so you do not have to re-type everything to add something to the default.
2368
cd95ead5 2369Every time there is a substitution, you will have to confirm. If there is an
2304df62
AD
2370error (e.g. an unmatched backtick), the default answer will remain unchanged
2371and you will be prompted again.
2372
2373If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2374the questions and use the computed defaults (or the previous answers if there
2375was already a config.sh file). Type 'Configure -h' for a list of options.
ecfc5424 2376You may also start interactively and then answer '& -d' at any prompt to turn
dfe9444c 2377on the non-interactive behaviour for the remainder of the execution.
2304df62
AD
2378
2379EOH
2380 . ./myread
2381 cat <<EOH
2382
2383Much effort has been expended to ensure that this shell script will run on any
2384Unix system. If despite that it blows up on yours, your best bet is to edit
40000a8c
AD
2385Configure and run it again. If you can't run Configure for some reason,
2386you'll have to generate a config.sh file by hand. Whatever problems you
7f2de2d2 2387have, let me (perlbug@perl.org) know how I blew it.
2304df62
AD
2388
2389This installation script affects things in two ways:
2390
23911) it may do direct variable substitutions on some of the files included
2392 in this kit.
23932) it builds a config.h file for inclusion in C programs. You may edit
2394 any of these files as the need arises after running this script.
2395
2396If you make a mistake on a question, there is no easy way to back up to it
2397currently. The easiest thing to do is to edit config.sh and rerun all the SH
2398files. Configure will offer to let you do this before it runs the SH files.
2399
2400EOH
2401 dflt='Type carriage return to continue'
2402 . ./myread
2403 case "$firsttime" in
2404 true) echo $user >>../.config/instruct;;
2405 esac
2406fi
2407
56b575b9
MB
2408: Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2409: This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2410if test "X$sysroot" = X; then
2411 sysroot=""
2412else
2413 case "$cc" in
2414 *gcc*|*g++*)
2415 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2416 # _sysroot is used in places where we need --sysroot=foo
2417 # but using the rest of the flags could cause issues.
2418 _sysroot="--sysroot=$sysroot";
2419 case "$ccflags" in
2420 *sysroot*) ;;
2421 'undef'|*)
2422 ccflags="$ccflags $_sysroot"
2423 esac
2424 case "$ldflags" in
2425 *sysroot*) ;;
2426 'undef'|*)
2427 ldflags="$ldflags $_sysroot"
2428 esac
2429 case "$cppflags" in
2430 *sysroot*) ;;
2431 'undef'|*)
2432 cppflags="$cppflags $_sysroot"
2433 esac
2434 # lddlflags updated below in lddlflags section;
2435 # same with cccdlflags
2436 ;;
2437 esac
2438
2439 # Adjust some defaults to also use $sysroot
2440 for var in xlibpth loclibpth locincpth glibpth; do
2441 eval xxx=\$$var
2442 eval $var=''
2443 for path in $xxx; do
2444 eval $var=\"\$$var $sysroot$path\"
2445 done
2446 done
2447
2448fi
2449
2304df62
AD
2450: find out where common programs are
2451echo " "
2452echo "Locating common programs..." >&4
2453cat <<EOSC >loc
2454$startsh
2455case \$# in
24560) exit 1;;
2457esac
2458thing=\$1
2459shift
2460dflt=\$1
2461shift
2462for dir in \$*; do
2463 case "\$thing" in
2464 .)
2465 if test -d \$dir/\$thing; then
2466 echo \$dir
2467 exit 0
2468 fi
2469 ;;
2470 *)
a0d0e21e 2471 for thisthing in \$dir/\$thing; do
ecfc5424 2472 : just loop through to pick last item
a0d0e21e 2473 done
25f94b33 2474 if test -f \$thisthing; then
a0d0e21e 2475 echo \$thisthing
2304df62 2476 exit 0
a5a94ea5
JH
2477 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2478 echo \$thisthing
776a38e3 2479 exit 0
2304df62 2480 elif test -f \$dir/\$thing.exe; then
c4f23d77
AD
2481 if test -n "$DJGPP"; then
2482 echo \$dir/\$thing.exe
b921d661 2483 elif test "$eunicefix" != ":"; then
c4f23d77
AD
2484 : on Eunice apparently
2485 echo \$dir/\$thing
2486 fi
2d736872 2487 exit 0
2304df62
AD
2488 fi
2489 ;;
2490 esac
2491done
2492echo \$dflt
2493exit 1
2494EOSC
2495chmod +x loc
2496$eunicefix loc
2497loclist="
2498awk
2499cat
f8006fac 2500chmod
b4eb6b3d
JH
2501comm
2502cp
2304df62
AD
2503echo
2504expr
2505grep
a0d0e21e 2506ls
b4eb6b3d 2507mkdir
2304df62
AD
2508rm
2509sed
b4eb6b3d 2510sort
85e6fe83 2511touch
2304df62 2512tr
b4eb6b3d 2513uniq
2304df62
AD
2514"
2515trylist="
dfe9444c 2516ar
3659ebf1 2517bison
b4eb6b3d 2518byacc
2304df62 2519cpp
b4eb6b3d 2520csh
2304df62
AD
2521date
2522egrep
1fef16b3 2523gmake
8ff267be 2524gzip
b4eb6b3d 2525less
8ff267be 2526ln
3c728e00 2527make
b4eb6b3d 2528more
693762b4 2529nm
b4eb6b3d 2530nroff
b8677e3b 2531perl
b4eb6b3d 2532pg
2304df62
AD
2533test
2534uname
8ff267be 2535zip
2304df62 2536"
8e07c86e 2537pth=`echo $PATH | sed -e "s/$p_/ /g"`
98b12e44 2538pth="$pth $sysroot/lib $sysroot/usr/lib"
2304df62 2539for file in $loclist; do
dfe9444c
AD
2540 eval xxx=\$$file
2541 case "$xxx" in
2542 /*|?:[\\/]*)
2543 if test -f "$xxx"; then
2544 : ok
2545 else
2546 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2547 xxx=`./loc $file $file $pth`
2548 fi
2549 ;;
2550 '') xxx=`./loc $file $file $pth`;;
2551 *) xxx=`./loc $xxx $xxx $pth`;;
2552 esac
a5a94ea5 2553 eval $file=$xxx$_exe
2304df62
AD
2554 eval _$file=$xxx
2555 case "$xxx" in
2556 /*)
2557 echo $file is in $xxx.
2558 ;;
8e07c86e
AD
2559 ?:[\\/]*)
2560 echo $file is in $xxx.
2561 ;;
2304df62 2562 *)
25f94b33
AD
2563 echo "I don't know where '$file' is, and my life depends on it." >&4
2564 echo "Go find a public domain implementation or fix your PATH setting!" >&4
4633a7c4 2565 exit 1
2304df62
AD
2566 ;;
2567 esac
2568done
2569echo " "
2570echo "Don't worry if any of the following aren't found..."
2571say=offhand
2572for file in $trylist; do
dfe9444c
AD
2573 eval xxx=\$$file
2574 case "$xxx" in
2575 /*|?:[\\/]*)
2576 if test -f "$xxx"; then
2577 : ok
2578 else
2579 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2580 xxx=`./loc $file $file $pth`
2581 fi
2582 ;;
2583 '') xxx=`./loc $file $file $pth`;;
2584 *) xxx=`./loc $xxx $xxx $pth`;;
2585 esac
306a8474 2586 eval $file=$xxx$_exe
2304df62
AD
2587 eval _$file=$xxx
2588 case "$xxx" in
2589 /*)
2590 echo $file is in $xxx.
2591 ;;
8e07c86e
AD
2592 ?:[\\/]*)
2593 echo $file is in $xxx.
2594 ;;
2304df62
AD
2595 *)
2596 echo "I don't see $file out there, $say."
2597 say=either
2598 ;;
2599 esac
2600done
2601case "$egrep" in
1fef16b3 2602egrep)
2304df62
AD
2603 echo "Substituting grep for egrep."
2604 egrep=$grep
868439a2 2605 _egrep=$grep
2304df62
AD
2606 ;;
2607esac
3141af47
MB
2608case "$less" in
2609'') ;;
a872f748 2610*) if $less -R </dev/null >/dev/null 2>&1; then
3141af47
MB
2611 echo "Substituting less -R for less."
2612 less="$less -R"
2613 _less=$less
2614 fi
2615 ;;
2616esac
8ff267be 2617case "$ln" in
1fef16b3 2618ln)
8ff267be
PP
2619 echo "Substituting cp for ln."
2620 ln=$cp
868439a2 2621 _ln=$cp
8ff267be
PP
2622 ;;
2623esac
2e26f1d5 2624case "$make" in
613d6c3e 2625make)
2e26f1d5
JH
2626 case "$gmake" in
2627 gmake)
2628 echo "I can't find make or gmake, and my life depends on it." >&4
2629 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2630 exit 1
2631 ;;
2632 esac
2633 ;;
613d6c3e 2634esac
2e26f1d5
JH
2635case "$gmake" in
2636gmake) ;;
2637*) # We can't have osname yet.
1fef16b3
JH
2638 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2639 # Assume that gmake, if found, is definitely GNU make
2640 # and prefer it over the system make.
2641 echo "Substituting gmake for make."
2642 make=$gmake
868439a2 2643 _make=$gmake
1fef16b3
JH
2644 fi
2645 ;;
a5a94ea5 2646esac
2304df62
AD
2647case "$test" in
2648test)
2649 echo "Hopefully test is built into your sh."
2650 ;;
2651*)
73614538 2652 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
5d644a95 2653 echo "Using the test built into your sh."
2304df62
AD
2654 test=test
2655 _test=test
2656 fi
2657 ;;
2658esac
2659case "$echo" in
2660echo)
2661 echo "Hopefully echo is built into your sh."
2662 ;;
2663'') ;;
2664*)
2665 echo " "
2666echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2667 $echo $n "hi there$c" >foo1
2668 echo $n "hi there$c" >foo2
2669 if cmp foo1 foo2 >/dev/null 2>&1; then
2670 echo "They are compatible. In fact, they may be identical."
2671 else
2672 case "$n" in
2673 '-n') n='' c='\c';;
2674 *) n='-n' c='';;
2675 esac
2676 cat <<FOO
2677They are not compatible! You are probably running ksh on a non-USG system.
2678I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2679have echo built in and we may have to run some Bourne shell scripts. That
2680means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2681
2682FOO
2683 $echo $n "The star should be here-->$c"
2684 $echo "*"
2685 fi
2686 $rm -f foo1 foo2
2687 ;;
2688esac
2689
2f88d857
MB
2690# This question was auctioned at YAPC::Europe-2007 in Vienna
2691# I never promised you could answer it. I only auctioned the question.
2692cat <<FOO
2693The following message is sponsored by
2694
2695 Dresden.pm<--The stars should be here.
2696
2697Dear Perl user, system administrator or package
2698maintainer, the Perl community sends greetings to
2699you. Do you (emblematical) greet back [Y/n]? n
2700
2701FOO
2702
613d6c3e 2703: Check what type of C compiler we use
6b769f8f 2704cat <<EOS >trygcc
2573c5f9
JH
2705$startsh
2706EOS
6b769f8f 2707cat <<'EOSC' >>trygcc
2573c5f9
JH
2708case "$cc" in
2709'') ;;
2710*) $rm -f try try.*
2711 $cat >try.c <<EOM
2712int main(int argc, char *argv[]) {
2713 return 0;
2714}
2715EOM
e4778687 2716 if $cc -o try $ccflags $ldflags try.c; then
2573c5f9
JH
2717 :
2718 else
2719 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2720 despair=yes
2721 trygcc=yes
2722 case "$cc" in
2723 *gcc*) trygcc=no ;;
2724 esac
dce40316
AD
2725 # Skip this test because it gives a false match on output like:
2726 # ./trygcc: line 23: cc: command not found
2727 # case "`$cc -v -c try.c 2>&1`" in
2728 # *gcc*) trygcc=no ;;
2729 # esac
2573c5f9
JH
2730 if $test X"$trygcc" = Xyes; then
2731 if gcc -o try -c try.c; then
2732 echo " "
2733 echo "You seem to have a working gcc, though." >&4
dce40316
AD
2734 # Switching compilers may undo the work of hints files.
2735 # The most common problem is -D_REENTRANT for threads.
2736 # This heuristic catches that case, but gets false positives
2737 # if -Dusethreads was not actually specified. Better to
d0166596 2738 # bail out here with a useful message than fail
dce40316
AD
2739 # mysteriously later. Should we perhaps just try to
2740 # re-invoke Configure -Dcc=gcc config_args ?
2741 if $test -f usethreads.cbu; then
d0166596 2742 $cat >&4 <<EOM
dce40316
AD
2743
2744*** However, any setting of the C compiler flags (e.g. for thread support)
2745*** will be lost. It may be necessary for you to restart Configure and
2746*** add -Dcc=gcc to your Configure command line.
2747
2748EOM
2749 rp="Would you like to go ahead and try gcc anyway?"
2750 dflt=n
2751 else
2752 rp="Would you like to use it?"
2753 dflt=y
2754 fi
2573c5f9
JH
2755 if $test -f myread; then
2756 . ./myread
2757 else
2758 if $test -f UU/myread; then
2759 . ./UU/myread
2760 else
2761 echo "Cannot find myread, sorry. Aborting." >&2
2762 exit 1
2763 fi
d0166596 2764 fi
2573c5f9 2765 case "$ans" in
6371411c 2766 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2573c5f9
JH
2767 esac
2768 fi
2769 fi
6b769f8f
RB
2770 fi
2771 $rm -f try try.*
2772 ;;
2773esac
2774EOSC
2775
2776cat <<EOS >checkcc
2777$startsh
2778EOS
2779cat <<'EOSC' >>checkcc
d0166596 2780case "$cc" in
6b769f8f 2781'') ;;
d0166596 2782*) $rm -f try try.*
6b769f8f
RB
2783 $cat >try.c <<EOM
2784int main(int argc, char *argv[]) {
2785 return 0;
2786}
2787EOM
2788 if $cc -o try $ccflags $ldflags try.c; then
2789 :
2790 else
2573c5f9 2791 if $test X"$despair" = Xyes; then
6b769f8f
RB
2792 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2793 fi
d0166596 2794 $cat >&4 <<EOM
5dd4fbdf
MB
2795You need to find a working C compiler.
2796Either (purchase and) install the C compiler supplied by your OS vendor,
2797or for a free C compiler try http://gcc.gnu.org/
2798I cannot continue any further, aborting.
2799EOM
6b769f8f 2800 exit 1
2573c5f9
JH
2801 fi
2802 $rm -f try try.*
2803 ;;
2804esac
2805EOSC
2806
a0d0e21e
LW
2807: determine whether symbolic links are supported
2808echo " "
2809$touch blurfl
2810if $ln -s blurfl sym > /dev/null 2>&1 ; then
2811 echo "Symbolic links are supported." >&4
818f00be 2812 lns="$ln -s"
a0d0e21e
LW
2813else
2814 echo "Symbolic links are NOT supported." >&4
2815 lns="$ln"
2816fi
2817$rm -f blurfl sym
2818
dafca956
JH
2819: determine whether symbolic links are supported
2820echo " "
2821case "$lns" in
18ea2752 2822*"ln"*" -s")
dafca956
JH
2823 echo "Checking how to test for symbolic links..." >&4
2824 $lns blurfl sym
4b661809 2825 if $test "X$issymlink" = X; then
2e2a97a6
JH
2826 case "$newsh" in
2827 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2828 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2829 esac
5d644a95
MB
2830 if test $? = 0; then
2831 issymlink="test -h"
2e2a97a6
JH
2832 else
2833 echo "Your builtin 'test -h' may be broken." >&4
2834 case "$test" in
2835 /*) ;;
2836 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2837 for p in $pth
2838 do
2839 if test -f "$p/$test"; then
2840 test="$p/$test"
2841 break
2842 fi
2843 done
2844 ;;
2845 esac
2846 case "$test" in
2847 /*)
2848 echo "Trying external '$test -h'." >&4
2849 issymlink="$test -h"
2850 if $test ! -h sym >/dev/null 2>&1; then
3c728e00 2851 echo "External '$test -h' is broken, too." >&4
2e2a97a6
JH
2852 issymlink=''
2853 fi
2854 ;;
2855 *) issymlink='' ;;
2856 esac
1332606d 2857 fi
5d644a95 2858 fi
4b661809 2859 if $test "X$issymlink" = X; then
dafca956 2860 if $test -L sym 2>/dev/null; then
5d644a95 2861 issymlink="$test -L"
2e2a97a6 2862 echo "The builtin '$test -L' worked." >&4
dafca956
JH
2863 fi
2864 fi
4b661809 2865 if $test "X$issymlink" != X; then
5d644a95 2866 echo "You can test for symbolic links with '$issymlink'." >&4
dafca956
JH
2867 else
2868 echo "I do not know how you can test for symbolic links." >&4
2869 fi
2870 $rm -f blurfl sym
2871 ;;
2872*) echo "No symbolic links, so not testing for their testing..." >&4
2873 ;;
2874esac
2875echo " "
2876
34f1896b 2877: Make symlinks util
dafca956
JH
2878case "$mksymlinks" in
2879$define|true|[yY]*)
2880 case "$src" in
2881 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2882 exit 1
2883 ;;
4b661809 2884 *) case "$lns:$issymlink" in
f314eb9f 2885 *"ln"*" -s:"*"test -"?)
dafca956 2886 echo "Creating the symbolic links..." >&4
dafca956 2887 cd ..
7191ba82
AF
2888 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2889 awk 'NF == 1 {
2890 dir=".";
2891 file=$1 "";
2892 }
2893 NF == 2 {
2894 dir=$1 "";
2895 file=$2 "";
2896 }
2897 {
2898 print "# dir = ", dir, "file = ", file
f40bbcbf 2899 mf[dir] = mf[dir]" "source"/"dir"/"file;
7191ba82
AF
2900 } END {
2901 for (d in mf) {
2902 if (d != ".") { print("mkdir -p "d) }
2903 print("ln -sf "mf[d]" "d);
2904 }
f40bbcbf 2905 }' source="$src" > UU/mksymlinks.$$
7191ba82
AF
2906 sh UU/mksymlinks.$$
2907 rm UU/mksymlinks.$$
dafca956
JH
2908 # Sanity check 1.
2909 if test ! -d t/base; then
2910 echo "Failed to create the subdirectories. Aborting." >&4
2911 exit 1
2912 fi
dafca956 2913 # Sanity check 2.
a0d24b8a
JH
2914 if test ! -f t/base/lex.t; then
2915 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
dafca956
JH
2916 exit 1
2917 fi
7191ba82
AF
2918 if test ! -f win32/win32.c; then
2919 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2920 exit 1
2921 fi
dafca956
JH
2922 cd UU
2923 ;;
2924 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2925 ;;
2926 esac
2927 ;;
2928 esac
2929 ;;
2930esac
2931
613d6c3e 2932: Check for Cross-Compilation
56b575b9
MB
2933if $test "X$targethost" = "X"; then
2934 targethost=""
2935fi
f53a6e0e
MB
2936if $test "X$targetenv" = "X"; then
2937 targetenv=""
2938fi
5440bc8e
JH
2939case "$usecrosscompile" in
2940$define|true|[yY]*)
93bc48fa 2941 $echo "Cross-compiling..."
56b575b9
MB
2942 croak=''
2943 case "$cc" in
2944 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2945 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2946 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2947 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2948 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2949 # leave out ld, choosing it is more complex
2950 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2951 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2952 # We are in a weird spot. Just before us, some values
2953 # were 'saved', to be restored after the hints are
2954 # run. This means that the changes we made to ar,
2955 # nm and ranlib will get reverted.
2956 # To avoid that, we hijack the saving mechanism and
2957 # have it save our new values.
2958 for file in ar nm ranlib; do
2959 eval xxx=\$$file
2960 eval $file=$xxx$_exe
2961 eval _$file=$xxx
2962 done
2963 ;;
5440bc8e
JH
2964 esac
2965 case "$targetarch" in
93bc48fa 2966 '') echo "Targetarch not defined." >&4; croak=y ;;
56b575b9 2967 *) echo "Using targetarch $targetarch." >&4 ;;
5440bc8e 2968 esac
93bc48fa
JH
2969 case "$targethost" in
2970 '') echo "Targethost not defined." >&4; croak=y ;;
56b575b9 2971 *) echo "Using targethost $targethost." >&4
5440bc8e 2972 esac
93bc48fa
JH
2973 locincpth=' '
2974 loclibpth=' '
5440bc8e 2975 case "$croak" in
93bc48fa 2976 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
5440bc8e 2977 esac
b98f6b80
JR
2978 : compile a host miniperl and generate_uudmap, unless we got passed them
2979 if $test "X$hostperl" = X; then
2980 echo "Building host miniperl and generate_uudmap binaries" >&4
4346df8f 2981 before_host=`pwd`
b98f6b80 2982 cd ..
4346df8f
BF
2983 cd $src
2984 src=`pwd`
f53a6e0e
MB
2985 rm -rf $src/host
2986 mkdir $src/host
2987 cd $src/host
4346df8f 2988 $src/Configure -des -Dusedevel -Dmksymlinks
1ca484ac
BF
2989 $make miniperl
2990 case "$hostgenerate" in
2991 '') $make generate_uudmap
f53a6e0e 2992 hostgenerate=$src/host/generate_uudmap
1ca484ac
BF
2993 ;;
2994 "$undef") hostgenerate=''
2995 ;;
2996 esac
4346df8f 2997 hostperl=$src/host/miniperl
4346df8f 2998 cd $before_host
b98f6b80 2999 fi
b36f1e2d 3000 hostosname=`$hostperl -le 'print $^O'`
cb87e003
JR
3001 ;;
3002*)
b75b1e25 3003 usecrosscompile="$undef"
cb87e003
JR
3004 ;;
3005esac
3006
3007: Define -Dtargethost=somecomputer to run compiled tests on another machine
0eafc8c9 3008case "$targethost" in
97076f2d
NW
3009 '') echo "Checking for cross-compile" >&4
3010 case "$usecrosscompile$multiarch" in
dbb1f24e 3011 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
97076f2d
NW
3012 if [ -f Makefile ]; then
3013 echo " "
3014 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3015 else
3016 echo "Configure done."
3017 fi
3018 exit 0
3019 ;;
97076f2d 3020 *) echo "No targethost for running compiler tests against defined, running locally" >&4
0eafc8c9
JR
3021 run=''
3022 to=:
3023 from=:
3024 ;;
dbb1f24e
NW
3025 esac
3026 ;;
0eafc8c9 3027 *) echo "Using targethost $targethost." >&4
5440bc8e
JH
3028 case "$src" in
3029 /*) run=$src/Cross/run
93c0359c 3030 targetmkdir=$src/Cross/mkdir
5440bc8e
JH
3031 to=$src/Cross/to
3032 from=$src/Cross/from
3033 ;;
93bc48fa 3034 *) pwd=`$test -f ../Configure & cd ..; pwd`
5440bc8e 3035 run=$pwd/Cross/run
f8006fac 3036 targetmkdir=$pwd/Cross/mkdir
5440bc8e
JH
3037 to=$pwd/Cross/to
3038 from=$pwd/Cross/from
3039 ;;
3040 esac
3041 case "$targetrun" in
3042 '') targetrun=ssh ;;
3043 esac
3044 case "$targetto" in
3045 '') targetto=scp ;;
3046 esac
3047 case "$targetfrom" in
3048 '') targetfrom=scp ;;
3049 esac
56b575b9
MB
3050 run=$run-$targetrun
3051 to=$to-$targetto
3052 from=$from-$targetfrom
93bc48fa
JH
3053 case "$targetdir" in
3054 '') targetdir=/tmp
56b575b9
MB
3055 echo "Guessing targetdir $targetdir." >&4
3056 ;;
93bc48fa 3057 esac
5440bc8e 3058 case "$targetuser" in
93bc48fa 3059 '') targetuser=root
56b575b9
MB
3060 echo "Guessing targetuser $targetuser." >&4
3061 ;;
5440bc8e 3062 esac
dad780ec
JR
3063 case "$targetport" in
3064 '') targetport=22
56b575b9
MB
3065 echo "Guessing targetport $targetport." >&4
3066 ;;
dad780ec 3067 esac
5440bc8e
JH
3068 case "$targetfrom" in
3069 scp) q=-q ;;
3070 *) q='' ;;
3071 esac
3072 case "$targetrun" in
3073 ssh|rsh)
3074 cat >$run <<EOF
3075#!/bin/sh
d1739b52 3076env=''
93c0359c
JH
3077case "\$1" in
3078-cwd)
3079 shift
3080 cwd=\$1
3081 shift
3082 ;;
3083esac
d1739b52
BF
3084case "\$1" in
3085-env)
3086 shift
3087 env=\$1
3088 shift
3089 ;;
3090esac
93c0359c
JH
3091case "\$cwd" in
3092'') cwd=$targetdir ;;
3093esac
5440bc8e
JH
3094exe=\$1
3095shift
dad780ec 3096$to \$exe
03deea9f 3097$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
5440bc8e
JH
3098EOF
3099 ;;
e9867f21
BF
3100 adb)
3101 $touch $run
3102 ;;
93bc48fa 3103 *) echo "Unknown targetrun '$targetrun'" >&4
5440bc8e
JH
3104 exit 1
3105 ;;
3106 esac
93c0359c
JH
3107 case "$targetmkdir" in
3108 */Cross/mkdir)
3109 cat >$targetmkdir <<EOF
3110#!/bin/sh
dad780ec 3111$targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
93c0359c 3112EOF
f8006fac 3113 $chmod a+rx $targetmkdir
93c0359c
JH
3114 ;;
3115 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3116 exit 1
3117 ;;
3118 esac
5440bc8e
JH
3119 case "$targetto" in
3120 scp|rcp)
3121 cat >$to <<EOF
3122#!/bin/sh
3123for f in \$@
3124do
93c0359c
JH
3125 case "\$f" in
3126 /*)
3127 $targetmkdir \`dirname \$f\`
f53a6e0e 3128 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
93c0359c
JH
3129 ;;
3130 *)
3131 $targetmkdir $targetdir/\`dirname \$f\`
f53a6e0e 3132 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
93c0359c
JH
3133 ;;
3134 esac
5440bc8e
JH
3135done
3136exit 0
3137EOF
3138 ;;
3139 cp) cat >$to <<EOF
3140#!/bin/sh
93c0359c
JH
3141for f in \$@
3142do
3143 case "\$f" in
3144 /*)
3145 $mkdir -p $targetdir/\`dirname \$f\`
3146 $cp \$f $targetdir/\$f || exit 1
3147 ;;
3148 *)
3149 $targetmkdir $targetdir/\`dirname \$f\`
3150 $cp \$f $targetdir/\$f || exit 1
3151 ;;
3152 esac
3153done
3154exit 0
5440bc8e
JH
3155EOF
3156 ;;
93bc48fa 3157 *) echo "Unknown targetto '$targetto'" >&4
5440bc8e
JH
3158 exit 1
3159 ;;
3160 esac
3161 case "$targetfrom" in
3162 scp|rcp)
3163 cat >$from <<EOF
3164#!/bin/sh
3165for f in \$@
3166do
93c0359c 3167 $rm -f \$f
dad780ec 3168 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
5440bc8e
JH
3169done
3170exit 0
3171EOF
3172 ;;
3173 cp) cat >$from <<EOF
3174#!/bin/sh
3175for f in \$@
3176do
93c0359c 3177 $rm -f \$f
5440bc8e
JH
3178 cp $targetdir/\$f . || exit 1
3179done
3180exit 0
3181EOF
3182 ;;
93bc48fa 3183 *) echo "Unknown targetfrom '$targetfrom'" >&4
5440bc8e
JH
3184 exit 1
3185 ;;
3186 esac
93bc48fa
JH
3187 if $test ! -f $run; then
3188 echo "Target 'run' script '$run' not found." >&4
5440bc8e 3189 else
f8006fac 3190 $chmod a+rx $run
5440bc8e 3191 fi
93bc48fa
JH
3192 if $test ! -f $to; then
3193 echo "Target 'to' script '$to' not found." >&4
5440bc8e 3194 else
f8006fac 3195 $chmod a+rx $to
5440bc8e 3196 fi
93bc48fa
JH
3197 if $test ! -f $from; then
3198 echo "Target 'from' script '$from' not found." >&4
5440bc8e 3199 else
f8006fac 3200 $chmod a+rx $from
5440bc8e 3201 fi
93bc48fa 3202 if $test ! -f $run -o ! -f $to -o ! -f $from; then
5440bc8e
JH
3203 exit 1
3204 fi
3205 cat >&4 <<EOF
f8006fac
JH
3206Using '$run' for remote execution,
3207and '$from' and '$to'
93bc48fa 3208for remote file transfer.
5440bc8e
JH
3209EOF
3210 ;;
3211*) run=''
3212 to=:
3213 from=:
b75b1e25 3214 usecrosscompile="$undef"
5440bc8e
JH
3215 targetarch=''
3216 ;;
3217esac
3218
ecfc5424
AD
3219: see whether [:lower:] and [:upper:] are supported character classes
3220echo " "
e129ac51
AB
3221case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3222ABYZ-abyz)
ecfc5424
AD
3223 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3224 up='[:upper:]'
3225 low='[:lower:]'
3226 ;;
416d0bea
MB
3227*) # There is a discontinuity in EBCDIC between 'R' and 'S'
3228 # (0xd9 and 0xe2), therefore that is a nice testing point.
3229 if test "X$up" = X -o "X$low" = X; then
3230 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3231 rs) up='[A-Z]'
3232 low='[a-z]'
28e8609d
JH
3233 ;;
3234 esac
416d0bea 3235 fi
28e8609d 3236 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3237 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3238 rs) up='A-Z'
28e8609d
JH
3239 low='a-z'
3240 ;;
3241 esac
416d0bea 3242 fi
28e8609d 3243 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3244 case "`echo RS | od -x 2>/dev/null`" in
3245 *D9E2*|*d9e2*)
28e8609d
JH
3246 echo "Hey, this might be EBCDIC." >&4
3247 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3248 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3249 rs) up='[A-IJ-RS-Z]'
3250 low='[a-ij-rs-z]'
28e8609d
JH
3251 ;;
3252 esac
3253 fi
3254 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3255 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3256 rs) up='A-IJ-RS-Z'
3257 low='a-ij-rs-z'
28e8609d
JH
3258 ;;
3259 esac
3260 fi
3261 ;;
3262 esac
3263 fi
3264esac
416d0bea
MB
3265case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3266rs)
28e8609d
JH
3267 echo "Using $up and $low to convert case." >&4
3268 ;;
ecfc5424 3269*)
28e8609d
JH
3270 echo "I don't know how to translate letters from upper to lower case." >&4
3271 echo "Your tr is not acting any way I know of." >&4
3272 exit 1
3273 ;;
ecfc5424
AD
3274esac
3275: set up the translation script tr, must be called with ./tr of course
3276cat >tr <<EOSC
3277$startsh
3278case "\$1\$2" in
3279'[A-Z][a-z]') exec $tr '$up' '$low';;
3280'[a-z][A-Z]') exec $tr '$low' '$up';;
3281esac
3282exec $tr "\$@"
3283EOSC
3284chmod +x tr
3285$eunicefix tr
3286
2304df62
AD
3287: Try to determine whether config.sh was made on this system
3288case "$config_sh" in
3289'')
43999f95
JH
3290myuname=`$uname -a 2>/dev/null`
3291$test -z "$myuname" && myuname=`hostname 2>/dev/null`
f4dc174a 3292# Downcase everything to avoid ambiguity.
1332606d 3293# Remove slashes and single quotes so we can use parts of this in
f4dc174a
AD
3294# directory and file names.
3295# Remove newlines so myuname is sane to use elsewhere.
28e8609d
JH
3296# tr '[A-Z]' '[a-z]' would not work in EBCDIC
3297# because the A-Z/a-z are not consecutive.
f4dc174a 3298myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3eaeeeae 3299 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1aef975c 3300newmyuname="$myuname"
2304df62 3301dflt=n
16d20bd9
AD
3302case "$knowitall" in
3303'')
3304 if test -f ../config.sh; then
3305 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3306 eval "`grep myuname= ../config.sh`"
3307 fi
3308 if test "X$myuname" = "X$newmyuname"; then
3309 dflt=y
3310 fi
2304df62 3311 fi
16d20bd9
AD
3312 ;;
3313*) dflt=y;;
3314esac
2304df62
AD
3315
3316: Get old answers from old config file if Configure was run on the
3317: same system, otherwise use the hints.
3318hint=default
3319cd ..
3320if test -f config.sh; then
16d20bd9
AD
3321 echo " "
3322 rp="I see a config.sh file. Shall I use it to set the defaults?"
2304df62
AD
3323 . UU/myread
3324 case "$ans" in
f83701cd
AD
3325 n*|N*) echo "OK, I'll ignore it."
3326 mv config.sh config.sh.old
3327 myuname="$newmyuname"
3328 ;;
2304df62 3329 *) echo "Fetching default answers from your old config.sh file..." >&4
ecfc5424
AD
3330 tmp_n="$n"
3331 tmp_c="$c"
85cad39c 3332 tmp_sh="$sh"
2304df62
AD
3333 . ./config.sh
3334 cp config.sh UU
ecfc5424
AD
3335 n="$tmp_n"
3336 c="$tmp_c"
85cad39c
PP
3337 : Older versions did not always set $sh. Catch re-use of such
3338 : an old config.sh.
3339 case "$sh" in
3340 '') sh="$tmp_sh" ;;
3341 esac
2304df62
AD
3342 hint=previous
3343 ;;
3344 esac
3345fi
2573c5f9 3346. ./UU/checkcc
2304df62
AD
3347if test ! -f config.sh; then
3348 $cat <<EOM
3349
4e2a5f63
AD
3350First time through, eh? I have some defaults handy for some systems
3351that need some extra help getting the Configure answers right:
2304df62
AD
3352
3353EOM
dfe9444c 3354 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2304df62
AD
3355 dflt=''
3356 : Half the following guesses are probably wrong... If you have better
7f2de2d2 3357 : tests or hints, please send them to perlbug@perl.org
2304df62 3358 : The metaconfig authors would also appreciate a copy...
a0d0e21e 3359 $test -f /irix && osname=irix
85e6fe83
LW
3360 $test -f /xenix && osname=sco_xenix
3361 $test -f /dynix && osname=dynix
3362 $test -f /dnix && osname=dnix
5f05dabc
PP
3363 $test -f /lynx.os && osname=lynxos
3364 $test -f /unicos && osname=unicos && osvers=`$uname -r`
c71a9cee 3365 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
7a4c00b4 3366 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
85e6fe83 3367 $test -f /bin/mips && /bin/mips && osname=mips
a0d0e21e
LW
3368 $test -d /usr/apollo/bin && osname=apollo
3369 $test -f /etc/saf/_sactab && osname=svr4
0cf583b0 3370 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
d54344fc 3371 $test -f /system/gnu_library/bin/ar.pm && osname=vos
dabb2532 3372 $test -f /sys/utilities/MultiView && osname=amigaos
e060872b 3373 if $test -d /MachTen -o -d /MachTen_Folder; then
dfe9444c 3374 osname=machten
4633a7c4 3375 if $test -x /sbin/version; then
dfe9444c 3376 osvers=`/sbin/version | $awk '{print $2}' |
4633a7c4
LW
3377 $sed -e 's/[A-Za-z]$//'`
3378 elif $test -x /usr/etc/version; then
dfe9444c 3379 osvers=`/usr/etc/version | $awk '{print $2}' |
4633a7c4
LW
3380 $sed -e 's/[A-Za-z]$//'`
3381 else
3382 osvers="$2.$3"
3383 fi
3384 fi
aaacdc8b
GS
3385
3386 $test -f /sys/posix.dll &&
3387 $test -f /usr/bin/what &&
3388 set X `/usr/bin/what /sys/posix.dll` &&
3389 $test "$3" = UWIN &&
3390 osname=uwin &&
3391 osvers="$5"
3392
2304df62
AD
3393 if $test -f $uname; then
3394 set X $myuname
3395 shift
3396
2304df62 3397 case "$5" in
85e6fe83 3398 fps*) osname=fps ;;
2304df62
AD
3399 mips*)
3400 case "$4" in
85e6fe83
LW
3401 umips) osname=umips ;;
3402 *) osname=mips ;;
2304df62 3403 esac;;
85e6fe83 3404 [23]100) osname=mips ;;
ecfc5424 3405 i386*)
c6912327
JH
3406 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3407 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
619ffc2b
JH
3408 osname='sco'
3409 osvers=$tmp
3410 elif $test -f /etc/kconfig; then
ecfc5424 3411 osname=isc
bd628c73 3412 if test "$lns" = "$ln -s"; then
a0d0e21e
LW
3413 osvers=4
3414 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3415 osvers=3
2304df62 3416 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
a0d0e21e 3417 osvers=2
ecfc5424
AD
3418 fi
3419 fi
2000072c 3420 tmp=''
ecfc5424 3421 ;;
c4f23d77
AD
3422 pc*)
3423 if test -n "$DJGPP"; then
3424 osname=dos
3425 osvers=djgpp
3426 fi
3427 ;;
2304df62
AD
3428 esac
3429
3430 case "$1" in
a0d0e21e
LW
3431 aix) osname=aix
3432 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3433 case "$tmp" in
e81c5c2a
NC
3434 # oslevel can fail with:
3435 # oslevel: Unable to acquire lock.
3436 *not\ found) osvers="$4"."$3" ;;
a0d0e21e
LW
3437 '<3240'|'<>3240') osvers=3.2.0 ;;
3438 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3439 '=3250'|'>3250') osvers=3.2.5 ;;
1aef975c 3440 *) osvers=$tmp;;
a0d0e21e
LW
3441 esac
3442 ;;
287574fe
MB
3443 bitrig) osname=bitrig
3444 osvers="$3"
3445 ;;
aaacdc8b
GS
3446 bsd386) osname=bsd386
3447 osvers=`$uname -r`
3448 ;;
3449 cygwin*) osname=cygwin
3450 osvers="$3"
3451 ;;
23f87696
SZ
3452 *dc.osx) osname=dcosx
3453 osvers="$3"
3454 ;;
a0d0e21e
LW
3455 dnix) osname=dnix
3456 osvers="$3"
3457 ;;
3458 domainos) osname=apollo
3459 osvers="$3"
3460 ;;
a774dfe6
RSG
3461 dgux) osname=dgux
3462 osvers="$3"
3463 ;;
3464 dragonfly) osname=dragonfly
a0d0e21e
LW
3465 osvers="$3"
3466 ;;
760ac839 3467 dynixptx*) osname=dynixptx
e58e581d 3468 osvers=`echo "$4"|sed 's/^v//'`
760ac839 3469 ;;
a774dfe6 3470 freebsd) osname=freebsd
a0d0e21e 3471 osvers="$3" ;;
761ee4e8
BD
3472 genix) osname=genix ;;
3473 gnu) osname=gnu
3474 osvers="$3" ;;
a774dfe6 3475 hp*) osname=hpux
bfb7748a 3476 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
a0d0e21e 3477 ;;
761ee4e8 3478 irix*) osname=irix
a0d0e21e
LW
3479 case "$3" in
3480 4*) osvers=4 ;;
3481 5*) osvers=5 ;;
ecfc5424 3482 *) osvers="$3" ;;
a0d0e21e
LW
3483 esac
3484 ;;
761ee4e8 3485 linux) osname=linux
a0d0e21e 3486 case "$3" in
a0d0e21e
LW
3487 *) osvers="$3" ;;
3488 esac
78ada538 3489 $test -f /system/lib/libandroid.so && osname=linux-android
a0d0e21e 3490 ;;
761ee4e8 3491 MiNT) osname=mint
28e8609d
JH
3492 ;;
3493 netbsd*) osname=netbsd
ecfc5424
AD
3494 osvers="$3"
3495 ;;
4e81affe
MMIJG
3496 news-os) osvers="$3"
3497 case "$3" in
3498 4*) osname=newsos4 ;;
3499 *) osname=newsos ;;
3500 esac
3501 ;;
28bb1e2c 3502 nonstop-ux) osname=nonstopux ;;
65dc58a1
TM
3503 openbsd) osname=openbsd
3504 osvers="$3"
3505 ;;
5c728af0
IZ
3506 os2) osname=os2
3507 osvers="$4"
3508 ;;
aaacdc8b
GS
3509 POSIX-BC | posix-bc ) osname=posix-bc
3510 osvers="$3"
a0d0e21e 3511 ;;
ae3afa4e
TH
3512 powerux | power_ux | powermax_os | powermaxos | \
3513 powerunix | power_unix) osname=powerux
3514 osvers="$3"
3515 ;;
aaacdc8b
GS
3516 qnx) osname=qnx
3517 osvers="$4"
3518 ;;
a0d0e21e
LW
3519 solaris) osname=solaris
3520 case "$3" in
3521 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
ecfc5424 3522 *) osvers="$3" ;;
a0d0e21e
LW
3523 esac
3524 ;;
85e6fe83
LW
3525 sunos) osname=sunos
3526 case "$3" in
85e6fe83
LW
3527 5*) osname=solaris
3528 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
a0d0e21e 3529 *) osvers="$3" ;;
2304df62
AD
3530 esac
3531 ;;
a0d0e21e 3532 titanos) osname=titanos
85e6fe83 3533 case "$3" in
a0d0e21e
LW
3534 1*) osvers=1 ;;
3535 2*) osvers=2 ;;
3536 3*) osvers=3 ;;
3537 4*) osvers=4 ;;
ecfc5424 3538 *) osvers="$3" ;;
2304df62
AD
3539 esac
3540 ;;
85e6fe83 3541 ultrix) osname=ultrix
ecfc5424 3542 osvers="$3"
2304df62 3543 ;;
28757baa 3544 osf1|mls+) case "$5" in
fed7345c
AD
3545 alpha)
3546 osname=dec_osf
fdd85a03 3547 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2aa76180
JH
3548 case "$osvers" in
3549 [1-9].[0-9]*) ;;
3550 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3551 esac
ecfc5424
AD
3552 ;;
3553 hp*) osname=hp_osf1 ;;
3554 mips) osname=mips_osf1 ;;
85e6fe83
LW
3555 esac
3556 ;;
af1ff193 3557 # UnixWare 7.1.2 is known as Open UNIX 8
381c1bae 3558 openunix|unixware) osname=svr5
0337d152
A
3559 osvers="$4"
3560 ;;
3c728e00 3561 uts) osname=uts
a0d0e21e
LW
3562 osvers="$3"
3563 ;;
3c728e00
JH
3564 vos) osvers="$3"
3565 ;;
85e6fe83 3566 $2) case "$osname" in
2304df62 3567 *isc*) ;;
a0d0e21e 3568 *freebsd*) ;;
5f05dabc 3569 svr*)
a0d0e21e 3570 : svr4.x or possibly later
a774dfe6 3571 case "svr$3" in
a0d0e21e
LW
3572 ${osname}*)
3573 osname=svr$3
3574 osvers=$4
3575 ;;
3576 esac
3577 case "$osname" in
3578 svr4.0)
3579 : Check for ESIX
3580 if test -f /stand/boot ; then
3581 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
ecfc5424
AD
3582 if test -n "$INITPROG" -a -f "$INITPROG"; then
3583 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3584 if test -n "$isesix"; then
a0d0e21e
LW
3585 osname=esix4
3586 fi
3587 fi
3588 fi
3589 ;;
3590 esac
3591 ;;
2304df62 3592 *) if test -f /etc/systemid; then
a0d0e21e
LW
3593 osname=sco
3594 set `echo $3 | $sed 's/\./ /g'` $4
c4f23d77 3595 if $test -f $src/hints/sco_$1_$2_$3.sh; then
85e6fe83 3596 osvers=$1.$2.$3
c4f23d77 3597 elif $test -f $src/hints/sco_$1_$2.sh; then
85e6fe83 3598 osvers=$1.$2
c4f23d77 3599 elif $test -f $src/hints/sco_$1.sh; then
85e6fe83 3600 osvers=$1
2304df62 3601 fi
a0d0e21e
LW
3602 else
3603 case "$osname" in
3604 '') : Still unknown. Probably a generic Sys V.
3605 osname="sysv"
3606 osvers="$3"
3607 ;;
3608 esac
2304df62
AD
3609 fi
3610 ;;
3611 esac
3612 ;;
a0d0e21e
LW
3613 *) case "$osname" in
3614 '') : Still unknown. Probably a generic BSD.
3615 osname="$1"
3616 osvers="$3"
3617 ;;
3618 esac
3619 ;;
2304df62
AD
3620 esac
3621 else
dfe9444c
AD
3622 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3623 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3624 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3625 osname=news_os
2304df62 3626 fi
dfe9444c 3627 $rm -f UU/kernel.what
5c728af0 3628 elif test -d c:/. -o -n "$is_os2" ; then
8e07c86e
AD
3629 set X $myuname
3630 osname=os2
3631 osvers="$5"
2304df62
AD
3632 fi
3633 fi
a774dfe6 3634
5440bc8e
JH
3635 case "$targetarch" in
3636 '') ;;
3637 *) hostarch=$osname
82643807
BF
3638 case "$targetarch" in
3639 nto*|*-nto-*)
c413f034
BF
3640 # Will load qnx.sh, which should change osname to nto
3641 osname=qnx
0d460bac 3642 osvers=''
82643807
BF
3643 ;;
3644 *linux-android*)
3645 # Catch arm-linux-androideabi, mipsel-linux-android,
3646 # and i686-linux-android
3647 osname=linux-android
0d460bac 3648 osvers=''
82643807 3649 ;;
6f372547
BF
3650 *linux*)
3651 # Something like arm-linux-gnueabihf is really just
3652 # plain linux.
3653 osname=linux
0d460bac
BF
3654 osvers=''
3655 ;;
3656 *solaris*|*sunos*)
3657 osname=solaris
3658 # XXX perhaps we should just assume
3659 # osvers to be 2, or maybe take the value
3660 # from targetarch. Using $run before the
3661 # hints are run is somewhat icky.
3662 set X `$run $uname -a 2>/dev/null`
3663 shift
3664 case "$3" in
3665 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3666 *) osvers="$3" ;;
3667 esac
6f372547 3668 ;;
82643807 3669 *)
f53a6e0e
MB
3670 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3671 osvers=''
82643807
BF
3672 ;;
3673 esac
5440bc8e
JH
3674 ;;
3675 esac
3676
a0d0e21e
LW
3677 : Now look for a hint file osname_osvers, unless one has been
3678 : specified already.
3679 case "$hintfile" in
3680 ''|' ')
1e127011 3681 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
a0d0e21e 3682 : Also try without trailing minor version numbers.
1e127011
DD
3683 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3684 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3685 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3686 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
a0d0e21e
LW
3687 case "$file" in
3688 '') dflt=none ;;
3689 *) case "$osvers" in
3690 '') dflt=$file
3691 ;;
dfe9444c 3692 *) if $test -f $src/hints/$file.sh ; then
a0d0e21e 3693 dflt=$file
dfe9444c 3694 elif $test -f $src/hints/$xfile.sh ; then
a0d0e21e 3695 dflt=$xfile
dfe9444c 3696 elif $test -f $src/hints/$xxfile.sh ; then
a0d0e21e 3697 dflt=$xxfile
dfe9444c 3698 elif $test -f $src/hints/$xxxfile.sh ; then
a0d0e21e 3699 dflt=$xxxfile
dfe9444c 3700 elif $test -f $src/hints/$xxxxfile.sh ; then
a0d0e21e 3701 dflt=$xxxxfile
dfe9444c 3702 elif $test -f "$src/hints/${osname}.sh" ; then
a0d0e21e
LW
3703 dflt="${osname}"
3704 else
3705 dflt=none
3706 fi
3707 ;;
3708 esac
85e6fe83
LW
3709 ;;
3710 esac
4e2a5f63
AD
3711 if $test -f Policy.sh ; then
3712 case "$dflt" in
3713 *Policy*) ;;
3714 none) dflt="Policy" ;;
3715 *) dflt="Policy $dflt" ;;
3716 esac
3717 fi
85e6fe83 3718 ;;
a0d0e21e 3719 *)
ecfc5424 3720 dflt=`echo $hintfile | $sed 's/\.sh$//'`
a0d0e21e 3721 ;;
2304df62 3722 esac
1aef975c 3723
4e2a5f63
AD
3724 if $test -f Policy.sh ; then
3725 $cat <<EOM
3726
3727There's also a Policy hint file available, which should make the
3728site-specific (policy) questions easier to answer.
3729EOM
3730
3731 fi
3732
2304df62
AD
3733 $cat <<EOM
3734
3735You may give one or more space-separated answers, or "none" if appropriate.
a2d23ec2
MB
3736If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3737previous run of Configure, you may specify it as well as or instead of
3738OS-specific hints. If hints are provided for your OS, you should use them:
3739although Perl can probably be built without hints on many platforms, using
3740hints often improve performance and may enable features that Configure can't
3741set up on its own. If there are no hints that match your OS, specify "none";
3742DO NOT give a wrong version or a wrong OS.
2304df62
AD
3743
3744EOM
4e2a5f63 3745
2304df62 3746 rp="Which of these apply, if any?"
dfe9444c 3747 . UU/myread
85e6fe83
LW
3748 tans=$ans
3749 for file in $tans; do
4e2a5f63
AD
3750 if $test X$file = XPolicy -a -f Policy.sh; then
3751 . Policy.sh
3752 $cat Policy.sh >> UU/config.sh
3753 elif $test -f $src/hints/$file.sh; then
dfe9444c
AD
3754 . $src/hints/$file.sh
3755 $cat $src/hints/$file.sh >> UU/config.sh
5440bc8e 3756 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
2304df62
AD
3757 : nothing
3758 else
85e6fe83
LW
3759 : Give one chance to correct a possible typo.
3760 echo "$file.sh does not exist"
3761 dflt=$file
3762 rp="hint to use instead?"
dfe9444c 3763 . UU/myread
85e6fe83 3764 for file in $ans; do
dfe9444c
AD
3765 if $test -f "$src/hints/$file.sh"; then
3766