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