This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure: unbreak -S option now that -O is the default
[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=''
ea442100 499d_fs_data_s=''
b4eb6b3d
JH
500d_fseeko=''
501d_fsetpos=''
ea442100 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=''
ea442100 512d_getfsstat=''
b4eb6b3d 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=''
ea442100
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=''
ea442100 594d_hasmntopt=''
b4eb6b3d 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 824d_statblks=''
ea442100
JH
825d_statfs_f_flags=''
826d_statfs_s=''
17a6c8e3
AD
827d_static_inline=''
828perl_static_inline=''
ea442100
JH
829d_fstatvfs=''
830d_statvfs=''
b4eb6b3d
JH
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=''
ea442100 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=''
ea442100 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=''
ea442100 1031i_sysmount=''
b4eb6b3d
JH
1032i_sysndir=''
1033i_sysparam=''
216dac04 1034i_syspoll=''
b4eb6b3d
JH
1035i_sysresrc=''
1036i_syssecrt=''
1037i_sysselct=''
1038i_sysstat=''
ea442100
JH
1039i_sysstatfs=''
1040i_sysstatvfs=''
b4eb6b3d
JH
1041i_systimes=''
1042i_systypes=''
1043i_sysuio=''
1044i_sysun=''
1045i_sysutsname=''
ea442100 1046i_sysvfs=''
b4eb6b3d
JH
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=''
ea442100 1058i_ustat=''
b4eb6b3d
JH
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=''
16d20bd9 1682knowitall=''
02e93a22 1683rm -f optdef.sh posthint.sh
28757baa
PP
1684cat >optdef.sh <<EOS
1685$startsh
1686EOS
2304df62 1687
dfe9444c 1688
2304df62
AD
1689: option parsing
1690while test $# -gt 0; do
1691 case "$1" in
1692 -d) shift; fastread=yes;;
1693 -e) shift; alldone=cont;;
1694 -f)
1695 shift
1696 cd ..
1697 if test -r "$1"; then
1698 config_sh="$1"
1699 else
a0d0e21e 1700 echo "$me: cannot read config file $1." >&2
2304df62
AD
1701 error=true
1702 fi
1703 cd UU
1704 shift;;
3f30fabf 1705 --help|\
2304df62
AD
1706 -h) shift; error=true;;
1707 -r) shift; reuseval=true;;
dfe9444c 1708 -s) shift; silent=true; realsilent=true;;
2304df62 1709 -E) shift; alldone=exit;;
16d20bd9 1710 -K) shift; knowitall=true;;
41d73075 1711 -O) shift;;
dfe9444c 1712 -S) shift; silent=true; extractsh=true;;
a0d0e21e
LW
1713 -D)
1714 shift
1715 case "$1" in
1716 *=)
1717 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1718 echo "$me: ignoring -D $1" >&2
1719 ;;
ecfc5424 1720 *=*) echo "$1" | \
1aef975c
AD
1721 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1722 *) echo "$1='define'" >> optdef.sh;;
a0d0e21e
LW
1723 esac
1724 shift
1725 ;;
1726 -U)
1727 shift
1728 case "$1" in
1aef975c 1729 *=) echo "$1" >> optdef.sh;;
a0d0e21e
LW
1730 *=*)
1731 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1732 echo "$me: ignoring -U $1" >&2
1733 ;;
1aef975c 1734 *) echo "$1='undef'" >> optdef.sh;;
a0d0e21e
LW
1735 esac
1736 shift
1737 ;;
02e93a22
JH
1738 -A)
1739 shift
1740 xxx=''
1741 yyy="$1"
02e93a22 1742 zzz=''
5f83a3e9 1743 uuu=undef
02e93a22 1744 case "$yyy" in
f7c31117 1745 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
5f83a3e9
JH
1746 case "$zzz" in
1747 *:*) zzz='' ;;
1748 *) xxx=append
613d6c3e 1749 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
f7c31117 1750 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
5f83a3e9
JH
1751 esac
1752 ;;
1753 esac
1754 case "$xxx" in
1755 '') case "$yyy" in
f7c31117
JH
1756 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1757 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1758 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1759 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1760 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1761 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
5f83a3e9 1762 esac
613d6c3e 1763 ;;
5f83a3e9 1764 esac
02e93a22
JH
1765 case "$xxx" in
1766 append)
5f83a3e9 1767 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
02e93a22 1768 clear)
5f83a3e9 1769 echo "$yyy=''" >> posthint.sh ;;
02e93a22
JH
1770 define)
1771 case "$zzz" in
1772 '') zzz=define ;;
1773 esac
5f83a3e9 1774 echo "$yyy='$zzz'" >> posthint.sh ;;
02e93a22 1775 eval)
5f83a3e9 1776 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
02e93a22 1777 prepend)
5f83a3e9 1778 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
02e93a22
JH
1779 undef)
1780 case "$zzz" in
1781 '') zzz="$uuu" ;;
1782 esac
5f83a3e9
JH
1783 echo "$yyy=$zzz" >> posthint.sh ;;
1784 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
02e93a22 1785 esac
bde6b06b 1786 shift
02e93a22 1787 ;;
216dac04 1788 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
5f83a3e9 1789 exit 0;;
2304df62 1790 --) break;;
a0d0e21e 1791 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
2304df62
AD
1792 *) break;;
1793 esac
1794done
1795
1796case "$error" in
1797true)
1798 cat >&2 <<EOM
2afac517 1799Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
02e93a22 1800 [-U symbol] [-U symbol=] [-A command:symbol...]
2304df62
AD
1801 -d : use defaults for all answers.
1802 -e : go on without questioning past the production of config.sh.
1803 -f : specify an alternate default configuration file.
1804 -h : print this help message and exit (with an error status).
1805 -r : reuse C symbols value if possible (skips costly nm extraction).
1806 -s : silent mode, only echoes questions and essential information.
a0d0e21e
LW
1807 -D : define symbol to have some value:
1808 -D symbol symbol gets the value 'define'
1809 -D symbol=value symbol gets the value 'value'
3f30fabf
MB
1810 common used examples (see INSTALL for more info):
1811 -Duse64bitint use 64bit integers
b79e0b55 1812 -Duse64bitall use 64bit integers and pointers
3f30fabf 1813 -Dusethreads use thread support
b79e0b55 1814 -Dinc_version_list=none do not include older perl trees in @INC
3f30fabf
MB
1815 -DEBUGGING=none DEBUGGING options
1816 -Dcc=gcc choose your compiler
1817 -Dprefix=/opt/perl5 choose your destination
2304df62 1818 -E : stop at the end of questions, after having produced config.sh.
16d20bd9 1819 -K : do not use unless you know what you are doing.
41d73075 1820 -O : ignored for backward compatibility
2304df62 1821 -S : perform variable substitutions on all .SH files (can mix with -f)
a0d0e21e
LW
1822 -U : undefine symbol:
1823 -U symbol symbol gets the value 'undef'
1824 -U symbol= symbol gets completely empty
3f30fabf 1825 e.g.: -Uversiononly
02e93a22 1826 -A : manipulate symbol after the platform specific hints have been applied:
2ac814f3
MB
1827 -A append:symbol=value append value to symbol
1828 -A symbol=value like append:, but with a separating space
1829 -A define:symbol=value define symbol to have value
1830 -A clear:symbol define symbol to be ''
1831 -A define:symbol define symbol to be 'define'
1832 -A eval:symbol=value define symbol to be eval of value
1833 -A prepend:symbol=value prepend value to symbol
1834 -A undef:symbol define symbol to be 'undef'
1835 -A undef:symbol= define symbol to be ''
3f30fabf 1836 e.g.: -A prepend:libswanted='cl pthread '
2ac814f3 1837 -A ccflags=-DSOME_MACRO
2304df62
AD
1838 -V : print version number and exit (with a zero status).
1839EOM
1840 exit 1
1841 ;;
1842esac
1843
dfe9444c
AD
1844: Sanity checks
1845case "$fastread$alldone" in
1846yescont|yesexit) ;;
1847*)
aaeb8e51
GS
1848 case "$extractsh" in
1849 true) ;;
1850 *)
1851 if test ! -t 0; then
1852 echo "Say 'sh Configure', not 'sh <Configure'"
1853 exit 1
1854 fi
1855 ;;
1856 esac
dfe9444c
AD
1857 ;;
1858esac
1859
2304df62
AD
1860exec 4>&1
1861case "$silent" in
1862true) exec 1>/dev/null;;
1863esac
1864
ecfc5424 1865: run the defines and the undefines, if any, but leave the file out there...
1aef975c 1866touch optdef.sh
e6704a40
MB
1867grep -q '\\' optdef.sh
1868if test $? = 0; then
1869 echo "Configure does not support \\ in -D arguments"
1870 exit 1
1871fi
1aef975c 1872. ./optdef.sh
02e93a22
JH
1873: create the posthint manipulation script and leave the file out there...
1874touch posthint.sh
a0d0e21e 1875
2304df62 1876: set package name
34f1896b 1877package='perl5'
b4eb6b3d
JH
1878first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1879last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
e129ac51
AB
1880case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
1881ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
b4eb6b3d
JH
1882*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1883esac
2304df62 1884
2304df62
AD
1885: Some greps do not return status, grrr.
1886echo "grimblepritz" >grimble
1887if grep blurfldyick grimble >/dev/null 2>&1 ; then
1888 contains=contains
1889elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1890 contains=grep
1891else
1892 contains=contains
1893fi
1894rm -f grimble
1895: the following should work in any shell
1896case "$contains" in
1897contains*)
1898 echo " "
1899 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1900 cat >contains <<'EOSS'
1901grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1902EOSS
1903chmod +x contains
1904esac
1905
dfe9444c
AD
1906: Find the path to the source tree
1907case "$src" in
1908'') case "$0" in
b233458b
JH
1909 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1910 case "$src" in
1911 /*) ;;
8504afb7 1912 .) ;;
b233458b
JH
1913 *) src=`cd ../$src && pwd` ;;
1914 esac
1915 ;;
dfe9444c
AD
1916 *) src='.';;
1917 esac;;
1918esac
1919case "$src" in
1920'') src=/
1921 rsrc=/
1922 ;;
34f1896b
MB
1923/*) rsrc="$src";;
1924*) rsrc="../$src";;
dfe9444c
AD
1925esac
1926if test -f $rsrc/Configure && \
34f1896b 1927 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
dfe9444c
AD
1928then
1929 : found it, so we are ok.
1930else
1931 rsrc=''
1932 for src in . .. ../.. ../../.. ../../../..; do
1933 if test -f ../$src/Configure && \
1934 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1935 then
1936 rsrc=../$src
1937 break
1938 fi
1939 done
1940fi
1941case "$rsrc" in
1942'')
1943 cat <<EOM >&4
1944
1945Sorry, I can't seem to locate the source dir for $package. Please start
1946Configure with an explicit path -- i.e. /some/path/Configure.
1947
1948EOM
1949 exit 1
1950 ;;
1951../.) rsrc='..';;
1952*)
1953 echo " "
1954 echo "Sources for $package found in \"$src\"." >&4
1955 ;;
1956esac
1957
1958: script used to extract .SH files with variable substitutions
1959cat >extract <<'EOS'
a02608de 1960PERL_CONFIG_SH=true
dfe9444c 1961echo "Doing variable substitutions on .SH files..."
24ccb310
JH
1962if test -f MANIFEST; then
1963 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
dfe9444c
AD
1964else
1965 echo "(Looking for .SH files under the source directory.)"
6904989c 1966 set x `(cd "$src"; find . -name "*.SH" -print)`
dfe9444c
AD
1967fi
1968shift
1969case $# in
6904989c 19700) set x `(cd "$src"; echo *.SH)`; shift;;
dfe9444c 1971esac
6904989c 1972if test ! -f "$src/$1"; then
dfe9444c
AD
1973 shift
1974fi
1975mkdir_p='
1976name=$1;
1977create="";
1978while test $name; do
1979 if test ! -d "$name"; then
1980 create="$name $create";
1981 name=`echo $name | sed -e "s|^[^/]*$||"`;
1982 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1983 else
1984 name="";
1985 fi;
1986done;
1987for file in $create; do
1988 mkdir $file;
1989done
1990'
1991for file in $*; do
1992 case "$src" in
1993 ".")
1994 case "$file" in
1995 */*)
1996 dir=`expr X$file : 'X\(.*\)/'`
1997 file=`expr X$file : 'X.*/\(.*\)'`
6904989c 1998 (cd "$dir" && . ./$file)
dfe9444c
AD
1999 ;;
2000 *)
2001 . ./$file
2002 ;;
2003 esac
2004 ;;
2005 *)
2006 case "$file" in
2007 */*)
2008 dir=`expr X$file : 'X\(.*\)/'`
2009 file=`expr X$file : 'X.*/\(.*\)'`
2010 (set x $dir; shift; eval $mkdir_p)
6904989c 2011 sh <"$src/$dir/$file"
dfe9444c
AD
2012 ;;
2013 *)
6904989c 2014 sh <"$src/$file"
dfe9444c
AD
2015 ;;
2016 esac
2017 ;;
2018 esac
2019done
6904989c 2020if test -f "$src/config_h.SH"; then
dfe9444c
AD
2021 if test ! -f config.h; then
2022 : oops, they left it out of MANIFEST, probably, so do it anyway.
6904989c 2023 . "$src/config_h.SH"
dfe9444c
AD
2024 fi
2025fi
2026EOS
2027
2028: extract files and exit if asked to do so
2029case "$extractsh" in
2030true)
2031 case "$realsilent" in
2032 true) ;;
2033 *) exec 1>&4;;
2034 esac
2035 case "$config_sh" in
2036 '') config_sh='config.sh';;
2037 esac
2038 echo " "
2039 echo "Fetching answers from $config_sh..."
2040 cd ..
2041 . $config_sh
7a4fcb3f 2042 . UU/optdef.sh
dfe9444c
AD
2043 echo " "
2044 . UU/extract
2045 rm -rf UU
24ccb310 2046 echo "Extraction done."
dfe9444c
AD
2047 exit 0
2048 ;;
2049esac
2050
2051: Eunice requires " " instead of "", can you believe it
2052echo " "
2053: Here we go...
2054echo "Beginning of configuration questions for $package."
2055
2056trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2057
2304df62
AD
2058: first determine how to suppress newline on echo command
2059echo " "
2060echo "Checking echo to see how to suppress newlines..."
2061(echo "hi there\c" ; echo " ") >.echotmp
2062if $contains c .echotmp >/dev/null 2>&1 ; then
2063 echo "...using -n."
2064 n='-n'
2065 c=''
2066else
2067 cat <<'EOM'
2068...using \c
2069EOM
2070 n=''
2071 c='\c'
2072fi
2073echo $n "The star should be here-->$c"
2074echo '*'
2075rm -f .echotmp
2076
2077: Now test for existence of everything in MANIFEST
2078echo " "
6904989c 2079if test -f "$rsrc/MANIFEST"; then
2304df62 2080 echo "First let's make sure your kit is complete. Checking..." >&4
1d8eaf8c 2081 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
776a38e3 2082 (split -l 50 2>/dev/null || split -50)
2304df62 2083 rm -f missing
dfe9444c 2084 tmppwd=`pwd`
2304df62 2085 for filelist in x??; do
776a38e3
MB
2086 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2087 >/dev/null 2>>"$tmppwd/missing")
2304df62
AD
2088 done
2089 if test -s missing; then
2090 cat missing >&4
2091 cat >&4 <<'EOM'
2092
2093THIS PACKAGE SEEMS TO BE INCOMPLETE.
2094
2095You have the option of continuing the configuration process, despite the
2096distinct possibility that your kit is damaged, by typing 'y'es. If you
2097do, don't blame me if something goes wrong. I advise you to type 'n'o
7f2de2d2 2098and contact the author (perlbug@perl.org).
2304df62
AD
2099
2100EOM
2101 echo $n "Continue? [n] $c" >&4
2102 read ans
2103 case "$ans" in
2104 y*)
2105 echo "Continuing..." >&4
2106 rm -f missing
2107 ;;
2108 *)
2109 echo "ABORTING..." >&4
2110 kill $$
2111 ;;
2112 esac
2113 else
dfe9444c 2114 echo "Looks good..."
2304df62
AD
2115 fi
2116else
2117 echo "There is no MANIFEST file. I hope your kit is complete !"
2118fi
2119rm -f missing x??
2120
5ff3f7a4 2121: Find the appropriate value for a newline for tr
613d6c3e 2122echo " "
5ff3f7a4
GS
2123if test -n "$DJGPP"; then
2124 trnl='\012'
2125fi
2126if test X"$trnl" = X; then
2127 case "`echo foo|tr '\n' x 2>/dev/null`" in
2128 foox) trnl='\n' ;;
2129 esac
2130fi
2131if test X"$trnl" = X; then
2132 case "`echo foo|tr '\012' x 2>/dev/null`" in
2133 foox) trnl='\012' ;;
2134 esac
2135fi
2136if test X"$trnl" = X; then
8be2c24c
JH
2137 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2138 fooxy) trnl='\n\r' ;;
2139 esac
2140fi
2141if test X"$trnl" = X; then
5ff3f7a4
GS
2142 cat <<EOM >&2
2143
2144$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2145
2146EOM
2147 exit 1
2148fi
2149
2304df62
AD
2150: compute the number of columns on the terminal for proper question formatting
2151case "$COLUMNS" in
2152'') COLUMNS='80';;
2153esac
2154
2155: set up the echo used in my read
2156myecho="case \"\$xxxm\" in
2157'') echo $n \"\$rp $c\" >&4;;
2158*) case \"\$rp\" in
2159 '') echo $n \"[\$xxxm] $c\";;
2160 *)
2161 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2162 echo \"\$rp\" >&4
2163 echo $n \"[\$xxxm] $c\" >&4
2164 else
2165 echo $n \"\$rp [\$xxxm] $c\" >&4
2166 fi
2167 ;;
2168 esac;;
2169esac"
2170
2171: now set up to do reads with possible shell escape and default assignment
2172cat <<EOSC >myread
28757baa 2173$startsh
2304df62
AD
2174xxxm=\$dflt
2175$myecho
2176ans='!'
2177case "\$fastread" in
2178yes) case "\$dflt" in
2179 '') ;;
2180 *) ans='';
2181 case "\$silent-\$rp" in
2182 true-) ;;
2183 *) echo " " >&4;;
2184 esac;;
2185 esac;;
2186*) case "\$silent" in
2187 true) case "\$rp" in
2188 '') ans='';;
2189 esac;;
2190 esac;;
2191esac
2192while expr "X\$ans" : "X!" >/dev/null; do
2193 read answ
2194 set x \$xxxm
2195 shift
dfe9444c 2196 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2304df62 2197 case "\$answ" in
dfe9444c
AD
2198 "!")
2199 sh 1>&4
2200 echo " "
2201 $myecho
2202 ;;
2203 !*)
2204 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2205 shift
2206 sh 1>&4 -c "\$*"
2207 echo " "
2208 $myecho
2209 ;;
2304df62
AD
2210 "\$ans")
2211 case "\$ans" in
ecfc5424
AD
2212 \\&*)
2213 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2214 shift
2215 case "\$1" in
2216 -d)
2217 fastread=yes
40a7a20a 2218 echo "(OK, I'll run with -d after this question.)" >&4
ecfc5424
AD
2219 ;;
2220 -*)
40a7a20a 2221 echo "*** Sorry, \$1 not supported yet." >&4
ecfc5424
AD
2222 ;;
2223 esac
2224 $myecho
2225 ans=!
2226 ;;
2304df62
AD
2227 esac;;
2228 *)
2229 case "\$aok" in
2230 y)
2231 echo "*** Substitution done -- please confirm."
2232 xxxm="\$ans"
c9795ab7 2233 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2304df62
AD
2234 xxxm="\$ans"
2235 ans=!
2236 ;;
2237 *)
2238 echo "*** Error -- try again."
2239 ans=!
2240 ;;
2241 esac
2242 $myecho
2243 ;;
2244 esac
2245 case "\$ans\$xxxm\$nostick" in
2246 '')
2247 ans=!
2248 $myecho
2249 ;;
2250 esac
2251done
2252case "\$ans" in
2253'') ans="\$xxxm";;
2254esac
2255EOSC
2256
2257: create .config dir to save info across Configure sessions
2258test -d ../.config || mkdir ../.config
2259cat >../.config/README <<EOF
2260This directory created by Configure to save information that should
dfe9444c 2261persist across sessions for $package.
2304df62
AD
2262
2263You may safely delete it if you wish.
2264EOF
2265
613d6c3e 2266: See if we are using a devel version and want that
9507cadf 2267xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
af960fef 2268case "$usedevel" in
1be1b388
MB
2269$define|true|[yY]*)
2270 usedevel="$define" ;;
9507cadf 2271*) case "$xversion" in
0107c034
JH
2272 *[13579])
2273 cat >&4 <<EOH
2274*** WHOA THERE!!! ***
2275
2276 This is an UNSTABLE DEVELOPMENT release.
9507cadf
JH
2277 The version of this $package distribution is $xversion, that is, odd,
2278 (as opposed to even) and that signifies a development release.
3d5d58b1 2279 If you want a maintenance release, you want an even-numbered version.
0107c034
JH
2280
2281 Do ***NOT*** install this into production use.
2282 Data corruption and crashes are possible.
2283
2284 It is most seriously suggested that you do not continue any further
2285 unless you want to help in developing and debugging Perl.
2286
6adc6a45
JH
2287 If you *still* want to build perl, you can answer 'y' now,
2288 or pass -Dusedevel to Configure.
2289
0107c034
JH
2290EOH
2291 rp='Do you really want to continue?'
2292 dflt='n'
2293 . ./myread
2294 case "$ans" in
8feeef0e
JH
2295 [yY]) echo >&4 "Okay, continuing."
2296 usedevel="$define" ;;
0107c034
JH
2297 *) echo >&4 "Okay, bye."
2298 exit 1
2299 ;;
2300 esac
2301 ;;
2302 esac
1be1b388 2303 usedevel="$undef"
0107c034
JH
2304 ;;
2305esac
8feeef0e
JH
2306case "$usedevel" in
2307$define|true|[yY]*)
2308 case "$versiononly" in
2309 '') versiononly="$define" ;;
2310 esac
2311 case "$installusrbinperl" in
2312 '') installusrbinperl="$undef" ;;
2313 esac
2314 ;;
2315esac
0107c034 2316
2304df62
AD
2317: general instructions
2318needman=true
2319firsttime=true
760ac839 2320user=`(logname) 2>/dev/null`
dfe9444c
AD
2321case "$user" in
2322'') user=`whoami 2>&1`;;
760ac839 2323esac
2304df62
AD
2324if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2325 firsttime=false
2326 echo " "
2327 rp='Would you like to see the instructions?'
2328 dflt=n
2329 . ./myread
2330 case "$ans" in
2331 [yY]*) ;;
2332 *) needman=false;;
2333 esac
2334fi
2335if $needman; then
2336 cat <<EOH
4e2a5f63 2337
2304df62 2338This installation shell script will examine your system and ask you questions
a0d0e21e 2339to determine how the perl5 package should be installed. If you get
2304df62
AD
2340stuck on a question, you may use a ! shell escape to start a subshell or
2341execute a command. Many of the questions will have default answers in square
2342brackets; typing carriage return will give you the default.
2343
2344On some of the questions which ask for file or directory names you are allowed
2345to use the ~name construct to specify the login directory belonging to "name",
2346even if you don't have a shell which knows about that. Questions where this is
2347allowed will be marked "(~name ok)".
2348
2349EOH
2350 rp=''
2351 dflt='Type carriage return to continue'
2352 . ./myread
2353 cat <<'EOH'
2354
2355The prompter used in this script allows you to use shell variables and
2356backticks in your answers. You may use $1, $2, etc... to refer to the words
2357in the default answer, as if the default line was a set of arguments given to a
2358script shell. This means you may also use $* to repeat the whole default line,
2359so you do not have to re-type everything to add something to the default.
2360
cd95ead5 2361Every time there is a substitution, you will have to confirm. If there is an
2304df62
AD
2362error (e.g. an unmatched backtick), the default answer will remain unchanged
2363and you will be prompted again.
2364
2365If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2366the questions and use the computed defaults (or the previous answers if there
2367was already a config.sh file). Type 'Configure -h' for a list of options.
ecfc5424 2368You may also start interactively and then answer '& -d' at any prompt to turn
dfe9444c 2369on the non-interactive behaviour for the remainder of the execution.
2304df62
AD
2370
2371EOH
2372 . ./myread
2373 cat <<EOH
2374
2375Much effort has been expended to ensure that this shell script will run on any
2376Unix system. If despite that it blows up on yours, your best bet is to edit
40000a8c
AD
2377Configure and run it again. If you can't run Configure for some reason,
2378you'll have to generate a config.sh file by hand. Whatever problems you
7f2de2d2 2379have, let me (perlbug@perl.org) know how I blew it.
2304df62
AD
2380
2381This installation script affects things in two ways:
2382
23831) it may do direct variable substitutions on some of the files included
2384 in this kit.
23852) it builds a config.h file for inclusion in C programs. You may edit
2386 any of these files as the need arises after running this script.
2387
2388If you make a mistake on a question, there is no easy way to back up to it
2389currently. The easiest thing to do is to edit config.sh and rerun all the SH
2390files. Configure will offer to let you do this before it runs the SH files.
2391
2392EOH
2393 dflt='Type carriage return to continue'
2394 . ./myread
2395 case "$firsttime" in
2396 true) echo $user >>../.config/instruct;;
2397 esac
2398fi
2399
56b575b9
MB
2400: Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2401: This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2402if test "X$sysroot" = X; then
2403 sysroot=""
2404else
2405 case "$cc" in
2406 *gcc*|*g++*)
2407 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2408 # _sysroot is used in places where we need --sysroot=foo
2409 # but using the rest of the flags could cause issues.
2410 _sysroot="--sysroot=$sysroot";
2411 case "$ccflags" in
2412 *sysroot*) ;;
2413 'undef'|*)
2414 ccflags="$ccflags $_sysroot"
2415 esac
2416 case "$ldflags" in
2417 *sysroot*) ;;
2418 'undef'|*)
2419 ldflags="$ldflags $_sysroot"
2420 esac
2421 case "$cppflags" in
2422 *sysroot*) ;;
2423 'undef'|*)
2424 cppflags="$cppflags $_sysroot"
2425 esac
2426 # lddlflags updated below in lddlflags section;
2427 # same with cccdlflags
2428 ;;
2429 esac
2430
2431 # Adjust some defaults to also use $sysroot
2432 for var in xlibpth loclibpth locincpth glibpth; do
2433 eval xxx=\$$var
2434 eval $var=''
2435 for path in $xxx; do
2436 eval $var=\"\$$var $sysroot$path\"
2437 done
2438 done
2439
2440fi
2441
2304df62
AD
2442: find out where common programs are
2443echo " "
2444echo "Locating common programs..." >&4
2445cat <<EOSC >loc
2446$startsh
2447case \$# in
24480) exit 1;;
2449esac
2450thing=\$1
2451shift
2452dflt=\$1
2453shift
2454for dir in \$*; do
2455 case "\$thing" in
2456 .)
2457 if test -d \$dir/\$thing; then
2458 echo \$dir
2459 exit 0
2460 fi
2461 ;;
2462 *)
a0d0e21e 2463 for thisthing in \$dir/\$thing; do
ecfc5424 2464 : just loop through to pick last item
a0d0e21e 2465 done
25f94b33 2466 if test -f \$thisthing; then
a0d0e21e 2467 echo \$thisthing
2304df62 2468 exit 0
a5a94ea5
JH
2469 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2470 echo \$thisthing
776a38e3 2471 exit 0
2304df62 2472 elif test -f \$dir/\$thing.exe; then
c4f23d77
AD
2473 if test -n "$DJGPP"; then
2474 echo \$dir/\$thing.exe
b921d661 2475 elif test "$eunicefix" != ":"; then
c4f23d77
AD
2476 : on Eunice apparently
2477 echo \$dir/\$thing
2478 fi
2d736872 2479 exit 0
2304df62
AD
2480 fi
2481 ;;
2482 esac
2483done
2484echo \$dflt
2485exit 1
2486EOSC
2487chmod +x loc
2488$eunicefix loc
2489loclist="
2490awk
2491cat
f8006fac 2492chmod
b4eb6b3d
JH
2493comm
2494cp
2304df62
AD
2495echo
2496expr
2497grep
a0d0e21e 2498ls
b4eb6b3d 2499mkdir
2304df62
AD
2500rm
2501sed
b4eb6b3d 2502sort
85e6fe83 2503touch
2304df62 2504tr
b4eb6b3d 2505uniq
2304df62
AD
2506"
2507trylist="
dfe9444c 2508ar
3659ebf1 2509bison
b4eb6b3d 2510byacc
2304df62 2511cpp
b4eb6b3d 2512csh
2304df62
AD
2513date
2514egrep
1fef16b3 2515gmake
8ff267be 2516gzip
b4eb6b3d 2517less
8ff267be 2518ln
3c728e00 2519make
b4eb6b3d 2520more
693762b4 2521nm
b4eb6b3d 2522nroff
b8677e3b 2523perl
b4eb6b3d 2524pg
2304df62
AD
2525test
2526uname
8ff267be 2527zip
2304df62 2528"
8e07c86e 2529pth=`echo $PATH | sed -e "s/$p_/ /g"`
98b12e44 2530pth="$pth $sysroot/lib $sysroot/usr/lib"
2304df62 2531for file in $loclist; do
dfe9444c
AD
2532 eval xxx=\$$file
2533 case "$xxx" in
2534 /*|?:[\\/]*)
2535 if test -f "$xxx"; then
2536 : ok
2537 else
2538 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2539 xxx=`./loc $file $file $pth`
2540 fi
2541 ;;
2542 '') xxx=`./loc $file $file $pth`;;
2543 *) xxx=`./loc $xxx $xxx $pth`;;
2544 esac
a5a94ea5 2545 eval $file=$xxx$_exe
2304df62
AD
2546 eval _$file=$xxx
2547 case "$xxx" in
2548 /*)
2549 echo $file is in $xxx.
2550 ;;
8e07c86e
AD
2551 ?:[\\/]*)
2552 echo $file is in $xxx.
2553 ;;
2304df62 2554 *)
25f94b33
AD
2555 echo "I don't know where '$file' is, and my life depends on it." >&4
2556 echo "Go find a public domain implementation or fix your PATH setting!" >&4
4633a7c4 2557 exit 1
2304df62
AD
2558 ;;
2559 esac
2560done
2561echo " "
2562echo "Don't worry if any of the following aren't found..."
2563say=offhand
2564for file in $trylist; do
dfe9444c
AD
2565 eval xxx=\$$file
2566 case "$xxx" in
2567 /*|?:[\\/]*)
2568 if test -f "$xxx"; then
2569 : ok
2570 else
2571 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2572 xxx=`./loc $file $file $pth`
2573 fi
2574 ;;
2575 '') xxx=`./loc $file $file $pth`;;
2576 *) xxx=`./loc $xxx $xxx $pth`;;
2577 esac
306a8474 2578 eval $file=$xxx$_exe
2304df62
AD
2579 eval _$file=$xxx
2580 case "$xxx" in
2581 /*)
2582 echo $file is in $xxx.
2583 ;;
8e07c86e
AD
2584 ?:[\\/]*)
2585 echo $file is in $xxx.
2586 ;;
2304df62
AD
2587 *)
2588 echo "I don't see $file out there, $say."
2589 say=either
2590 ;;
2591 esac
2592done
2593case "$egrep" in
1fef16b3 2594egrep)
2304df62
AD
2595 echo "Substituting grep for egrep."
2596 egrep=$grep
868439a2 2597 _egrep=$grep
2304df62
AD
2598 ;;
2599esac
3141af47
MB
2600case "$less" in
2601'') ;;
a872f748 2602*) if $less -R </dev/null >/dev/null 2>&1; then
3141af47
MB
2603 echo "Substituting less -R for less."
2604 less="$less -R"
2605 _less=$less
2606 fi
2607 ;;
2608esac
8ff267be 2609case "$ln" in
1fef16b3 2610ln)
8ff267be
PP
2611 echo "Substituting cp for ln."
2612 ln=$cp
868439a2 2613 _ln=$cp
8ff267be
PP
2614 ;;
2615esac
2e26f1d5 2616case "$make" in
613d6c3e 2617make)
2e26f1d5
JH
2618 case "$gmake" in
2619 gmake)
2620 echo "I can't find make or gmake, and my life depends on it." >&4
2621 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2622 exit 1
2623 ;;
2624 esac
2625 ;;
613d6c3e 2626esac
2e26f1d5
JH
2627case "$gmake" in
2628gmake) ;;
2629*) # We can't have osname yet.
1fef16b3
JH
2630 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2631 # Assume that gmake, if found, is definitely GNU make
2632 # and prefer it over the system make.
2633 echo "Substituting gmake for make."
2634 make=$gmake
868439a2 2635 _make=$gmake
1fef16b3
JH
2636 fi
2637 ;;
a5a94ea5 2638esac
2304df62
AD
2639case "$test" in
2640test)
2641 echo "Hopefully test is built into your sh."
2642 ;;
2643*)
73614538 2644 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
5d644a95 2645 echo "Using the test built into your sh."
2304df62
AD
2646 test=test
2647 _test=test
2648 fi
2649 ;;
2650esac
2651case "$echo" in
2652echo)
2653 echo "Hopefully echo is built into your sh."
2654 ;;
2655'') ;;
2656*)
2657 echo " "
2658echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2659 $echo $n "hi there$c" >foo1
2660 echo $n "hi there$c" >foo2
2661 if cmp foo1 foo2 >/dev/null 2>&1; then
2662 echo "They are compatible. In fact, they may be identical."
2663 else
2664 case "$n" in
2665 '-n') n='' c='\c';;
2666 *) n='-n' c='';;
2667 esac
2668 cat <<FOO
2669They are not compatible! You are probably running ksh on a non-USG system.
2670I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2671have echo built in and we may have to run some Bourne shell scripts. That
2672means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2673
2674FOO
2675 $echo $n "The star should be here-->$c"
2676 $echo "*"
2677 fi
2678 $rm -f foo1 foo2
2679 ;;
2680esac
2681
2f88d857
MB
2682# This question was auctioned at YAPC::Europe-2007 in Vienna
2683# I never promised you could answer it. I only auctioned the question.
2684cat <<FOO
2685The following message is sponsored by
2686
2687 Dresden.pm<--The stars should be here.
2688
2689Dear Perl user, system administrator or package
2690maintainer, the Perl community sends greetings to
2691you. Do you (emblematical) greet back [Y/n]? n
2692
2693FOO
2694
613d6c3e 2695: Check what type of C compiler we use
6b769f8f 2696cat <<EOS >trygcc
2573c5f9
JH
2697$startsh
2698EOS
6b769f8f 2699cat <<'EOSC' >>trygcc
2573c5f9
JH
2700case "$cc" in
2701'') ;;
2702*) $rm -f try try.*
2703 $cat >try.c <<EOM
2704int main(int argc, char *argv[]) {
2705 return 0;
2706}
2707EOM
e4778687 2708 if $cc -o try $ccflags $ldflags try.c; then
2573c5f9
JH
2709 :
2710 else
2711 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2712 despair=yes
2713 trygcc=yes
2714 case "$cc" in
2715 *gcc*) trygcc=no ;;
2716 esac
dce40316
AD
2717 # Skip this test because it gives a false match on output like:
2718 # ./trygcc: line 23: cc: command not found
2719 # case "`$cc -v -c try.c 2>&1`" in
2720 # *gcc*) trygcc=no ;;
2721 # esac
2573c5f9
JH
2722 if $test X"$trygcc" = Xyes; then
2723 if gcc -o try -c try.c; then
2724 echo " "
2725 echo "You seem to have a working gcc, though." >&4
dce40316
AD
2726 # Switching compilers may undo the work of hints files.
2727 # The most common problem is -D_REENTRANT for threads.
2728 # This heuristic catches that case, but gets false positives
2729 # if -Dusethreads was not actually specified. Better to
d0166596 2730 # bail out here with a useful message than fail
dce40316
AD
2731 # mysteriously later. Should we perhaps just try to
2732 # re-invoke Configure -Dcc=gcc config_args ?
2733 if $test -f usethreads.cbu; then
d0166596 2734 $cat >&4 <<EOM
dce40316
AD
2735
2736*** However, any setting of the C compiler flags (e.g. for thread support)
2737*** will be lost. It may be necessary for you to restart Configure and
2738*** add -Dcc=gcc to your Configure command line.
2739
2740EOM
2741 rp="Would you like to go ahead and try gcc anyway?"
2742 dflt=n
2743 else
2744 rp="Would you like to use it?"
2745 dflt=y
2746 fi
2573c5f9
JH
2747 if $test -f myread; then
2748 . ./myread
2749 else
2750 if $test -f UU/myread; then
2751 . ./UU/myread
2752 else
2753 echo "Cannot find myread, sorry. Aborting." >&2
2754 exit 1
2755 fi
d0166596 2756 fi
2573c5f9 2757 case "$ans" in
6371411c 2758 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2573c5f9
JH
2759 esac
2760 fi
2761 fi
6b769f8f
RB
2762 fi
2763 $rm -f try try.*
2764 ;;
2765esac
2766EOSC
2767
2768cat <<EOS >checkcc
2769$startsh
2770EOS
2771cat <<'EOSC' >>checkcc
d0166596 2772case "$cc" in
6b769f8f 2773'') ;;
d0166596 2774*) $rm -f try try.*
6b769f8f
RB
2775 $cat >try.c <<EOM
2776int main(int argc, char *argv[]) {
2777 return 0;
2778}
2779EOM
2780 if $cc -o try $ccflags $ldflags try.c; then
2781 :
2782 else
2573c5f9 2783 if $test X"$despair" = Xyes; then
6b769f8f
RB
2784 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2785 fi
d0166596 2786 $cat >&4 <<EOM
5dd4fbdf
MB
2787You need to find a working C compiler.
2788Either (purchase and) install the C compiler supplied by your OS vendor,
2789or for a free C compiler try http://gcc.gnu.org/
2790I cannot continue any further, aborting.
2791EOM
6b769f8f 2792 exit 1
2573c5f9
JH
2793 fi
2794 $rm -f try try.*
2795 ;;
2796esac
2797EOSC
2798
a0d0e21e
LW
2799: determine whether symbolic links are supported
2800echo " "
2801$touch blurfl
2802if $ln -s blurfl sym > /dev/null 2>&1 ; then
2803 echo "Symbolic links are supported." >&4
818f00be 2804 lns="$ln -s"
a0d0e21e
LW
2805else
2806 echo "Symbolic links are NOT supported." >&4
2807 lns="$ln"
2808fi
2809$rm -f blurfl sym
2810
dafca956
JH
2811: determine whether symbolic links are supported
2812echo " "
2813case "$lns" in
18ea2752 2814*"ln"*" -s")
dafca956
JH
2815 echo "Checking how to test for symbolic links..." >&4
2816 $lns blurfl sym
4b661809 2817 if $test "X$issymlink" = X; then
2e2a97a6
JH
2818 case "$newsh" in
2819 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2820 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2821 esac
5d644a95
MB
2822 if test $? = 0; then
2823 issymlink="test -h"
2e2a97a6
JH
2824 else
2825 echo "Your builtin 'test -h' may be broken." >&4
2826 case "$test" in
2827 /*) ;;
2828 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2829 for p in $pth
2830 do
2831 if test -f "$p/$test"; then
2832 test="$p/$test"
2833 break
2834 fi
2835 done
2836 ;;
2837 esac
2838 case "$test" in
2839 /*)
2840 echo "Trying external '$test -h'." >&4
2841 issymlink="$test -h"
2842 if $test ! -h sym >/dev/null 2>&1; then
3c728e00 2843 echo "External '$test -h' is broken, too." >&4
2e2a97a6
JH
2844 issymlink=''
2845 fi
2846 ;;
2847 *) issymlink='' ;;
2848 esac
1332606d 2849 fi
5d644a95 2850 fi
4b661809 2851 if $test "X$issymlink" = X; then
dafca956 2852 if $test -L sym 2>/dev/null; then
5d644a95 2853 issymlink="$test -L"
2e2a97a6 2854 echo "The builtin '$test -L' worked." >&4
dafca956
JH
2855 fi
2856 fi
4b661809 2857 if $test "X$issymlink" != X; then
5d644a95 2858 echo "You can test for symbolic links with '$issymlink'." >&4
dafca956
JH
2859 else
2860 echo "I do not know how you can test for symbolic links." >&4
2861 fi
2862 $rm -f blurfl sym
2863 ;;
2864*) echo "No symbolic links, so not testing for their testing..." >&4
2865 ;;
2866esac
2867echo " "
2868
34f1896b 2869: Make symlinks util
dafca956
JH
2870case "$mksymlinks" in
2871$define|true|[yY]*)
2872 case "$src" in
2873 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2874 exit 1
2875 ;;
4b661809 2876 *) case "$lns:$issymlink" in
f314eb9f 2877 *"ln"*" -s:"*"test -"?)
dafca956 2878 echo "Creating the symbolic links..." >&4
dafca956 2879 cd ..
7191ba82
AF
2880 awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
2881 awk 'NF == 1 {
2882 dir=".";
2883 file=$1 "";
2884 }
2885 NF == 2 {
2886 dir=$1 "";
2887 file=$2 "";
2888 }
2889 {
2890 print "# dir = ", dir, "file = ", file
f40bbcbf 2891 mf[dir] = mf[dir]" "source"/"dir"/"file;
7191ba82
AF
2892 } END {
2893 for (d in mf) {
2894 if (d != ".") { print("mkdir -p "d) }
2895 print("ln -sf "mf[d]" "d);
2896 }
f40bbcbf 2897 }' source="$src" > UU/mksymlinks.$$
7191ba82
AF
2898 sh UU/mksymlinks.$$
2899 rm UU/mksymlinks.$$
dafca956
JH
2900 # Sanity check 1.
2901 if test ! -d t/base; then
2902 echo "Failed to create the subdirectories. Aborting." >&4
2903 exit 1
2904 fi
dafca956 2905 # Sanity check 2.
a0d24b8a
JH
2906 if test ! -f t/base/lex.t; then
2907 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
dafca956
JH
2908 exit 1
2909 fi
7191ba82
AF
2910 if test ! -f win32/win32.c; then
2911 echo "Failed to create the symlinks (win32/win32.c missing). Aborting." >&4
2912 exit 1
2913 fi
dafca956
JH
2914 cd UU
2915 ;;
2916 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2917 ;;
2918 esac
2919 ;;
2920 esac
2921 ;;
2922esac
2923
613d6c3e 2924: Check for Cross-Compilation
56b575b9
MB
2925if $test "X$targethost" = "X"; then
2926 targethost=""
2927fi
f53a6e0e
MB
2928if $test "X$targetenv" = "X"; then
2929 targetenv=""
2930fi
5440bc8e
JH
2931case "$usecrosscompile" in
2932$define|true|[yY]*)
93bc48fa 2933 $echo "Cross-compiling..."
56b575b9
MB
2934 croak=''
2935 case "$cc" in
2936 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2937 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2938 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2939 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2940 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2941 # leave out ld, choosing it is more complex
2942 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2943 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2944 # We are in a weird spot. Just before us, some values
2945 # were 'saved', to be restored after the hints are
2946 # run. This means that the changes we made to ar,
2947 # nm and ranlib will get reverted.
2948 # To avoid that, we hijack the saving mechanism and
2949 # have it save our new values.
2950 for file in ar nm ranlib; do
2951 eval xxx=\$$file
2952 eval $file=$xxx$_exe
2953 eval _$file=$xxx
2954 done
2955 ;;
5440bc8e
JH
2956 esac
2957 case "$targetarch" in
93bc48fa 2958 '') echo "Targetarch not defined." >&4; croak=y ;;
56b575b9 2959 *) echo "Using targetarch $targetarch." >&4 ;;
5440bc8e 2960 esac
93bc48fa
JH
2961 case "$targethost" in
2962 '') echo "Targethost not defined." >&4; croak=y ;;
56b575b9 2963 *) echo "Using targethost $targethost." >&4
5440bc8e 2964 esac
93bc48fa
JH
2965 locincpth=' '
2966 loclibpth=' '
5440bc8e 2967 case "$croak" in
93bc48fa 2968 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
5440bc8e 2969 esac
b98f6b80
JR
2970 : compile a host miniperl and generate_uudmap, unless we got passed them
2971 if $test "X$hostperl" = X; then
2972 echo "Building host miniperl and generate_uudmap binaries" >&4
4346df8f 2973 before_host=`pwd`
b98f6b80 2974 cd ..
4346df8f
BF
2975 cd $src
2976 src=`pwd`
f53a6e0e
MB
2977 rm -rf $src/host
2978 mkdir $src/host
2979 cd $src/host
4346df8f 2980 $src/Configure -des -Dusedevel -Dmksymlinks
1ca484ac
BF
2981 $make miniperl
2982 case "$hostgenerate" in
2983 '') $make generate_uudmap
f53a6e0e 2984 hostgenerate=$src/host/generate_uudmap
1ca484ac
BF
2985 ;;
2986 "$undef") hostgenerate=''
2987 ;;
2988 esac
4346df8f 2989 hostperl=$src/host/miniperl
4346df8f 2990 cd $before_host
b98f6b80 2991 fi
b36f1e2d 2992 hostosname=`$hostperl -le 'print $^O'`
cb87e003
JR
2993 ;;
2994*)
b75b1e25 2995 usecrosscompile="$undef"
cb87e003
JR
2996 ;;
2997esac
2998
2999: Define -Dtargethost=somecomputer to run compiled tests on another machine
0eafc8c9 3000case "$targethost" in
97076f2d
NW
3001 '') echo "Checking for cross-compile" >&4
3002 case "$usecrosscompile$multiarch" in
dbb1f24e 3003 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
97076f2d
NW
3004 if [ -f Makefile ]; then
3005 echo " "
3006 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
3007 else
3008 echo "Configure done."
3009 fi
3010 exit 0
3011 ;;
97076f2d 3012 *) echo "No targethost for running compiler tests against defined, running locally" >&4
0eafc8c9
JR
3013 run=''
3014 to=:
3015 from=:
3016 ;;
dbb1f24e
NW
3017 esac
3018 ;;
0eafc8c9 3019 *) echo "Using targethost $targethost." >&4
5440bc8e
JH
3020 case "$src" in
3021 /*) run=$src/Cross/run
93c0359c 3022 targetmkdir=$src/Cross/mkdir
5440bc8e
JH
3023 to=$src/Cross/to
3024 from=$src/Cross/from
3025 ;;
93bc48fa 3026 *) pwd=`$test -f ../Configure & cd ..; pwd`
5440bc8e 3027 run=$pwd/Cross/run
f8006fac 3028 targetmkdir=$pwd/Cross/mkdir
5440bc8e
JH
3029 to=$pwd/Cross/to
3030 from=$pwd/Cross/from
3031 ;;
3032 esac
3033 case "$targetrun" in
3034 '') targetrun=ssh ;;
3035 esac
3036 case "$targetto" in
3037 '') targetto=scp ;;
3038 esac
3039 case "$targetfrom" in
3040 '') targetfrom=scp ;;
3041 esac
56b575b9
MB
3042 run=$run-$targetrun
3043 to=$to-$targetto
3044 from=$from-$targetfrom
93bc48fa
JH
3045 case "$targetdir" in
3046 '') targetdir=/tmp
56b575b9
MB
3047 echo "Guessing targetdir $targetdir." >&4
3048 ;;
93bc48fa 3049 esac
5440bc8e 3050 case "$targetuser" in
93bc48fa 3051 '') targetuser=root
56b575b9
MB
3052 echo "Guessing targetuser $targetuser." >&4
3053 ;;
5440bc8e 3054 esac
dad780ec
JR
3055 case "$targetport" in
3056 '') targetport=22
56b575b9
MB
3057 echo "Guessing targetport $targetport." >&4
3058 ;;
dad780ec 3059 esac
5440bc8e
JH
3060 case "$targetfrom" in
3061 scp) q=-q ;;
3062 *) q='' ;;
3063 esac
3064 case "$targetrun" in
3065 ssh|rsh)
3066 cat >$run <<EOF
3067#!/bin/sh
d1739b52 3068env=''
93c0359c
JH
3069case "\$1" in
3070-cwd)
3071 shift
3072 cwd=\$1
3073 shift
3074 ;;
3075esac
d1739b52
BF
3076case "\$1" in
3077-env)
3078 shift
3079 env=\$1
3080 shift
3081 ;;
3082esac
93c0359c
JH
3083case "\$cwd" in
3084'') cwd=$targetdir ;;
3085esac
5440bc8e
JH
3086exe=\$1
3087shift
dad780ec 3088$to \$exe
03deea9f 3089$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
5440bc8e
JH
3090EOF
3091 ;;
e9867f21
BF
3092 adb)
3093 $touch $run
3094 ;;
93bc48fa 3095 *) echo "Unknown targetrun '$targetrun'" >&4
5440bc8e
JH
3096 exit 1
3097 ;;
3098 esac
93c0359c
JH
3099 case "$targetmkdir" in
3100 */Cross/mkdir)
3101 cat >$targetmkdir <<EOF
3102#!/bin/sh
dad780ec 3103$targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
93c0359c 3104EOF
f8006fac 3105 $chmod a+rx $targetmkdir
93c0359c
JH
3106 ;;
3107 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3108 exit 1
3109 ;;
3110 esac
5440bc8e
JH
3111 case "$targetto" in
3112 scp|rcp)
3113 cat >$to <<EOF
3114#!/bin/sh
3115for f in \$@
3116do
93c0359c
JH
3117 case "\$f" in
3118 /*)
3119 $targetmkdir \`dirname \$f\`
f53a6e0e 3120 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
93c0359c
JH
3121 ;;
3122 *)
3123 $targetmkdir $targetdir/\`dirname \$f\`
f53a6e0e 3124 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
93c0359c
JH
3125 ;;
3126 esac
5440bc8e
JH
3127done
3128exit 0
3129EOF
3130 ;;
3131 cp) cat >$to <<EOF
3132#!/bin/sh
93c0359c
JH
3133for f in \$@
3134do
3135 case "\$f" in
3136 /*)
3137 $mkdir -p $targetdir/\`dirname \$f\`
3138 $cp \$f $targetdir/\$f || exit 1
3139 ;;
3140 *)
3141 $targetmkdir $targetdir/\`dirname \$f\`
3142 $cp \$f $targetdir/\$f || exit 1
3143 ;;
3144 esac
3145done
3146exit 0
5440bc8e
JH
3147EOF
3148 ;;
93bc48fa 3149 *) echo "Unknown targetto '$targetto'" >&4
5440bc8e
JH
3150 exit 1
3151 ;;
3152 esac
3153 case "$targetfrom" in
3154 scp|rcp)
3155 cat >$from <<EOF
3156#!/bin/sh
3157for f in \$@
3158do
93c0359c 3159 $rm -f \$f
dad780ec 3160 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
5440bc8e
JH
3161done
3162exit 0
3163EOF
3164 ;;
3165 cp) cat >$from <<EOF
3166#!/bin/sh
3167for f in \$@
3168do
93c0359c 3169 $rm -f \$f
5440bc8e
JH
3170 cp $targetdir/\$f . || exit 1
3171done
3172exit 0
3173EOF
3174 ;;
93bc48fa 3175 *) echo "Unknown targetfrom '$targetfrom'" >&4
5440bc8e
JH
3176 exit 1
3177 ;;
3178 esac
93bc48fa
JH
3179 if $test ! -f $run; then
3180 echo "Target 'run' script '$run' not found." >&4
5440bc8e 3181 else
f8006fac 3182 $chmod a+rx $run
5440bc8e 3183 fi
93bc48fa
JH
3184 if $test ! -f $to; then
3185 echo "Target 'to' script '$to' not found." >&4
5440bc8e 3186 else
f8006fac 3187 $chmod a+rx $to
5440bc8e 3188 fi
93bc48fa
JH
3189 if $test ! -f $from; then
3190 echo "Target 'from' script '$from' not found." >&4
5440bc8e 3191 else
f8006fac 3192 $chmod a+rx $from
5440bc8e 3193 fi
93bc48fa 3194 if $test ! -f $run -o ! -f $to -o ! -f $from; then
5440bc8e
JH
3195 exit 1
3196 fi
3197 cat >&4 <<EOF
f8006fac
JH
3198Using '$run' for remote execution,
3199and '$from' and '$to'
93bc48fa 3200for remote file transfer.
5440bc8e
JH
3201EOF
3202 ;;
3203*) run=''
3204 to=:
3205 from=:
b75b1e25 3206 usecrosscompile="$undef"
5440bc8e
JH
3207 targetarch=''
3208 ;;
3209esac
3210
ecfc5424
AD
3211: see whether [:lower:] and [:upper:] are supported character classes
3212echo " "
e129ac51
AB
3213case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
3214ABYZ-abyz)
ecfc5424
AD
3215 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3216 up='[:upper:]'
3217 low='[:lower:]'
3218 ;;
416d0bea
MB
3219*) # There is a discontinuity in EBCDIC between 'R' and 'S'
3220 # (0xd9 and 0xe2), therefore that is a nice testing point.
3221 if test "X$up" = X -o "X$low" = X; then
3222 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3223 rs) up='[A-Z]'
3224 low='[a-z]'
28e8609d
JH
3225 ;;
3226 esac
416d0bea 3227 fi
28e8609d 3228 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3229 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3230 rs) up='A-Z'
28e8609d
JH
3231 low='a-z'
3232 ;;
3233 esac
416d0bea 3234 fi
28e8609d 3235 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3236 case "`echo RS | od -x 2>/dev/null`" in
3237 *D9E2*|*d9e2*)
28e8609d
JH
3238 echo "Hey, this might be EBCDIC." >&4
3239 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3240 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3241 rs) up='[A-IJ-RS-Z]'
3242 low='[a-ij-rs-z]'
28e8609d
JH
3243 ;;
3244 esac
3245 fi
3246 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3247 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3248 rs) up='A-IJ-RS-Z'
3249 low='a-ij-rs-z'
28e8609d
JH
3250 ;;
3251 esac
3252 fi
3253 ;;
3254 esac
3255 fi
3256esac
416d0bea
MB
3257case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3258rs)
28e8609d
JH
3259 echo "Using $up and $low to convert case." >&4
3260 ;;
ecfc5424 3261*)
28e8609d
JH
3262 echo "I don't know how to translate letters from upper to lower case." >&4
3263 echo "Your tr is not acting any way I know of." >&4
3264 exit 1
3265 ;;
ecfc5424
AD
3266esac
3267: set up the translation script tr, must be called with ./tr of course
3268cat >tr <<EOSC
3269$startsh
3270case "\$1\$2" in
3271'[A-Z][a-z]') exec $tr '$up' '$low';;
3272'[a-z][A-Z]') exec $tr '$low' '$up';;
3273esac
3274exec $tr "\$@"
3275EOSC
3276chmod +x tr
3277$eunicefix tr
3278
2304df62
AD
3279: Try to determine whether config.sh was made on this system
3280case "$config_sh" in
3281'')
43999f95
JH
3282myuname=`$uname -a 2>/dev/null`
3283$test -z "$myuname" && myuname=`hostname 2>/dev/null`
f4dc174a 3284# Downcase everything to avoid ambiguity.
1332606d 3285# Remove slashes and single quotes so we can use parts of this in
f4dc174a
AD
3286# directory and file names.
3287# Remove newlines so myuname is sane to use elsewhere.
28e8609d
JH
3288# tr '[A-Z]' '[a-z]' would not work in EBCDIC
3289# because the A-Z/a-z are not consecutive.
f4dc174a 3290myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3eaeeeae 3291 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1aef975c 3292newmyuname="$myuname"
2304df62 3293dflt=n
16d20bd9
AD
3294case "$knowitall" in
3295'')
3296 if test -f ../config.sh; then
3297 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3298 eval "`grep myuname= ../config.sh`"
3299 fi
3300 if test "X$myuname" = "X$newmyuname"; then
3301 dflt=y
3302 fi
2304df62 3303 fi
16d20bd9
AD
3304 ;;
3305*) dflt=y;;
3306esac
2304df62
AD
3307
3308: Get old answers from old config file if Configure was run on the
3309: same system, otherwise use the hints.
3310hint=default
3311cd ..
3312if test -f config.sh; then
16d20bd9
AD
3313 echo " "
3314 rp="I see a config.sh file. Shall I use it to set the defaults?"
2304df62
AD
3315 . UU/myread
3316 case "$ans" in
f83701cd
AD
3317 n*|N*) echo "OK, I'll ignore it."
3318 mv config.sh config.sh.old
3319 myuname="$newmyuname"
3320 ;;
2304df62 3321 *) echo "Fetching default answers from your old config.sh file..." >&4
ecfc5424
AD
3322 tmp_n="$n"
3323 tmp_c="$c"
85cad39c 3324 tmp_sh="$sh"
2304df62
AD
3325 . ./config.sh
3326 cp config.sh UU
ecfc5424
AD
3327 n="$tmp_n"
3328 c="$tmp_c"
85cad39c
PP
3329 : Older versions did not always set $sh. Catch re-use of such
3330 : an old config.sh.
3331 case "$sh" in
3332 '') sh="$tmp_sh" ;;
3333 esac
2304df62
AD
3334 hint=previous
3335 ;;
3336 esac
3337fi
2573c5f9 3338. ./UU/checkcc
2304df62
AD
3339if test ! -f config.sh; then
3340 $cat <<EOM
3341
4e2a5f63
AD
3342First time through, eh? I have some defaults handy for some systems
3343that need some extra help getting the Configure answers right:
2304df62
AD
3344
3345EOM
dfe9444c 3346 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2304df62
AD
3347 dflt=''
3348 : Half the following guesses are probably wrong... If you have better
7f2de2d2 3349 : tests or hints, please send them to perlbug@perl.org
2304df62 3350 : The metaconfig authors would also appreciate a copy...
a0d0e21e 3351 $test -f /irix && osname=irix
85e6fe83
LW
3352 $test -f /xenix && osname=sco_xenix
3353 $test -f /dynix && osname=dynix
3354 $test -f /dnix && osname=dnix
5f05dabc
PP
3355 $test -f /lynx.os && osname=lynxos
3356 $test -f /unicos && osname=unicos && osvers=`$uname -r`
c71a9cee 3357 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
7a4c00b4 3358 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
85e6fe83 3359 $test -f /bin/mips && /bin/mips && osname=mips
a0d0e21e
LW
3360 $test -d /usr/apollo/bin && osname=apollo
3361 $test -f /etc/saf/_sactab && osname=svr4
0cf583b0 3362 $test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
d54344fc 3363 $test -f /system/gnu_library/bin/ar.pm && osname=vos
dabb2532 3364 $test -f /sys/utilities/MultiView && osname=amigaos
e060872b 3365 if $test -d /MachTen -o -d /MachTen_Folder; then
dfe9444c 3366 osname=machten
4633a7c4 3367 if $test -x /sbin/version; then
dfe9444c 3368 osvers=`/sbin/version | $awk '{print $2}' |
4633a7c4
LW
3369 $sed -e 's/[A-Za-z]$//'`
3370 elif $test -x /usr/etc/version; then
dfe9444c 3371 osvers=`/usr/etc/version | $awk '{print $2}' |
4633a7c4
LW
3372 $sed -e 's/[A-Za-z]$//'`
3373 else
3374 osvers="$2.$3"
3375 fi
3376 fi
aaacdc8b
GS
3377
3378 $test -f /sys/posix.dll &&
3379 $test -f /usr/bin/what &&
3380 set X `/usr/bin/what /sys/posix.dll` &&
3381 $test "$3" = UWIN &&
3382 osname=uwin &&
3383 osvers="$5"
3384
2304df62
AD
3385 if $test -f $uname; then
3386 set X $myuname
3387 shift
3388
2304df62 3389 case "$5" in
85e6fe83 3390 fps*) osname=fps ;;
2304df62
AD
3391 mips*)
3392 case "$4" in
85e6fe83
LW
3393 umips) osname=umips ;;
3394 *) osname=mips ;;
2304df62 3395 esac;;
85e6fe83 3396 [23]100) osname=mips ;;
ecfc5424 3397 i386*)
c6912327
JH
3398 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3399 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
619ffc2b
JH
3400 osname='sco'
3401 osvers=$tmp
3402 elif $test -f /etc/kconfig; then
ecfc5424 3403 osname=isc
bd628c73 3404 if test "$lns" = "$ln -s"; then
a0d0e21e
LW
3405 osvers=4
3406 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3407 osvers=3
2304df62 3408 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
a0d0e21e 3409 osvers=2
ecfc5424
AD
3410 fi
3411 fi
2000072c 3412 tmp=''
ecfc5424 3413 ;;
c4f23d77
AD
3414 pc*)
3415 if test -n "$DJGPP"; then
3416 osname=dos
3417 osvers=djgpp
3418 fi
3419 ;;
2304df62
AD
3420 esac
3421
3422 case "$1" in
a0d0e21e
LW
3423 aix) osname=aix
3424 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3425 case "$tmp" in
e81c5c2a
NC
3426 # oslevel can fail with:
3427 # oslevel: Unable to acquire lock.
3428 *not\ found) osvers="$4"."$3" ;;
a0d0e21e
LW
3429 '<3240'|'<>3240') osvers=3.2.0 ;;
3430 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3431 '=3250'|'>3250') osvers=3.2.5 ;;
1aef975c 3432 *) osvers=$tmp;;
a0d0e21e
LW
3433 esac
3434 ;;
287574fe
MB
3435 bitrig) osname=bitrig
3436 osvers="$3"
3437 ;;
aaacdc8b
GS
3438 bsd386) osname=bsd386
3439 osvers=`$uname -r`
3440 ;;
3441 cygwin*) osname=cygwin
3442 osvers="$3"
3443 ;;
23f87696
SZ
3444 *dc.osx) osname=dcosx
3445 osvers="$3"
3446 ;;
a0d0e21e
LW
3447 dnix) osname=dnix
3448 osvers="$3"
3449 ;;
3450 domainos) osname=apollo
3451 osvers="$3"
3452 ;;
a774dfe6
RSG
3453 dgux) osname=dgux
3454 osvers="$3"
3455 ;;
3456 dragonfly) osname=dragonfly
a0d0e21e
LW
3457 osvers="$3"
3458 ;;
760ac839 3459 dynixptx*) osname=dynixptx
e58e581d 3460 osvers=`echo "$4"|sed 's/^v//'`
760ac839 3461 ;;
a774dfe6 3462 freebsd) osname=freebsd
a0d0e21e 3463 osvers="$3" ;;
761ee4e8
BD
3464 genix) osname=genix ;;
3465 gnu) osname=gnu
3466 osvers="$3" ;;
a774dfe6 3467 hp*) osname=hpux
bfb7748a 3468 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
a0d0e21e 3469 ;;
761ee4e8 3470 irix*) osname=irix
a0d0e21e
LW
3471 case "$3" in
3472 4*) osvers=4 ;;
3473 5*) osvers=5 ;;
ecfc5424 3474 *) osvers="$3" ;;
a0d0e21e
LW
3475 esac
3476 ;;
761ee4e8 3477 linux) osname=linux
a0d0e21e 3478 case "$3" in
a0d0e21e
LW
3479 *) osvers="$3" ;;
3480 esac
78ada538 3481 $test -f /system/lib/libandroid.so && osname=linux-android
a0d0e21e 3482 ;;
761ee4e8 3483 MiNT) osname=mint
28e8609d
JH
3484 ;;
3485 netbsd*) osname=netbsd
ecfc5424
AD
3486 osvers="$3"
3487 ;;
4e81affe
MMIJG
3488 news-os) osvers="$3"
3489 case "$3" in
3490 4*) osname=newsos4 ;;
3491 *) osname=newsos ;;
3492 esac
3493 ;;
28bb1e2c 3494 nonstop-ux) osname=nonstopux ;;
65dc58a1
TM
3495 openbsd) osname=openbsd
3496 osvers="$3"
3497 ;;
5c728af0
IZ
3498 os2) osname=os2
3499 osvers="$4"
3500 ;;
aaacdc8b
GS
3501 POSIX-BC | posix-bc ) osname=posix-bc
3502 osvers="$3"
a0d0e21e 3503 ;;
ae3afa4e
TH
3504 powerux | power_ux | powermax_os | powermaxos | \
3505 powerunix | power_unix) osname=powerux
3506 osvers="$3"
3507 ;;
aaacdc8b
GS
3508 qnx) osname=qnx
3509 osvers="$4"
3510 ;;
a0d0e21e
LW
3511 solaris) osname=solaris
3512 case "$3" in
3513 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
ecfc5424 3514 *) osvers="$3" ;;
a0d0e21e
LW
3515 esac
3516 ;;
85e6fe83
LW
3517 sunos) osname=sunos
3518 case "$3" in
85e6fe83
LW
3519 5*) osname=solaris
3520 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
a0d0e21e 3521 *) osvers="$3" ;;
2304df62
AD
3522 esac
3523 ;;
a0d0e21e 3524 titanos) osname=titanos
85e6fe83 3525 case "$3" in
a0d0e21e
LW
3526 1*) osvers=1 ;;
3527 2*) osvers=2 ;;
3528 3*) osvers=3 ;;
3529 4*) osvers=4 ;;
ecfc5424 3530 *) osvers="$3" ;;
2304df62
AD
3531 esac
3532 ;;
85e6fe83 3533 ultrix) osname=ultrix
ecfc5424 3534 osvers="$3"
2304df62 3535 ;;
28757baa 3536 osf1|mls+) case "$5" in
fed7345c
AD
3537 alpha)
3538 osname=dec_osf
fdd85a03 3539 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2aa76180
JH
3540 case "$osvers" in
3541 [1-9].[0-9]*) ;;
3542 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3543 esac
ecfc5424
AD
3544 ;;
3545 hp*) osname=hp_osf1 ;;
3546 mips) osname=mips_osf1 ;;
85e6fe83
LW
3547 esac
3548 ;;
af1ff193 3549 # UnixWare 7.1.2 is known as Open UNIX 8
381c1bae 3550 openunix|unixware) osname=svr5
0337d152
A
3551 osvers="$4"
3552 ;;
3c728e00 3553 uts) osname=uts
a0d0e21e
LW
3554 osvers="$3"
3555 ;;
3c728e00
JH
3556 vos) osvers="$3"
3557 ;;
85e6fe83 3558 $2) case "$osname" in
2304df62 3559 *isc*) ;;
a0d0e21e 3560 *freebsd*) ;;
5f05dabc 3561 svr*)
a0d0e21e 3562 : svr4.x or possibly later
a774dfe6 3563 case "svr$3" in
a0d0e21e
LW
3564 ${osname}*)
3565 osname=svr$3
3566 osvers=$4
3567 ;;
3568 esac
3569 case "$osname" in
3570 svr4.0)
3571 : Check for ESIX
3572 if test -f /stand/boot ; then
3573 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
ecfc5424
AD
3574 if test -n "$INITPROG" -a -f "$INITPROG"; then
3575 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3576 if test -n "$isesix"; then
a0d0e21e
LW
3577 osname=esix4
3578 fi
3579 fi
3580 fi
3581 ;;
3582 esac
3583 ;;
2304df62 3584 *) if test -f /etc/systemid; then
a0d0e21e
LW
3585 osname=sco
3586 set `echo $3 | $sed 's/\./ /g'` $4
c4f23d77 3587 if $test -f $src/hints/sco_$1_$2_$3.sh; then
85e6fe83 3588 osvers=$1.$2.$3
c4f23d77 3589 elif $test -f $src/hints/sco_$1_$2.sh; then
85e6fe83 3590 osvers=$1.$2
c4f23d77 3591 elif $test -f $src/hints/sco_$1.sh; then
85e6fe83 3592 osvers=$1
2304df62 3593 fi
a0d0e21e
LW
3594 else
3595 case "$osname" in
3596 '') : Still unknown. Probably a generic Sys V.
3597 osname="sysv"
3598 osvers="$3"
3599 ;;
3600 esac
2304df62
AD
3601 fi
3602 ;;
3603 esac
3604 ;;
a0d0e21e
LW
3605 *) case "$osname" in
3606 '') : Still unknown. Probably a generic BSD.
3607 osname="$1"
3608 osvers="$3"
3609 ;;
3610 esac
3611 ;;
2304df62
AD
3612 esac
3613 else
dfe9444c
AD
3614 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3615 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3616 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3617 osname=news_os
2304df62 3618 fi
dfe9444c 3619 $rm -f UU/kernel.what
5c728af0 3620 elif test -d c:/. -o -n "$is_os2" ; then
8e07c86e
AD
3621 set X $myuname
3622 osname=os2
3623 osvers="$5"
2304df62
AD
3624 fi
3625 fi
a774dfe6 3626
5440bc8e
JH
3627 case "$targetarch" in
3628 '') ;;
3629 *) hostarch=$osname
82643807
BF
3630 case "$targetarch" in
3631 nto*|*-nto-*)
c413f034
BF
3632 # Will load qnx.sh, which should change osname to nto
3633 osname=qnx
0d460bac 3634 osvers=''
82643807
BF
3635 ;;
3636 *linux-android*)
3637 # Catch arm-linux-androideabi, mipsel-linux-android,
3638 # and i686-linux-android
3639 osname=linux-android
0d460bac 3640 osvers=''
82643807 3641 ;;
6f372547
BF
3642 *linux*)
3643 # Something like arm-linux-gnueabihf is really just
3644 # plain linux.
3645 osname=linux
0d460bac
BF
3646 osvers=''
3647 ;;
3648 *solaris*|*sunos*)
3649 osname=solaris
3650 # XXX perhaps we should just assume
3651 # osvers to be 2, or maybe take the value
3652 # from targetarch. Using $run before the
3653 # hints are run is somewhat icky.
3654 set X `$run $uname -a 2>/dev/null`
3655 shift
3656 case "$3" in
3657 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3658 *) osvers="$3" ;;
3659 esac
6f372547 3660 ;;
82643807 3661 *)
f53a6e0e
MB
3662 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3663 osvers=''
82643807
BF
3664 ;;
3665 esac
5440bc8e
JH
3666 ;;
3667 esac
3668
a0d0e21e
LW
3669 : Now look for a hint file osname_osvers, unless one has been
3670 : specified already.
3671 case "$hintfile" in
3672 ''|' ')
1e127011 3673 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
a0d0e21e 3674 : Also try without trailing minor version numbers.
1e127011
DD
3675 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3676 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3677 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3678 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
a0d0e21e
LW
3679 case "$file" in
3680 '') dflt=none ;;
3681 *) case "$osvers" in
3682 '') dflt=$file
3683 ;;
dfe9444c 3684 *) if $test -f $src/hints/$file.sh ; then
a0d0e21e 3685 dflt=$file
dfe9444c 3686 elif $test -f $src/hints/$xfile.sh ; then
a0d0e21e 3687 dflt=$xfile
dfe9444c 3688 elif $test -f $src/hints/$xxfile.sh ; then
a0d0e21e 3689 dflt=$xxfile
dfe9444c 3690 elif $test -f $src/hints/$xxxfile.sh ; then
a0d0e21e 3691 dflt=$xxxfile
dfe9444c 3692 elif $test -f $src/hints/$xxxxfile.sh ; then
a0d0e21e 3693 dflt=$xxxxfile
dfe9444c 3694 elif $test -f "$src/hints/${osname}.sh" ; then
a0d0e21e
LW
3695 dflt="${osname}"
3696 else
3697 dflt=none
3698 fi
3699 ;;
3700 esac
85e6fe83
LW
3701 ;;
3702 esac
4e2a5f63
AD
3703 if $test -f Policy.sh ; then
3704 case "$dflt" in
3705 *Policy*) ;;
3706 none) dflt="Policy" ;;
3707 *) dflt="Policy $dflt" ;;
3708 esac
3709 fi
85e6fe83 3710 ;;
a0d0e21e 3711 *)
ecfc5424 3712 dflt=`echo $hintfile | $sed 's/\.sh$//'`
a0d0e21e 3713 ;;
2304df62 3714 esac
1aef975c 3715
4e2a5f63
AD
3716 if $test -f Policy.sh ; then
3717 $cat <<EOM
3718
3719There's also a Policy hint file available, which should make the
3720site-specific (policy) questions easier to answer.
3721EOM
3722
3723 fi
3724
2304df62
AD
3725 $cat <<EOM
3726
3727You may give one or more space-separated answers, or "none" if appropriate.
a2d23ec2
MB
3728If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3729previous run of Configure, you may specify it as well as or instead of
3730OS-specific hints. If hints are provided for your OS, you should use them:
3731although Perl can probably be built without hints on many platforms, using
3732hints often improve performance and may enable features that Configure can't
3733set up on its own. If there are no hints that match your OS, specify "none";
3734DO NOT give a wrong version or a wrong OS.
2304df62
AD
3735
3736EOM
4e2a5f63 3737
2304df62 3738 rp="Which of these apply, if any?"
dfe9444c 3739 . UU/myread
85e6fe83
LW
3740 tans=$ans
3741 for file in $tans; do
4e2a5f63
AD
3742 if $test X$file = XPolicy -a -f Policy.sh; then
3743 . Policy.sh
3744 $cat Policy.sh >> UU/config.sh
3745 elif $test -f $src/hints/$file.sh; then
dfe9444c
AD
3746 . $src/hints/$file.sh
3747 $cat $src/hints/$file.sh >> UU/config.sh
5440bc8e 3748 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
2304df62
AD
3749 : nothing
3750 else
85e6fe83
LW
3751 : Give one chance to correct a possible typo.
3752 echo "$file.sh does not exist"
3753 dflt=$file
3754 rp="hint to use instead?"
dfe9444c 3755 . UU/myread
85e6fe83 3756 for file in $ans; do
dfe9444c
AD
3757 if $test -f "$src/hints/$file.sh"; then
3758 . $src/hints/$file.sh
3759 $cat $src/hints/$file.sh >> UU/config.sh
85e6fe83
LW
3760 elif $test X$ans = X -o X$ans = Xnone ; then
3761 : nothing
3762 else
3763 echo "$file.sh does not exist -- ignored."
3764 fi
3765 done
2304df62
AD
3766 fi
3767 done