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