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