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