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