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