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