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