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