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