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