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