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