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