This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New file. Changes from 5.002 to 5.003
[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
17# comp.sources.misc so you may fetch it yourself from your nearest
18# archive site. Check with Archie if you don't know where that can be.)
19#
20
8e07c86e 21# $Id: Head.U,v 3.0.1.8 1995/07/25 13:40:02 ram Exp $
2304df62 22#
760ac839 23# Generated on Thu Aug 8 17:48:02 BST 1996 [metaconfig 3.0 PL60]
2304df62
AD
24
25cat >/tmp/c1$$ <<EOF
26ARGGGHHHH!!!!!
27
28SCO csh still thinks true is false. Write to SCO today and tell them that next
29year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
30
31(Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
32we'd have to do is go in and swap the && and || tokens, wherever they are.)
33
34[End of diatribe. We now return you to your regularly scheduled programming...]
35EOF
36cat >/tmp/c2$$ <<EOF
37
38OOPS! You naughty creature! You didn't run Configure with sh!
39I will attempt to remedy the situation by running sh for you...
40EOF
41
42true || cat /tmp/c1$$ /tmp/c2$$
43true || exec sh $0 $argv:q
44
45(exit $?0) || cat /tmp/c2$$
46(exit $?0) || exec sh $0 $argv:q
47rm -f /tmp/c1$$ /tmp/c2$$
48
a0d0e21e
LW
49: compute my invocation name
50me=$0
51case "$0" in
52*/*)
53 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
54 test "$me" || me=$0
55 ;;
56esac
57
8e07c86e
AD
58: Proper PATH separator
59p_=:
60: On OS/2 this directory should exist if this is not floppy only system :-]
61if test -d c:/.; then
62 p_=\;
63 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
64 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
65fi
a0d0e21e
LW
66
67: Proper PATH setting
68paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
16d20bd9 69paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
232e078e 70paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
16d20bd9 71paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
232e078e
AD
72paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
73paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
74paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
75paths="$paths /sbin /usr/sbin /usr/libexec"
a0d0e21e
LW
76
77for p in $paths
78do
8e07c86e
AD
79 case "$p_$PATH$p_" in
80 *$p_$p$p_*) ;;
81 *) test -d $p && PATH=$PATH$p_$p ;;
a0d0e21e
LW
82 esac
83done
84
8e07c86e 85PATH=.$p_$PATH
2304df62
AD
86export PATH
87
a0d0e21e 88: Sanity checks
2304df62 89if test ! -t 0; then
a0d0e21e 90 echo "Say 'sh $me', not 'sh <$me'"
2304df62
AD
91 exit 1
92fi
93
94: On HP-UX, large Configure scripts may exercise a bug in /bin/sh
95if test -f /hp-ux -a -f /bin/ksh; then
96 if (PATH=.; alias -x) >/dev/null 2>&1; then
97 : already under /bin/ksh
98 else
99 cat <<'EOM'
100(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
101EOM
ecfc5424 102 unset ENV
2304df62
AD
103 exec /bin/ksh $0 "$@"
104 fi
105else
106 : Warn them if they use ksh on other systems
107 (PATH=.; alias -x) >/dev/null 2>&1 && \
a0d0e21e
LW
108 cat <<EOM
109(I see you are using the Korn shell. Some ksh's blow up on $me,
2304df62
AD
110especially on exotic machines. If yours does, try the Bourne shell instead.)
111EOM
112fi
113
114: Configure runs within the UU subdirectory
115test -d UU || mkdir UU
8e07c86e 116cd UU && rm -f ./*
2304df62 117
a0d0e21e 118dynamic_ext=''
2304df62 119extensions=''
a0d0e21e
LW
120known_extensions=''
121static_ext=''
122useposix=''
2c7991dc 123usesafe=''
ecfc5424 124d_bsd=''
40a7a20a 125d_eunice=''
2304df62
AD
126d_xenix=''
127eunicefix=''
128Mcc=''
129awk=''
130bash=''
131bison=''
132byacc=''
133cat=''
134chgrp=''
135chmod=''
136chown=''
ecfc5424 137comm=''
2304df62
AD
138compress=''
139cp=''
140cpio=''
141cpp=''
142csh=''
143date=''
144echo=''
145egrep=''
146emacs=''
147expr=''
148find=''
149flex=''
150gcc=''
151grep=''
152inews=''
153ksh=''
154less=''
155line=''
156lint=''
157ln=''
158lp=''
159lpr=''
160ls=''
161mail=''
162mailx=''
163make=''
164mkdir=''
165more=''
166mv=''
167nroff=''
168perl=''
169pg=''
170pmake=''
171pr=''
172rm=''
173rmail=''
174sed=''
175sendmail=''
176sh=''
177shar=''
178sleep=''
179smail=''
180sort=''
181submit=''
182tail=''
183tar=''
184tbl=''
185test=''
186touch=''
187tr=''
188troff=''
189uname=''
190uniq=''
191uuname=''
192vi=''
193zcat=''
1aef975c 194full_sed=''
a0d0e21e 195libswanted=''
2304df62
AD
196hint=''
197myuname=''
85e6fe83
LW
198osname=''
199osvers=''
2304df62
AD
200Author=''
201Date=''
202Header=''
203Id=''
204Locker=''
205Log=''
206RCSfile=''
207Revision=''
208Source=''
209State=''
4633a7c4
LW
210ar=''
211archobjs=''
212exe_ext=''
213firstmakefile=''
214lib_ext=''
215obj_ext=''
216path_sep=''
2304df62 217afs=''
a0d0e21e
LW
218alignbytes=''
219archlib=''
220archlibexp=''
a0d0e21e
LW
221d_archlib=''
222installarchlib=''
40000a8c
AD
223archname=''
224myarchname=''
ecfc5424 225baserev=''
2304df62
AD
226bin=''
227binexp=''
228installbin=''
760ac839 229bin_sh=''
2304df62
AD
230byteorder=''
231cc=''
232gccversion=''
233ccflags=''
234cppflags=''
235ldflags=''
236lkflags=''
8e07c86e 237locincpth=''
2304df62 238optimize=''
8e07c86e 239cf_email=''
2304df62
AD
240cf_by=''
241cf_time=''
242contains=''
a0d0e21e 243cpp_stuff=''
2304df62
AD
244cpplast=''
245cppminus=''
246cpprun=''
247cppstdin=''
248d_access=''
a0d0e21e 249d_alarm=''
ecfc5424 250d_attribut=''
2304df62
AD
251d_bcmp=''
252d_bcopy=''
253d_bzero=''
254d_casti32=''
255castflags=''
256d_castneg=''
a0d0e21e
LW
257d_chown=''
258d_chroot=''
2304df62 259d_chsize=''
a0d0e21e
LW
260d_closedir=''
261d_void_closedir=''
2304df62
AD
262d_const=''
263cryptlib=''
264d_crypt=''
265d_csh=''
1aef975c 266full_csh=''
a0d0e21e
LW
267d_cuserid=''
268d_dbl_dig=''
269d_difftime=''
270d_dlerror=''
271d_dlopen=''
272d_dlsymun=''
2304df62 273d_dosuid=''
a0d0e21e 274d_suidsafe=''
2304df62
AD
275d_dup2=''
276d_fchmod=''
277d_fchown=''
278d_fcntl=''
a0d0e21e
LW
279d_fd_macros=''
280d_fd_set=''
281d_fds_bits=''
282d_fgetpos=''
2304df62
AD
283d_flexfnam=''
284d_flock=''
a0d0e21e
LW
285d_fork=''
286d_fsetpos=''
287d_Gconvert=''
2304df62
AD
288d_getgrps=''
289d_gethent=''
290aphostname=''
291d_gethname=''
292d_phostname=''
293d_uname=''
a0d0e21e 294d_getlogin=''
2304df62
AD
295d_getpgrp2=''
296d_getpgrp=''
a0d0e21e 297d_getppid=''
2304df62
AD
298d_getprior=''
299d_htonl=''
300d_isascii=''
301d_killpg=''
302d_link=''
a0d0e21e
LW
303d_locconv=''
304d_lockf=''
2304df62 305d_lstat=''
a0d0e21e
LW
306d_mblen=''
307d_mbstowcs=''
308d_mbtowc=''
2304df62
AD
309d_memcmp=''
310d_memcpy=''
311d_memmove=''
312d_memset=''
313d_mkdir=''
a0d0e21e
LW
314d_mkfifo=''
315d_mktime=''
2304df62
AD
316d_msg=''
317d_msgctl=''
318d_msgget=''
319d_msgrcv=''
320d_msgsnd=''
a0d0e21e 321d_nice=''
2304df62 322d_open3=''
a0d0e21e
LW
323d_fpathconf=''
324d_pathconf=''
325d_pause=''
760ac839 326d_perlstdio=''
a0d0e21e 327d_pipe=''
8e07c86e 328d_poll=''
2304df62
AD
329d_portable=''
330d_readdir=''
85e6fe83
LW
331d_rewinddir=''
332d_seekdir=''
333d_telldir=''
a0d0e21e 334d_readlink=''
2304df62
AD
335d_rename=''
336d_rmdir=''
337d_safebcpy=''
338d_safemcpy=''
339d_select=''
340d_sem=''
341d_semctl=''
342d_semget=''
343d_semop=''
344d_setegid=''
345d_seteuid=''
a0d0e21e 346d_setlinebuf=''
2304df62
AD
347d_setlocale=''
348d_setpgid=''
349d_setpgrp2=''
350d_bsdpgrp=''
351d_setpgrp=''
352d_setprior=''
353d_setregid=''
354d_setresgid=''
355d_setresuid=''
356d_setreuid=''
357d_setrgid=''
358d_setruid=''
359d_setsid=''
760ac839 360d_sfio=''
2304df62
AD
361d_shm=''
362d_shmat=''
a0d0e21e
LW
363d_shmatprototype=''
364shmattype=''
2304df62
AD
365d_shmctl=''
366d_shmdt=''
367d_shmget=''
a5f75d66 368d_sigsetjmp=''
2c7991dc
PP
369d_sigaction=''
370d_sigintrp=''
371d_sigvec=''
372d_sigvectr=''
2304df62
AD
373d_oldsock=''
374d_socket=''
375d_sockpair=''
376sockethdr=''
377socketlib=''
378d_statblks=''
c2960299
AD
379d_stdio_cnt_lval=''
380d_stdio_ptr_lval=''
16d20bd9 381d_stdiobase=''
2304df62 382d_stdstdio=''
16d20bd9
AD
383stdio_base=''
384stdio_bufsiz=''
385stdio_cnt=''
386stdio_ptr=''
2304df62
AD
387d_index=''
388d_strchr=''
a0d0e21e 389d_strcoll=''
2304df62
AD
390d_strctcpy=''
391d_strerrm=''
392d_strerror=''
393d_sysernlst=''
394d_syserrlst=''
a0d0e21e 395d_strxfrm=''
2304df62
AD
396d_symlink=''
397d_syscall=''
a0d0e21e 398d_sysconf=''
2304df62 399d_system=''
a0d0e21e
LW
400d_tcgetpgrp=''
401d_tcsetpgrp=''
85e6fe83
LW
402d_time=''
403timetype=''
2304df62
AD
404clocktype=''
405d_times=''
406d_truncate=''
a0d0e21e
LW
407d_tzname=''
408d_umask=''
2304df62 409d_vfork=''
a0d0e21e 410usevfork=''
2304df62
AD
411d_voidsig=''
412signal_t=''
413d_volatile=''
414d_charvspr=''
415d_vprintf=''
416d_wait4=''
417d_waitpid=''
a0d0e21e
LW
418d_wcstombs=''
419d_wctomb=''
420dlext=''
85e6fe83
LW
421cccdlflags=''
422ccdlflags=''
ecfc5424 423d_shrplib=''
2304df62 424dlsrc=''
232e078e 425ld=''
85e6fe83 426lddlflags=''
ecfc5424 427shrpdir=''
2304df62 428usedl=''
a0d0e21e 429fpostype=''
2304df62
AD
430gidtype=''
431groupstype=''
432h_fcntl=''
433h_sysfile=''
ecfc5424
AD
434db_hashtype=''
435db_prefixtype=''
a0d0e21e 436i_db=''
2304df62 437i_dbm=''
8e07c86e 438i_rpcsvcdbm=''
2304df62 439d_dirnamlen=''
a0d0e21e 440direntrytype=''
2304df62 441i_dirent=''
a0d0e21e 442i_dld=''
2304df62
AD
443i_dlfcn=''
444i_fcntl=''
a0d0e21e 445i_float=''
2304df62
AD
446i_gdbm=''
447i_grp=''
a0d0e21e 448i_limits=''
4633a7c4 449i_locale=''
a0d0e21e
LW
450i_malloc=''
451i_math=''
85e6fe83 452i_memory=''
2304df62 453i_ndbm=''
85e6fe83 454i_neterrno=''
2304df62
AD
455i_niin=''
456i_sysin=''
457d_pwage=''
458d_pwchange=''
459d_pwclass=''
460d_pwcomment=''
461d_pwexpire=''
462d_pwquota=''
463i_pwd=''
760ac839 464i_sfio=''
2304df62 465i_stddef=''
a0d0e21e 466i_stdlib=''
2304df62
AD
467i_string=''
468strings=''
469i_sysdir=''
470i_sysfile=''
471d_voidtty=''
472i_bsdioctl=''
a0d0e21e 473i_sysfilio=''
2304df62
AD
474i_sysioctl=''
475i_syssockio=''
476i_sysndir=''
a0d0e21e 477i_sysparam=''
2304df62 478i_sysselct=''
1aef975c 479i_sysstat=''
a0d0e21e 480i_systimes=''
fed7345c 481i_systypes=''
25f94b33 482i_sysun=''
2304df62
AD
483i_sgtty=''
484i_termio=''
485i_termios=''
486i_systime=''
487i_systimek=''
488i_time=''
489timeincl=''
85e6fe83 490i_unistd=''
2304df62 491i_utime=''
760ac839 492i_values=''
a0d0e21e 493i_stdarg=''
2304df62
AD
494i_varargs=''
495i_varhdr=''
496i_vfork=''
497intsize=''
2304df62 498libc=''
a0d0e21e 499glibpth=''
2304df62 500libpth=''
8e07c86e 501loclibpth=''
2304df62
AD
502plibpth=''
503xlibpth=''
504libs=''
85e6fe83
LW
505lns=''
506lseektype=''
760ac839 507mab=''
85e6fe83 508d_mymalloc=''
94b6baf5 509freetype=''
2304df62
AD
510mallocobj=''
511mallocsrc=''
512malloctype=''
513usemymalloc=''
16d20bd9
AD
514installman1dir=''
515man1dir=''
516man1direxp=''
517man1ext=''
518installman3dir=''
519man3dir=''
520man3direxp=''
521man3ext=''
2304df62
AD
522huge=''
523large=''
524medium=''
525models=''
526small=''
527split=''
a0d0e21e 528modetype=''
2304df62
AD
529mydomain=''
530myhostname=''
531phostname=''
532c=''
533n=''
8e07c86e
AD
534d_eofnblk=''
535eagain=''
536o_nonblock=''
537rd_nodata=''
2304df62
AD
538groupcat=''
539hostcat=''
540passcat=''
4633a7c4
LW
541d_oldarchlib=''
542oldarchlib=''
543oldarchlibexp=''
85e6fe83
LW
544orderlib=''
545ranlib=''
2304df62
AD
546package=''
547spackage=''
2c7991dc 548pager=''
ecfc5424 549patchlevel=''
760ac839 550subversion=''
8e07c86e 551perladmin=''
4633a7c4 552perlpath=''
a0d0e21e 553prefix=''
1aef975c 554prefixexp=''
2304df62
AD
555installprivlib=''
556privlib=''
557privlibexp=''
558prototype=''
559randbits=''
560installscript=''
561scriptdir=''
562scriptdirexp=''
a0d0e21e 563selecttype=''
2304df62 564sig_name=''
8e07c86e 565sig_num=''
4633a7c4
LW
566installsitearch=''
567sitearch=''
568sitearchexp=''
25f94b33
AD
569installsitelib=''
570sitelib=''
571sitelibexp=''
a0d0e21e
LW
572sizetype=''
573so=''
2304df62
AD
574sharpbang=''
575shsharp=''
576spitshell=''
a0d0e21e 577ssizetype=''
4633a7c4 578startperl=''
2304df62
AD
579startsh=''
580stdchar=''
581sysman=''
582uidtype=''
583nm_opt=''
40a7a20a 584nm_so_opt=''
2304df62
AD
585runnm=''
586usenm=''
587incpath=''
588mips=''
589mips_type=''
590usrinc=''
591defvoidused=''
592voidflags=''
2304df62
AD
593CONFIG=''
594
ecfc5424
AD
595define='define'
596undef='undef'
597smallmach='pdp11 i8086 z8000 i80286 iAPX286'
598rmlist=''
599
600: We must find out about Eunice early
601eunicefix=':'
602if test -f /etc/unixtovms; then
603 eunicefix=/etc/unixtovms
604fi
605if test -f /etc/unixtovms.exe; then
606 eunicefix=/etc/unixtovms.exe
607fi
608
609: list of known cpp symbols, sorted alphabetically
610al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
611al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
612al="$al MIPSEB MIPSEL MSDOS MTXINU MULTIMAX MVS"
613al="$al M_COFF M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM"
614al="$al M_SYS3 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX"
615al="$al NeXT OCS88 OSF1 PARISC PC532 PORTAR POSIX"
616al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
617al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
618al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
619al="$al VMS Xenix286"
620al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
621al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
622al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
623al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
624al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
625al="$al _SYSTYPE_SYSV _SYSV3 _U370 _UNICOS"
626al="$al __386BSD__ __BIG_ENDIAN __BIG_ENDIAN__ __BSD_4_4__"
627al="$al __DGUX__ __DPX2__ __H3050R __H3050RX"
628al="$al __LITTLE_ENDIAN __LITTLE_ENDIAN__ __MACH__"
629al="$al __MIPSEB __MIPSEB__ __MIPSEL __MIPSEL__"
630al="$al __Next__ __OSF1__ __PARAGON__ __PGC__ __PWB __STDC__"
631al="$al __SVR4_2__ __UMAXV__"
632al="$al ____386BSD____ __alpha __alpha__ __amiga"
633al="$al __bsd4_2 __bsd4_2__ __bsdi__ __convex__"
634al="$al __host_mips__"
635al="$al __hp9000s200 __hp9000s300 __hp9000s400 __hp9000s500"
636al="$al __hp9000s500 __hp9000s700 __hp9000s800"
637al="$al __hppa __hpux __hp_osf __i286 __i286__ __i386 __i386__"
638al="$al __i486 __i486__ __i860 __i860__ __ibmesa __ksr1__ __linux__"
639al="$al __m68k __m68k__ __m88100__ __m88k __m88k__"
640al="$al __mc68000 __mc68000__ __mc68020 __mc68020__"
641al="$al __mc68030 __mc68030__ __mc68040 __mc68040__"
642al="$al __mc88100 __mc88100__ __mips __mips__"
643al="$al __motorola__ __osf__ __pa_risc __sparc__ __stdc__"
644al="$al __sun __sun__ __svr3__ __svr4__ __ultrix __ultrix__"
645al="$al __unix __unix__ __uxpm__ __uxps__ __vax __vax__"
646al="$al _host_mips _mips _unix"
647al="$al a29k aegis aix aixpc alliant alpha am29000 amiga ansi ardent"
648al="$al apollo ardent att386 att3b"
649al="$al bsd bsd43 bsd4_2 bsd4_3 bsd4_4 bsdi bull"
650al="$al cadmus clipper concurrent convex cray ctix"
651al="$al dmert encore gcos gcx gimpel gould"
652al="$al hbullx20 hcx host_mips hp200 hp300 hp700 hp800"
653al="$al hp9000 hp9000s300 hp9000s400 hp9000s500"
654al="$al hp9000s700 hp9000s800 hp9k8 hppa hpux"
655al="$al i186 i286 i386 i486 i8086"
656al="$al i80960 i860 iAPX286 ibm ibm032 ibmrt interdata is68k"
657al="$al ksr1 linux luna luna88k m68k m88100 m88k"
658al="$al mc300 mc500 mc68000 mc68010 mc68020 mc68030"
659al="$al mc68040 mc68060 mc68k mc68k32 mc700"
660al="$al mc88000 mc88100 merlin mert mips mvs n16"
661al="$al ncl_el ncl_mr"
662al="$al news1500 news1700 news1800 news1900 news3700"
663al="$al news700 news800 news900 ns16000 ns32000"
664al="$al ns32016 ns32332 ns32k nsc32000 os osf"
665al="$al parisc pc532 pdp11 plexus posix pyr"
666al="$al riscix riscos scs sequent sgi sinix sony sony_news"
667al="$al sonyrisc sparc sparclite spectrum stardent stratos"
668al="$al sun sun3 sun386 svr4 sysV68 sysV88"
669al="$al titan tower tower32 tower32_200 tower32_600 tower32_700"
670al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
671al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
672al="$al xenix z8000"
673
ecfc5424
AD
674groupstype=''
675i_whoami=''
8e07c86e
AD
676: default library list
677libswanted=''
678: set useposix=false in your hint file to disable the POSIX extension.
679useposix=true
2c7991dc
PP
680: set usesafe=false in your hint if you want to skip the Safe extension.
681usesafe=true
40a7a20a 682: Define several unixisms. These can be used in hint files.
25f94b33
AD
683exe_ext=''
684: Extra object files, if any, needed on this platform.
685archobjs=''
760ac839 686bin_sh='/bin/sh'
8e07c86e 687: Possible local include directories to search.
25f94b33 688: Set locincpth to "" in a hint file to defeat local include searches.
8e07c86e
AD
689locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
690locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
691:
692: no include file wanted by default
693inclwanted=''
694
ecfc5424
AD
695: change the next line if compiling for Xenix/286 on Xenix/386
696xlibpth='/usr/lib/386 /lib/386'
697
8e07c86e
AD
698: Possible local library directories to search.
699loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
700loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
701
ecfc5424 702: general looking path for locating libraries
8e07c86e
AD
703glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib"
704glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small"
705glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib"
ecfc5424
AD
706
707: Private path used by Configure to find libraries. Its value
708: is prepended to libpth. This variable takes care of special
709: machines, like the mips. Usually, it should be empty.
710plibpth=''
711
760ac839 712mab=''
ecfc5424
AD
713: full support for void wanted by default
714defvoidused=15
715
ecfc5424 716: List of libraries we want.
760ac839 717libswanted='sfio net socket inet nsl nm ndbm gdbm dbm db malloc dl'
ecfc5424
AD
718libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
719libswanted="$libswanted ucb bsd BSD PW x"
1aef975c 720: We probably want to search /usr/shlib before most other libraries.
94b6baf5 721: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
ecfc5424
AD
722glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
723glibpth="/usr/shlib $glibpth"
724: Do not use vfork unless overridden by a hint file.
725usevfork=false
726
760ac839
LW
727: see if sh knows # comments
728echo " "
729echo "Checking your sh to see if it knows about # comments..." >&4
730if `sh -c '#' >/dev/null 2>&1`; then
731 echo "Your sh handles # comments correctly."
732 shsharp=true
733 spitshell=cat
734 echo " "
735 echo "Okay, let's see if #! works on this system..."
736 xcat=/bin/cat
737 test -f $xcat || xcat=/usr/bin/cat
738 echo "#!$xcat" >try
739 $eunicefix try
740 chmod +x try
741 ./try > today
742 if test -s today; then
743 echo "It does."
744 sharpbang='#!'
745 else
746 echo "#! $xcat" > try
747 $eunicefix try
748 chmod +x try
749 ./try > today
750 if test -s today; then
751 echo "It does."
752 sharpbang='#! '
753 else
754 echo "It's just a comment."
755 sharpbang=': use '
756 fi
757 fi
758else
759 echo "Your sh doesn't grok # comments--I will strip them later on."
760 shsharp=false
761 cd ..
762 echo "exec grep -v '^[ ]*#'" >spitshell
763 chmod +x spitshell
764 $eunicefix spitshell
765 spitshell=`pwd`/spitshell
766 cd UU
767 echo "I presume that if # doesn't work, #! won't work either!"
768 sharpbang=': use '
769fi
770rm -f try today
771
772: figure out how to guarantee sh startup
773echo " "
774echo "Checking out how to guarantee sh startup..." >&4
775case "$SYSTYPE" in
776*bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
777*) startsh=$sharpbang'/bin/sh';;
778esac
779echo "Let's see if '$startsh' works..."
780cat >try <<EOSS
781$startsh
782set abc
783test "$?abc" != 1
784EOSS
785
786chmod +x try
787$eunicefix try
788if ./try; then
789 echo "Yup, it does."
790else
791echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
792fi
793rm -f try
794
2304df62 795: script used to extract .SH files with variable substitutions
760ac839
LW
796cat >extract <<EOS
797$startsh
798EOS
799cat >>extract <<'EOS'
2304df62
AD
800CONFIG=true
801echo "Doing variable substitutions on .SH files..."
802if test -f MANIFEST; then
a0d0e21e
LW
803 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
804 : Pick up possible extension manifests.
805 for dir in ext/* ; do
806 if test -f $dir/MANIFEST; then
807 xxx=`awk '{print $1}' < $dir/MANIFEST |
808 sed -n "/\.SH$/ s@^@$dir/@p"`
809 shlist="$shlist $xxx"
810 fi
811 done
812 set x $shlist
2304df62
AD
813else
814 echo "(Looking for .SH files under the current directory.)"
815 set x `find . -name "*.SH" -print`
816fi
817shift
818case $# in
8190) set x *.SH; shift;;
820esac
821if test ! -f $1; then
822 shift
823fi
824for file in $*; do
825 case "$file" in
826 */*)
827 dir=`expr X$file : 'X\(.*\)/'`
828 file=`expr X$file : 'X.*/\(.*\)'`
829 (cd $dir && . ./$file)
830 ;;
831 *)
832 . ./$file
833 ;;
834 esac
835done
836if test -f config_h.SH; then
837 if test ! -f config.h; then
838 : oops, they left it out of MANIFEST, probably, so do it anyway.
839 . ./config_h.SH
840 fi
841fi
842EOS
843
844: produce awk script to parse command line options
845cat >options.awk <<'EOF'
846BEGIN {
16d20bd9 847 optstr = "dD:eEf:hKOrsSU:V"; # getopt-style specification
2304df62
AD
848
849 len = length(optstr);
850 for (i = 1; i <= len; i++) {
851 c = substr(optstr, i, 1);
852 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
853 if (a == ":") {
854 arg[c] = 1;
855 i++;
856 }
857 opt[c] = 1;
858 }
859}
860{
861 expect = 0;
862 str = $0;
863 if (substr(str, 1, 1) != "-") {
864 printf("'%s'\n", str);
865 next;
866 }
867 len = length($0);
868 for (i = 2; i <= len; i++) {
869 c = substr(str, i, 1);
870 if (!opt[c]) {
871 printf("-%s\n", substr(str, i));
872 next;
873 }
874 printf("-%s\n", c);
875 if (arg[c]) {
876 if (i < len)
877 printf("'%s'\n", substr(str, i + 1));
878 else
879 expect = 1;
880 next;
881 }
882 }
883}
884END {
885 if (expect)
886 print "?";
887}
888EOF
889
890: process the command line options
4633a7c4
LW
891set X `for arg in "$@"; do echo "X$arg"; done |
892 sed -e s/X// | awk -f options.awk`
2304df62
AD
893eval "set $*"
894shift
895rm -f options.awk
896
897: set up default values
898fastread=''
899reuseval=false
900config_sh=''
901alldone=''
902error=''
903silent=''
904extractsh=''
ecfc5424 905override=''
16d20bd9 906knowitall=''
1aef975c 907rm -f optdef.sh
2304df62
AD
908
909: option parsing
910while test $# -gt 0; do
911 case "$1" in
912 -d) shift; fastread=yes;;
913 -e) shift; alldone=cont;;
914 -f)
915 shift
916 cd ..
917 if test -r "$1"; then
918 config_sh="$1"
919 else
a0d0e21e 920 echo "$me: cannot read config file $1." >&2
2304df62
AD
921 error=true
922 fi
923 cd UU
924 shift;;
925 -h) shift; error=true;;
926 -r) shift; reuseval=true;;
927 -s) shift; silent=true;;
928 -E) shift; alldone=exit;;
16d20bd9 929 -K) shift; knowitall=true;;
ecfc5424 930 -O) shift; override=true;;
2304df62 931 -S) shift; extractsh=true;;
a0d0e21e
LW
932 -D)
933 shift
934 case "$1" in
935 *=)
936 echo "$me: use '-U symbol=', not '-D symbol='." >&2
937 echo "$me: ignoring -D $1" >&2
938 ;;
ecfc5424 939 *=*) echo "$1" | \
1aef975c
AD
940 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
941 *) echo "$1='define'" >> optdef.sh;;
a0d0e21e
LW
942 esac
943 shift
944 ;;
945 -U)
946 shift
947 case "$1" in
1aef975c 948 *=) echo "$1" >> optdef.sh;;
a0d0e21e
LW
949 *=*)
950 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
951 echo "$me: ignoring -U $1" >&2
952 ;;
1aef975c 953 *) echo "$1='undef'" >> optdef.sh;;
a0d0e21e
LW
954 esac
955 shift
956 ;;
2c7991dc 957 -V) echo "$me generated by metaconfig 3.0 PL60." >&2
2304df62
AD
958 exit 0;;
959 --) break;;
a0d0e21e 960 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
2304df62
AD
961 *) break;;
962 esac
963done
964
965case "$error" in
966true)
967 cat >&2 <<EOM
16d20bd9 968Usage: $me [-dehrEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
a0d0e21e 969 [-U symbol] [-U symbol=]
2304df62
AD
970 -d : use defaults for all answers.
971 -e : go on without questioning past the production of config.sh.
972 -f : specify an alternate default configuration file.
973 -h : print this help message and exit (with an error status).
974 -r : reuse C symbols value if possible (skips costly nm extraction).
975 -s : silent mode, only echoes questions and essential information.
a0d0e21e
LW
976 -D : define symbol to have some value:
977 -D symbol symbol gets the value 'define'
978 -D symbol=value symbol gets the value 'value'
2304df62 979 -E : stop at the end of questions, after having produced config.sh.
16d20bd9 980 -K : do not use unless you know what you are doing.
ecfc5424 981 -O : let -D and -U override definitions from loaded configuration file.
2304df62 982 -S : perform variable substitutions on all .SH files (can mix with -f)
a0d0e21e
LW
983 -U : undefine symbol:
984 -U symbol symbol gets the value 'undef'
985 -U symbol= symbol gets completely empty
2304df62
AD
986 -V : print version number and exit (with a zero status).
987EOM
988 exit 1
989 ;;
990esac
991
992exec 4>&1
993case "$silent" in
994true) exec 1>/dev/null;;
995esac
996
ecfc5424 997: run the defines and the undefines, if any, but leave the file out there...
1aef975c
AD
998touch optdef.sh
999. ./optdef.sh
a0d0e21e 1000
2304df62
AD
1001case "$extractsh" in
1002true)
1003 case "$config_sh" in
1004 '') config_sh='config.sh'; config='./config.sh';;
1005 /*) config="$config_sh";;
1006 *) config="./$config_sh";;
1007 esac
1008 echo " "
1009 echo "Fetching answers from $config_sh..."
1010 cd ..
1011 . $config
1aef975c 1012 test "$override" && . ./optdef.sh
2304df62
AD
1013 echo " "
1014 . ./UU/extract
1015 rm -rf UU
1016 echo "Done."
1017 exit 0
1018 ;;
1019esac
1020
1021: set package name
85e6fe83 1022package=perl5
1aef975c
AD
1023first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1024last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1025case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1026ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1027*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1028esac
2304df62
AD
1029
1030: Eunice requires " " instead of "", can you believe it
1031echo " "
1032: Here we go...
1033echo "Beginning of configuration questions for $package."
1034
1aef975c 1035trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
2304df62 1036
2304df62
AD
1037: Some greps do not return status, grrr.
1038echo "grimblepritz" >grimble
1039if grep blurfldyick grimble >/dev/null 2>&1 ; then
1040 contains=contains
1041elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1042 contains=grep
1043else
1044 contains=contains
1045fi
1046rm -f grimble
1047: the following should work in any shell
1048case "$contains" in
1049contains*)
1050 echo " "
1051 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1052 cat >contains <<'EOSS'
1053grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1054EOSS
1055chmod +x contains
1056esac
1057
1058: first determine how to suppress newline on echo command
1059echo " "
1060echo "Checking echo to see how to suppress newlines..."
1061(echo "hi there\c" ; echo " ") >.echotmp
1062if $contains c .echotmp >/dev/null 2>&1 ; then
1063 echo "...using -n."
1064 n='-n'
1065 c=''
1066else
1067 cat <<'EOM'
1068...using \c
1069EOM
1070 n=''
1071 c='\c'
1072fi
1073echo $n "The star should be here-->$c"
1074echo '*'
1075rm -f .echotmp
1076
1077: Now test for existence of everything in MANIFEST
1078echo " "
1079if test -f ../MANIFEST; then
1080 echo "First let's make sure your kit is complete. Checking..." >&4
1081 awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
1082 rm -f missing
1083 for filelist in x??; do
1084 (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
1085 done
1086 if test -s missing; then
1087 cat missing >&4
1088 cat >&4 <<'EOM'
1089
1090THIS PACKAGE SEEMS TO BE INCOMPLETE.
1091
1092You have the option of continuing the configuration process, despite the
1093distinct possibility that your kit is damaged, by typing 'y'es. If you
1094do, don't blame me if something goes wrong. I advise you to type 'n'o
760ac839 1095and contact the author (lwall@sems.com).
2304df62
AD
1096
1097EOM
1098 echo $n "Continue? [n] $c" >&4
1099 read ans
1100 case "$ans" in
1101 y*)
1102 echo "Continuing..." >&4
1103 rm -f missing
1104 ;;
1105 *)
1106 echo "ABORTING..." >&4
1107 kill $$
1108 ;;
1109 esac
1110 else
1111 echo "Looks good..." >&4
1112 fi
1113else
1114 echo "There is no MANIFEST file. I hope your kit is complete !"
1115fi
1116rm -f missing x??
1117
1118: compute the number of columns on the terminal for proper question formatting
1119case "$COLUMNS" in
1120'') COLUMNS='80';;
1121esac
1122
1123: set up the echo used in my read
1124myecho="case \"\$xxxm\" in
1125'') echo $n \"\$rp $c\" >&4;;
1126*) case \"\$rp\" in
1127 '') echo $n \"[\$xxxm] $c\";;
1128 *)
1129 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1130 echo \"\$rp\" >&4
1131 echo $n \"[\$xxxm] $c\" >&4
1132 else
1133 echo $n \"\$rp [\$xxxm] $c\" >&4
1134 fi
1135 ;;
1136 esac;;
1137esac"
1138
1139: now set up to do reads with possible shell escape and default assignment
1140cat <<EOSC >myread
1141xxxm=\$dflt
1142$myecho
1143ans='!'
1144case "\$fastread" in
1145yes) case "\$dflt" in
1146 '') ;;
1147 *) ans='';
1148 case "\$silent-\$rp" in
1149 true-) ;;
1150 *) echo " " >&4;;
1151 esac;;
1152 esac;;
1153*) case "\$silent" in
1154 true) case "\$rp" in
1155 '') ans='';;
1156 esac;;
1157 esac;;
1158esac
1159while expr "X\$ans" : "X!" >/dev/null; do
1160 read answ
1161 set x \$xxxm
1162 shift
1163 aok=''; eval "ans=\"\$answ\"" && aok=y
1164 case "\$answ" in
1165 "\$ans")
1166 case "\$ans" in
ecfc5424
AD
1167 \\&*)
1168 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1169 shift
1170 case "\$1" in
1171 -d)
1172 fastread=yes
40a7a20a 1173 echo "(OK, I'll run with -d after this question.)" >&4
ecfc5424
AD
1174 ;;
1175 -*)
40a7a20a 1176 echo "*** Sorry, \$1 not supported yet." >&4
ecfc5424
AD
1177 ;;
1178 esac
1179 $myecho
1180 ans=!
1181 ;;
2304df62
AD
1182 "!")
1183 sh 1>&4
1184 echo " "
1185 $myecho
1186 ;;
1187 !*)
1188 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1189 shift
1190 sh 1>&4 -c "\$*"
1191 echo " "
1192 $myecho
1193 ;;
1194 esac;;
1195 *)
1196 case "\$aok" in
1197 y)
1198 echo "*** Substitution done -- please confirm."
1199 xxxm="\$ans"
1200 ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
1201 xxxm="\$ans"
1202 ans=!
1203 ;;
1204 *)
1205 echo "*** Error -- try again."
1206 ans=!
1207 ;;
1208 esac
1209 $myecho
1210 ;;
1211 esac
1212 case "\$ans\$xxxm\$nostick" in
1213 '')
1214 ans=!
1215 $myecho
1216 ;;
1217 esac
1218done
1219case "\$ans" in
1220'') ans="\$xxxm";;
1221esac
1222EOSC
1223
1224: create .config dir to save info across Configure sessions
1225test -d ../.config || mkdir ../.config
1226cat >../.config/README <<EOF
1227This directory created by Configure to save information that should
1228persist across sessions.
1229
1230You may safely delete it if you wish.
1231EOF
1232
1233: general instructions
1234needman=true
1235firsttime=true
760ac839
LW
1236user=`(logname) 2>/dev/null`
1237case "$user" in "")
1238 user=`whoami 2>&1` ;;
1239esac
2304df62
AD
1240if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1241 firsttime=false
1242 echo " "
1243 rp='Would you like to see the instructions?'
1244 dflt=n
1245 . ./myread
1246 case "$ans" in
1247 [yY]*) ;;
1248 *) needman=false;;
1249 esac
1250fi
1251if $needman; then
1252 cat <<EOH
1253
1254This installation shell script will examine your system and ask you questions
a0d0e21e 1255to determine how the perl5 package should be installed. If you get
2304df62
AD
1256stuck on a question, you may use a ! shell escape to start a subshell or
1257execute a command. Many of the questions will have default answers in square
1258brackets; typing carriage return will give you the default.
1259
1260On some of the questions which ask for file or directory names you are allowed
1261to use the ~name construct to specify the login directory belonging to "name",
1262even if you don't have a shell which knows about that. Questions where this is
1263allowed will be marked "(~name ok)".
1264
1265EOH
1266 rp=''
1267 dflt='Type carriage return to continue'
1268 . ./myread
1269 cat <<'EOH'
1270
1271The prompter used in this script allows you to use shell variables and
1272backticks in your answers. You may use $1, $2, etc... to refer to the words
1273in the default answer, as if the default line was a set of arguments given to a
1274script shell. This means you may also use $* to repeat the whole default line,
1275so you do not have to re-type everything to add something to the default.
1276
1277Everytime there is a substitution, you will have to confirm. If there is an
1278error (e.g. an unmatched backtick), the default answer will remain unchanged
1279and you will be prompted again.
1280
1281If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1282the questions and use the computed defaults (or the previous answers if there
1283was already a config.sh file). Type 'Configure -h' for a list of options.
ecfc5424
AD
1284You may also start interactively and then answer '& -d' at any prompt to turn
1285on the non-interactive behaviour for the remaining of the execution.
2304df62
AD
1286
1287EOH
1288 . ./myread
1289 cat <<EOH
1290
1291Much effort has been expended to ensure that this shell script will run on any
1292Unix system. If despite that it blows up on yours, your best bet is to edit
40000a8c
AD
1293Configure and run it again. If you can't run Configure for some reason,
1294you'll have to generate a config.sh file by hand. Whatever problems you
760ac839 1295have, let me (lwall@sems.com) know how I blew it.
2304df62
AD
1296
1297This installation script affects things in two ways:
1298
12991) it may do direct variable substitutions on some of the files included
1300 in this kit.
13012) it builds a config.h file for inclusion in C programs. You may edit
1302 any of these files as the need arises after running this script.
1303
1304If you make a mistake on a question, there is no easy way to back up to it
1305currently. The easiest thing to do is to edit config.sh and rerun all the SH
1306files. Configure will offer to let you do this before it runs the SH files.
1307
1308EOH
1309 dflt='Type carriage return to continue'
1310 . ./myread
1311 case "$firsttime" in
1312 true) echo $user >>../.config/instruct;;
1313 esac
1314fi
1315
2304df62
AD
1316: find out where common programs are
1317echo " "
1318echo "Locating common programs..." >&4
1319cat <<EOSC >loc
1320$startsh
1321case \$# in
13220) exit 1;;
1323esac
1324thing=\$1
1325shift
1326dflt=\$1
1327shift
1328for dir in \$*; do
1329 case "\$thing" in
1330 .)
1331 if test -d \$dir/\$thing; then
1332 echo \$dir
1333 exit 0
1334 fi
1335 ;;
1336 *)
a0d0e21e 1337 for thisthing in \$dir/\$thing; do
ecfc5424 1338 : just loop through to pick last item
a0d0e21e 1339 done
25f94b33 1340 if test -f \$thisthing; then
a0d0e21e 1341 echo \$thisthing
2304df62
AD
1342 exit 0
1343 elif test -f \$dir/\$thing.exe; then
1344 : on Eunice apparently
1345 echo \$dir/\$thing
1346 exit 0
1347 fi
1348 ;;
1349 esac
1350done
1351echo \$dflt
1352exit 1
1353EOSC
1354chmod +x loc
1355$eunicefix loc
1356loclist="
1357awk
1358cat
ecfc5424 1359comm
2304df62
AD
1360cp
1361echo
1362expr
a0d0e21e 1363find
2304df62 1364grep
85e6fe83 1365ln
a0d0e21e 1366ls
2304df62 1367mkdir
2304df62
AD
1368rm
1369sed
1370sort
85e6fe83 1371touch
2304df62
AD
1372tr
1373uniq
1374"
1375trylist="
1376Mcc
2304df62
AD
1377byacc
1378cpp
1379csh
1380date
1381egrep
2c7991dc 1382less
2304df62 1383line
2c7991dc 1384more
2304df62
AD
1385nroff
1386perl
2c7991dc 1387pg
40a7a20a 1388sendmail
2304df62
AD
1389test
1390uname
1391"
8e07c86e 1392pth=`echo $PATH | sed -e "s/$p_/ /g"`
2304df62
AD
1393pth="$pth /lib /usr/lib"
1394for file in $loclist; do
1395 xxx=`./loc $file $file $pth`
1396 eval $file=$xxx
1397 eval _$file=$xxx
1398 case "$xxx" in
1399 /*)
1400 echo $file is in $xxx.
1401 ;;
8e07c86e
AD
1402 ?:[\\/]*)
1403 echo $file is in $xxx.
1404 ;;
2304df62 1405 *)
25f94b33
AD
1406 echo "I don't know where '$file' is, and my life depends on it." >&4
1407 echo "Go find a public domain implementation or fix your PATH setting!" >&4
4633a7c4 1408 exit 1
2304df62
AD
1409 ;;
1410 esac
1411done
1412echo " "
1413echo "Don't worry if any of the following aren't found..."
1414say=offhand
1415for file in $trylist; do
1416 xxx=`./loc $file $file $pth`
1417 eval $file=$xxx
1418 eval _$file=$xxx
1419 case "$xxx" in
1420 /*)
1421 echo $file is in $xxx.
1422 ;;
8e07c86e
AD
1423 ?:[\\/]*)
1424 echo $file is in $xxx.
1425 ;;
2304df62
AD
1426 *)
1427 echo "I don't see $file out there, $say."
1428 say=either
1429 ;;
1430 esac
1431done
1432case "$egrep" in
1433egrep)
1434 echo "Substituting grep for egrep."
1435 egrep=$grep
1436 ;;
1437esac
1438case "$test" in
1439test)
1440 echo "Hopefully test is built into your sh."
1441 ;;
1442*)
ecfc5424 1443 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2304df62
AD
1444 echo "Using the test built into your sh."
1445 test=test
1446 _test=test
1447 fi
1448 ;;
1449esac
1450case "$echo" in
1451echo)
1452 echo "Hopefully echo is built into your sh."
1453 ;;
1454'') ;;
1455*)
1456 echo " "
1457echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
1458 $echo $n "hi there$c" >foo1
1459 echo $n "hi there$c" >foo2
1460 if cmp foo1 foo2 >/dev/null 2>&1; then
1461 echo "They are compatible. In fact, they may be identical."
1462 else
1463 case "$n" in
1464 '-n') n='' c='\c';;
1465 *) n='-n' c='';;
1466 esac
1467 cat <<FOO
1468They are not compatible! You are probably running ksh on a non-USG system.
1469I'll have to use $echo instead of the builtin, since Bourne shell doesn't
1470have echo built in and we may have to run some Bourne shell scripts. That
1471means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
1472
1473FOO
1474 $echo $n "The star should be here-->$c"
1475 $echo "*"
1476 fi
1477 $rm -f foo1 foo2
1478 ;;
1479esac
1480
a0d0e21e
LW
1481: determine whether symbolic links are supported
1482echo " "
1483$touch blurfl
1484if $ln -s blurfl sym > /dev/null 2>&1 ; then
1485 echo "Symbolic links are supported." >&4
1486 lns="$ln -s"
1487else
1488 echo "Symbolic links are NOT supported." >&4
1489 lns="$ln"
1490fi
1491$rm -f blurfl sym
1492
ecfc5424
AD
1493: see whether [:lower:] and [:upper:] are supported character classes
1494echo " "
1495up='[A-Z]'
1496low='[a-z]'
1497case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1498ABYZ)
1499 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
1500 up='[:upper:]'
1501 low='[:lower:]'
1502 ;;
1503*)
1504 echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
1505 ;;
1506esac
1507: set up the translation script tr, must be called with ./tr of course
1508cat >tr <<EOSC
1509$startsh
1510case "\$1\$2" in
1511'[A-Z][a-z]') exec $tr '$up' '$low';;
1512'[a-z][A-Z]') exec $tr '$low' '$up';;
1513esac
1514exec $tr "\$@"
1515EOSC
1516chmod +x tr
1517$eunicefix tr
1518
2304df62
AD
1519: Try to determine whether config.sh was made on this system
1520case "$config_sh" in
1521'')
1522myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
a0d0e21e 1523myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
ecfc5424 1524 ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
1aef975c 1525newmyuname="$myuname"
2304df62 1526dflt=n
16d20bd9
AD
1527case "$knowitall" in
1528'')
1529 if test -f ../config.sh; then
1530 if $contains myuname= ../config.sh >/dev/null 2>&1; then
1531 eval "`grep myuname= ../config.sh`"
1532 fi
1533 if test "X$myuname" = "X$newmyuname"; then
1534 dflt=y
1535 fi
2304df62 1536 fi
16d20bd9
AD
1537 ;;
1538*) dflt=y;;
1539esac
2304df62
AD
1540
1541: Get old answers from old config file if Configure was run on the
1542: same system, otherwise use the hints.
1543hint=default
1544cd ..
1545if test -f config.sh; then
16d20bd9
AD
1546 echo " "
1547 rp="I see a config.sh file. Shall I use it to set the defaults?"
2304df62
AD
1548 . UU/myread
1549 case "$ans" in
1550 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
1551 *) echo "Fetching default answers from your old config.sh file..." >&4
ecfc5424
AD
1552 tmp_n="$n"
1553 tmp_c="$c"
2304df62
AD
1554 . ./config.sh
1555 cp config.sh UU
ecfc5424
AD
1556 n="$tmp_n"
1557 c="$tmp_c"
2304df62
AD
1558 hint=previous
1559 ;;
1560 esac
1561fi
1562if test ! -f config.sh; then
1563 $cat <<EOM
1564
1565First time through, eh? I have some defaults handy for the following systems:
1566
1567EOM
1568 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1569 dflt=''
1570 : Half the following guesses are probably wrong... If you have better
760ac839 1571 : tests or hints, please send them to lwall@sems.com
2304df62 1572 : The metaconfig authors would also appreciate a copy...
a0d0e21e 1573 $test -f /irix && osname=irix
85e6fe83
LW
1574 $test -f /xenix && osname=sco_xenix
1575 $test -f /dynix && osname=dynix
1576 $test -f /dnix && osname=dnix
a0d0e21e 1577 $test -f /unicos && osname=unicos && osvers=`$uname -r`
85e6fe83 1578 $test -f /bin/mips && /bin/mips && osname=mips
ecfc5424
AD
1579 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1580 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
a0d0e21e
LW
1581 $test -d /usr/apollo/bin && osname=apollo
1582 $test -f /etc/saf/_sactab && osname=svr4
85e6fe83 1583 $test -d /usr/include/minix && osname=minix
4633a7c4
LW
1584 if $test -d /MachTen; then
1585 osname=machten
1586 if $test -x /sbin/version; then
1587 osvers=`/sbin/version | $awk '{print $2}' |
1588 $sed -e 's/[A-Za-z]$//'`
1589 elif $test -x /usr/etc/version; then
1590 osvers=`/usr/etc/version | $awk '{print $2}' |
1591 $sed -e 's/[A-Za-z]$//'`
1592 else
1593 osvers="$2.$3"
1594 fi
1595 fi
2304df62
AD
1596 if $test -f $uname; then
1597 set X $myuname
1598 shift
1599
2304df62 1600 case "$5" in
85e6fe83 1601 fps*) osname=fps ;;
2304df62
AD
1602 mips*)
1603 case "$4" in
85e6fe83
LW
1604 umips) osname=umips ;;
1605 *) osname=mips ;;
2304df62 1606 esac;;
85e6fe83
LW
1607 [23]100) osname=mips ;;
1608 next*) osname=next ;;
1609 news*) osname=news ;;
ecfc5424
AD
1610 i386*)
1611 if $test -f /etc/kconfig; then
1612 osname=isc
a0d0e21e
LW
1613 if test "$lns" = "ln -s"; then
1614 osvers=4
1615 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1616 osvers=3
2304df62 1617 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
a0d0e21e 1618 osvers=2
ecfc5424
AD
1619 fi
1620 fi
1621 ;;
2304df62
AD
1622 esac
1623
1624 case "$1" in
a0d0e21e
LW
1625 aix) osname=aix
1626 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1627 case "$tmp" in
1aef975c 1628 'not found') osvers="$4"."$3" ;;
a0d0e21e
LW
1629 '<3240'|'<>3240') osvers=3.2.0 ;;
1630 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1631 '=3250'|'>3250') osvers=3.2.5 ;;
1aef975c 1632 *) osvers=$tmp;;
a0d0e21e
LW
1633 esac
1634 ;;
1635 dnix) osname=dnix
1636 osvers="$3"
1637 ;;
1638 domainos) osname=apollo
1639 osvers="$3"
1640 ;;
1641 dgux) osname=dgux
1642 osvers="$3"
1643 ;;
760ac839
LW
1644 dynixptx*) osname=dynixptx
1645 osvers="$3"
1646 ;;
a0d0e21e
LW
1647 freebsd) osname=freebsd
1648 osvers="$3" ;;
1649 genix) osname=genix ;;
1650 hp*) osname=hpux
1651 case "$3" in
1652 *.08.*) osvers=9 ;;
1653 *.09.*) osvers=9 ;;
1654 *.10.*) osvers=10 ;;
ecfc5424 1655 *) osvers="$3" ;;
a0d0e21e
LW
1656 esac
1657 ;;
a78b0d02 1658 irix*) osname=irix
a0d0e21e
LW
1659 case "$3" in
1660 4*) osvers=4 ;;
1661 5*) osvers=5 ;;
ecfc5424 1662 *) osvers="$3" ;;
a0d0e21e
LW
1663 esac
1664 ;;
1665 linux) osname=linux
1666 case "$3" in
1667 1*) osvers=1 ;;
1668 *) osvers="$3" ;;
1669 esac
1670 ;;
1671 netbsd*) osname=netbsd
ecfc5424
AD
1672 osvers="$3"
1673 ;;
a0d0e21e
LW
1674 bsd386) osname=bsd386
1675 osvers=`$uname -r`
1676 ;;
1677 next*) osname=next ;;
1678 solaris) osname=solaris
1679 case "$3" in
1680 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
ecfc5424 1681 *) osvers="$3" ;;
a0d0e21e
LW
1682 esac
1683 ;;
85e6fe83
LW
1684 sunos) osname=sunos
1685 case "$3" in
85e6fe83
LW
1686 5*) osname=solaris
1687 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
a0d0e21e 1688 *) osvers="$3" ;;
2304df62
AD
1689 esac
1690 ;;
a0d0e21e 1691 titanos) osname=titanos
85e6fe83 1692 case "$3" in
a0d0e21e
LW
1693 1*) osvers=1 ;;
1694 2*) osvers=2 ;;
1695 3*) osvers=3 ;;
1696 4*) osvers=4 ;;
ecfc5424 1697 *) osvers="$3" ;;
2304df62
AD
1698 esac
1699 ;;
85e6fe83 1700 ultrix) osname=ultrix
ecfc5424 1701 osvers="$3"
2304df62 1702 ;;
85e6fe83 1703 osf1) case "$5" in
fed7345c
AD
1704 alpha)
1705 osname=dec_osf
1706 osvers=`echo "$3" | sed 's/^[vt]//'`
ecfc5424
AD
1707 ;;
1708 hp*) osname=hp_osf1 ;;
1709 mips) osname=mips_osf1 ;;
85e6fe83
LW
1710 esac
1711 ;;
a0d0e21e
LW
1712 uts) osname=uts
1713 osvers="$3"
1714 ;;
85e6fe83 1715 $2) case "$osname" in
2304df62 1716 *isc*) ;;
a0d0e21e
LW
1717 *freebsd*) ;;
1718 svr*)
1719 : svr4.x or possibly later
1720 case "svr$3" in
1721 ${osname}*)
1722 osname=svr$3
1723 osvers=$4
1724 ;;
1725 esac
1726 case "$osname" in
1727 svr4.0)
1728 : Check for ESIX
1729 if test -f /stand/boot ; then
1730 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
ecfc5424
AD
1731 if test -n "$INITPROG" -a -f "$INITPROG"; then
1732 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1733 if test -n "$isesix"; then
a0d0e21e
LW
1734 osname=esix4
1735 fi
1736 fi
1737 fi
1738 ;;
1739 esac
1740 ;;
2304df62 1741 *) if test -f /etc/systemid; then
a0d0e21e
LW
1742 osname=sco
1743 set `echo $3 | $sed 's/\./ /g'` $4
2304df62 1744 if $test -f sco_$1_$2_$3.sh; then
85e6fe83 1745 osvers=$1.$2.$3
2304df62 1746 elif $test -f sco_$1_$2.sh; then
85e6fe83 1747 osvers=$1.$2
2304df62 1748 elif $test -f sco_$1.sh; then
85e6fe83 1749 osvers=$1
2304df62 1750 fi
a0d0e21e
LW
1751 else
1752 case "$osname" in
1753 '') : Still unknown. Probably a generic Sys V.
1754 osname="sysv"
1755 osvers="$3"
1756 ;;
1757 esac
2304df62
AD
1758 fi
1759 ;;
1760 esac
1761 ;;
a0d0e21e
LW
1762 *) case "$osname" in
1763 '') : Still unknown. Probably a generic BSD.
1764 osname="$1"
1765 osvers="$3"
1766 ;;
1767 esac
1768 ;;
2304df62
AD
1769 esac
1770 else
1771 if test -f /vmunix -a -f news_os.sh; then
ecfc5424 1772 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
2304df62 1773 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
85e6fe83 1774 osname=news_os
2304df62
AD
1775 fi
1776 $rm -f ../UU/kernel.what
8e07c86e
AD
1777 elif test -d c:/.; then
1778 set X $myuname
1779 osname=os2
1780 osvers="$5"
2304df62
AD
1781 fi
1782 fi
85e6fe83 1783
a0d0e21e
LW
1784 : Now look for a hint file osname_osvers, unless one has been
1785 : specified already.
1786 case "$hintfile" in
1787 ''|' ')
ecfc5424 1788 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
a0d0e21e 1789 : Also try without trailing minor version numbers.
ecfc5424
AD
1790 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1791 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1792 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1793 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
a0d0e21e
LW
1794 case "$file" in
1795 '') dflt=none ;;
1796 *) case "$osvers" in
1797 '') dflt=$file
1798 ;;
1799 *) if $test -f $file.sh ; then
1800 dflt=$file
1801 elif $test -f $xfile.sh ; then
1802 dflt=$xfile
1803 elif $test -f $xxfile.sh ; then
1804 dflt=$xxfile
1805 elif $test -f $xxxfile.sh ; then
1806 dflt=$xxxfile
1807 elif $test -f $xxxxfile.sh ; then
1808 dflt=$xxxxfile
1809 elif $test -f "${osname}.sh" ; then
1810 dflt="${osname}"
1811 else
1812 dflt=none
1813 fi
1814 ;;
1815 esac
85e6fe83
LW
1816 ;;
1817 esac
1818 ;;
a0d0e21e 1819 *)
ecfc5424 1820 dflt=`echo $hintfile | $sed 's/\.sh$//'`
a0d0e21e 1821 ;;
2304df62 1822 esac
1aef975c 1823
2304df62
AD
1824 $cat <<EOM
1825
1826You may give one or more space-separated answers, or "none" if appropriate.
1827If your OS version has no hints, DO NOT give a wrong version -- say "none".
1828
1829EOM
1830 rp="Which of these apply, if any?"
1831 . ../UU/myread
85e6fe83
LW
1832 tans=$ans
1833 for file in $tans; do
2304df62
AD
1834 if $test -f $file.sh; then
1835 . ./$file.sh
1836 $cat $file.sh >> ../UU/config.sh
85e6fe83 1837 elif $test X$tans = X -o X$tans = Xnone ; then
2304df62
AD
1838 : nothing
1839 else
85e6fe83
LW
1840 : Give one chance to correct a possible typo.
1841 echo "$file.sh does not exist"
1842 dflt=$file
1843 rp="hint to use instead?"
1844 . ../UU/myread
1845 for file in $ans; do
1846 if $test -f "$file.sh"; then
1847 . ./$file.sh
1848 $cat $file.sh >> ../UU/config.sh
1849 elif $test X$ans = X -o X$ans = Xnone ; then
1850 : nothing
1851 else
1852 echo "$file.sh does not exist -- ignored."
1853 fi
1854 done
2304df62
AD
1855 fi
1856 done
85e6fe83 1857
2304df62 1858 hint=recommended
85e6fe83
LW
1859 : Remember our hint file for later.
1860 if $test -f "$file.sh" ; then
a0d0e21e 1861 hintfile="$file"
85e6fe83 1862 else
a0d0e21e 1863 hintfile=''
85e6fe83
LW
1864 fi
1865
2304df62
AD
1866 cd ..
1867fi
1868cd UU
1869;;
1870*)
1871 echo " "
1872 echo "Fetching default answers from $config_sh..." >&4
ecfc5424
AD
1873 tmp_n="$n"
1874 tmp_c="$c"
2304df62
AD
1875 cd ..
1876 cp $config_sh config.sh 2>/dev/null
a78b0d02 1877 chmod +w config.sh
2304df62
AD
1878 . ./config.sh
1879 cd UU
1880 cp ../config.sh .
ecfc5424
AD
1881 n="$tmp_n"
1882 c="$tmp_c"
2304df62
AD
1883 hint=previous
1884 ;;
1885esac
1aef975c
AD
1886test "$override" && . ./optdef.sh
1887myuname="$newmyuname"
2304df62
AD
1888
1889: Restore computed paths
1890for file in $loclist $trylist; do
1891 eval $file="\$_$file"
1892done
1893
85e6fe83 1894cat << EOM
a0d0e21e 1895
85e6fe83 1896Configure uses the operating system name and version to set some defaults.
ecfc5424
AD
1897The default value is probably right if the name rings a bell. Otherwise,
1898since spelling matters for me, either accept the default or answer "none"
1899to leave it blank.
a0d0e21e 1900
85e6fe83 1901EOM
85e6fe83 1902case "$osname" in
a0d0e21e 1903 ''|' ')
85e6fe83 1904 case "$hintfile" in
a0d0e21e 1905 ''|' '|none) dflt=none ;;
ecfc5424 1906 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
85e6fe83
LW
1907 esac
1908 ;;
1909 *) dflt="$osname" ;;
1910esac
1911rp="Operating system name?"
1912. ./myread
1913case "$ans" in
ecfc5424
AD
1914none) osname='' ;;
1915*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
85e6fe83 1916esac
760ac839
LW
1917
1918
2304df62
AD
1919: who configured the system
1920cf_time=`$date 2>&1`
a0d0e21e
LW
1921(logname > .temp) >/dev/null 2>&1
1922$test -s .temp || (whoami > .temp) >/dev/null 2>&1
1923$test -s .temp || echo unknown > .temp
1924cf_by=`$cat .temp`
1925$rm -f .temp
2304df62 1926
4633a7c4 1927: determine the architecture name
2304df62 1928echo " "
4633a7c4
LW
1929if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
1930 tarch=`arch`"-$osname"
1931elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
1932 if uname -m > tmparch 2>&1 ; then
1933 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
1934 else
1935 tarch="$osname"
1936 fi
1937 $rm -f tmparch
1938else
1939 tarch="$osname"
1940fi
1941case "$myarchname" in
1942''|"$tarch") ;;
1943*)
1944 echo "(Your architecture name used to be $myarchname.)"
1945 archname=''
2304df62
AD
1946 ;;
1947esac
4633a7c4
LW
1948case "$archname" in
1949'') dflt="$tarch";;
1950*) dflt="$archname";;
1951esac
1952rp='What is your architecture name'
1953. ./myread
1954archname="$ans"
1955myarchname="$tarch"
1956
1957: is AFS running?
1958echo " "
1959if test -d /afs; then
1960 echo "AFS may be running... I'll be extra cautious then..." >&4
1961 afs=true
2304df62 1962else
4633a7c4
LW
1963 echo "AFS does not seem to be running..." >&4
1964 afs=false
2304df62
AD
1965fi
1966
4633a7c4
LW
1967: decide how portable to be. Allow command line overrides.
1968case "$d_portable" in
1969"$undef") ;;
1970*) d_portable="$define" ;;
2304df62 1971esac
2304df62 1972
4633a7c4
LW
1973: set up shell script to do ~ expansion
1974cat >filexp <<EOSS
1975$startsh
1976: expand filename
1977case "\$1" in
1978 ~/*|~)
1979 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2304df62 1980 ;;
4633a7c4
LW
1981 ~*)
1982 if $test -f /bin/csh; then
1983 /bin/csh -f -c "glob \$1"
1984 failed=\$?
1985 echo ""
1986 exit \$failed
1987 else
1988 name=\`$expr x\$1 : '..\([^/]*\)'\`
1989 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
1990 if $test ! -d "\$dir"; then
1991 me=\`basename \$0\`
1992 echo "\$me: can't locate home directory for: \$name" >&2
1993 exit 1
1994 fi
1995 case "\$1" in
1996 */*)
1997 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
1998 ;;
1999 *)
2000 echo \$dir
2001 ;;
2304df62 2002 esac
4633a7c4 2003 fi
2304df62
AD
2004 ;;
2005*)
4633a7c4 2006 echo \$1
2304df62
AD
2007 ;;
2008esac
4633a7c4
LW
2009EOSS
2010chmod +x filexp
2011$eunicefix filexp
2304df62
AD
2012
2013: now set up to get a file name
2014cat <<'EOSC' >getfile
2015tilde=''
2016fullpath=''
2017already=''
2018skip=''
2019none_ok=''
2020exp_file=''
a0d0e21e 2021nopath_ok=''
2304df62
AD
2022orig_rp="$rp"
2023orig_dflt="$dflt"
2024
2025case "$fn" in
ecfc5424
AD
2026*\(*)
2027 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2028 fn=`echo $fn | sed 's/(.*)//'`
2029 ;;
2030esac
2031
2032case "$fn" in
a0d0e21e
LW
2033*:*)
2034 loc_file=`expr $fn : '.*:\(.*\)'`
2035 fn=`expr $fn : '\(.*\):.*'`
2036 ;;
2037esac
2038
2039case "$fn" in
2304df62
AD
2040*~*) tilde=true;;
2041esac
2042case "$fn" in
2043*/*) fullpath=true;;
2044esac
2045case "$fn" in
2046*+*) skip=true;;
2047esac
2048case "$fn" in
2049*n*) none_ok=true;;
2050esac
2051case "$fn" in
2052*e*) exp_file=true;;
2053esac
a0d0e21e
LW
2054case "$fn" in
2055*p*) nopath_ok=true;;
2056esac
2304df62
AD
2057
2058case "$fn" in
2059*f*) type='File';;
2060*d*) type='Directory';;
a0d0e21e 2061*l*) type='Locate';;
2304df62
AD
2062esac
2063
2064what="$type"
2065case "$what" in
2066Locate) what='File';;
2067esac
2068
2069case "$exp_file" in
2070'')
2071 case "$d_portable" in
2072 "$define") ;;
2073 *) exp_file=true;;
2074 esac
2075 ;;
2076esac
2077
2078cd ..
2079while test "$type"; do
2080 redo=''
2081 rp="$orig_rp"
2082 dflt="$orig_dflt"
2083 case "$tilde" in
2084 true) rp="$rp (~name ok)";;
2085 esac
2086 . UU/myread
ecfc5424
AD
2087 if test -f UU/getfile.ok && \
2088 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2089 then
2090 value="$ans"
2091 ansexp="$ans"
2092 break
2093 fi
2304df62
AD
2094 case "$ans" in
2095 none)
2096 value=''
2097 ansexp=''
2098 case "$none_ok" in
2099 true) type='';;
2100 esac
2101 ;;
2102 *)
2103 case "$tilde" in
2104 '') value="$ans"
2105 ansexp="$ans";;
2106 *)
2107 value=`UU/filexp $ans`
2108 case $? in
2109 0)
2110 if test "$ans" != "$value"; then
ecfc5424 2111 echo "(That expands to $value on this system.)"
2304df62
AD
2112 fi
2113 ;;
2114 *) value="$ans";;
2115 esac
2116 ansexp="$value"
2117 case "$exp_file" in
2118 '') value="$ans";;
2119 esac
2120 ;;
2121 esac
2122 case "$fullpath" in
2123 true)
2124 case "$ansexp" in
2125 /*) value="$ansexp" ;;
2126 *)
2127 redo=true
2128 case "$already" in
2129 true)
2130 echo "I shall only accept a full path name, as in /bin/ls." >&4
2131 echo "Use a ! shell escape if you wish to check pathnames." >&4
2132 ;;
2133 *)
2134 echo "Please give a full path name, starting with slash." >&4
2135 case "$tilde" in
2136 true)
2137 echo "Note that using ~name is ok provided it expands well." >&4
2138 already=true
2139 ;;
2140 esac
2141 esac
2142 ;;
2143 esac
2144 ;;
2145 esac
2146 case "$redo" in
2147 '')
2148 case "$type" in
2149 File)
2150 if test -f "$ansexp"; then
2151 type=''
2152 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2153 then
2154 echo "($value is not a plain file, but that's ok.)"
2155 type=''
2156 fi
2157 ;;
2158 Directory)
2159 if test -d "$ansexp"; then
2160 type=''
2161 fi
2162 ;;
2163 Locate)
40000a8c 2164 if test -d "$ansexp"; then
a0d0e21e
LW
2165 echo "(Looking for $loc_file in directory $value.)"
2166 value="$value/$loc_file"
40000a8c 2167 ansexp="$ansexp/$loc_file"
2304df62 2168 fi
40000a8c 2169 if test -f "$ansexp"; then
2304df62
AD
2170 type=''
2171 fi
a0d0e21e
LW
2172 case "$nopath_ok" in
2173 true) case "$value" in
2174 */*) ;;
2175 *) echo "Assuming $value will be in people's path."
2176 type=''
2177 ;;
2178 esac
2179 ;;
2180 esac
2304df62
AD
2181 ;;
2182 esac
2183
2184 case "$skip" in
2185 true) type='';
2186 esac
2187
2188 case "$type" in
2189 '') ;;
2190 *)
2191 if test "$fastread" = yes; then
2192 dflt=y
2193 else
2194 dflt=n
2195 fi
2196 rp="$what $value doesn't exist. Use that name anyway?"
2197 . UU/myread
2198 dflt=''
2199 case "$ans" in
2200 y*) type='';;
2201 *) echo " ";;
2202 esac
2203 ;;
2204 esac
2205 ;;
2206 esac
2207 ;;
2208 esac
2209done
2210cd UU
2211ans="$value"
2212rp="$orig_rp"
2213dflt="$orig_dflt"
ecfc5424 2214rm -f getfile.ok
2304df62
AD
2215EOSC
2216
4633a7c4
LW
2217: determine root of directory hierarchy where package will be installed.
2218case "$prefix" in
2219'')
2220 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
8e07c86e 2221 ;;
4633a7c4
LW
2222*)
2223 dflt="$prefix"
8e07c86e
AD
2224 ;;
2225esac
4633a7c4 2226$cat <<EOM
2304df62 2227
4633a7c4
LW
2228By default, $package will be installed in $dflt/bin, manual
2229pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2230all installation directories. Typically set to /usr/local, but you
2231may choose /usr if you wish to install $package among your system
2232binaries. If you wish to have binaries under /bin but manual pages
2233under /usr/local/man, that's ok: you will be prompted separately
2234for each of the installation directories, the prefix being only used
2235to set the defaults.
8e07c86e
AD
2236
2237EOM
2238fn=d~
2239rp='Installation prefix to use?'
2240. ./getfile
2241oldprefix=''
2242case "$prefix" in
a0d0e21e 2243'') ;;
8e07c86e
AD
2244*)
2245 case "$ans" in
2246 "$prefix") ;;
2247 *) oldprefix="$prefix";;
2248 esac
2249 ;;
a0d0e21e 2250esac
8e07c86e
AD
2251prefix="$ans"
2252prefixexp="$ansexp"
a0d0e21e 2253
8e07c86e
AD
2254: set the prefixit variable, to compute a suitable default value
2255prefixit='case "$3" in
2256""|none)
2257 case "$oldprefix" in
2258 "") eval "$1=\"\$$2\"";;
2259 *)
2260 case "$3" in
2261 "") eval "$1=";;
2262 none)
2263 eval "tp=\"\$$2\"";
2264 case "$tp" in
2265 ""|" ") eval "$1=\"\$$2\"";;
2266 *) eval "$1=";;
2267 esac;;
2268 esac;;
2269 esac;;
2270*)
2271 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2272 case "$tp" in
2273 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2274 /*-$oldprefix/*|\~*-$oldprefix/*)
2275 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2276 *) eval "$1=\"\$$2\"";;
2277 esac;;
2278esac'
a0d0e21e 2279
4633a7c4
LW
2280: determine where private library files go
2281: Usual default is /usr/local/lib/perl5. Also allow things like
2282: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2283case "$prefix" in
2284*perl*) set dflt privlib lib ;;
2285*) set dflt privlib lib/$package ;;
2286esac
8e07c86e 2287eval $prefixit
4633a7c4
LW
2288$cat <<EOM
2289
2290There are some auxiliary files for $package that need to be put into a
2291private library directory that is accessible by everyone.
2292
2293EOM
2294fn=d~+
2295rp='Pathname where the private library files will reside?'
8e07c86e 2296. ./getfile
4633a7c4
LW
2297if $test "X$privlibexp" != "X$ansexp"; then
2298 installprivlib=''
8e07c86e 2299fi
4633a7c4
LW
2300privlib="$ans"
2301privlibexp="$ansexp"
8e07c86e
AD
2302if $afs; then
2303 $cat <<EOM
2304df62 2304
8e07c86e 2305Since you are running AFS, I need to distinguish the directory in which
4633a7c4 2306private files reside from the directory in which they are installed (and from
8e07c86e 2307which they are presumably copied to the former directory by occult means).
a0d0e21e 2308
8e07c86e 2309EOM
4633a7c4
LW
2310 case "$installprivlib" in
2311 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2312 *) dflt="$installprivlib";;
8e07c86e
AD
2313 esac
2314 fn=de~
4633a7c4 2315 rp='Where will private files be installed?'
8e07c86e 2316 . ./getfile
4633a7c4 2317 installprivlib="$ans"
8e07c86e 2318else
4633a7c4
LW
2319 installprivlib="$privlibexp"
2320fi
2321
2322: set the base revision
2323baserev=5.0
2324
2325: get the patchlevel
2326echo " "
2327echo "Getting the current patchlevel..." >&4
2328if $test -r ../patchlevel.h;then
760ac839
LW
2329 patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h`
2330 subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h`
4633a7c4
LW
2331else
2332 patchlevel=0
f55a7265 2333 subversion=0
8e07c86e 2334fi
760ac839 2335echo "(You have $package $baserev patchlevel $patchlevel subversion $subversion.)"
2304df62 2336
8e07c86e
AD
2337: set the prefixup variable, to restore leading tilda escape
2338prefixup='case "$prefixexp" in
2339"$prefix") ;;
2340*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2341esac'
2342
4633a7c4
LW
2343: determine where public architecture dependent libraries go
2344set archlib archlib
8e07c86e 2345eval $prefixit
4633a7c4 2346case "$archlib" in
8e07c86e 2347'')
4633a7c4 2348 case "$privlib" in
760ac839 2349 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
4633a7c4
LW
2350 set dflt
2351 eval $prefixup
2352 ;;
a78b0d02 2353 *) version=`LC_ALL=C;export LC_ALL;\
760ac839
LW
2354 echo $baserev $patchlevel $subversion | \
2355 $awk '{print $1 + $2/1000.0 + $3/100000.0}'`
4633a7c4
LW
2356 dflt="$privlib/$archname/$version"
2357 ;;
2358 esac
8e07c86e 2359 ;;
4633a7c4 2360*) dflt="$archlib";;
8e07c86e 2361esac
4633a7c4
LW
2362cat <<EOM
2363
2364$spackage contains architecture-dependent library files. If you are
2365sharing libraries in a heterogeneous environment, you might store
2366these files in a separate location. Otherwise, you can just include
2367them with the rest of the public library files.
2368
8e07c86e 2369EOM
4633a7c4
LW
2370fn=d+~
2371rp='Where do you want to put the public architecture-dependent libraries?'
8e07c86e 2372. ./getfile
4633a7c4
LW
2373archlib="$ans"
2374archlibexp="$ansexp"
2375
8e07c86e
AD
2376if $afs; then
2377 $cat <<EOM
2378
2379Since you are running AFS, I need to distinguish the directory in which
4633a7c4 2380private files reside from the directory in which they are installed (and from
8e07c86e
AD
2381which they are presumably copied to the former directory by occult means).
2382
2383EOM
4633a7c4
LW
2384 case "$installarchlib" in
2385 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2386 *) dflt="$installarchlib";;
8e07c86e
AD
2387 esac
2388 fn=de~
4633a7c4 2389 rp='Where will architecture-dependent library files be installed?'
8e07c86e 2390 . ./getfile
4633a7c4 2391 installarchlib="$ans"
8e07c86e 2392else
4633a7c4
LW
2393 installarchlib="$archlibexp"
2394fi
2395if $test X"$archlib" = X"$privlib"; then
2396 d_archlib="$undef"
2397else
2398 d_archlib="$define"
8e07c86e
AD
2399fi
2400
40a7a20a
PP
2401: set up the script used to warn in case of inconsistency
2402cat <<'EOSC' >whoa
2403dflt=y
2404echo " "
2405echo "*** WHOA THERE!!! ***" >&4
2406echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2407rp=" Keep the $hint value?"
2408. ./myread
2409case "$ans" in
2410y) td=$was; tu=$was;;
2411esac
2412EOSC
2413
2414: function used to set $1 to $val
2415setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2416case "$val$was" in
2417$define$undef) . ./whoa; eval "$var=\$td";;
2418$undef$define) . ./whoa; eval "$var=\$tu";;
2419*) eval "$var=$val";;
2420esac'
2421
2422: make some quick guesses about what we are up against
2423echo " "
2424$echo $n "Hmm... $c"
2425echo exit 1 >bsd
2426echo exit 1 >usg
2427echo exit 1 >v7
2428echo exit 1 >osf1
2429echo exit 1 >eunice
2430echo exit 1 >xenix
2431echo exit 1 >venix
2432d_bsd="$undef"
2433$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2434if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2435then
2436 echo "Looks kind of like an OSF/1 system, but we'll see..."
2437 echo exit 0 >osf1
2438elif test `echo abc | tr a-z A-Z` = Abc ; then
2439 xxx=`./loc addbib blurfl $pth`
2440 if $test -f $xxx; then
2441 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2442 echo exit 0 >bsd
2443 echo exit 0 >usg
2444 else
2445 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2446 echo "Looks kind of like an extended USG system, but we'll see..."
2447 else
2448 echo "Looks kind of like a USG system, but we'll see..."
2449 fi
2450 echo exit 0 >usg
2451 fi
2452elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2453 echo "Looks kind of like a BSD system, but we'll see..."
2454 d_bsd="$define"
2455 echo exit 0 >bsd
2456else
2457 echo "Looks kind of like a Version 7 system, but we'll see..."
2458 echo exit 0 >v7
2459fi
2460case "$eunicefix" in
2461*unixtovms*)
2462 $cat <<'EOI'
2463There is, however, a strange, musty smell in the air that reminds me of
2464something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2465EOI
2466 echo exit 0 >eunice
2467 d_eunice="$define"
2468: it so happens the Eunice I know will not run shell scripts in Unix format
2469 ;;
2470*)
2471 echo " "
2472 echo "Congratulations. You aren't running Eunice."
2473 d_eunice="$undef"
2474 ;;
2475esac
2476if test -f /xenix; then
2477 echo "Actually, this looks more like a XENIX system..."
2478 echo exit 0 >xenix
2479 d_xenix="$define"
2480else
2481 echo " "
2482 echo "It's not Xenix..."
2483 d_xenix="$undef"
2484fi
2485chmod +x xenix
2486$eunicefix xenix
2487if test -f /venix; then
2488 echo "Actually, this looks more like a VENIX system..."
2489 echo exit 0 >venix
2490else
2491 echo " "
2492 if ./xenix; then
2493 : null
2494 else
2495 echo "Nor is it Venix..."
2496 fi
2497fi
2498chmod +x bsd usg v7 osf1 eunice xenix venix
2499$eunicefix bsd usg v7 osf1 eunice xenix venix
2500$rm -f foo
2501
2502: see if setuid scripts can be secure
2503$cat <<EOM
2504
2505Some kernels have a bug that prevents setuid #! scripts from being
2506secure. Some sites have disabled setuid #! scripts because of this.
2507
2508First let's decide if your kernel supports secure setuid #! scripts.
2509(If setuid #! scripts would be secure but have been disabled anyway,
2510don't say that they are secure if asked.)
2511
2512EOM
2513
2514val="$undef"
2515if $test -d /dev/fd; then
2516 echo "#!$ls" >reflect
2517 chmod +x,u+s reflect
2518 ./reflect >flect 2>&1
2519 if $contains "/dev/fd" flect >/dev/null; then
2520 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2521 val="$define"
2522 else
2523 $cat <<EOM
2524If you are not sure if they are secure, I can check but I'll need a
2525username and password different from the one you are using right now.
2526If you don't have such a username or don't want me to test, simply
2527enter 'none'.
2528
2529EOM
2530 rp='Other username to test security of setuid scripts with?'
2531 dflt='none'
2532 . ./myread
2533 case "$ans" in
2534 n|none)
2535 case "$d_suidsafe" in
2536 '') echo "I'll assume setuid scripts are *not* secure." >&4
2537 dflt=n;;
2538 "$undef")
2539 echo "Well, the $hint value is *not* secure." >&4
2540 dflt=n;;
2541 *) echo "Well, the $hint value *is* secure." >&4
2542 dflt=y;;
2543 esac
2544 ;;
2545 *)
2546 $rm -f reflect flect
2547 echo "#!$ls" >reflect
2548 chmod +x,u+s reflect
2549 echo >flect
2550 chmod a+w flect
2551 echo '"su" will (probably) prompt you for '"$ans's password."
2552 su $ans -c './reflect >flect'
2553 if $contains "/dev/fd" flect >/dev/null; then
2554 echo "Okay, it looks like setuid scripts are secure." >&4
2555 dflt=y
2556 else
2557 echo "I don't think setuid scripts are secure." >&4
2558 dflt=n
2559 fi
2560 ;;
2561 esac
2562 rp='Does your kernel have *secure* setuid scripts?'
2563 . ./myread
2564 case "$ans" in
2565 [yY]*) val="$define";;
2566 *) val="$undef";;
2567 esac
2568 fi
2569else
2570 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
760ac839 2571 echo "(That's for file descriptors, not floppy disks.)"
40a7a20a
PP
2572 val="$undef"
2573fi
2574set d_suidsafe
2575eval $setvar
2576
2577$rm -f reflect flect
2578
2579: now see if they want to do setuid emulation
2580echo " "
2581val="$undef"
2582case "$d_suidsafe" in
2583"$define")
2584 val="$undef"
2585 echo "No need to emulate SUID scripts since they are secure here." >& 4
2586 ;;
2587*)
2588 $cat <<EOM
2589Some systems have disabled setuid scripts, especially systems where
2590setuid scripts cannot be secure. On systems where setuid scripts have
2591been disabled, the setuid/setgid bits on scripts are currently
2592useless. It is possible for $package to detect those bits and emulate
2593setuid/setgid in a secure fashion. This emulation will only work if
2594setuid scripts have been disabled in your kernel.
2595
2596EOM
2597 case "$d_dosuid" in
2598 "$define") dflt=y ;;
2599 *) dflt=n ;;
2600 esac
2601 rp="Do you want to do setuid/setgid emulation?"
2602 . ./myread
2603 case "$ans" in
2604 [yY]*) val="$define";;
2605 *) val="$undef";;
2606 esac
2607 ;;
2608esac
2609set d_dosuid
2610eval $setvar
2611
37120919
AD
2612: determine where site specific libraries go.
2613set sitelib sitelib
2614eval $prefixit
2615case "$sitelib" in
2616'') dflt="$privlib/site_perl" ;;
2617*) dflt="$sitelib" ;;
2618esac
2619$cat <<EOM
2620
2621The installation process will also create a directory for
2622site-specific extensions and modules. Some users find it convenient
2623to place all local files in this directory rather than in the main
2624distribution directory.
2625
2626EOM
2627fn=d~+
2628rp='Pathname for the site-specific library files?'
2629. ./getfile
2630if $test "X$sitelibexp" != "X$ansexp"; then
2631 installsitelib=''
2632fi
2633sitelib="$ans"
2634sitelibexp="$ansexp"
2635if $afs; then
2636 $cat <<EOM
2637
2638Since you are running AFS, I need to distinguish the directory in which
2639private files reside from the directory in which they are installed (and from
2640which they are presumably copied to the former directory by occult means).
2641
2642EOM
2643 case "$installsitelib" in
2644 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
2645 *) dflt="$installsitelib";;
2646 esac
2647 fn=de~
2648 rp='Where will private files be installed?'
2649 . ./getfile
2650 installsitelib="$ans"
2651else
2652 installsitelib="$sitelibexp"
2653fi
4633a7c4 2654
37120919
AD
2655: determine where site specific architecture-dependent libraries go.
2656xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
2657: xxx is usuually lib/site_perl/archname.
2658set sitearch sitearch none
8e07c86e 2659eval $prefixit
37120919
AD
2660case "$sitearch" in
2661'') dflt="$sitelib/$archname" ;;
2662*) dflt="$sitearch" ;;
2663esac
8e07c86e
AD
2664$cat <<EOM
2665
4633a7c4
LW
2666The installation process will also create a directory for
2667architecture-dependent site-specific extensions and modules.
8e07c86e
AD
2668
2669EOM
4633a7c4
LW
2670fn=nd~+
2671rp='Pathname for the site-specific architecture-dependent library files?'
8e07c86e 2672. ./getfile
4633a7c4
LW
2673if $test "X$sitearchexp" != "X$ansexp"; then
2674 installsitearch=''
8e07c86e 2675fi
4633a7c4
LW
2676sitearch="$ans"
2677sitearchexp="$ansexp"
8e07c86e
AD
2678if $afs; then
2679 $cat <<EOM
2680
2681Since you are running AFS, I need to distinguish the directory in which
2682private files reside from the directory in which they are installed (and from
2683which they are presumably copied to the former directory by occult means).
2684
2685EOM
4633a7c4
LW
2686 case "$installsitearch" in
2687 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
2688 *) dflt="$installsitearch";;
8e07c86e
AD
2689 esac
2690 fn=de~
2691 rp='Where will private files be installed?'
2692 . ./getfile
4633a7c4 2693 installsitearch="$ans"
8e07c86e 2694else
4633a7c4 2695 installsitearch="$sitearchexp"
8e07c86e
AD
2696fi
2697
4633a7c4
LW
2698: determine where old public architecture dependent libraries might be
2699case "$oldarchlib" in
2700'') case "$privlib" in
2701 '') ;;
2702 *) dflt="$privlib/$archname"
8e07c86e 2703 ;;
8e07c86e
AD
2704 esac
2705 ;;
4633a7c4
LW
2706*) dflt="$oldarchlib"
2707 ;;
8e07c86e 2708esac
4633a7c4
LW
2709if $test ! -d "$dflt/auto"; then
2710 dflt=none
2711fi
8e07c86e
AD
2712cat <<EOM
2713
760ac839 2714In 5.001, Perl stored architecture-dependent library files in a directory
4633a7c4
LW
2715with a name such as $privlib/$archname,
2716and this directory contained files from the standard extensions and
2717files from any additional extensions you might have added. Starting
2718with version 5.002, all the architecture-dependent standard extensions
760ac839
LW
2719will go into a version-specific directory such as
2720$archlib,
4633a7c4
LW
2721while locally-added extensions will go into
2722$sitearch.
2723
2724If you wish Perl to continue to search the old architecture-dependent
2725library for your local extensions, give the path to that directory.
2726If you do not wish to use your old architecture-dependent library
2727files, answer 'none'.
8e07c86e
AD
2728
2729EOM
4633a7c4
LW
2730fn=dn~
2731rp='Directory for your old 5.001 architecture-dependent libraries?'
8e07c86e 2732. ./getfile
4633a7c4
LW
2733oldarchlib="$ans"
2734oldarchlibexp="$ansexp"
2735case "$oldarchlib" in
2736''|' ') val="$undef" ;;
2737*) val="$define" ;;
2738esac
2739set d_oldarchlib
2740eval $setvar
8e07c86e 2741
760ac839
LW
2742
2743case "$usestdio" in
2744false) dflt='n';;
2745*) dflt='y';;
2746esac
2747echo "$package can now use alternate file IO mechanisms to ANSI stdio."
2748echo "However these are experimental and may cause problems with some"
2749echo "extension modules"
2750rp="Use stdio as with previous versions?"
2751. ./myread
2752case "$ans" in
2753y|Y)
2754 echo "Ok, doing things the stdio way"
2755 val="$define"
2756 ;;
2757*)
2758 val="$undef"
2759 ;;
2760esac
2761set d_perlstdio
2762eval $setvar
2763case "$d_perlstdio" in
2764$define) usestdio='true';;
2765*) usestdio='false';;
2766esac
2767
2768
2769
4633a7c4
LW
2770: determine where public executables go
2771echo " "
2772set dflt bin bin
2773eval $prefixit
2774fn=d~
2775rp='Pathname where the public executables will reside?'
2776. ./getfile
2777if $test "X$ansexp" != "X$binexp"; then
2778 installbin=''
2779fi
2780bin="$ans"
2781binexp="$ansexp"
8e07c86e
AD
2782if $afs; then
2783 $cat <<EOM
2784
2785Since you are running AFS, I need to distinguish the directory in which
4633a7c4 2786executables reside from the directory in which they are installed (and from
8e07c86e
AD
2787which they are presumably copied to the former directory by occult means).
2788
2789EOM
4633a7c4
LW
2790 case "$installbin" in
2791 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
2792 *) dflt="$installbin";;
8e07c86e
AD
2793 esac
2794 fn=de~
4633a7c4 2795 rp='Where will public executables be installed?'
8e07c86e 2796 . ./getfile
4633a7c4 2797 installbin="$ans"
8e07c86e 2798else
4633a7c4 2799 installbin="$binexp"
8e07c86e
AD
2800fi
2801
2c7991dc
PP
2802: determine where manual pages are on this system
2803echo " "
2804case "$sysman" in
2805'')
2806 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2807 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2808 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2809 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2810 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2811 sysman=`./loc . /usr/man/man1 $syspath`
2812 ;;
2813esac
2814if $test -d "$sysman"; then
2815 echo "System manual is in $sysman." >&4
2816else
2817 echo "Could not find manual pages in source form." >&4
2818fi
2819
8e07c86e
AD
2820: determine where manual pages go
2821set man1dir man1dir none
2822eval $prefixit
2823$cat <<EOM
2824
2825$spackage has manual pages available in source form.
2826EOM
2827case "$nroff" in
2828nroff)
2829 echo "However, you don't have nroff, so they're probably useless to you."
2830 case "$man1dir" in
2831 '') man1dir="none";;
2832 esac;;
2833esac
2834echo "If you don't want the manual sources installed, answer 'none'."
2835case "$man1dir" in
2c7991dc
PP
2836' ') dflt=none
2837 ;;
8e07c86e 2838'')
25f94b33
AD
2839 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
2840 lookpath="$lookpath $prefixexp/man/p_man/man1"
2841 lookpath="$lookpath $prefixexp/man/u_man/man1"
2c7991dc 2842 lookpath="$lookpath $prefixexp/man/man.1"
25f94b33
AD
2843 : If prefix contains 'perl' then we want to keep the man pages
2844 : under the prefix directory. Otherwise, look in a variety of
2845 : other possible places. This is debatable, but probably a
2c7991dc
PP
2846 : good compromise. Well, apparently not.
2847 : Experience has shown people expect man1dir to be under prefix,
2848 : so we now always put it there. Users who want other behavior
2849 : can answer interactively or use a command line option.
2850 : Does user have System V-style man paths.
2851 case "$sysman" in
2852 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
2853 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
25f94b33 2854 esac
8e07c86e
AD
2855 set dflt
2856 eval $prefixup
2857 ;;
8e07c86e
AD
2858*) dflt="$man1dir"
2859 ;;
2860esac
2861echo " "
4633a7c4 2862fn=dn+~
8e07c86e
AD
2863rp="Where do the main $spackage manual pages (source) go?"
2864. ./getfile
25f94b33 2865if $test "X$man1direxp" != "X$ansexp"; then
8e07c86e
AD
2866 installman1dir=''
2867fi
2868man1dir="$ans"
2869man1direxp="$ansexp"
2870case "$man1dir" in
2871'') man1dir=' '
2872 installman1dir='';;
2873esac
2874if $afs; then
2875 $cat <<EOM
2876
2877Since you are running AFS, I need to distinguish the directory in which
2878manual pages reside from the directory in which they are installed (and from
2879which they are presumably copied to the former directory by occult means).
2880
2881EOM
2882 case "$installman1dir" in
2883 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
2884 *) dflt="$installman1dir";;
2885 esac
2886 fn=de~
2887 rp='Where will man pages be installed?'
2888 . ./getfile
2889 installman1dir="$ans"
2890else
2891 installman1dir="$man1direxp"
2892fi
2893
2894: What suffix to use on installed man pages
2895
2896case "$man1dir" in
2897' ')
2898 man1ext='0'
2899 ;;
2900*)
2901 rp="What suffix should be used for the main $spackage man pages?"
2c7991dc
PP
2902 case "$man1ext" in
2903 '') case "$man1dir" in
2904 *1) dflt=1 ;;
2905 *1p) dflt=1p ;;
2906 *1pm) dflt=1pm ;;
2907 *l) dflt=l;;
2908 *n) dflt=n;;
2909 *o) dflt=o;;
2910 *p) dflt=p;;
2911 *C) dflt=C;;
2912 *L) dflt=L;;
2913 *L1) dflt=L1;;
2914 *) dflt=1;;
2915 esac
2916 ;;
2917 *) dflt="$man1ext";;
8e07c86e
AD
2918 esac
2919 . ./myread
2920 man1ext="$ans"
2921 ;;
2922esac
2923
8e07c86e
AD
2924: see if we can have long filenames
2925echo " "
2926rmlist="$rmlist /tmp/cf$$"
2927$test -d /tmp/cf$$ || mkdir /tmp/cf$$
2928first=123456789abcdef
2929second=/tmp/cf$$/$first
2930$rm -f $first $second
2931if (echo hi >$first) 2>/dev/null; then
2932 if $test -f 123456789abcde; then
2933 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
2934 val="$undef"
2935 else
2936 if (echo hi >$second) 2>/dev/null; then
2937 if $test -f /tmp/cf$$/123456789abcde; then
2938 $cat <<'EOM'
2939That's peculiar... You can have filenames longer than 14 characters, but only
2940on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
2941I shall consider your system cannot support long filenames at all.
2942EOM
2943 val="$undef"
2944 else
2945 echo 'You can have filenames longer than 14 characters.' >&4
2946 val="$define"
2947 fi
2948 else
2949 $cat <<'EOM'
2950How confusing! Some of your filesystems are sane enough to allow filenames
2951longer than 14 characters but some others like /tmp can't even think about them.
2952So, for now on, I shall assume your kernel does not allow them at all.
2953EOM
2954 val="$undef"
2955 fi
2956 fi
2957else
2958 $cat <<'EOM'
2959You can't have filenames longer than 14 chars. You can't even think about them!
2960EOM
2961 val="$undef"
2962fi
2963set d_flexfnam
2964eval $setvar
2965$rm -rf /tmp/cf$$ 123456789abcde*
2966
2967: determine where library module manual pages go
2968set man3dir man3dir none
2969eval $prefixit
2970$cat <<EOM
2971
2972$spackage has manual pages for many of the library modules.
2973EOM
2974
2975case "$nroff" in
2976nroff)
2977 $cat <<'EOM'
2978However, you don't have nroff, so they're probably useless to you.
2979You can use the supplied perldoc script instead.
2980EOM
2981 case "$man3dir" in
2982 '') man3dir="none";;
2983 esac;;
2984esac
2985
2986case "$d_flexfnam" in
2987undef)
2988 $cat <<'EOM'
2989However, your system can't handle the long file names like File::Basename.3.
2990You can use the supplied perldoc script instead.
2991EOM
2992 case "$man3dir" in
2993 '') man3dir="none";;
2994 esac;;
2995esac
2996
2997echo "If you don't want the manual sources installed, answer 'none'."
4633a7c4
LW
2998: We dont use /usr/local/man/man3 because some man programs will
2999: only show the /usr/local/man/man3 contents, and not the system ones,
3000: thus man less will show the perl module less.pm, but not the system
3001: less command. We might also conflict with TCL man pages.
3002: However, something like /opt/perl/man/man3 is fine.
8e07c86e 3003case "$man3dir" in
4633a7c4 3004'') case "$prefix" in
2c7991dc
PP
3005 *perl*) dflt=`echo $man1dir |
3006 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
4633a7c4
LW
3007 *) dflt="$privlib/man/man3" ;;
3008 esac
3009 ;;
8e07c86e
AD
3010' ') dflt=none;;
3011*) dflt="$man3dir" ;;
3012esac
3013echo " "
3014
4633a7c4 3015fn=dn+~
8e07c86e
AD
3016rp="Where do the $spackage library man pages (source) go?"
3017. ./getfile
3018if test "X$man3direxp" != "X$ansexp"; then
3019 installman3dir=''
3020fi
3021
3022man3dir="$ans"
3023man3direxp="$ansexp"
3024case "$man3dir" in
3025'') man3dir=' '
3026 installman3dir='';;
3027esac
3028if $afs; then
3029 $cat <<EOM
3030
3031Since you are running AFS, I need to distinguish the directory in which
3032manual pages reside from the directory in which they are installed (and from
3033which they are presumably copied to the former directory by occult means).
3034
3035EOM
3036 case "$installman3dir" in
3037 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
3038 *) dflt="$installman3dir";;
3039 esac
3040 fn=de~
3041 rp='Where will man pages be installed?'
3042 . ./getfile
3043 installman3dir="$ans"
3044else
3045 installman3dir="$man3direxp"
3046fi
3047
3048: What suffix to use on installed man pages
3049
3050case "$man3dir" in
3051' ')
3052 man3ext='0'
3053 ;;
3054*)
3055 rp="What suffix should be used for the $spackage library man pages?"
2c7991dc
PP
3056 case "$man3ext" in
3057 '') case "$man3dir" in
3058 *3) dflt=3 ;;
3059 *3p) dflt=3p ;;
3060 *3pm) dflt=3pm ;;
3061 *l) dflt=l;;
3062 *n) dflt=n;;
3063 *o) dflt=o;;
3064 *p) dflt=p;;
3065 *C) dflt=C;;
3066 *L) dflt=L;;
3067 *L3) dflt=L3;;
3068 *) dflt=3;;
3069 esac
3070 ;;
3071 *) dflt="$man3ext";;
8e07c86e
AD
3072 esac
3073 . ./myread
3074 man3ext="$ans"
3075 ;;
3076esac
3077
4633a7c4
LW
3078: see what memory models we can support
3079case "$models" in
3080'')
3081 $cat >pdp11.c <<'EOP'
3082main() {
3083#ifdef pdp11
3084 exit(0);
3085#else
3086 exit(1);
3087#endif
3088}
3089EOP
3090 cc -o pdp11 pdp11.c >/dev/null 2>&1
3091 if ./pdp11 2>/dev/null; then
3092 dflt='unsplit split'
3093 else
3094 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3095 case "$tans" in
3096 X) dflt='none';;
3097 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3098 dflt='small'
3099 else
3100 dflt=''
3101 fi
3102 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3103 dflt="$dflt medium"
3104 fi
3105 if $test -d /lib/large || $test -d /usr/lib/large; then
3106 dflt="$dflt large"
3107 fi
3108 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3109 dflt="$dflt huge"
3110 fi
3111 esac
3112 fi;;
3113*) dflt="$models";;
8e07c86e 3114esac
4633a7c4
LW
3115$cat <<EOM
3116
3117Some systems have different model sizes. On most systems they are called
3118small, medium, large, and huge. On the PDP11 they are called unsplit and
3119split. If your system doesn't support different memory models, say "none".
3120If you wish to force everything to one memory model, say "none" here and
3121put the appropriate flags later when it asks you for other cc and ld flags.
3122Venix systems may wish to put "none" and let the compiler figure things out.
3123(In the following question multiple model names should be space separated.)
8e07c86e 3124
4633a7c4
LW
3125EOM
3126rp="Which memory models are supported?"
8e07c86e 3127. ./myread
4633a7c4 3128models="$ans"
8e07c86e 3129
4633a7c4
LW
3130case "$models" in
3131none)
3132 small=''
3133 medium=''
3134 large=''
3135 huge=''
3136 unsplit=''
3137 split=''
3138 ;;
3139*split)
3140 case "$split" in
3141 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3142 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3143 dflt='-i'
3144 else
3145 dflt='none'
3146 fi;;
3147 *) dflt="$split";;
8e07c86e 3148 esac
4633a7c4
LW
3149 rp="What flag indicates separate I and D space?"
3150 . ./myread
3151 tans="$ans"
3152 case "$tans" in
3153 none) tans='';;
8e07c86e 3154 esac
4633a7c4
LW
3155 split="$tans"
3156 unsplit='';;
3157*large*|*small*|*medium*|*huge*)
3158 case "$models" in
3159 *large*)
3160 case "$large" in
3161 '') dflt='-Ml';;
3162 *) dflt="$large";;
3163 esac
3164 rp="What flag indicates large model?"
3165 . ./myread
3166 tans="$ans"
3167 case "$tans" in
3168 none) tans='';
3169 esac
3170 large="$tans";;
3171 *) large='';;
8e07c86e 3172 esac
4633a7c4
LW
3173 case "$models" in
3174 *huge*) case "$huge" in
3175 '') dflt='-Mh';;
3176 *) dflt="$huge";;
3177 esac
3178 rp="What flag indicates huge model?"
3179 . ./myread
3180 tans="$ans"
3181 case "$tans" in
3182 none) tans='';
3183 esac
3184 huge="$tans";;
3185 *) huge="$large";;
3186 esac
3187 case "$models" in
3188 *medium*) case "$medium" in
3189 '') dflt='-Mm';;
3190 *) dflt="$medium";;
3191 esac
3192 rp="What flag indicates medium model?"
3193 . ./myread
3194 tans="$ans"
3195 case "$tans" in
3196 none) tans='';
3197 esac
3198 medium="$tans";;
3199 *) medium="$large";;
3200 esac
3201 case "$models" in
3202 *small*) case "$small" in
3203 '') dflt='none';;
3204 *) dflt="$small";;
3205 esac
3206 rp="What flag indicates small model?"
3207 . ./myread
3208 tans="$ans"
3209 case "$tans" in
3210 none) tans='';
3211 esac
3212 small="$tans";;
3213 *) small='';;
3214 esac
3215 ;;
3216*)
3217 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
8e07c86e
AD
3218 ;;
3219esac
3220
2c7991dc 3221: see if we need a special compiler
16d20bd9 3222echo " "
4633a7c4
LW
3223if ./usg; then
3224 case "$cc" in
3225 '') case "$Mcc" in
3226 /*) dflt='Mcc';;
3227 *) case "$large" in
3228 -M*) dflt='cc';;
3229 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3230 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3231 dflt='cc'
3232 else
3233 dflt='cc -M'
3234 fi
3235 else
3236 dflt='cc'
3237 fi;;
3238 esac;;
3239 esac;;
3240 *) dflt="$cc";;
3241 esac
3242 $cat <<'EOM'
3243On some systems the default C compiler will not resolve multiple global
3244references that happen to have the same name. On some such systems the "Mcc"
3245command may be used to force these to be resolved. On other systems a "cc -M"
3246command is required. (Note that the -M flag on other systems indicates a
3247memory model to use!) If you have the Gnu C compiler, you might wish to use
3248that instead.
16d20bd9
AD
3249
3250EOM
4633a7c4
LW
3251 rp="What command will force resolution on this system?"
3252 . ./myread
3253 cc="$ans"
16d20bd9 3254else
4633a7c4
LW
3255 case "$cc" in
3256 '') dflt=cc;;
3257 *) dflt="$cc";;
3258 esac
3259 rp="Use which C compiler?"
3260 . ./myread
3261 cc="$ans"
16d20bd9 3262fi
4633a7c4
LW
3263echo " "
3264echo "Checking for GNU cc in disguise and/or its version number..." >&4
3265$cat >gccvers.c <<EOM
3266#include <stdio.h>
3267int main() {
3268#ifdef __GNUC__
3269#ifdef __VERSION__
3270 printf("%s\n", __VERSION__);
3271#else
3272 printf("%s\n", "1");
3273#endif
3274#endif
3275 exit(0);
3276}
3277EOM
3278if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3279 gccversion=`./gccvers`
3280 case "$gccversion" in
3281 '') echo "You are not using GNU cc." ;;
3282 *) echo "You are using GNU cc $gccversion." ;;
16d20bd9 3283 esac
4633a7c4 3284else
16d20bd9 3285 echo " "
4633a7c4
LW
3286 echo "*** WHOA THERE!!! ***" >&4
3287 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3288 case "$knowitall" in
3289 '')
3290 echo " You'd better start hunting for one and let me know about it." >&4
16d20bd9
AD
3291 exit 1
3292 ;;
3293 esac
4633a7c4
LW
3294fi
3295$rm -f gccvers*
3296case "$gccversion" in
32971*) cpp=`./loc gcc-cpp $cpp $pth` ;;
16d20bd9 3298esac
16d20bd9 3299
4633a7c4 3300: What should the include directory be ?
2304df62 3301echo " "
4633a7c4
LW
3302$echo $n "Hmm... $c"
3303dflt='/usr/include'
3304incpath=''
3305mips_type=''
3306if $test -f /bin/mips && /bin/mips; then
3307 echo "Looks like a MIPS system..."
3308 $cat >usr.c <<'EOCP'
3309#ifdef SYSTYPE_BSD43
3310/bsd43
3311#endif
3312EOCP
3313 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3314 dflt='/bsd43/usr/include'
3315 incpath='/bsd43'
3316 mips_type='BSD 4.3'
2304df62 3317 else
4633a7c4 3318 mips_type='System V'
2304df62 3319 fi
4633a7c4
LW
3320 $rm -f usr.c usr.out
3321 echo "and you're compiling with the $mips_type compiler and libraries."
3322 xxx_prompt=y
3323 echo "exit 0" >mips
3324else
2c7991dc
PP
3325 echo "Doesn't look like a MIPS system."
3326 xxx_prompt=n
3327 echo "exit 1" >mips
3328fi
3329chmod +x mips
3330$eunicefix mips
3331echo " "
3332case "$usrinc" in
3333'') ;;
3334*) dflt="$usrinc";;
3335esac
3336case "$xxx_prompt" in
3337y) fn=d/
3338 rp='Where are the include files you want to use?'
3339 . ./getfile
3340 usrinc="$ans"
3341 ;;
3342*) usrinc="$dflt"
3343 ;;
3344esac
3345
3346: see if we have to deal with yellow pages, now NIS.
3347if $test -d /usr/etc/yp || $test -d /etc/yp; then
3348 if $test -f /usr/etc/nibindd; then
3349 echo " "
3350 echo "I'm fairly confident you're on a NeXT."
3351 echo " "
3352 rp='Do you get the hosts file via NetInfo?'
3353 dflt=y
3354 case "$hostcat" in
3355 nidump*) ;;
3356 '') ;;
3357 *) dflt=n;;
3358 esac
3359 . ./myread
3360 case "$ans" in
3361 y*) hostcat='nidump hosts .';;
3362 *) case "$hostcat" in
3363 nidump*) hostcat='';;
3364 esac
3365 ;;
3366 esac
3367 fi
3368 case "$hostcat" in
3369 nidump*) ;;
3370 *)
3371 case "$hostcat" in
3372 *ypcat*) dflt=y;;
3373 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
3374 dflt=y
3375 else
3376 dflt=n
3377 fi;;
3378 *) dflt=n;;
3379 esac
3380 echo " "
3381 rp='Are you getting the hosts file via yellow pages?'
3382 . ./myread
3383 case "$ans" in
3384 y*) hostcat='ypcat hosts';;
3385 *) hostcat='cat /etc/hosts';;
3386 esac
3387 ;;
3388 esac
3389fi
3390
3391: now get the host name
3392echo " "
3393echo "Figuring out host name..." >&4
3394case "$myhostname" in
3395'') cont=true
3396 echo 'Maybe "hostname" will work...'
3397 if tans=`sh -c hostname 2>&1` ; then
3398 myhostname=$tans
3399 phostname=hostname
3400 cont=''
3401 fi
3402 ;;
3403*) cont='';;
3404esac
3405if $test "$cont"; then
3406 if ./xenix; then
3407 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
3408 if tans=`cat /etc/systemid 2>&1` ; then
3409 myhostname=$tans
3410 phostname='cat /etc/systemid'
3411 echo "Whadyaknow. Xenix always was a bit strange..."
3412 cont=''
3413 fi
3414 elif $test -r /etc/systemid; then
3415 echo "(What is a non-Xenix system doing with /etc/systemid?)"
3416 fi
3417fi
3418if $test "$cont"; then
3419 echo 'No, maybe "uuname -l" will work...'
3420 if tans=`sh -c 'uuname -l' 2>&1` ; then
3421 myhostname=$tans
3422 phostname='uuname -l'
3423 else
3424 echo 'Strange. Maybe "uname -n" will work...'
3425 if tans=`sh -c 'uname -n' 2>&1` ; then
3426 myhostname=$tans
3427 phostname='uname -n'
3428 else
3429 echo 'Oh well, maybe I can mine it out of whoami.h...'
3430 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
3431 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
3432 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
3433 else
3434 case "$myhostname" in
3435 '') echo "Does this machine have an identity crisis or something?"
3436 phostname='';;
3437 *)
3438 echo "Well, you said $myhostname before..."
3439 phostname='echo $myhostname';;
3440 esac
3441 fi
3442 fi
3443 fi
3444fi
3445: you do not want to know about this
3446set $myhostname
3447myhostname=$1
3448
3449: verify guess
3450if $test "$myhostname" ; then
3451 dflt=y
3452 rp='Your host name appears to be "'$myhostname'".'" Right?"
3453 . ./myread
3454 case "$ans" in
3455 y*) ;;
3456 *) myhostname='';;
3457 esac
3458fi
3459
3460: bad guess or no guess
3461while $test "X$myhostname" = X ; do
3462 dflt=''
3463 rp="Please type the (one word) name of your host:"
3464 . ./myread
3465 myhostname="$ans"
3466done
3467
3468: translate upper to lower if necessary
3469case "$myhostname" in
3470*[A-Z]*)
3471 echo "(Normalizing case in your host name)"
3472 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
3473 ;;
3474esac
3475
3476case "$myhostname" in
3477*.*)
3478 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
3479 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
3480 echo "(Trimming domain name from host name--host name is now $myhostname)"
3481 ;;
3482*) case "$mydomain" in
3483 '')
3484 {
3485 : If we use NIS, try ypmatch.
3486 : Is there some reason why this was not done before?
3487 test "X$hostcat" = "Xypcat hosts" &&
3488 ypmatch "$myhostname" hosts 2>/dev/null |\
3489 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
3490 $test -s hosts
3491 } || {
3492 : Extract only the relevant hosts, reducing file size,
3493 : remove comments, insert trailing space for later use.
3494 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
3495 /[ ]$myhostname[ . ]/p" > hosts
3496 }
3497 tmp_re="[ . ]"
3498 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
3499 END { print sum }" hosts` = x1 || tmp_re="[ ]"
3500 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
3501 hosts | $sort | $uniq | \
3502 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
3503 case `$echo X$dflt` in
3504 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
3505 dflt=.
3506 ;;
3507 .) echo "(You do not have fully-qualified names in /etc/hosts)"
3508 ;;
3509 esac
3510 case "$dflt" in
3511 .)
3512 tans=`./loc resolv.conf X /etc /usr/etc`
3513 if $test -f "$tans"; then
3514 echo "(Attempting domain name extraction from $tans)"
3515 : Why was there an Egrep here, when Sed works?
3516 dflt=.`$sed -n -e 's/^domain[ ]*\(.*\)/\1/p' $tans \
3517 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
3518 fi
3519 ;;
3520 esac
3521 case "$dflt" in
3522 .) echo "(No help from resolv.conf either -- attempting clever guess)"
3523 dflt=.`sh -c domainname 2>/dev/null`
3524 case "$dflt" in
3525 '') dflt='.';;
3526 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
3527 esac
3528 ;;
3529 esac
3530 case "$dflt" in
3531 .) echo "(Lost all hope -- silly guess then)"
3532 dflt='.uucp'
3533 ;;
3534 esac
3535 $rm -f hosts
3536 ;;
3537 *) dflt="$mydomain";;
3538 esac;;
3539esac
3540echo " "
3541rp="What is your domain name?"
3542. ./myread
3543tans="$ans"
3544case "$ans" in
3545'') ;;
3546.*) ;;
3547*) tans=".$tans";;
3548esac
3549mydomain="$tans"
3550
3551: translate upper to lower if necessary
3552case "$mydomain" in
3553*[A-Z]*)
3554 echo "(Normalizing case in your domain name)"
3555 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
3556 ;;
3557esac
3558
3559: a little sanity check here
3560case "$phostname" in
3561'') ;;
3562*)
3563 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
3564 $myhostname$mydomain|$myhostname) ;;
3565 *)
3566 case "$phostname" in
3567 sed*)
3568 echo "(That doesn't agree with your whoami.h file, by the way.)"
3569 ;;
3570 *)
3571 echo "(That doesn't agree with your $phostname command, by the way.)"
3572 ;;
3573 esac
3574 ;;
3575 esac
3576 ;;
3577esac
3578
3579$cat <<EOM
3580
3581I need to get your e-mail address in Internet format if possible, i.e.
3582something like user@host.domain. Please answer accurately since I have
3583no easy means to double check it. The default value provided below
3584is most probably close to the reality but may not be valid from outside
3585your organization...
3586
3587EOM
3588cont=x
3589while test "$cont"; do
3590 case "$cf_email" in
3591 '') dflt="$cf_by@$myhostname$mydomain";;
3592 *) dflt="$cf_email";;
3593 esac
3594 rp='What is your e-mail address?'
3595 . ./myread
3596 cf_email="$ans"
3597 case "$cf_email" in
3598 *@*.*) cont='' ;;
3599 *)
3600 rp='Address does not look like an Internet one. Use it anyway?'
3601 case "$fastread" in
3602 yes) dflt=y ;;
3603 *) dflt=n ;;
3604 esac
3605 . ./myread
3606 case "$ans" in
3607 y*) cont='' ;;
3608 *) echo " " ;;
3609 esac
3610 ;;
3611 esac
3612done
3613
3614$cat <<EOM
3615
3616If you or somebody else will be maintaining perl at your site, please
3617fill in the correct e-mail address here so that they may be contacted
3618if necessary. Currently, the "perlbug" program included with perl
3619will send mail to this address in addition to perlbug@perl.com. You may
3620enter "none" for no administrator.
3621
3622EOM
3623case "$perladmin" in
3624'') dflt="$cf_email";;
3625*) dflt="$perladmin";;
3626esac
3627rp='Perl administrator e-mail address'
3628. ./myread
3629perladmin="$ans"
3630
3631: determine where public executable scripts go
3632set scriptdir scriptdir
3633eval $prefixit
3634case "$scriptdir" in
3635'')
3636 dflt="$bin"
3637 : guess some guesses
3638 $test -d /usr/share/scripts && dflt=/usr/share/scripts
3639 $test -d /usr/share/bin && dflt=/usr/share/bin
3640 $test -d /usr/local/script && dflt=/usr/local/script
3641 $test -d $prefixexp/script && dflt=$prefixexp/script
3642 set dflt
3643 eval $prefixup
3644 ;;
3645*) dflt="$scriptdir"
3646 ;;
3647esac
3648$cat <<EOM
3649
3650Some installations have a separate directory just for executable scripts so
3651that they can mount it across multiple architectures but keep the scripts in
3652one spot. You might, for example, have a subdirectory of /usr/share for this.
3653Or you might just lump your scripts in with all your other executables.
3654
3655EOM
3656fn=d~
3657rp='Where do you keep publicly executable scripts?'
3658. ./getfile
3659if $test "X$ansexp" != "X$scriptdirexp"; then
3660 installscript=''
3661fi
3662scriptdir="$ans"
3663scriptdirexp="$ansexp"
3664if $afs; then
3665 $cat <<EOM
3666
3667Since you are running AFS, I need to distinguish the directory in which
3668scripts reside from the directory in which they are installed (and from
3669which they are presumably copied to the former directory by occult means).
3670
3671EOM
3672 case "$installscript" in
3673 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
3674 *) dflt="$installscript";;
3675 esac
3676 fn=de~
3677 rp='Where will public scripts be installed?'
3678 . ./getfile
3679 installscript="$ans"
3680else
3681 installscript="$scriptdirexp"
4633a7c4 3682fi
2c7991dc
PP
3683
3684: determine perl absolute location
3685case "$perlpath" in
3686'') perlpath=$binexp/perl ;;
2304df62 3687esac
2c7991dc
PP
3688
3689: figure out how to guarantee perl startup
3690case "$startperl" in
3691'')
3692 case "$sharpbang" in
3693 *!)
3694 $cat <<EOH
3695
3696I can use the #! construct to start perl on your system. This will
3697make startup of perl scripts faster, but may cause problems if you
3698want to share those scripts and perl is not in a standard place
3699($perlpath) on all your platforms. The alternative is to force
3700a shell by starting the script with a single ':' character.
3701
3702EOH
3703 dflt=$perlpath
3704 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
3705 . ./myread
3706 case "$ans" in
3707 none) startperl=": # use perl";;
3708 *) startperl="#!$ans";;
3709 esac
3710 ;;
3711 *) startperl=": # use perl"
3712 ;;
3713 esac
2304df62
AD
3714 ;;
3715esac
2c7991dc 3716echo "I'll use $startperl to start perl scripts."
2304df62 3717
4633a7c4 3718: see how we invoke the C preprocessor
2304df62 3719echo " "
4633a7c4
LW
3720echo "Now, how can we feed standard input to your C preprocessor..." >&4
3721cat <<'EOT' >testcpp.c
3722#define ABC abc
3723#define XYZ xyz
3724ABC.XYZ
3725EOT
3726cd ..
3727echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3728chmod 755 cppstdin
3729wrapper=`pwd`/cppstdin
3730ok='false'
3731cd UU
3732
3733if $test "X$cppstdin" != "X" && \
3734 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3735 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3736then
3737 echo "You used to use $cppstdin $cppminus so we'll use that again."
3738 case "$cpprun" in
3739 '') echo "But let's see if we can live without a wrapper..." ;;
3740 *)
3741 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3742 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3743 then
3744 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3745 ok='true'
a0d0e21e 3746 else
4633a7c4 3747 echo "(However, $cpprun $cpplast does not work, let's see...)"
2304df62 3748 fi
2304df62 3749 ;;
2304df62 3750 esac
4633a7c4
LW
3751else
3752 case "$cppstdin" in
3753 '') ;;
3754 *)
3755 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3756 ;;
3757 esac
3758fi
3759
3760if $ok; then
3761 : nothing
3762elif echo 'Maybe "'"$cc"' -E" will work...'; \
3763 $cc -E <testcpp.c >testcpp.out 2>&1; \
3764 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3765 echo "Yup, it does."
3766 x_cpp="$cc -E"
3767 x_minus='';
3768elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3769 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3770 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3771 echo "Yup, it does."
3772 x_cpp="$cc -E"
3773 x_minus='-';
3774elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3775 $cc -P <testcpp.c >testcpp.out 2>&1; \
3776 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3777 echo "Yipee, that works!"
3778 x_cpp="$cc -P"
3779 x_minus='';
3780elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3781 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3782 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3783 echo "At long last!"
3784 x_cpp="$cc -P"
3785 x_minus='-';
3786elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3787 $cpp <testcpp.c >testcpp.out 2>&1; \
3788 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3789 echo "It works!"
3790 x_cpp="$cpp"
3791 x_minus='';
3792elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3793 $cpp - <testcpp.c >testcpp.out 2>&1; \
3794 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3795 echo "Hooray, it works! I was beginning to wonder."
3796 x_cpp="$cpp"
3797 x_minus='-';
3798elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3799 $wrapper <testcpp.c >testcpp.out 2>&1; \
3800 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3801 x_cpp="$wrapper"
3802 x_minus=''
3803 echo "Eureka!"
3804else
3805 dflt=''
3806 rp="No dice. I can't find a C preprocessor. Name one:"
3807 . ./myread
3808 x_cpp="$ans"
3809 x_minus=''
3810 $x_cpp <testcpp.c >testcpp.out 2>&1
3811 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3812 echo "OK, that will do." >&4
3813 else
3814echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3815 exit 1
3816 fi
3817fi
3818
3819case "$ok" in
3820false)
3821 cppstdin="$x_cpp"
3822 cppminus="$x_minus"
3823 cpprun="$x_cpp"
3824 cpplast="$x_minus"
3825 set X $x_cpp
3826 shift
3827 case "$1" in
3828 "$cpp")
3829 echo "Perhaps can we force $cc -E using a wrapper..."
3830 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3831 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3832 then
3833 echo "Yup, we can."
3834 cppstdin="$wrapper"
3835 cppminus='';
3836 else
3837 echo "Nope, we'll have to live without it..."
3838 fi
3839 ;;
3840 esac
3841 case "$cpprun" in
3842 "$wrapper")
3843 cpprun=''
3844 cpplast=''
3845 ;;
3846 esac
3847 ;;
3848esac
3849
3850case "$cppstdin" in
3851"$wrapper") ;;
3852*) $rm -f $wrapper;;
3853esac
3854$rm -f testcpp.c testcpp.out
3855
3856: Set private lib path
3857case "$plibpth" in
3858'') if ./mips; then
3859 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3860 fi;;
3861esac
3862case "$libpth" in
3863' ') dlist='';;
3864'') dlist="$loclibpth $plibpth $glibpth";;
3865*) dlist="$libpth";;
3866esac
3867
3868: Now check and see which directories actually exist, avoiding duplicates
3869libpth=''
3870for xxx in $dlist
3871do
3872 if $test -d $xxx; then
3873 case " $libpth " in
3874 *" $xxx "*) ;;
3875 *) libpth="$libpth $xxx";;
3876 esac
3877 fi
3878done
3879$cat <<'EOM'
3880
3881Some systems have incompatible or broken versions of libraries. Among
3882the directories listed in the question below, please remove any you
3883know not to be holding relevant libraries, and add any that are needed.
3884Say "none" for none.
3885
3886EOM
3887case "$libpth" in
3888'') dflt='none';;
3889*)
3890 set X $libpth
3891 shift
3892 dflt=${1+"$@"}
3893 ;;
3894esac
3895rp="Directories to use for library searches?"
3896. ./myread
3897case "$ans" in
3898none) libpth=' ';;
3899*) libpth="$ans";;
3900esac
3901
3902: determine optimize, if desired, or use for debug flag also
3903case "$optimize" in
3904' ') dflt='none';;
3905'') dflt='-O';;
3906*) dflt="$optimize";;
3907esac
3908$cat <<EOH
3909
760ac839 3910Some C compilers have problems with their optimizers. By default, $package
4633a7c4
LW
3911compiles with the -O flag to use the optimizer. Alternately, you might want
3912to use the symbolic debugger, which uses the -g flag (on traditional Unix
3913systems). Either flag can be specified here. To use neither flag, specify
3914the word "none".
3915
3916EOH
3917rp="What optimizer/debugger flag should be used?"
3918. ./myread
3919optimize="$ans"
3920case "$optimize" in
3921'none') optimize=" ";;
3922esac
3923
3924dflt=''
25f94b33
AD
3925: We will not override a previous value, but we might want to
3926: augment a hint file
3927case "$hint" in
3928none|recommended)
4633a7c4
LW
3929 case "$gccversion" in
3930 1*) dflt='-fpcc-struct-return' ;;
3931 esac
3932 case "$optimize" in
3933 *-g*) dflt="$dflt -DDEBUGGING";;
3934 esac
3935 case "$gccversion" in
3936 2*) if test -d /etc/conf/kconfig.d &&
3937 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3938 then
3939 dflt="$dflt -posix"
3940 fi
3941 ;;
3942 esac
3943 ;;
3944esac
3945
3946case "$mips_type" in
3947*BSD*|'') inclwanted="$locincpth $usrinc";;
3948*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
3949esac
3950for thisincl in $inclwanted; do
3951 if $test -d $thisincl; then
3952 if $test x$thisincl != x$usrinc; then
3953 case "$dflt" in
3954 *$thisincl*);;
3955 *) dflt="$dflt -I$thisincl";;
3956 esac
3957 fi
3958 fi
3959done
3960
3961inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
3962 xxx=true;
3963elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
3964 xxx=true;
3965else
3966 xxx=false;
3967fi;
3968if $xxx; then
3969 case "$dflt" in
3970 *$2*);;
3971 *) dflt="$dflt -D$2";;
3972 esac;
3973fi'
3974
3975if ./osf1; then
3976 set signal.h __LANGUAGE_C__; eval $inctest
3977else
3978 set signal.h LANGUAGE_C; eval $inctest
3979fi
3980set signal.h NO_PROTOTYPE; eval $inctest
3981set signal.h _NO_PROTO; eval $inctest
3982
25f94b33
AD
3983case "$hint" in
3984none|recommended) dflt="$ccflags $dflt" ;;
4633a7c4
LW
3985*) dflt="$ccflags";;
3986esac
25f94b33
AD
3987
3988case "$dflt" in
3989''|' ') dflt=none;;
3990esac
4633a7c4
LW
3991$cat <<EOH
3992
3993Your C compiler may want other flags. For this question you should include
3994-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
3995but you should NOT include libraries or ld flags like -lwhatever. If you
3996want $package to honor its debug switch, you should include -DDEBUGGING here.
3997Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
3998-DHIDEMYMALLOC or -DCRIPPLED_CC.
3999
4000To use no flags, specify the word "none".
4001
4002EOH
4003set X $dflt
4004shift
4005dflt=${1+"$@"}
4006rp="Any additional cc flags?"
4007. ./myread
4008case "$ans" in
4009none) ccflags='';;
4010*) ccflags="$ans";;
4011esac
4012
4013: the following weeds options from ccflags that are of no interest to cpp
4014cppflags="$ccflags"
4015case "$gccversion" in
40161*) cppflags="$cppflags -D__GNUC__"
4017esac
4018case "$mips_type" in
4019'');;
4020*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4021esac
4022case "$cppflags" in
4023'');;
4024*)
4025 echo " "
4026 echo "Let me guess what the preprocessor flags are..." >&4
4027 set X $cppflags
4028 shift
4029 cppflags=''
4030 $cat >cpp.c <<'EOM'
4031#define BLURFL foo
4032
4033BLURFL xx LFRULB
4034EOM
4035 previous=''
4036 for flag in $*
4037 do
4038 case "$flag" in
4039 -*) ftry="$flag";;
4040 *) ftry="$previous $flag";;
4041 esac
4042 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
4043 >cpp1.out 2>/dev/null && \
4044 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
4045 >cpp2.out 2>/dev/null && \
4046 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4047 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4048 then
4049 cppflags="$cppflags $ftry"
4050 previous=''
4051 else
4052 previous="$flag"
4053 fi
4054 done
4055 set X $cppflags
4056 shift
4057 cppflags=${1+"$@"}
4058 case "$cppflags" in
4059 *-*) echo "They appear to be: $cppflags";;
4060 esac
4061 $rm -f cpp.c cpp?.out
4062 ;;
4063esac
4064
4065: flags used in final linking phase
4066
4067case "$ldflags" in
4068'') if ./venix; then
4069 dflt='-i -z'
4070 else
4071 dflt=''
4072 fi
4073 case "$ccflags" in
4074 *-posix*) dflt="$dflt -posix" ;;
4075 esac
4076 ;;
4077*) dflt="$ldflags";;
4078esac
4079
4080: Try to guess additional flags to pick up local libraries.
4081for thislibdir in $libpth; do
4082 case " $loclibpth " in
4083 *" $thislibdir "*)
4084 case "$dflt " in
25f94b33 4085 *"-L$thislibdir "*) ;;
4633a7c4
LW
4086 *) dflt="$dflt -L$thislibdir" ;;
4087 esac
4088 ;;
4089 esac
4090done
4091
4092case "$dflt" in
4093'') dflt='none' ;;
4094esac
4095
4096$cat <<EOH
4097
4098Your C linker may need flags. For this question you should
4099include -L/whatever and any other flags used by the C linker, but you
4100should NOT include libraries like -lwhatever.
4101
4102Make sure you include the appropriate -L/path flags if your C linker
4103does not normally search all of the directories you specified above,
4104namely
4105 $libpth
4106To use no flags, specify the word "none".
4107
4108EOH
4109
4110rp="Any additional ld flags (NOT including libraries)?"
4111. ./myread
4112case "$ans" in
4113none) ldflags='';;
4114*) ldflags="$ans";;
4115esac
4116rmlist="$rmlist pdp11"
4117
4118: coherency check
4119echo " "
4120echo "Checking your choice of C compiler and flags for coherency..." >&4
4121set X $cc $optimize $ccflags $ldflags try.c -o try
4122shift
4123$cat >try.msg <<EOM
4124I've tried to compile and run a simple program with:
4125
4126 $*
4127 ./try
4128
4129and I got the following output:
4130
4131EOM
4132$cat > try.c <<'EOF'
4133#include <stdio.h>
4134main() { exit(0); }
4135EOF
4136dflt=y
4137if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
4138 if sh -c './try' >>try.msg 2>&1; then
4139 dflt=n
4140 else
4141 echo "The program compiled OK, but exited with status $?." >>try.msg
4142 rp="You have a problem. Shall I abort Configure"
4143 dflt=y
4144 fi
4145else
4146 echo "I can't compile the test program." >>try.msg
4147 rp="You have a BIG problem. Shall I abort Configure"
4148 dflt=y
4149fi
4150case "$dflt" in
4151y)
4152 $cat try.msg
4153 case "$knowitall" in
4154 '')
4155 echo "(The supplied flags might be incorrect with this C compiler.)"
4156 ;;
4157 *) dflt=n;;
4158 esac
4159 echo " "
4160 . ./myread
4161 case "$ans" in
4162 n*|N*) ;;
4163 *) echo "Ok. Stopping Configure." >&4
4164 exit 1
4165 ;;
4166 esac
4167 ;;
4168n) echo "OK, that should do.";;
4169esac
4170$rm -f try try.* core
4171
4172: compute shared library extension
4173case "$so" in
4174'')
4175 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4176 dflt='sl'
4177 else
4178 dflt='so'
4179 fi
4180 ;;
4181*) dflt="$so";;
4182esac
4183$cat <<EOM
4184
4185On some systems, shared libraries may be available. Answer 'none' if
4186you want to suppress searching of shared libraries for the remaining
4187of this configuration.
4188
4189EOM
4190rp='What is the file extension used for shared libraries?'
4191. ./myread
4192so="$ans"
4193
4194: Looking for optional libraries
4195echo " "
4196echo "Checking for optional libraries..." >&4
4197case "$libs" in
4198' '|'') dflt='';;
4199*) dflt="$libs";;
4200esac
4201case "$libswanted" in
4202'') libswanted='c_s';;
4203esac
4204for thislib in $libswanted; do
4205
4206 if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
4207 echo "Found -l$thislib (shared)."
4208 case " $dflt " in
4209 *"-l$thislib "*);;
4210 *) dflt="$dflt -l$thislib";;
4211 esac
4212 elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
4213 echo "Found -l$thislib (shared)."
4214 case " $dflt " in
4215 *"-l$thislib "*);;
4216 *) dflt="$dflt -l$thislib";;
4217 esac
4218 elif xxx=`./loc lib$thislib.a X $libpth`; $test -f "$xxx"; then
4219 echo "Found -l$thislib."
4220 case " $dflt " in
4221 *"-l$thislib "*);;
4222 *) dflt="$dflt -l$thislib";;
4223 esac