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