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