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