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