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