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