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