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