This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Updated for 5.003_05.
[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#
85cad39c 23# Generated on Fri Aug 30 11:30:25 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
PP
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
PP
497libperl=''
498useshrplib=''
a0d0e21e 499glibpth=''
2304df62 500libpth=''
8e07c86e 501loclibpth=''
2304df62
AD
502plibpth=''
503xlibpth=''
504libs=''
85e6fe83
LW
505lns=''
506lseektype=''
8ff267be
PP
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
PP
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
PP
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
PP
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
PP
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
PP
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"
85cad39c 1601 tmp_sh="$sh"
2304df62
AD
1602 . ./config.sh
1603 cp config.sh UU
ecfc5424
AD
1604 n="$tmp_n"
1605 c="$tmp_c"
85cad39c
PP
1606 : Older versions did not always set $sh. Catch re-use of such
1607 : an old config.sh.
1608 case "$sh" in
1609 '') sh="$tmp_sh" ;;
1610 esac
2304df62
AD
1611 hint=previous
1612 ;;
1613 esac
1614fi
1615if test ! -f config.sh; then
1616 $cat <<EOM
1617
1618First time through, eh? I have some defaults handy for the following systems:
1619
1620EOM
1621 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
1622 dflt=''
1623 : Half the following guesses are probably wrong... If you have better
8ff267be 1624 : tests or hints, please send them to doughera@lafcol.lafayette.edu
2304df62 1625 : The metaconfig authors would also appreciate a copy...
a0d0e21e 1626 $test -f /irix && osname=irix
85e6fe83
LW
1627 $test -f /xenix && osname=sco_xenix
1628 $test -f /dynix && osname=dynix
1629 $test -f /dnix && osname=dnix
a0d0e21e 1630 $test -f /unicos && osname=unicos && osvers=`$uname -r`
85e6fe83 1631 $test -f /bin/mips && /bin/mips && osname=mips
ecfc5424
AD
1632 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
1633 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
a0d0e21e
LW
1634 $test -d /usr/apollo/bin && osname=apollo
1635 $test -f /etc/saf/_sactab && osname=svr4
85e6fe83 1636 $test -d /usr/include/minix && osname=minix
4633a7c4
LW
1637 if $test -d /MachTen; then
1638 osname=machten
1639 if $test -x /sbin/version; then
1640 osvers=`/sbin/version | $awk '{print $2}' |
1641 $sed -e 's/[A-Za-z]$//'`
1642 elif $test -x /usr/etc/version; then
1643 osvers=`/usr/etc/version | $awk '{print $2}' |
1644 $sed -e 's/[A-Za-z]$//'`
1645 else
1646 osvers="$2.$3"
1647 fi
1648 fi
2304df62
AD
1649 if $test -f $uname; then
1650 set X $myuname
1651 shift
1652
2304df62 1653 case "$5" in
85e6fe83 1654 fps*) osname=fps ;;
2304df62
AD
1655 mips*)
1656 case "$4" in
85e6fe83
LW
1657 umips) osname=umips ;;
1658 *) osname=mips ;;
2304df62 1659 esac;;
85e6fe83
LW
1660 [23]100) osname=mips ;;
1661 next*) osname=next ;;
1662 news*) osname=news ;;
ecfc5424
AD
1663 i386*)
1664 if $test -f /etc/kconfig; then
1665 osname=isc
a0d0e21e
LW
1666 if test "$lns" = "ln -s"; then
1667 osvers=4
1668 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
1669 osvers=3
2304df62 1670 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
a0d0e21e 1671 osvers=2
ecfc5424
AD
1672 fi
1673 fi
1674 ;;
2304df62
AD
1675 esac
1676
1677 case "$1" in
a0d0e21e
LW
1678 aix) osname=aix
1679 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
1680 case "$tmp" in
1aef975c 1681 'not found') osvers="$4"."$3" ;;
a0d0e21e
LW
1682 '<3240'|'<>3240') osvers=3.2.0 ;;
1683 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
1684 '=3250'|'>3250') osvers=3.2.5 ;;
1aef975c 1685 *) osvers=$tmp;;
a0d0e21e
LW
1686 esac
1687 ;;
1688 dnix) osname=dnix
1689 osvers="$3"
1690 ;;
1691 domainos) osname=apollo
1692 osvers="$3"
1693 ;;
1694 dgux) osname=dgux
1695 osvers="$3"
1696 ;;
760ac839
LW
1697 dynixptx*) osname=dynixptx
1698 osvers="$3"
1699 ;;
a0d0e21e
LW
1700 freebsd) osname=freebsd
1701 osvers="$3" ;;
1702 genix) osname=genix ;;
1703 hp*) osname=hpux
1704 case "$3" in
1705 *.08.*) osvers=9 ;;
1706 *.09.*) osvers=9 ;;
1707 *.10.*) osvers=10 ;;
ecfc5424 1708 *) osvers="$3" ;;
a0d0e21e
LW
1709 esac
1710 ;;
a78b0d02 1711 irix*) osname=irix
a0d0e21e
LW
1712 case "$3" in
1713 4*) osvers=4 ;;
1714 5*) osvers=5 ;;
ecfc5424 1715 *) osvers="$3" ;;
a0d0e21e
LW
1716 esac
1717 ;;
1718 linux) osname=linux
1719 case "$3" in
1720 1*) osvers=1 ;;
1721 *) osvers="$3" ;;
1722 esac
1723 ;;
1724 netbsd*) osname=netbsd
ecfc5424
AD
1725 osvers="$3"
1726 ;;
a0d0e21e
LW
1727 bsd386) osname=bsd386
1728 osvers=`$uname -r`
1729 ;;
1730 next*) osname=next ;;
1731 solaris) osname=solaris
1732 case "$3" in
1733 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
ecfc5424 1734 *) osvers="$3" ;;
a0d0e21e
LW
1735 esac
1736 ;;
85e6fe83
LW
1737 sunos) osname=sunos
1738 case "$3" in
85e6fe83
LW
1739 5*) osname=solaris
1740 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
a0d0e21e 1741 *) osvers="$3" ;;
2304df62
AD
1742 esac
1743 ;;
a0d0e21e 1744 titanos) osname=titanos
85e6fe83 1745 case "$3" in
a0d0e21e
LW
1746 1*) osvers=1 ;;
1747 2*) osvers=2 ;;
1748 3*) osvers=3 ;;
1749 4*) osvers=4 ;;
ecfc5424 1750 *) osvers="$3" ;;
2304df62
AD
1751 esac
1752 ;;
85e6fe83 1753 ultrix) osname=ultrix
ecfc5424 1754 osvers="$3"
2304df62 1755 ;;
85e6fe83 1756 osf1) case "$5" in
fed7345c
AD
1757 alpha)
1758 osname=dec_osf
1759 osvers=`echo "$3" | sed 's/^[vt]//'`
ecfc5424
AD
1760 ;;
1761 hp*) osname=hp_osf1 ;;
1762 mips) osname=mips_osf1 ;;
85e6fe83
LW
1763 esac
1764 ;;
a0d0e21e
LW
1765 uts) osname=uts
1766 osvers="$3"
1767 ;;
85e6fe83 1768 $2) case "$osname" in
2304df62 1769 *isc*) ;;
a0d0e21e
LW
1770 *freebsd*) ;;
1771 svr*)
1772 : svr4.x or possibly later
1773 case "svr$3" in
1774 ${osname}*)
1775 osname=svr$3
1776 osvers=$4
1777 ;;
1778 esac
1779 case "$osname" in
1780 svr4.0)
1781 : Check for ESIX
1782 if test -f /stand/boot ; then
1783 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
ecfc5424
AD
1784 if test -n "$INITPROG" -a -f "$INITPROG"; then
1785 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
1786 if test -n "$isesix"; then
a0d0e21e
LW
1787 osname=esix4
1788 fi
1789 fi
1790 fi
1791 ;;
1792 esac
1793 ;;
2304df62 1794 *) if test -f /etc/systemid; then
a0d0e21e
LW
1795 osname=sco
1796 set `echo $3 | $sed 's/\./ /g'` $4
2304df62 1797 if $test -f sco_$1_$2_$3.sh; then
85e6fe83 1798 osvers=$1.$2.$3
2304df62 1799 elif $test -f sco_$1_$2.sh; then
85e6fe83 1800 osvers=$1.$2
2304df62 1801 elif $test -f sco_$1.sh; then
85e6fe83 1802 osvers=$1
2304df62 1803 fi
a0d0e21e
LW
1804 else
1805 case "$osname" in
1806 '') : Still unknown. Probably a generic Sys V.
1807 osname="sysv"
1808 osvers="$3"
1809 ;;
1810 esac
2304df62
AD
1811 fi
1812 ;;
1813 esac
1814 ;;
a0d0e21e
LW
1815 *) case "$osname" in
1816 '') : Still unknown. Probably a generic BSD.
1817 osname="$1"
1818 osvers="$3"
1819 ;;
1820 esac
1821 ;;
2304df62
AD
1822 esac
1823 else
1824 if test -f /vmunix -a -f news_os.sh; then
ecfc5424 1825 (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
2304df62 1826 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
85e6fe83 1827 osname=news_os
2304df62
AD
1828 fi
1829 $rm -f ../UU/kernel.what
8e07c86e
AD
1830 elif test -d c:/.; then
1831 set X $myuname
1832 osname=os2
1833 osvers="$5"
2304df62
AD
1834 fi
1835 fi
85e6fe83 1836
a0d0e21e
LW
1837 : Now look for a hint file osname_osvers, unless one has been
1838 : specified already.
1839 case "$hintfile" in
1840 ''|' ')
ecfc5424 1841 file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
a0d0e21e 1842 : Also try without trailing minor version numbers.
ecfc5424
AD
1843 xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
1844 xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
1845 xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
1846 xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
a0d0e21e
LW
1847 case "$file" in
1848 '') dflt=none ;;
1849 *) case "$osvers" in
1850 '') dflt=$file
1851 ;;
1852 *) if $test -f $file.sh ; then
1853 dflt=$file
1854 elif $test -f $xfile.sh ; then
1855 dflt=$xfile
1856 elif $test -f $xxfile.sh ; then
1857 dflt=$xxfile
1858 elif $test -f $xxxfile.sh ; then
1859 dflt=$xxxfile
1860 elif $test -f $xxxxfile.sh ; then
1861 dflt=$xxxxfile
1862 elif $test -f "${osname}.sh" ; then
1863 dflt="${osname}"
1864 else
1865 dflt=none
1866 fi
1867 ;;
1868 esac
85e6fe83
LW
1869 ;;
1870 esac
1871 ;;
a0d0e21e 1872 *)
ecfc5424 1873 dflt=`echo $hintfile | $sed 's/\.sh$//'`
a0d0e21e 1874 ;;
2304df62 1875 esac
1aef975c 1876
2304df62
AD
1877 $cat <<EOM
1878
1879You may give one or more space-separated answers, or "none" if appropriate.
1880If your OS version has no hints, DO NOT give a wrong version -- say "none".
1881
1882EOM
1883 rp="Which of these apply, if any?"
1884 . ../UU/myread
85e6fe83
LW
1885 tans=$ans
1886 for file in $tans; do
2304df62
AD
1887 if $test -f $file.sh; then
1888 . ./$file.sh
1889 $cat $file.sh >> ../UU/config.sh
85e6fe83 1890 elif $test X$tans = X -o X$tans = Xnone ; then
2304df62
AD
1891 : nothing
1892 else
85e6fe83
LW
1893 : Give one chance to correct a possible typo.
1894 echo "$file.sh does not exist"
1895 dflt=$file
1896 rp="hint to use instead?"
1897 . ../UU/myread
1898 for file in $ans; do
1899 if $test -f "$file.sh"; then
1900 . ./$file.sh
1901 $cat $file.sh >> ../UU/config.sh
1902 elif $test X$ans = X -o X$ans = Xnone ; then
1903 : nothing
1904 else
1905 echo "$file.sh does not exist -- ignored."
1906 fi
1907 done
2304df62
AD
1908 fi
1909 done
85e6fe83 1910
2304df62 1911 hint=recommended
85e6fe83
LW
1912 : Remember our hint file for later.
1913 if $test -f "$file.sh" ; then
a0d0e21e 1914 hintfile="$file"
85e6fe83 1915 else
a0d0e21e 1916 hintfile=''
85e6fe83
LW
1917 fi
1918
2304df62
AD
1919 cd ..
1920fi
1921cd UU
1922;;
1923*)
1924 echo " "
1925 echo "Fetching default answers from $config_sh..." >&4
ecfc5424
AD
1926 tmp_n="$n"
1927 tmp_c="$c"
2304df62
AD
1928 cd ..
1929 cp $config_sh config.sh 2>/dev/null
a78b0d02 1930 chmod +w config.sh
2304df62
AD
1931 . ./config.sh
1932 cd UU
1933 cp ../config.sh .
ecfc5424
AD
1934 n="$tmp_n"
1935 c="$tmp_c"
2304df62
AD
1936 hint=previous
1937 ;;
1938esac
1aef975c
AD
1939test "$override" && . ./optdef.sh
1940myuname="$newmyuname"
2304df62
AD
1941
1942: Restore computed paths
1943for file in $loclist $trylist; do
1944 eval $file="\$_$file"
1945done
1946
85e6fe83 1947cat << EOM
a0d0e21e 1948
85e6fe83 1949Configure uses the operating system name and version to set some defaults.
ecfc5424
AD
1950The default value is probably right if the name rings a bell. Otherwise,
1951since spelling matters for me, either accept the default or answer "none"
1952to leave it blank.
a0d0e21e 1953
85e6fe83 1954EOM
85e6fe83 1955case "$osname" in
a0d0e21e 1956 ''|' ')
85e6fe83 1957 case "$hintfile" in
a0d0e21e 1958 ''|' '|none) dflt=none ;;
ecfc5424 1959 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
85e6fe83
LW
1960 esac
1961 ;;
1962 *) dflt="$osname" ;;
1963esac
1964rp="Operating system name?"
1965. ./myread
1966case "$ans" in
ecfc5424
AD
1967none) osname='' ;;
1968*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
85e6fe83 1969esac
8ff267be
PP
1970echo " "
1971case "$osvers" in
1972 ''|' ')
1973 case "$hintfile" in
1974 ''|' '|none) dflt=none ;;
1975 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
1976 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
1977 case "$dflt" in
1978 ''|' ') dflt=none ;;
1979 esac
1980 ;;
1981 esac
1982 ;;
1983 *) dflt="$osvers" ;;
1984esac
1985rp="Operating system version?"
1986. ./myread
1987case "$ans" in
1988none) osvers='' ;;
1989*) osvers="$ans" ;;
1990esac
1991
760ac839
LW
1992
1993
2304df62
AD
1994: who configured the system
1995cf_time=`$date 2>&1`
8ff267be
PP
1996cf_by=`(logname) 2>/dev/null`
1997case "$cf_by" in "")
1998 cf_by=`(whoami) 2>/dev/null`
1999 case "$cf_by" in "")
2000 cf_by=unknown ;;
2001 esac ;;
2002esac
2304df62 2003
4633a7c4 2004: determine the architecture name
2304df62 2005echo " "
4633a7c4
LW
2006if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
2007 tarch=`arch`"-$osname"
2008elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
2009 if uname -m > tmparch 2>&1 ; then
2010 tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
2011 else
2012 tarch="$osname"
2013 fi
2014 $rm -f tmparch
2015else
2016 tarch="$osname"
2017fi
2018case "$myarchname" in
2019''|"$tarch") ;;
2020*)
2021 echo "(Your architecture name used to be $myarchname.)"
2022 archname=''
2304df62
AD
2023 ;;
2024esac
4633a7c4
LW
2025case "$archname" in
2026'') dflt="$tarch";;
2027*) dflt="$archname";;
2028esac
2029rp='What is your architecture name'
2030. ./myread
2031archname="$ans"
2032myarchname="$tarch"
2033
2034: is AFS running?
2035echo " "
2036if test -d /afs; then
2037 echo "AFS may be running... I'll be extra cautious then..." >&4
2038 afs=true
2304df62 2039else
4633a7c4
LW
2040 echo "AFS does not seem to be running..." >&4
2041 afs=false
2304df62
AD
2042fi
2043
4633a7c4
LW
2044: decide how portable to be. Allow command line overrides.
2045case "$d_portable" in
2046"$undef") ;;
2047*) d_portable="$define" ;;
2304df62 2048esac
2304df62 2049
4633a7c4
LW
2050: set up shell script to do ~ expansion
2051cat >filexp <<EOSS
2052$startsh
2053: expand filename
2054case "\$1" in
2055 ~/*|~)
2056 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
2304df62 2057 ;;
4633a7c4
LW
2058 ~*)
2059 if $test -f /bin/csh; then
2060 /bin/csh -f -c "glob \$1"
2061 failed=\$?
2062 echo ""
2063 exit \$failed
2064 else
2065 name=\`$expr x\$1 : '..\([^/]*\)'\`
2066 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
2067 if $test ! -d "\$dir"; then
2068 me=\`basename \$0\`
2069 echo "\$me: can't locate home directory for: \$name" >&2
2070 exit 1
2071 fi
2072 case "\$1" in
2073 */*)
2074 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
2075 ;;
2076 *)
2077 echo \$dir
2078 ;;
2304df62 2079 esac
4633a7c4 2080 fi
2304df62
AD
2081 ;;
2082*)
4633a7c4 2083 echo \$1
2304df62
AD
2084 ;;
2085esac
4633a7c4
LW
2086EOSS
2087chmod +x filexp
2088$eunicefix filexp
2304df62
AD
2089
2090: now set up to get a file name
2091cat <<'EOSC' >getfile
2092tilde=''
2093fullpath=''
2094already=''
2095skip=''
2096none_ok=''
2097exp_file=''
a0d0e21e 2098nopath_ok=''
2304df62
AD
2099orig_rp="$rp"
2100orig_dflt="$dflt"
2101
2102case "$fn" in
ecfc5424
AD
2103*\(*)
2104 expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
2105 fn=`echo $fn | sed 's/(.*)//'`
2106 ;;
2107esac
2108
2109case "$fn" in
a0d0e21e
LW
2110*:*)
2111 loc_file=`expr $fn : '.*:\(.*\)'`
2112 fn=`expr $fn : '\(.*\):.*'`
2113 ;;
2114esac
2115
2116case "$fn" in
2304df62
AD
2117*~*) tilde=true;;
2118esac
2119case "$fn" in
2120*/*) fullpath=true;;
2121esac
2122case "$fn" in
2123*+*) skip=true;;
2124esac
2125case "$fn" in
2126*n*) none_ok=true;;
2127esac
2128case "$fn" in
2129*e*) exp_file=true;;
2130esac
a0d0e21e
LW
2131case "$fn" in
2132*p*) nopath_ok=true;;
2133esac
2304df62
AD
2134
2135case "$fn" in
2136*f*) type='File';;
2137*d*) type='Directory';;
a0d0e21e 2138*l*) type='Locate';;
2304df62
AD
2139esac
2140
2141what="$type"
2142case "$what" in
2143Locate) what='File';;
2144esac
2145
2146case "$exp_file" in
2147'')
2148 case "$d_portable" in
2149 "$define") ;;
2150 *) exp_file=true;;
2151 esac
2152 ;;
2153esac
2154
2155cd ..
2156while test "$type"; do
2157 redo=''
2158 rp="$orig_rp"
2159 dflt="$orig_dflt"
2160 case "$tilde" in
2161 true) rp="$rp (~name ok)";;
2162 esac
2163 . UU/myread
ecfc5424
AD
2164 if test -f UU/getfile.ok && \
2165 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
2166 then
2167 value="$ans"
2168 ansexp="$ans"
2169 break
2170 fi
2304df62
AD
2171 case "$ans" in
2172 none)
2173 value=''
2174 ansexp=''
2175 case "$none_ok" in
2176 true) type='';;
2177 esac
2178 ;;
2179 *)
2180 case "$tilde" in
2181 '') value="$ans"
2182 ansexp="$ans";;
2183 *)
2184 value=`UU/filexp $ans`
2185 case $? in
2186 0)
2187 if test "$ans" != "$value"; then
ecfc5424 2188 echo "(That expands to $value on this system.)"
2304df62
AD
2189 fi
2190 ;;
2191 *) value="$ans";;
2192 esac
2193 ansexp="$value"
2194 case "$exp_file" in
2195 '') value="$ans";;
2196 esac
2197 ;;
2198 esac
2199 case "$fullpath" in
2200 true)
2201 case "$ansexp" in
2202 /*) value="$ansexp" ;;
2203 *)
2204 redo=true
2205 case "$already" in
2206 true)
2207 echo "I shall only accept a full path name, as in /bin/ls." >&4
2208 echo "Use a ! shell escape if you wish to check pathnames." >&4
2209 ;;
2210 *)
2211 echo "Please give a full path name, starting with slash." >&4
2212 case "$tilde" in
2213 true)
2214 echo "Note that using ~name is ok provided it expands well." >&4
2215 already=true
2216 ;;
2217 esac
2218 esac
2219 ;;
2220 esac
2221 ;;
2222 esac
2223 case "$redo" in
2224 '')
2225 case "$type" in
2226 File)
2227 if test -f "$ansexp"; then
2228 type=''
2229 elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
2230 then
2231 echo "($value is not a plain file, but that's ok.)"
2232 type=''
2233 fi
2234 ;;
2235 Directory)
2236 if test -d "$ansexp"; then
2237 type=''
2238 fi
2239 ;;
2240 Locate)
40000a8c 2241 if test -d "$ansexp"; then
a0d0e21e
LW
2242 echo "(Looking for $loc_file in directory $value.)"
2243 value="$value/$loc_file"
40000a8c 2244 ansexp="$ansexp/$loc_file"
2304df62 2245 fi
40000a8c 2246 if test -f "$ansexp"; then
2304df62
AD
2247 type=''
2248 fi
a0d0e21e
LW
2249 case "$nopath_ok" in
2250 true) case "$value" in
2251 */*) ;;
2252 *) echo "Assuming $value will be in people's path."
2253 type=''
2254 ;;
2255 esac
2256 ;;
2257 esac
2304df62
AD
2258 ;;
2259 esac
2260
2261 case "$skip" in
2262 true) type='';
2263 esac
2264
2265 case "$type" in
2266 '') ;;
2267 *)
2268 if test "$fastread" = yes; then
2269 dflt=y
2270 else
2271 dflt=n
2272 fi
2273 rp="$what $value doesn't exist. Use that name anyway?"
2274 . UU/myread
2275 dflt=''
2276 case "$ans" in
2277 y*) type='';;
2278 *) echo " ";;
2279 esac
2280 ;;
2281 esac
2282 ;;
2283 esac
2284 ;;
2285 esac
2286done
2287cd UU
2288ans="$value"
2289rp="$orig_rp"
2290dflt="$orig_dflt"
ecfc5424 2291rm -f getfile.ok
2304df62
AD
2292EOSC
2293
4633a7c4
LW
2294: determine root of directory hierarchy where package will be installed.
2295case "$prefix" in
2296'')
2297 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
8e07c86e 2298 ;;
4633a7c4
LW
2299*)
2300 dflt="$prefix"
8e07c86e
AD
2301 ;;
2302esac
4633a7c4 2303$cat <<EOM
2304df62 2304
4633a7c4
LW
2305By default, $package will be installed in $dflt/bin, manual
2306pages under $dflt/man, etc..., i.e. with $dflt as prefix for
2307all installation directories. Typically set to /usr/local, but you
2308may choose /usr if you wish to install $package among your system
2309binaries. If you wish to have binaries under /bin but manual pages
2310under /usr/local/man, that's ok: you will be prompted separately
2311for each of the installation directories, the prefix being only used
2312to set the defaults.
8e07c86e
AD
2313
2314EOM
2315fn=d~
2316rp='Installation prefix to use?'
2317. ./getfile
2318oldprefix=''
2319case "$prefix" in
a0d0e21e 2320'') ;;
8e07c86e
AD
2321*)
2322 case "$ans" in
2323 "$prefix") ;;
2324 *) oldprefix="$prefix";;
2325 esac
2326 ;;
a0d0e21e 2327esac
8e07c86e
AD
2328prefix="$ans"
2329prefixexp="$ansexp"
a0d0e21e 2330
8e07c86e
AD
2331: set the prefixit variable, to compute a suitable default value
2332prefixit='case "$3" in
2333""|none)
2334 case "$oldprefix" in
2335 "") eval "$1=\"\$$2\"";;
2336 *)
2337 case "$3" in
2338 "") eval "$1=";;
2339 none)
2340 eval "tp=\"\$$2\"";
2341 case "$tp" in
2342 ""|" ") eval "$1=\"\$$2\"";;
2343 *) eval "$1=";;
2344 esac;;
2345 esac;;
2346 esac;;
2347*)
2348 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
2349 case "$tp" in
2350 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
2351 /*-$oldprefix/*|\~*-$oldprefix/*)
2352 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
2353 *) eval "$1=\"\$$2\"";;
2354 esac;;
2355esac'
a0d0e21e 2356
4633a7c4
LW
2357: determine where private library files go
2358: Usual default is /usr/local/lib/perl5. Also allow things like
2359: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2360case "$prefix" in
2361*perl*) set dflt privlib lib ;;
2362*) set dflt privlib lib/$package ;;
2363esac
8e07c86e 2364eval $prefixit
4633a7c4
LW
2365$cat <<EOM
2366
2367There are some auxiliary files for $package that need to be put into a
2368private library directory that is accessible by everyone.
2369
2370EOM
2371fn=d~+
2372rp='Pathname where the private library files will reside?'
8e07c86e 2373. ./getfile
4633a7c4
LW
2374if $test "X$privlibexp" != "X$ansexp"; then
2375 installprivlib=''
8e07c86e 2376fi
4633a7c4
LW
2377privlib="$ans"
2378privlibexp="$ansexp"
8e07c86e
AD
2379if $afs; then
2380 $cat <<EOM
2304df62 2381
8e07c86e 2382Since you are running AFS, I need to distinguish the directory in which
4633a7c4 2383private files reside from the directory in which they are installed (and from
8e07c86e 2384which they are presumably copied to the former directory by occult means).
a0d0e21e 2385
8e07c86e 2386EOM
4633a7c4
LW
2387 case "$installprivlib" in
2388 '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
2389 *) dflt="$installprivlib";;
8e07c86e
AD
2390 esac
2391 fn=de~
4633a7c4 2392 rp='Where will private files be installed?'
8e07c86e 2393 . ./getfile
4633a7c4 2394 installprivlib="$ans"
8e07c86e 2395else
4633a7c4
LW
2396 installprivlib="$privlibexp"
2397fi
2398
2399: set the base revision
2400baserev=5.0
2401
2402: get the patchlevel
2403echo " "
2404echo "Getting the current patchlevel..." >&4
2405if $test -r ../patchlevel.h;then
760ac839
LW
2406 patchlevel=`awk '/PATCHLEVEL/ {print $3}' ../patchlevel.h`
2407 subversion=`awk '/SUBVERSION/ {print $3}' ../patchlevel.h`
4633a7c4
LW
2408else
2409 patchlevel=0
f55a7265 2410 subversion=0
8e07c86e 2411fi
760ac839 2412echo "(You have $package $baserev patchlevel $patchlevel subversion $subversion.)"
2304df62 2413
8e07c86e
AD
2414: set the prefixup variable, to restore leading tilda escape
2415prefixup='case "$prefixexp" in
2416"$prefix") ;;
2417*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
2418esac'
2419
4633a7c4
LW
2420: determine where public architecture dependent libraries go
2421set archlib archlib
8e07c86e 2422eval $prefixit
4633a7c4 2423case "$archlib" in
8e07c86e 2424'')
4633a7c4 2425 case "$privlib" in
760ac839 2426 '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
4633a7c4
LW
2427 set dflt
2428 eval $prefixup
2429 ;;
a78b0d02 2430 *) version=`LC_ALL=C;export LC_ALL;\
760ac839
LW
2431 echo $baserev $patchlevel $subversion | \
2432 $awk '{print $1 + $2/1000.0 + $3/100000.0}'`
4633a7c4
LW
2433 dflt="$privlib/$archname/$version"
2434 ;;
2435 esac
8e07c86e 2436 ;;
4633a7c4 2437*) dflt="$archlib";;
8e07c86e 2438esac
4633a7c4
LW
2439cat <<EOM
2440
2441$spackage contains architecture-dependent library files. If you are
2442sharing libraries in a heterogeneous environment, you might store
2443these files in a separate location. Otherwise, you can just include
2444them with the rest of the public library files.
2445
8e07c86e 2446EOM
4633a7c4
LW
2447fn=d+~
2448rp='Where do you want to put the public architecture-dependent libraries?'
8e07c86e 2449. ./getfile
4633a7c4
LW
2450archlib="$ans"
2451archlibexp="$ansexp"
2452
8e07c86e
AD
2453if $afs; then
2454 $cat <<EOM
2455
2456Since you are running AFS, I need to distinguish the directory in which
4633a7c4 2457private files reside from the directory in which they are installed (and from
8e07c86e
AD
2458which they are presumably copied to the former directory by occult means).
2459
2460EOM
4633a7c4
LW
2461 case "$installarchlib" in
2462 '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
2463 *) dflt="$installarchlib";;
8e07c86e
AD
2464 esac
2465 fn=de~
4633a7c4 2466 rp='Where will architecture-dependent library files be installed?'
8e07c86e 2467 . ./getfile
4633a7c4 2468 installarchlib="$ans"
8e07c86e 2469else
4633a7c4
LW
2470 installarchlib="$archlibexp"
2471fi
2472if $test X"$archlib" = X"$privlib"; then
2473 d_archlib="$undef"
2474else
2475 d_archlib="$define"
8e07c86e
AD
2476fi
2477
40a7a20a
PP
2478: set up the script used to warn in case of inconsistency
2479cat <<'EOSC' >whoa
2480dflt=y
2481echo " "
2482echo "*** WHOA THERE!!! ***" >&4
2483echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2484rp=" Keep the $hint value?"
2485. ./myread
2486case "$ans" in
2487y) td=$was; tu=$was;;
2488esac
2489EOSC
2490
2491: function used to set $1 to $val
2492setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2493case "$val$was" in
2494$define$undef) . ./whoa; eval "$var=\$td";;
2495$undef$define) . ./whoa; eval "$var=\$tu";;
2496*) eval "$var=$val";;
2497esac'
2498
2499: make some quick guesses about what we are up against
2500echo " "
2501$echo $n "Hmm... $c"
2502echo exit 1 >bsd
2503echo exit 1 >usg
2504echo exit 1 >v7
2505echo exit 1 >osf1
2506echo exit 1 >eunice
2507echo exit 1 >xenix
2508echo exit 1 >venix
8ff267be 2509echo exit 1 >os2
40a7a20a
PP
2510d_bsd="$undef"
2511$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
2512if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
2513then
2514 echo "Looks kind of like an OSF/1 system, but we'll see..."
2515 echo exit 0 >osf1
2516elif test `echo abc | tr a-z A-Z` = Abc ; then
2517 xxx=`./loc addbib blurfl $pth`
2518 if $test -f $xxx; then
2519 echo "Looks kind of like a USG system with BSD features, but we'll see..."
2520 echo exit 0 >bsd
2521 echo exit 0 >usg
2522 else
2523 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
2524 echo "Looks kind of like an extended USG system, but we'll see..."
2525 else
2526 echo "Looks kind of like a USG system, but we'll see..."
2527 fi
2528 echo exit 0 >usg
2529 fi
2530elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
2531 echo "Looks kind of like a BSD system, but we'll see..."
2532 d_bsd="$define"
2533 echo exit 0 >bsd
2534else
2535 echo "Looks kind of like a Version 7 system, but we'll see..."
2536 echo exit 0 >v7
2537fi
2538case "$eunicefix" in
2539*unixtovms*)
2540 $cat <<'EOI'
2541There is, however, a strange, musty smell in the air that reminds me of
2542something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
2543EOI
2544 echo exit 0 >eunice
2545 d_eunice="$define"
2546: it so happens the Eunice I know will not run shell scripts in Unix format
2547 ;;
2548*)
2549 echo " "
2550 echo "Congratulations. You aren't running Eunice."
2551 d_eunice="$undef"
2552 ;;
2553esac
8ff267be
PP
2554: Detect OS2. The p_ variable is set above in the Head.U unit.
2555case "$p_" in
2556:) ;;
2557*)
2558 $cat <<'EOI'
2559I have the feeling something is not exactly right, however...don't tell me...
2560lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
2561EOI
2562 echo exit 0 >os2
2563 ;;
2564esac
40a7a20a
PP
2565if test -f /xenix; then
2566 echo "Actually, this looks more like a XENIX system..."
2567 echo exit 0 >xenix
2568 d_xenix="$define"
2569else
2570 echo " "
2571 echo "It's not Xenix..."
2572 d_xenix="$undef"
2573fi
2574chmod +x xenix
2575$eunicefix xenix
2576if test -f /venix; then
2577 echo "Actually, this looks more like a VENIX system..."
2578 echo exit 0 >venix
2579else
2580 echo " "
2581 if ./xenix; then
2582 : null
2583 else
2584 echo "Nor is it Venix..."
2585 fi
2586fi
8ff267be
PP
2587chmod +x bsd usg v7 osf1 eunice xenix venix os2
2588$eunicefix bsd usg v7 osf1 eunice xenix venix os2
40a7a20a
PP
2589$rm -f foo
2590
2591: see if setuid scripts can be secure
2592$cat <<EOM
2593
2594Some kernels have a bug that prevents setuid #! scripts from being
2595secure. Some sites have disabled setuid #! scripts because of this.
2596
2597First let's decide if your kernel supports secure setuid #! scripts.
2598(If setuid #! scripts would be secure but have been disabled anyway,
2599don't say that they are secure if asked.)
2600
2601EOM
2602
2603val="$undef"
2604if $test -d /dev/fd; then
2605 echo "#!$ls" >reflect
2606 chmod +x,u+s reflect
2607 ./reflect >flect 2>&1
2608 if $contains "/dev/fd" flect >/dev/null; then
2609 echo "Congratulations, your kernel has secure setuid scripts!" >&4
2610 val="$define"
2611 else
2612 $cat <<EOM
2613If you are not sure if they are secure, I can check but I'll need a
2614username and password different from the one you are using right now.
2615If you don't have such a username or don't want me to test, simply
2616enter 'none'.
2617
2618EOM
2619 rp='Other username to test security of setuid scripts with?'
2620 dflt='none'
2621 . ./myread
2622 case "$ans" in
2623 n|none)
2624 case "$d_suidsafe" in
2625 '') echo "I'll assume setuid scripts are *not* secure." >&4
2626 dflt=n;;
2627 "$undef")
2628 echo "Well, the $hint value is *not* secure." >&4
2629 dflt=n;;
2630 *) echo "Well, the $hint value *is* secure." >&4
2631 dflt=y;;
2632 esac
2633 ;;
2634 *)
2635 $rm -f reflect flect
2636 echo "#!$ls" >reflect
2637 chmod +x,u+s reflect
2638 echo >flect
2639 chmod a+w flect
2640 echo '"su" will (probably) prompt you for '"$ans's password."
2641 su $ans -c './reflect >flect'
2642 if $contains "/dev/fd" flect >/dev/null; then
2643 echo "Okay, it looks like setuid scripts are secure." >&4
2644 dflt=y
2645 else
2646 echo "I don't think setuid scripts are secure." >&4
2647 dflt=n
2648 fi
2649 ;;
2650 esac
2651 rp='Does your kernel have *secure* setuid scripts?'
2652 . ./myread
2653 case "$ans" in
2654 [yY]*) val="$define";;
2655 *) val="$undef";;
2656 esac
2657 fi
2658else
2659 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
760ac839 2660 echo "(That's for file descriptors, not floppy disks.)"
40a7a20a
PP
2661 val="$undef"
2662fi
2663set d_suidsafe
2664eval $setvar
2665
2666$rm -f reflect flect
2667
2668: now see if they want to do setuid emulation
2669echo " "
2670val="$undef"
2671case "$d_suidsafe" in
2672"$define")
2673 val="$undef"
2674 echo "No need to emulate SUID scripts since they are secure here." >& 4
2675 ;;
2676*)
2677 $cat <<EOM
2678Some systems have disabled setuid scripts, especially systems where
2679setuid scripts cannot be secure. On systems where setuid scripts have
2680been disabled, the setuid/setgid bits on scripts are currently
2681useless. It is possible for $package to detect those bits and emulate
2682setuid/setgid in a secure fashion. This emulation will only work if
2683setuid scripts have been disabled in your kernel.
2684
2685EOM
2686 case "$d_dosuid" in
2687 "$define") dflt=y ;;
2688 *) dflt=n ;;
2689 esac
2690 rp="Do you want to do setuid/setgid emulation?"
2691 . ./myread
2692 case "$ans" in
2693 [yY]*) val="$define";;
2694 *) val="$undef";;
2695 esac
2696 ;;
2697esac
2698set d_dosuid
2699eval $setvar
2700
37120919
AD
2701: determine where site specific libraries go.
2702set sitelib sitelib
2703eval $prefixit
2704case "$sitelib" in
2705'') dflt="$privlib/site_perl" ;;
2706*) dflt="$sitelib" ;;
2707esac
2708$cat <<EOM
2709
2710The installation process will also create a directory for
2711site-specific extensions and modules. Some users find it convenient
2712to place all local files in this directory rather than in the main
2713distribution directory.
2714
2715EOM
2716fn=d~+
2717rp='Pathname for the site-specific library files?'
2718. ./getfile
2719if $test "X$sitelibexp" != "X$ansexp"; then
2720 installsitelib=''
2721fi
2722sitelib="$ans"
2723sitelibexp="$ansexp"
2724if $afs; then
2725 $cat <<EOM
2726
2727Since you are running AFS, I need to distinguish the directory in which
2728private files reside from the directory in which they are installed (and from
2729which they are presumably copied to the former directory by occult means).
2730
2731EOM
2732 case "$installsitelib" in
2733 '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
2734 *) dflt="$installsitelib";;
2735 esac
2736 fn=de~
2737 rp='Where will private files be installed?'
2738 . ./getfile
2739 installsitelib="$ans"
2740else
2741 installsitelib="$sitelibexp"
2742fi
4633a7c4 2743
37120919
AD
2744: determine where site specific architecture-dependent libraries go.
2745xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
2746: xxx is usuually lib/site_perl/archname.
2747set sitearch sitearch none
8e07c86e 2748eval $prefixit
37120919
AD
2749case "$sitearch" in
2750'') dflt="$sitelib/$archname" ;;
2751*) dflt="$sitearch" ;;
2752esac
8e07c86e
AD
2753$cat <<EOM
2754
4633a7c4
LW
2755The installation process will also create a directory for
2756architecture-dependent site-specific extensions and modules.
8e07c86e
AD
2757
2758EOM
4633a7c4
LW
2759fn=nd~+
2760rp='Pathname for the site-specific architecture-dependent library files?'
8e07c86e 2761. ./getfile
4633a7c4
LW
2762if $test "X$sitearchexp" != "X$ansexp"; then
2763 installsitearch=''
8e07c86e 2764fi
4633a7c4
LW
2765sitearch="$ans"
2766sitearchexp="$ansexp"
8e07c86e
AD
2767if $afs; then
2768 $cat <<EOM
2769
2770Since you are running AFS, I need to distinguish the directory in which
2771private files reside from the directory in which they are installed (and from
2772which they are presumably copied to the former directory by occult means).
2773
2774EOM
4633a7c4
LW
2775 case "$installsitearch" in
2776 '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
2777 *) dflt="$installsitearch";;
8e07c86e
AD
2778 esac
2779 fn=de~
2780 rp='Where will private files be installed?'
2781 . ./getfile
4633a7c4 2782 installsitearch="$ans"
8e07c86e 2783else
4633a7c4 2784 installsitearch="$sitearchexp"
8e07c86e
AD
2785fi
2786
4633a7c4
LW
2787: determine where old public architecture dependent libraries might be
2788case "$oldarchlib" in
2789'') case "$privlib" in
2790 '') ;;
2791 *) dflt="$privlib/$archname"
8e07c86e 2792 ;;
8e07c86e
AD
2793 esac
2794 ;;
4633a7c4
LW
2795*) dflt="$oldarchlib"
2796 ;;
8e07c86e 2797esac
4633a7c4
LW
2798if $test ! -d "$dflt/auto"; then
2799 dflt=none
2800fi
8e07c86e
AD
2801cat <<EOM
2802
760ac839 2803In 5.001, Perl stored architecture-dependent library files in a directory
4633a7c4
LW
2804with a name such as $privlib/$archname,
2805and this directory contained files from the standard extensions and
2806files from any additional extensions you might have added. Starting
2807with version 5.002, all the architecture-dependent standard extensions
760ac839
LW
2808will go into a version-specific directory such as
2809$archlib,
4633a7c4
LW
2810while locally-added extensions will go into
2811$sitearch.
2812
2813If you wish Perl to continue to search the old architecture-dependent
2814library for your local extensions, give the path to that directory.
2815If you do not wish to use your old architecture-dependent library
2816files, answer 'none'.
8e07c86e
AD
2817
2818EOM
4633a7c4
LW
2819fn=dn~
2820rp='Directory for your old 5.001 architecture-dependent libraries?'
8e07c86e 2821. ./getfile
4633a7c4
LW
2822oldarchlib="$ans"
2823oldarchlibexp="$ansexp"
2824case "$oldarchlib" in
2825''|' ') val="$undef" ;;
2826*) val="$define" ;;
2827esac
2828set d_oldarchlib
2829eval $setvar
8e07c86e 2830
4633a7c4
LW
2831: determine where public executables go
2832echo " "
2833set dflt bin bin
2834eval $prefixit
2835fn=d~
2836rp='Pathname where the public executables will reside?'
2837. ./getfile
2838if $test "X$ansexp" != "X$binexp"; then
2839 installbin=''
2840fi
2841bin="$ans"
2842binexp="$ansexp"
8e07c86e
AD
2843if $afs; then
2844 $cat <<EOM
2845
2846Since you are running AFS, I need to distinguish the directory in which
4633a7c4 2847executables reside from the directory in which they are installed (and from
8e07c86e
AD
2848which they are presumably copied to the former directory by occult means).
2849
2850EOM
4633a7c4
LW
2851 case "$installbin" in
2852 '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
2853 *) dflt="$installbin";;
8e07c86e
AD
2854 esac
2855 fn=de~
4633a7c4 2856 rp='Where will public executables be installed?'
8e07c86e 2857 . ./getfile
4633a7c4 2858 installbin="$ans"
8e07c86e 2859else
4633a7c4 2860 installbin="$binexp"
8e07c86e
AD
2861fi
2862
2c7991dc
PP
2863: determine where manual pages are on this system
2864echo " "
2865case "$sysman" in
2866'')
2867 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
2868 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
2869 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
2870 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
2871 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
2872 sysman=`./loc . /usr/man/man1 $syspath`
2873 ;;
2874esac
2875if $test -d "$sysman"; then
2876 echo "System manual is in $sysman." >&4
2877else
2878 echo "Could not find manual pages in source form." >&4
2879fi
2880
8e07c86e
AD
2881: determine where manual pages go
2882set man1dir man1dir none
2883eval $prefixit
2884$cat <<EOM
2885
2886$spackage has manual pages available in source form.
2887EOM
2888case "$nroff" in
2889nroff)
2890 echo "However, you don't have nroff, so they're probably useless to you."
2891 case "$man1dir" in
2892 '') man1dir="none";;
2893 esac;;
2894esac
2895echo "If you don't want the manual sources installed, answer 'none'."
2896case "$man1dir" in
2c7991dc
PP
2897' ') dflt=none
2898 ;;
8e07c86e 2899'')
25f94b33
AD
2900 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
2901 lookpath="$lookpath $prefixexp/man/p_man/man1"
2902 lookpath="$lookpath $prefixexp/man/u_man/man1"
2c7991dc 2903 lookpath="$lookpath $prefixexp/man/man.1"
25f94b33
AD
2904 : If prefix contains 'perl' then we want to keep the man pages
2905 : under the prefix directory. Otherwise, look in a variety of
2906 : other possible places. This is debatable, but probably a
2c7991dc
PP
2907 : good compromise. Well, apparently not.
2908 : Experience has shown people expect man1dir to be under prefix,
2909 : so we now always put it there. Users who want other behavior
2910 : can answer interactively or use a command line option.
2911 : Does user have System V-style man paths.
2912 case "$sysman" in
2913 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
2914 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
25f94b33 2915 esac
8e07c86e
AD
2916 set dflt
2917 eval $prefixup
2918 ;;
8e07c86e
AD
2919*) dflt="$man1dir"
2920 ;;
2921esac
2922echo " "
4633a7c4 2923fn=dn+~
8e07c86e
AD
2924rp="Where do the main $spackage manual pages (source) go?"
2925. ./getfile
25f94b33 2926if $test "X$man1direxp" != "X$ansexp"; then
8e07c86e
AD
2927 installman1dir=''
2928fi
2929man1dir="$ans"
2930man1direxp="$ansexp"
2931case "$man1dir" in
2932'') man1dir=' '
2933 installman1dir='';;
2934esac
2935if $afs; then
2936 $cat <<EOM
2937
2938Since you are running AFS, I need to distinguish the directory in which
2939manual pages reside from the directory in which they are installed (and from
2940which they are presumably copied to the former directory by occult means).
2941
2942EOM
2943 case "$installman1dir" in
2944 '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
2945 *) dflt="$installman1dir";;
2946 esac
2947 fn=de~
2948 rp='Where will man pages be installed?'
2949 . ./getfile
2950 installman1dir="$ans"
2951else
2952 installman1dir="$man1direxp"
2953fi
2954
2955: What suffix to use on installed man pages
2956
2957case "$man1dir" in
2958' ')
2959 man1ext='0'
2960 ;;
2961*)
2962 rp="What suffix should be used for the main $spackage man pages?"
2c7991dc
PP
2963 case "$man1ext" in
2964 '') case "$man1dir" in
2965 *1) dflt=1 ;;
2966 *1p) dflt=1p ;;
2967 *1pm) dflt=1pm ;;
2968 *l) dflt=l;;
2969 *n) dflt=n;;
2970 *o) dflt=o;;
2971 *p) dflt=p;;
2972 *C) dflt=C;;
2973 *L) dflt=L;;
2974 *L1) dflt=L1;;
2975 *) dflt=1;;
2976 esac
2977 ;;
2978 *) dflt="$man1ext";;
8e07c86e
AD
2979 esac
2980 . ./myread
2981 man1ext="$ans"
2982 ;;
2983esac
2984
8e07c86e
AD
2985: see if we can have long filenames
2986echo " "
2987rmlist="$rmlist /tmp/cf$$"
2988$test -d /tmp/cf$$ || mkdir /tmp/cf$$
2989first=123456789abcdef
2990second=/tmp/cf$$/$first
2991$rm -f $first $second
2992if (echo hi >$first) 2>/dev/null; then
2993 if $test -f 123456789abcde; then
2994 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
2995 val="$undef"
2996 else
2997 if (echo hi >$second) 2>/dev/null; then
2998 if $test -f /tmp/cf$$/123456789abcde; then
2999 $cat <<'EOM'
3000That's peculiar... You can have filenames longer than 14 characters, but only
3001on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
3002I shall consider your system cannot support long filenames at all.
3003EOM
3004 val="$undef"
3005 else
3006 echo 'You can have filenames longer than 14 characters.' >&4
3007 val="$define"
3008 fi
3009 else
3010 $cat <<'EOM'
3011How confusing! Some of your filesystems are sane enough to allow filenames
3012longer than 14 characters but some others like /tmp can't even think about them.
3013So, for now on, I shall assume your kernel does not allow them at all.
3014EOM
3015 val="$undef"
3016 fi
3017 fi
3018else
3019 $cat <<'EOM'
3020You can't have filenames longer than 14 chars. You can't even think about them!
3021EOM
3022 val="$undef"
3023fi
3024set d_flexfnam
3025eval $setvar
3026$rm -rf /tmp/cf$$ 123456789abcde*
3027
3028: determine where library module manual pages go
3029set man3dir man3dir none
3030eval $prefixit
3031$cat <<EOM
3032
3033$spackage has manual pages for many of the library modules.
3034EOM
3035
3036case "$nroff" in
3037nroff)
3038 $cat <<'EOM'
3039However, you don't have nroff, so they're probably useless to you.
3040You can use the supplied perldoc script instead.
3041EOM
3042 case "$man3dir" in
3043 '') man3dir="none";;
3044 esac;;
3045esac
3046
3047case "$d_flexfnam" in
3048undef)
3049 $cat <<'EOM'
3050However, your system can't handle the long file names like File::Basename.3.
3051You can use the supplied perldoc script instead.
3052EOM
3053 case "$man3dir" in
3054 '') man3dir="none";;
3055 esac;;
3056esac
3057
3058echo "If you don't want the manual sources installed, answer 'none'."
4633a7c4
LW
3059: We dont use /usr/local/man/man3 because some man programs will
3060: only show the /usr/local/man/man3 contents, and not the system ones,
3061: thus man less will show the perl module less.pm, but not the system
3062: less command. We might also conflict with TCL man pages.
3063: However, something like /opt/perl/man/man3 is fine.
8e07c86e 3064case "$man3dir" in
4633a7c4 3065'') case "$prefix" in
2c7991dc
PP
3066 *perl*) dflt=`echo $man1dir |
3067 $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
4633a7c4
LW
3068 *) dflt="$privlib/man/man3" ;;
3069 esac
3070 ;;
8e07c86e
AD
3071' ') dflt=none;;
3072*) dflt="$man3dir" ;;
3073esac
3074echo " "
3075
4633a7c4 3076fn=dn+~
8e07c86e
AD
3077rp="Where do the $spackage library man pages (source) go?"
3078. ./getfile
3079if test "X$man3direxp" != "X$ansexp"; then
3080 installman3dir=''
3081fi
3082
3083man3dir="$ans"
3084man3direxp="$ansexp"
3085case "$man3dir" in
3086'') man3dir=' '
3087 installman3dir='';;
3088esac
3089if $afs; then
3090 $cat <<EOM
3091
3092Since you are running AFS, I need to distinguish the directory in which
3093manual pages reside from the directory in which they are installed (and from
3094which they are presumably copied to the former directory by occult means).
3095
3096EOM
3097 case "$installman3dir" in
3098 '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
3099 *) dflt="$installman3dir";;
3100 esac
3101 fn=de~
3102 rp='Where will man pages be installed?'
3103 . ./getfile
3104 installman3dir="$ans"
3105else
3106 installman3dir="$man3direxp"
3107fi
3108
3109: What suffix to use on installed man pages
3110
3111case "$man3dir" in
3112' ')
3113 man3ext='0'
3114 ;;
3115*)
3116 rp="What suffix should be used for the $spackage library man pages?"
2c7991dc
PP
3117 case "$man3ext" in
3118 '') case "$man3dir" in
3119 *3) dflt=3 ;;
3120 *3p) dflt=3p ;;
3121 *3pm) dflt=3pm ;;
3122 *l) dflt=l;;
3123 *n) dflt=n;;
3124 *o) dflt=o;;
3125 *p) dflt=p;;
3126 *C) dflt=C;;
3127 *L) dflt=L;;
3128 *L3) dflt=L3;;
3129 *) dflt=3;;
3130 esac
3131 ;;
3132 *) dflt="$man3ext";;
8e07c86e
AD
3133 esac
3134 . ./myread
3135 man3ext="$ans"
3136 ;;
3137esac
3138
4633a7c4
LW
3139: see what memory models we can support
3140case "$models" in
3141'')
3142 $cat >pdp11.c <<'EOP'
3143main() {
3144#ifdef pdp11
3145 exit(0);
3146#else
3147 exit(1);
3148#endif
3149}
3150EOP
3151 cc -o pdp11 pdp11.c >/dev/null 2>&1
3152 if ./pdp11 2>/dev/null; then
3153 dflt='unsplit split'
3154 else
3155 tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
3156 case "$tans" in
3157 X) dflt='none';;
3158 *) if $test -d /lib/small || $test -d /usr/lib/small; then
3159 dflt='small'
3160 else
3161 dflt=''
3162 fi
3163 if $test -d /lib/medium || $test -d /usr/lib/medium; then
3164 dflt="$dflt medium"
3165 fi
3166 if $test -d /lib/large || $test -d /usr/lib/large; then
3167 dflt="$dflt large"
3168 fi
3169 if $test -d /lib/huge || $test -d /usr/lib/huge; then
3170 dflt="$dflt huge"
3171 fi
3172 esac
3173 fi;;
3174*) dflt="$models";;
8e07c86e 3175esac
4633a7c4
LW
3176$cat <<EOM
3177
3178Some systems have different model sizes. On most systems they are called
3179small, medium, large, and huge. On the PDP11 they are called unsplit and
3180split. If your system doesn't support different memory models, say "none".
3181If you wish to force everything to one memory model, say "none" here and
3182put the appropriate flags later when it asks you for other cc and ld flags.
3183Venix systems may wish to put "none" and let the compiler figure things out.
3184(In the following question multiple model names should be space separated.)
8e07c86e 3185
4633a7c4
LW
3186EOM
3187rp="Which memory models are supported?"
8e07c86e 3188. ./myread
4633a7c4 3189models="$ans"
8e07c86e 3190
4633a7c4
LW
3191case "$models" in
3192none)
3193 small=''
3194 medium=''
3195 large=''
3196 huge=''
3197 unsplit=''
3198 split=''
3199 ;;
3200*split)
3201 case "$split" in
3202 '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
3203 $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
3204 dflt='-i'
3205 else
3206 dflt='none'
3207 fi;;
3208 *) dflt="$split";;
8e07c86e 3209 esac
4633a7c4
LW
3210 rp="What flag indicates separate I and D space?"
3211 . ./myread
3212 tans="$ans"
3213 case "$tans" in
3214 none) tans='';;
8e07c86e 3215 esac
4633a7c4
LW
3216 split="$tans"
3217 unsplit='';;
3218*large*|*small*|*medium*|*huge*)
3219 case "$models" in
3220 *large*)
3221 case "$large" in
3222 '') dflt='-Ml';;
3223 *) dflt="$large";;
3224 esac
3225 rp="What flag indicates large model?"
3226 . ./myread
3227 tans="$ans"
3228 case "$tans" in
3229 none) tans='';
3230 esac
3231 large="$tans";;
3232 *) large='';;
8e07c86e 3233 esac
4633a7c4
LW
3234 case "$models" in
3235 *huge*) case "$huge" in
3236 '') dflt='-Mh';;
3237 *) dflt="$huge";;
3238 esac
3239 rp="What flag indicates huge model?"
3240 . ./myread
3241 tans="$ans"
3242 case "$tans" in
3243 none) tans='';
3244 esac
3245 huge="$tans";;
3246 *) huge="$large";;
3247 esac
3248 case "$models" in
3249 *medium*) case "$medium" in
3250 '') dflt='-Mm';;
3251 *) dflt="$medium";;
3252 esac
3253 rp="What flag indicates medium model?"
3254 . ./myread
3255 tans="$ans"
3256 case "$tans" in
3257 none) tans='';
3258 esac
3259 medium="$tans";;
3260 *) medium="$large";;
3261 esac
3262 case "$models" in
3263 *small*) case "$small" in
3264 '') dflt='none';;
3265 *) dflt="$small";;
3266 esac
3267 rp="What flag indicates small model?"
3268 . ./myread
3269 tans="$ans"
3270 case "$tans" in
3271 none) tans='';
3272 esac
3273 small="$tans";;
3274 *) small='';;
3275 esac
3276 ;;
3277*)
3278 echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
8e07c86e
AD
3279 ;;
3280esac
3281
2c7991dc 3282: see if we need a special compiler
16d20bd9 3283echo " "
4633a7c4
LW
3284if ./usg; then
3285 case "$cc" in
3286 '') case "$Mcc" in
3287 /*) dflt='Mcc';;
3288 *) case "$large" in
3289 -M*) dflt='cc';;
3290 *) if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
3291 if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
3292 dflt='cc'
3293 else
3294 dflt='cc -M'
3295 fi
3296 else
3297 dflt='cc'
3298 fi;;
3299 esac;;
3300 esac;;
3301 *) dflt="$cc";;
3302 esac
3303 $cat <<'EOM'
3304On some systems the default C compiler will not resolve multiple global
3305references that happen to have the same name. On some such systems the "Mcc"
3306command may be used to force these to be resolved. On other systems a "cc -M"
3307command is required. (Note that the -M flag on other systems indicates a
3308memory model to use!) If you have the Gnu C compiler, you might wish to use
3309that instead.
16d20bd9
AD
3310
3311EOM
4633a7c4
LW
3312 rp="What command will force resolution on this system?"
3313 . ./myread
3314 cc="$ans"
16d20bd9 3315else
4633a7c4
LW
3316 case "$cc" in
3317 '') dflt=cc;;
3318 *) dflt="$cc";;
3319 esac
3320 rp="Use which C compiler?"
3321 . ./myread
3322 cc="$ans"
16d20bd9 3323fi
4633a7c4
LW
3324echo " "
3325echo "Checking for GNU cc in disguise and/or its version number..." >&4
3326$cat >gccvers.c <<EOM
3327#include <stdio.h>
3328int main() {
3329#ifdef __GNUC__
3330#ifdef __VERSION__
3331 printf("%s\n", __VERSION__);
3332#else
3333 printf("%s\n", "1");
3334#endif
3335#endif
3336 exit(0);
3337}
3338EOM
3339if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
3340 gccversion=`./gccvers`
3341 case "$gccversion" in
3342 '') echo "You are not using GNU cc." ;;
3343 *) echo "You are using GNU cc $gccversion." ;;
16d20bd9 3344 esac
4633a7c4 3345else
16d20bd9 3346 echo " "
4633a7c4
LW
3347 echo "*** WHOA THERE!!! ***" >&4
3348 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3349 case "$knowitall" in
3350 '')
3351 echo " You'd better start hunting for one and let me know about it." >&4
16d20bd9
AD
3352 exit 1
3353 ;;
3354 esac
4633a7c4
LW
3355fi
3356$rm -f gccvers*
3357case "$gccversion" in
33581*) cpp=`./loc gcc-cpp $cpp $pth` ;;
16d20bd9 3359esac
16d20bd9 3360
4633a7c4 3361: What should the include directory be ?
2304df62 3362echo " "
4633a7c4
LW
3363$echo $n "Hmm... $c"
3364dflt='/usr/include'
3365incpath=''
3366mips_type=''
3367if $test -f /bin/mips && /bin/mips; then
3368 echo "Looks like a MIPS system..."
3369 $cat >usr.c <<'EOCP'
3370#ifdef SYSTYPE_BSD43
3371/bsd43
3372#endif
3373EOCP
3374 if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3375 dflt='/bsd43/usr/include'
3376 incpath='/bsd43'
3377 mips_type='BSD 4.3'
2304df62 3378 else
4633a7c4 3379 mips_type='System V'
2304df62 3380 fi
4633a7c4
LW
3381 $rm -f usr.c usr.out
3382 echo "and you're compiling with the $mips_type compiler and libraries."
3383 xxx_prompt=y
3384 echo "exit 0" >mips
3385else
2c7991dc
PP
3386 echo "Doesn't look like a MIPS system."
3387 xxx_prompt=n
3388 echo "exit 1" >mips
3389fi
3390chmod +x mips
3391$eunicefix mips
3392echo " "
3393case "$usrinc" in
3394'') ;;
3395*) dflt="$usrinc";;
3396esac
3397case "$xxx_prompt" in
3398y) fn=d/
3399 rp='Where are the include files you want to use?'
3400 . ./getfile
3401 usrinc="$ans"
3402 ;;
3403*) usrinc="$dflt"
3404 ;;
3405esac
3406
3407: see if we have to deal with yellow pages, now NIS.
3408if $test -d /usr/etc/yp || $test -d /etc/yp; then
3409 if $test -f /usr/etc/nibindd; then
3410 echo " "
3411 echo "I'm fairly confident you're on a NeXT."
3412 echo " "
3413 rp='Do you get the hosts file via NetInfo?'
3414 dflt=y
3415 case "$hostcat" in
3416 nidump*) ;;
3417 '') ;;
3418 *) dflt=n;;
3419 esac
3420 . ./myread
3421 case "$ans" in
3422 y*) hostcat='nidump hosts .';;
3423 *) case "$hostcat" in
3424 nidump*) hostcat='';;
3425 esac
3426 ;;
3427 esac
3428 fi
3429 case "$hostcat" in
3430 nidump*) ;;
3431 *)
3432 case "$hostcat" in
3433 *ypcat*) dflt=y;;
3434 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
3435 dflt=y
3436 else
3437 dflt=n
3438 fi;;
3439 *) dflt=n;;
3440 esac
3441 echo " "
3442 rp='Are you getting the hosts file via yellow pages?'
3443 . ./myread
3444 case "$ans" in
3445 y*) hostcat='ypcat hosts';;
3446 *) hostcat='cat /etc/hosts';;
3447 esac
3448 ;;
3449 esac
3450fi
3451
3452: now get the host name
3453echo " "
3454echo "Figuring out host name..." >&4
3455case "$myhostname" in
3456'') cont=true
3457 echo 'Maybe "hostname" will work...'
3458 if tans=`sh -c hostname 2>&1` ; then
3459 myhostname=$tans
3460 phostname=hostname
3461 cont=''
3462 fi
3463 ;;
3464*) cont='';;
3465esac
3466if $test "$cont"; then
3467 if ./xenix; then
3468 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
3469 if tans=`cat /etc/systemid 2>&1` ; then
3470 myhostname=$tans
3471 phostname='cat /etc/systemid'
3472 echo "Whadyaknow. Xenix always was a bit strange..."
3473 cont=''
3474 fi
3475 elif $test -r /etc/systemid; then
3476 echo "(What is a non-Xenix system doing with /etc/systemid?)"
3477 fi
3478fi
3479if $test "$cont"; then
3480 echo 'No, maybe "uuname -l" will work...'
3481 if tans=`sh -c 'uuname -l' 2>&1` ; then
3482 myhostname=$tans
3483 phostname='uuname -l'
3484 else
3485 echo 'Strange. Maybe "uname -n" will work...'
3486 if tans=`sh -c 'uname -n' 2>&1` ; then
3487 myhostname=$tans
3488 phostname='uname -n'
3489 else
3490 echo 'Oh well, maybe I can mine it out of whoami.h...'
3491 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
3492 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
3493 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
3494 else
3495 case "$myhostname" in
3496 '') echo "Does this machine have an identity crisis or something?"
3497 phostname='';;
3498 *)
3499 echo "Well, you said $myhostname before..."
3500 phostname='echo $myhostname';;
3501 esac
3502 fi
3503 fi
3504 fi
3505fi
3506: you do not want to know about this
3507set $myhostname
3508myhostname=$1
3509
3510: verify guess
3511if $test "$myhostname" ; then
3512 dflt=y
3513 rp='Your host name appears to be "'$myhostname'".'" Right?"
3514 . ./myread
3515 case "$ans" in
3516 y*) ;;
3517 *) myhostname='';;
3518 esac
3519fi
3520
3521: bad guess or no guess
3522while $test "X$myhostname" = X ; do
3523 dflt=''
3524 rp="Please type the (one word) name of your host:"
3525 . ./myread
3526 myhostname="$ans"
3527done
3528
3529: translate upper to lower if necessary
3530case "$myhostname" in
3531*[A-Z]*)
3532 echo "(Normalizing case in your host name)"
3533 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
3534 ;;
3535esac
3536
3537case "$myhostname" in
3538*.*)
3539 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
3540 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
3541 echo "(Trimming domain name from host name--host name is now $myhostname)"
3542 ;;
3543*) case "$mydomain" in
3544 '')
3545 {
3546 : If we use NIS, try ypmatch.
3547 : Is there some reason why this was not done before?
3548 test "X$hostcat" = "Xypcat hosts" &&
3549 ypmatch "$myhostname" hosts 2>/dev/null |\
3550 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
3551 $test -s hosts
3552 } || {
3553 : Extract only the relevant hosts, reducing file size,
3554 : remove comments, insert trailing space for later use.
3555 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
3556 /[ ]$myhostname[ . ]/p" > hosts
3557 }
3558 tmp_re="[ . ]"
3559 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
3560 END { print sum }" hosts` = x1 || tmp_re="[ ]"
3561 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
3562 hosts | $sort | $uniq | \
3563 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
3564 case `$echo X$dflt` in
3565 X*\ *) echo "(Several hosts in /etc/hosts matched hostname)"
3566 dflt=.
3567 ;;
8ff267be 3568 X.) echo "(You do not have fully-qualified names in /etc/hosts)"
2c7991dc
PP
3569 ;;
3570 esac
3571 case "$dflt" in
3572 .)
3573 tans=`./loc resolv.conf X /etc /usr/etc`
3574 if $test -f "$tans"; then
3575 echo "(Attempting domain name extraction from $tans)"
3576 : Why was there an Egrep here, when Sed works?
3577 dflt=.`$sed -n -e 's/^domain[ ]*\(.*\)/\1/p' $tans \
3578 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
3579 fi
3580 ;;
3581 esac
3582 case "$dflt" in
3583 .) echo "(No help from resolv.conf either -- attempting clever guess)"
3584 dflt=.`sh -c domainname 2>/dev/null`
3585 case "$dflt" in
3586 '') dflt='.';;
3587 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
3588 esac
3589 ;;
3590 esac
3591 case "$dflt" in
3592 .) echo "(Lost all hope -- silly guess then)"
3593 dflt='.uucp'
3594 ;;
3595 esac
3596 $rm -f hosts
3597 ;;
3598 *) dflt="$mydomain";;
3599 esac;;
3600esac
3601echo " "
3602rp="What is your domain name?"
3603. ./myread
3604tans="$ans"
3605case "$ans" in
3606'') ;;
3607.*) ;;
3608*) tans=".$tans";;
3609esac
3610mydomain="$tans"
3611
3612: translate upper to lower if necessary
3613case "$mydomain" in
3614*[A-Z]*)
3615 echo "(Normalizing case in your domain name)"
3616 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
3617 ;;
3618esac
3619
3620: a little sanity check here
3621case "$phostname" in
3622'') ;;
3623*)
3624 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
3625 $myhostname$mydomain|$myhostname) ;;
3626 *)
3627 case "$phostname" in
3628 sed*)
3629 echo "(That doesn't agree with your whoami.h file, by the way.)"
3630 ;;
3631 *)
3632 echo "(That doesn't agree with your $phostname command, by the way.)"
3633 ;;
3634 esac
3635 ;;
3636 esac
3637 ;;
3638esac
3639
3640$cat <<EOM
3641
3642I need to get your e-mail address in Internet format if possible, i.e.
3643something like user@host.domain. Please answer accurately since I have
3644no easy means to double check it. The default value provided below
3645is most probably close to the reality but may not be valid from outside
3646your organization...
3647
3648EOM
3649cont=x
3650while test "$cont"; do
3651 case "$cf_email" in
3652 '') dflt="$cf_by@$myhostname$mydomain";;
3653 *) dflt="$cf_email";;
3654 esac
3655 rp='What is your e-mail address?'
3656 . ./myread
3657 cf_email="$ans"
3658 case "$cf_email" in
3659 *@*.*) cont='' ;;
3660 *)
3661 rp='Address does not look like an Internet one. Use it anyway?'
3662 case "$fastread" in
3663 yes) dflt=y ;;
3664 *) dflt=n ;;
3665 esac
3666 . ./myread
3667 case "$ans" in
3668 y*) cont='' ;;
3669 *) echo " " ;;
3670 esac
3671 ;;
3672 esac
3673done
3674
3675$cat <<EOM
3676
3677If you or somebody else will be maintaining perl at your site, please
3678fill in the correct e-mail address here so that they may be contacted
3679if necessary. Currently, the "perlbug" program included with perl
3680will send mail to this address in addition to perlbug@perl.com. You may
3681enter "none" for no administrator.
3682
3683EOM
3684case "$perladmin" in
3685'') dflt="$cf_email";;
3686*) dflt="$perladmin";;
3687esac
3688rp='Perl administrator e-mail address'
3689. ./myread
3690perladmin="$ans"
3691
3692: determine where public executable scripts go
3693set scriptdir scriptdir
3694eval $prefixit
3695case "$scriptdir" in
3696'')
3697 dflt="$bin"
3698 : guess some guesses
3699 $test -d /usr/share/scripts && dflt=/usr/share/scripts
3700 $test -d /usr/share/bin && dflt=/usr/share/bin
3701 $test -d /usr/local/script && dflt=/usr/local/script
3702 $test -d $prefixexp/script && dflt=$prefixexp/script
3703 set dflt
3704 eval $prefixup
3705 ;;
3706*) dflt="$scriptdir"
3707 ;;
3708esac
3709$cat <<EOM
3710
3711Some installations have a separate directory just for executable scripts so
3712that they can mount it across multiple architectures but keep the scripts in
3713one spot. You might, for example, have a subdirectory of /usr/share for this.
3714Or you might just lump your scripts in with all your other executables.
3715
3716EOM
3717fn=d~
3718rp='Where do you keep publicly executable scripts?'
3719. ./getfile
3720if $test "X$ansexp" != "X$scriptdirexp"; then
3721 installscript=''
3722fi
3723scriptdir="$ans"
3724scriptdirexp="$ansexp"
3725if $afs; then
3726 $cat <<EOM
3727
3728Since you are running AFS, I need to distinguish the directory in which
3729scripts reside from the directory in which they are installed (and from
3730which they are presumably copied to the former directory by occult means).
3731
3732EOM
3733 case "$installscript" in
3734 '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
3735 *) dflt="$installscript";;
3736 esac
3737 fn=de~
3738 rp='Where will public scripts be installed?'
3739 . ./getfile
3740 installscript="$ans"
3741else
3742 installscript="$scriptdirexp"
4633a7c4 3743fi
2c7991dc
PP
3744
3745: determine perl absolute location
3746case "$perlpath" in
3747'') perlpath=$binexp/perl ;;
2304df62 3748esac
2c7991dc
PP
3749
3750: figure out how to guarantee perl startup
3751case "$startperl" in
3752'')
3753 case "$sharpbang" in
3754 *!)
3755 $cat <<EOH
3756
3757I can use the #! construct to start perl on your system. This will
3758make startup of perl scripts faster, but may cause problems if you
3759want to share those scripts and perl is not in a standard place
3760($perlpath) on all your platforms. The alternative is to force
3761a shell by starting the script with a single ':' character.
3762
3763EOH
3764 dflt=$perlpath
3765 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
3766 . ./myread
3767 case "$ans" in
3768 none) startperl=": # use perl";;
3769 *) startperl="#!$ans";;
3770 esac
3771 ;;
3772 *) startperl=": # use perl"
3773 ;;
3774 esac
2304df62
AD
3775 ;;
3776esac
2c7991dc 3777echo "I'll use $startperl to start perl scripts."
2304df62 3778
8ff267be
PP
3779cat <<EOM
3780
3781Previous version of $package used the standard IO mechanisms as defined in
3782<stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
3783mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
3784the default and is the only supported mechanism. This abstraction
3785layer can use AT&T's sfio (if you already have sfio installed) or
3786fall back on standard IO. This PerlIO abstraction layer is
3787experimental and may cause problems with some extension modules.
3788
3789If this doesn't make any sense to you, just accept the default 'n'.
3790EOM
3791case "$useperlio" in
3792$define|true|[yY]*) dflt='y';;
3793*) dflt='n';;
3794esac
3795rp='Use the experimental PerlIO abstraction layer?'
3796. ./myread
3797case "$ans" in
3798y|Y)
3799 val="$define"
3800 ;;
3801*)
3802 echo "Ok, doing things the stdio way"
3803 val="$undef"
3804 ;;
3805esac
3806set useperlio
3807eval $setvar
3808
4633a7c4 3809: see how we invoke the C preprocessor
2304df62 3810echo " "
4633a7c4
LW
3811echo "Now, how can we feed standard input to your C preprocessor..." >&4
3812cat <<'EOT' >testcpp.c
3813#define ABC abc
3814#define XYZ xyz
3815ABC.XYZ
3816EOT
3817cd ..
3818echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3819chmod 755 cppstdin
3820wrapper=`pwd`/cppstdin
3821ok='false'
3822cd UU
3823
3824if $test "X$cppstdin" != "X" && \
3825 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3826 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3827then
3828 echo "You used to use $cppstdin $cppminus so we'll use that again."
3829 case "$cpprun" in
3830 '') echo "But let's see if we can live without a wrapper..." ;;
3831 *)
3832 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3834 then
3835 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3836 ok='true'
a0d0e21e 3837 else
4633a7c4 3838 echo "(However, $cpprun $cpplast does not work, let's see...)"
2304df62 3839 fi
2304df62 3840 ;;
2304df62 3841 esac
4633a7c4
LW
3842else
3843 case "$cppstdin" in
3844 '') ;;
3845 *)
3846 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3847 ;;
3848 esac
3849fi
3850
3851if $ok; then
3852 : nothing
3853elif echo '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"' -E -" will work...'; \
3860 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3861 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3862 echo "Yup, it does."
3863 x_cpp="$cc -E"
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 "Yipee, that works!"
3869 x_cpp="$cc -P"
3870 x_minus='';
3871elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3872 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3873 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3874 echo "At long last!"
3875 x_cpp="$cc -P"
3876 x_minus='-';
3877elif echo 'No such luck, 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 "It works!"
3881 x_cpp="$cpp"
3882 x_minus='';
3883elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3884 $cpp - <testcpp.c >testcpp.out 2>&1; \
3885 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3886 echo "Hooray, it works! I was beginning to wonder."
3887 x_cpp="$cpp"
3888 x_minus='-';
3889elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3890 $wrapper <testcpp.c >testcpp.out 2>&1; \
3891 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3892 x_cpp="$wrapper"
3893 x_minus=''
3894 echo "Eureka!"
3895else
3896 dflt=''
3897 rp="No dice. I can't find a C preprocessor. Name one:"
3898 . ./myread
3899 x_cpp="$ans"
3900 x_minus=''
3901 $x_cpp <testcpp.c >testcpp.out 2>&1
3902 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3903 echo "OK, that will do." >&4
3904 else
3905echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3906 exit 1
3907 fi
3908fi
3909
3910case "$ok" in
3911false)
3912 cppstdin="$x_cpp"
3913 cppminus="$x_minus"
3914 cpprun="$x_cpp"
3915 cpplast="$x_minus"
3916 set X $x_cpp
3917 shift
3918 case "$1" in
3919 "$cpp")
3920 echo "Perhaps can we force $cc -E using a wrapper..."
3921 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3922 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3923 then
3924 echo "Yup, we can."
3925 cppstdin="$wrapper"
3926 cppminus='';
3927 else
3928 echo "Nope, we'll have to live without it..."
3929 fi
3930 ;;
3931 esac
3932 case "$cpprun" in
3933 "$wrapper")
3934 cpprun=''
3935 cpplast=''
3936 ;;
3937 esac
3938 ;;
3939esac
3940
3941case "$cppstdin" in
3942"$wrapper") ;;
3943*) $rm -f $wrapper;;
3944esac
3945$rm -f testcpp.c testcpp.out
3946
3947: Set private lib path
3948case "$plibpth" in
3949'') if ./mips; then
3950 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3951 fi;;
3952esac
3953case "$libpth" in
3954' ') dlist='';;
3955'') dlist="$loclibpth $plibpth $glibpth";;
3956*) dlist="$libpth";;
3957esac
3958
3959: Now check and see which directories actually exist, avoiding duplicates
3960libpth=''
3961for xxx in $dlist
3962do
3963 if $test -d $xxx; then
3964 case " $libpth " in
3965 *" $xxx "*) ;;
3966 *) libpth="$libpth $xxx";;
3967 esac
3968 fi
3969done
3970$cat <<'EOM'
3971
3972Some systems have incompatible or broken versions of libraries. Among
3973the directories listed in the question below, please remove any you
3974know not to be holding relevant libraries, and add any that are needed.
3975Say "none" for none.
3976
3977EOM
3978case "$libpth" in
3979'') dflt='none';;
3980*)
3981 set X $libpth
3982 shift
3983 dflt=${1+"$@"}
3984 ;;
3985esac
3986rp="Directories to use for library searches?"
3987. ./myread
3988case "$ans" in
3989none) libpth=' ';;
3990*) libpth="$ans";;
3991esac
3992
3993: determine optimize, if desired, or use for debug flag also
3994case "$optimize" in
3995' ') dflt='none';;
3996'') dflt='-O';;
3997*) dflt="$optimize";;
3998esac
3999$cat <<EOH
4000
760ac839 4001Some C compilers have problems with their optimizers. By default, $package
4633a7c4
LW
4002compiles with the -O flag to use the optimizer. Alternately, you might want
4003to use the symbolic debugger, which uses the -g flag (on traditional Unix
4004systems). Either flag can be specified here. To use neither flag, specify
4005the word "none".
4006
4007EOH
4008rp="What optimizer/debugger flag should be used?"
4009. ./myread
4010optimize="$ans"
4011case "$optimize" in
4012'none') optimize=" ";;
4013esac
4014
4015dflt=''
25f94b33
AD
4016: We will not override a previous value, but we might want to
4017: augment a hint file
4018case "$hint" in
4019none|recommended)
4633a7c4
LW
4020 case "$gccversion" in
4021 1*) dflt='-fpcc-struct-return' ;;
4022 esac
4023 case "$optimize" in
4024 *-g*) dflt="$dflt -DDEBUGGING";;
4025 esac
4026 case "$gccversion" in
4027 2*) if test -d /etc/conf/kconfig.d &&
4028 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4029 then
4030 dflt="$dflt -posix"
4031 fi
4032 ;;
4033 esac
4034 ;;
4035esac
4036
4037case "$mips_type" in
4038*BSD*|'') inclwanted="$locincpth $usrinc";;
4039*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4040esac
4041for thisincl in $inclwanted; do
4042 if $test -d $thisincl; then
4043 if $test x$thisincl != x$usrinc; then
4044 case "$dflt" in
4045 *$thisincl*);;
4046 *) dflt="$dflt -I$thisincl";;
4047 esac
4048 fi
4049 fi
4050done
4051
4052inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4053 xxx=true;
4054elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4055 xxx=true;
4056else
4057 xxx=false;
4058fi;
4059if $xxx; then
4060 case "$dflt" in
4061 *$2*);;
4062 *) dflt="$dflt -D$2";;
4063 esac;
4064fi'
4065
4066if ./osf1; then
4067 set signal.h __LANGUAGE_C__; eval $inctest
4068else
4069 set signal.h LANGUAGE_C; eval $inctest
4070fi
4071set signal.h NO_PROTOTYPE; eval $inctest
4072set signal.h _NO_PROTO; eval $inctest
4073
25f94b33
AD
4074case "$hint" in
4075none|recommended) dflt="$ccflags $dflt" ;;
4633a7c4
LW
4076*) dflt="$ccflags";;
4077esac
25f94b33
AD
4078
4079case "$dflt" in
4080''|' ') dflt=none;;
4081esac
4633a7c4
LW
4082$cat <<EOH
4083
4084Your C compiler may want other flags. For this question you should include
4085-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4086but you should NOT include libraries or ld flags like -lwhatever. If you
4087want $package to honor its debug switch, you should include -DDEBUGGING here.
4088Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
4089-DHIDEMYMALLOC or -DCRIPPLED_CC.
4090
4091To use no flags, specify the word "none".
4092
4093EOH
4094set X $dflt
4095shift
4096dflt=${1+"$@"}
4097rp="Any additional cc flags?"
4098. ./myread
4099case "$ans" in
4100none) ccflags='';;
4101*) ccflags="$ans";;
4102esac
4103
4104: the following weeds options from ccflags that are of no interest to cpp
4105cppflags="$ccflags"
4106case "$gccversion" in
41071*) cppflags="$cppflags -D__GNUC__"
4108esac
4109case "$mips_type" in
4110'');;
4111*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4112esac
4113case "$cppflags" in
4114'');;
4115*)
4116 echo " "
4117 echo "Let me guess what the preprocessor flags are..." >&4
4118 set X $cppflags
4119 shift
4120 cppflags=''
4121 $cat >cpp.c <<'EOM'
4122#define BLURFL foo
4123
4124BLURFL xx LFRULB
4125EOM
4126 previous=''
4127 for flag in $*
4128 do
4129 case "$flag" in
4130 -*) ftry="$flag";;
4131 *) ftry="$previous $flag";;
4132 esac
4133 if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
4134 >cpp1.out 2>/dev/null && \
4135 $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
4136 >cpp2.out 2>/dev/null && \
4137 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4138 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4139 then
4140 cppflags="$cppflags $ftry"
4141 previous=''
4142 else
4143 previous="$flag"
4144 fi
4145 done
4146 set X $cppflags
4147 shift
4148 cppflags=${1+"$@"}
4149 case "$cppflags" in
4150 *-*) echo "They appear to be: $cppflags";;
4151 esac
4152 $rm -f cpp.c cpp?.out
4153 ;;
4154esac
4155
4156: flags used in final linking phase
4157
4158case "$ldflags" in
4159'') if ./venix; then
4160 dflt='-i -z'
4161 else
4162 dflt=''
4163 fi
4164 case "$ccflags" in
4165 *-posix*) dflt="$dflt -posix" ;;
4166 esac
4167 ;;
4168*) dflt="$ldflags";;
4169esac
4170
4171: Try to guess additional flags to pick up local libraries.
4172for thislibdir in $libpth; do
4173 case " $loclibpth " in
4174 *" $thislibdir "*)
4175 case "$dflt " in
25f94b33 4176 *"-L$thislibdir "*) ;;
4633a7c4
LW
4177 *) dflt="$dflt -L$thislibdir" ;;
4178 esac
4179 ;;
4180 esac
4181done
4182
4183case "$dflt" in
4184'') dflt='none' ;;
4185esac
4186
4187$cat <<EOH
4188
4189Your C linker may need flags. For this question you should
4190include -L/whatever and any other flags used by the C linker, but you
4191should NOT include libraries like -lwhatever.