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