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