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