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