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