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