home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-22 | 22.7 KB | 1,001 lines |
- #!/bin/sh
- #
- # If these # comments don't work, trim them. Don't worry about the other
- # shell scripts, Configure will trim # comments from them for you.
- #
- # $Header: Configure,v 4.3.3.3 91/01/16 02:00:36 davison Trn $
- #
- # $Log: Configure,v $
- # Revision 4.3.3.3 91/01/16 02:00:36 davison
- # Integrated rn patches 48-54 and tweaked sitename handling.
- #
- # Revision 4.3.3.2 90/08/20 16:09:59 davison
- # Added MMDF support, revised sitename/domain/signal/tzset/PATH.
- #
- # Revision 4.3.3.1 90/07/24 21:56:31 davison
- # Initial Trn Release
- #
- # Revision 4.3.2.37 90/12/30 03:46:54 sob
- # Changed "hidden" to "hiddennet" to be like nntp and bnews.
- # Made it possible to cancel articles if hiddennet is defined.
- #
- # Revision 4.3.2.36 90/12/30 03:31:17 sob
- # Better NeXT support and some other problems corrected.
- #
- # Revision 4.3.2.35 90/12/04 02:51:20 sob
- # Removed redundant "addcflags" label
- #
- # Revision 4.3.2.34 90/11/22 17:49:31 sob
- # Fixed bug in "hidden" code.
- #
- # Revision 4.3.2.33 90/11/22 13:42:44 sob
- # Added support for the Uniq System V.3 OS (courtesy of a3@rivm.nl &
- # frans@rivm.nl).
- # Added support for making all mail and news appear to come from the domain
- # itself instead of individual hosts within a domain.
- #
- # Revision 4.3.2.32 90/11/22 13:30:37 sob
- # Fixes to make using the supplied ndir.c work correctly.
- # Fixes to make building rn on an Apollo work correctly.
- #
- # Revision 4.3.2.31 90/11/10 00:08:08 sob
- # This one appears to work for Interactive Unix.
- #
- # Revision 4.3.2.30 90/11/09 23:29:16 sob
- # Added a few line for making rrn under Interactive Unix easier.
- #
- # Revision 4.3.2.29 90/11/05 23:26:21 sob
- # Added detection of /usr/include/sys/ptem.h for more recent versions
- # of System V.
- #
- # Revision 4.3.2.28 90/11/04 03:35:01 sob
- # Added better detection for getwd() and getcwd(). This will hopefully be
- # the last hurrah of this problem (naive, aren't I?)
- #
- # Revision 4.3.2.27 90/10/06 11:54:56 sob
- # Added check for memcpy/bcopy.
- #
- # Revision 4.3.2.26 90/10/01 01:39:43 sob
- # Altered the FLAGS for SCO Xenix 286. The old one are commented out. Let's
- # see if this works better.
- #
- # Revision 4.3.2.25 90/05/12 17:34:53 sob
- # Still more XENIX fixes and fixes for using socketlib when rrn and not when
- # just rn.
- #
- # Revision 4.3.2.24 90/05/12 14:07:43 sob
- # Fixed up LDFLAGS for xenix 286
- #
- # Revision 4.3.2.23 90/05/04 00:42:31 sob
- # Fixes for Pyramids, more on the return value of signal() and
- # syncing up the use of socketlib.
- #
- # Revision 4.3.2.22 90/04/17 15:44:24 sob
- # Added better directory structure detection.
- #
- # Revision 4.3.2.21 90/04/14 19:36:38 sob
- # Added better support for the NeXT.
- #
- # Revision 4.3.2.20 90/04/14 01:53:36 sob
- # Spelling Problem!
- #
- # Revision 4.3.2.19 90/03/17 21:33:21 sob
- # Reworked VOIDSIG into SIGRET.
- #
- # Revision 4.3.2.18 90/03/17 17:45:25 sob
- # Changes to detect when to use termio and when not to.
- #
- # Revision 4.3.2.17 90/03/17 16:53:11 sob
- # Applied a patch to correctly determine being on a Sun running OS 4.0 or
- # later.
- #
- # Revision 4.3.2.16 89/12/20 23:20:38 sob
- # Added hp-ux support suggested by tml@hemuli.atk.vtt.fi. Also,
- # corrected some bugs reported by tml@hemuli.atk.vtt.fi.
- #
- # Revision 4.3.2.15 89/12/18 00:02:04 sob
- # Fixed bug reported by Jim Thompson <jthomp@sun.com> on the
- # use of ypmatch against the so-called services.byname YP map.
- # Sigh. Will YP EVER work?
- #
- # Revision 4.3.2.14 89/12/17 12:55:39 sob
- # Minor bug fix to yp detection code.
- #
- # Revision 4.3.2.13 89/12/17 01:53:21 sob
- # Changed from using ypcat to using ypmatch
- #
- # Revision 4.3.2.12 89/12/15 19:35:20 sob
- # getpwent was not getting defined when YP is present.
- # bug reported by dglo@ads.com
- #
- # Revision 4.3.2.11 89/12/13 00:42:59 sob
- # Included suggested patches by weening@gang-of-four.stanford.edu.
- #
- # Revision 4.3.2.10 89/12/09 01:47:49 sob
- # Configure now removes myread when exiting.
- #
- # Revision 4.3.2.9 89/12/08 22:41:14 sob
- # Added minor changes suggested by weening@Gang-of-Four.Stanford.EDU and
- # jik@pit-manager.mit.edu
- #
- # Revision 4.3.2.8 89/11/28 00:30:06 sob
- # Attempted to make some of the references to the news software version
- # levels more clear for the benefit of novice news installers.
- #
- # Revision 4.3.2.7 89/11/27 02:25:26 sob
- # Better detection of SunOS 4.0 and getpwent will be used on systems
- # that support YP, just in case.
- #
- # Revision 4.3.2.6 89/11/27 01:32:56 sob
- # Added some changes suggested by various usenet postings.
- # Limited support for NeXT.
- #
- # Revision 4.3.2.5 89/11/08 04:47:27 sob
- # Added VOIDSIG handling for SunOS 4.X
- #
- # Revision 4.3.2.4 89/11/06 00:05:38 sob
- # Added RRN support originally distributed with NNTP 1.5
- #
- # Revision 4.3.2.3 89/11/05 23:35:43 sob
- # Added checks for ultrix and sun
- #
- # Revision 4.3.1.6 86/07/24 14:41:18 lwall
- # Handles missing Relay-Version: from news 2.10.3 headers.
- #
- # Revision 4.3.1.5 85/05/23 11:23:22 lwall
- # filexp flubs sed command.
- #
- # Revision 4.3.1.4 85/05/20 17:13:11 lwall
- # Makes sure -lcurses is really a terminfo library.
- # Puts single instead of double quotes around defs in config.sh.
- #
- # Revision 4.3.1.3 85/05/16 16:48:48 lwall
- # Took space from end of filexp output.
- #
- # Revision 4.3.1.2 85/05/13 15:54:35 lwall
- # Libraries in /usr/local/lib shouldn't use -l switch.
- #
- # Revision 4.3.1.1 85/05/10 11:29:20 lwall
- # Branch for patches.
- #
- # Revision 4.3 85/05/01 11:31:23 lwall
- # Baseline for release with 4.3bsd.
- #
-
- # Yes, you may rip this off to use in other distribution packages.
-
- WHITE='[ ]'; : there should be a tab and a space between the brackets.
- CTRLA=''; : there should be a control-A between the single-quotes.
-
- n=''
- c=''
- libc=''
- eunicefix=''
- eunice=''
- cpp=''
- shsharp=''
- spitshell=''
- startsh=''
- test=''
- expr=''
- sed=''
- echo=''
- cat=''
- rm=''
- mv=''
- cp=''
- tail=''
- tr=''
- mkdir=''
- sort=''
- uniq=''
- inews=''
- grep=''
- egrep=''
- nidump=''
- ypmatch=''
- contains=''
- lib=''
- nametype=''
- cc=''
- iandd=''
- include=''
- rrninclude=''
- termlib=''
- jobslib=''
- ndirlib=''
- socketlib=''
- dirtype=''
- dirinc=''
- libndir=''
- usendir=''
- ndirc=''
- ndiro=''
- pager=''
- mailer=''
- internet=''
- rnbin=''
- filexp=''
- distlist=''
- Log=''
- Header=''
- sitename=''
- hostfile=''
- domain=''
- orgname=''
- isadmin=''
- newsadmin=''
- rnlib=''
- mansrc=''
- manext=''
- maildir=''
- spool=''
- active=''
- myactive=''
- mininact=''
- pref=''
- defeditor=''
- rootid=''
- mboxchar=''
- locpref=''
- orgpref=''
- citypref=''
- statepref=''
- cntrypref=''
- contpref=''
- strchr=''
- memcpy=''
- rename=''
- truncate=''
- chsize=''
- tzset=''
- threaddef=''
- selectdef=''
- threaddir=''
- novoid=''
- novfork=''
- portable=''
- passnam=''
- berknam=''
- usgnam=''
- whoami=''
- termio=''
- fcntl=''
- ioctl=''
- ptem=''
- normsig=''
- sigblock=''
- sigret=''
- getuidgid=''
- getcwd=''
- getwd=''
- havetlib=''
- getpwent=''
- gethostname=''
- douname=''
- phostname=''
- hostcmd=''
- norelay=''
- isrrn=''
- rdchk=''
- serverfile=''
- NNTPSRC=''
- CONFIG=''
- hiddennet=''
-
- echo "Beginning of configuration questions for trn."
- : Eunice requires " " instead of "", can you believe it
- echo " "
-
- : sanity checks
- PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/bsd'
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
-
- if test ! -t 0; then
- echo "Type 'sh Configure', not 'sh <Configure'"
- exit 1
- fi
-
- : some greps do not return status, grrr.
- echo "grimblepritz" >grimble
- if grep blurfldyick grimble >/dev/null 2>&1 ; then
- contains=contains
- else
- if grep grimblepritz grimble >/dev/null 2>&1 ; then
- contains=grep
- else
- contains=contains
- fi
- fi
-
- : the following should work in any shell
- case $contains in
- contains*)
- echo " "
- echo "AGH! Grep doesn't return a status. Attempting remedial action."
- cat >contains <<'EOSS'
- grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
- EOSS
- chmod 755 contains
- esac
-
- : first determine how to suppress newline on echo command
- echo "Checking echo to see how to suppress newlines..."
- (echo "hi there\c" ; echo " ") >.echotmp
- if $contains c .echotmp >/dev/null 2>&1 ; then
- echo "...using -n."
- n='-n'
- c=''
- else
- echo "...using \\\c."
- n=''
- c='\c'
- fi
- echo $n "Type carriage return to continue. Your cursor should be here-->$c"
- read ans
- rm .echotmp
-
- : now set up to do reads with possible shell escape
- : if this does not work on your machine, 1,$s/. myread/read ans/
- cat <<EOSC >myread
- ans='!'
- while expr "X\$ans" : "X!" >/dev/null; do
- read ans
- case "\$ans" in
- !)
- sh
- echo " "
- echo $n "Your answer: $c"
- ;;
- !*)
- set \`expr "X\$ans" : "X!\(.*\)\$"\`
- sh -c "\$*"
- echo " "
- echo $n "Your answer: $c"
- ;;
- esac
- done
- EOSC
-
- : general instructions
- cat <<'EOH'
-
- This installation shell script will examine your system and ask you questions
- to determine how trn and its auxiliary files should be installed. If you
- get stuck on a question, you may use a ! shell escape to start a subshell or
- execute a command. Many of the questions will have default answers in
- square brackets--typing carriage return will give you the default.
-
- On some of the questions which ask for file or directory names you are
- allowed to use the ~name construct to specify the login directory belonging
- to "name", even if you don't have a shell which knows about that. Questions
- where this is allowed will be marked "(~name ok)".
-
- Much effort has been expended to ensure that this shell script will run
- on any Unix system. If despite that it blows up on you, your best bet is to
- edit Configure and run it again. (Trying to install trn without having run
- Configure is well nigh impossible.) Also, tell Wayne (davison@dri.com)
- how he blew it.
-
- This installation script affects things in two ways: 1) it does direct
- variable substitutions on some of the files included in this kit, and
- 2) it builds a config.h file for inclusion in C programs. You may edit
- any of these files as the need arises after running this script.
-
- EOH
- echo $n "[Type carriage return to continue] $c"
- . myread
- Xn=$n
- Xc=$c
- : get old answers, if there is a config file out there
- if test -f config.sh; then
- echo " "
- echo "(Fetching default answers from your old config.sh file...)"
- . ./config.sh
- fi
- n=$Xn
- c=$Xc
-
- : get list of predefined functions in a handy place
- echo " "
- if test -f /lib/libc.a; then
- echo "Your C library is in /lib/libc.a. You're normal."
- libc=/lib/libc.a
- else
- if test -f /lib/Llibc.a; then
- echo "Your C library is in /lib/Llibc.a. I smell Xenix!"
- libc=/lib/Llibc.a
- else
- if test -f /usr/lib/libc.a; then
- echo "Your C library is in /usr/lib/libc.a, of all places."
- libc=/usr/lib/libc.a
- else
- if test -f /lib/clib; then
- echo "Your C library is in /lib/clib. How nonstandard, must be Apollo."
- libc=/lib/clib
- else
- if test -f "$libc"; then
- echo "Your C library is in $libc, like you said before."
- else
- cat <<'EOM'
-
- I can't seem to find your C library. I've looked for /lib/libc.a and
- /usr/lib/libc.a, but neither of those are there. Perhaps you can find
- out by reading `man 3 intro' if you have the 'man' facility installed.
-
- EOM
- echo $n "What is the full name of your C library? $c"
- . myread
- libc="$ans"
- fi
- fi
- fi
- fi
- fi
- echo " "
- echo $n "Extracting names from $libc for later perusal...$c"
- if ar t $libc >libc.list 2>/dev/null; then
- echo "done"
- else
- if test $libc = /lib/clib; then
- if nm -g $libc | sed -e 's/$/.o/' >libc.list; then
- echo "done"
- else
- echo " "
- echo "Apparently $libc is not an object module. Try again."
- exit 1
- fi
- else
- echo " "
- echo "The archiver doesn't think $libc is a reasonable library."
- exit 1
- fi
- fi
- : make some quick guesses about what we are up against
- echo " "
- echo $n "Hmm... $c"
- if $contains sigvec.o libc.list >/dev/null 2>&1 ; then
- echo "Looks kind of like a BSD system, but we'll see..."
- echo exit 0 >bsd
- echo exit 1 >usg
- echo exit 1 >v7
- else
- if $contains dup2.o libc.list >/dev/null 2>&1 ; then
- echo "Looks sort of like a V7 system, but we'll see..."
- echo exit 1 >bsd
- echo exit 1 >usg
- echo exit 0 >v7
- else
- echo "Looks kind of like a USG system, but we'll see..."
- echo exit 1 >bsd
- echo exit 0 >usg
- echo exit 1 >v7
- fi
- fi
- :
- if test -f /etc/inittab; then
- echo "You have an inittab file. You must be a USG system!"
- echo exit 1 >bsd
- echo exit 0 >usg
- echo exit 1 >v7
- fi
- if $contains vmssystem.o libc.list >/dev/null 2>&1 ; then
- cat <<'EOI'
- There is, however, a strange, musty smell in the air that reminds me of
- something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
- EOI
- echo "exit 0" >eunice
- eunicefix=unixtovms
- eunice=define
- : it so happens the Eunice I know will not run shell scripts in Unix format
- else
- echo " "
- echo "Congratulations. You aren't running Eunice."
- eunicefix=':'
- eunice=undef
- echo "exit 1" >eunice
- fi
- chmod 755 bsd usg v7 eunice
- $eunicefix bsd usg v7 eunice
- : see how we invoke the C preprocessor
- echo " "
- echo "Checking to see how your C preprocessor is invoked..."
- cat <<'EOT' >testcpp.c
- #define ABC abc
- #define XYZ xyz
- ABC+XYZ
- EOT
- echo 'Maybe "cc -E" will work...'
- cc -E testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yup, it does."
- cpp='cc -E'
- else
- echo 'Nope...maybe "cc -P" will work...'
- cc -P testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yup, that does."
- cpp='cc -P'
- else
- echo 'Nixed again...maybe "/lib/cpp" will work...'
- /lib/cpp testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Hooray, it works! I was beginning to wonder."
- cpp='/lib/cpp'
- else
- if $contains 'abc +xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Found it! You're on a NeXT, aren't you?"
- cpp='/lib/cpp'
- else
- echo 'Hmm...maybe you already told me...'
- case "$cpp" in
- '') ;;
- *) $cpp testcpp.c >testcpp.out 2>&1;;
- esac
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Hooray, you did! I was beginning to wonder."
- else
- echo "Nope. I can't find a C preprocessor. Name one: $c"
- . myread
- cpp="$ans"
- $cpp testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "OK, that will do."
- else
- echo "Sorry, I can't get that to work. Go find one."
- exit 1
- fi
- fi
- fi
- fi
- fi
- fi
- rm -f testcpp.c testcpp.out
- : check for pdp11
- echo " "
- cat <<'EOT' >pdp11.c
- #ifdef pdp11
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp pdp11.c | grep exit >pdp11
- chmod 755 pdp11
- $eunicefix pdp11
- rm pdp11.c
- if pdp11; then
- echo "This looks like a pdp11 to me."
- fi
- : check for ultrix
- cat <<'EOT' >ultrix.c
- #ifdef ultrix
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp ultrix.c | grep exit >ultrix
- chmod 755 ultrix
- $eunicefix ultrix
- rm ultrix.c
- if ultrix; then
- echo "Running ultrix, eh?"
- fi
-
- : check for sun 4.0
- cat <<'EOT' >sun.c
- #ifdef sun
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp sun.c | grep exit >sun
- chmod 755 sun
- $eunicefix sun
- rm sun.c
- if sun; then
- echo "This looks like a sun to me."
- if test -f /etc/ld.so.cache ; then
- echo "And it appears you are running SunOS 4.0 or greater."
- fi
- fi
- : check for hp-ux
- cat <<'EOT' >hp-ux.c
- #ifdef hpux
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp hp-ux.c | grep exit >hp-ux
- chmod 755 hp-ux
- $eunicefix hp-ux
- rm hp-ux.c
- if hp-ux; then
- echo "Hewlett-Packard must have built this..."
- socketlib=-lbsdipc
- fi
-
- : check for sgi
- cat <<'EOT' >sgi.c
- #ifdef sgi
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp sgi.c | grep exit >sgi
- chmod 755 sgi
- $eunicefix sgi
- rm sgi.c
- if sgi; then
- echo "Silicon Graphics must have built this..."
- include=-I/usr/include/bsd
- rrninclude="-I/usr/include/bsd -DUSG"
- socketlib=-lbsd
- fi
-
- : check for XENIX
- cat <<'EOT' >xenix
- test -f /xenix; exit $?
- EOT
- chmod 755 xenix
- $eunicefix xenix
- if xenix; then
- echo "Kinda looks like XENIX....hmmm"
- rrninclude="-DUSG -DLAI_TCP"
- socketlib=-lsocket
- rdchk=define
- dirtype=dirent
- else
- rdchk=undef
- fi
-
- : check for Pyramid OSx
- cat <<'EOT' >pyr.c
- #ifdef pyr
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp pyr.c | grep exit >pyr
- chmod 755 pyr
- $eunicefix pyr
- rm pyr.c
- if pyr; then
- echo "This looks like a Pyramid to me."
- fi
-
- : check for NeXT
- cat <<'EOT' >next.c
- #ifdef NeXT
- exit 0
- #else
- exit 1
- #endif
- EOT
- $cpp next.c | grep exit >next
- chmod 755 next
- $eunicefix next
- rm next.c
- if next; then
- echo "My, you really ARE on a NeXT."
- addcflags='-bsd'
- fi
-
- if bsd; then
- getuidgid=define
- else
- getuidgid=undef
- fi
-
- cat <<'EOT' > s5uniq
- if test -f /bin/uname
- then
- case `uname -r -m` in
- "5.3 vax-"*)
- if [ -f /usr/lib/libnet.a \
- -a -f /usr/lib/libhdb.a \
- -a -f /usr/lib/libbbn.a \
- -a -f /usr/lib/libstr.a ]
- then
- exit 0
- fi;;
- esac
- fi
- exit 1
- EOT
- chmod 755 s5uniq
- if s5uniq; then
- echo "This looks like Uniq. What a pity."
- socketlib="-lnet -lhdb -lbbn -lstr"
- rrninclude="-DR_UNIQ -DUSG"
- # -DR_UNIQ and -DUSG are needed for ~nntp/common/clientlib.c
- fi
-
- : see if sh knows # comments
- echo " "
- echo "Checking your sh to see if it knows about # comments..."
- if sh -c '#' >/dev/null 2>&1 ; then
- echo "Your sh handles # comments correctly."
- shsharp=true
- spitshell=cat
- echo " "
- echo "Okay, let's see if #! works on this system..."
- echo "#!/bin/echo hi" > try
- $eunicefix try
- chmod 755 try
- try > today
- if test -s today; then
- echo "It does."
- sharpbang='#!'
- else
- echo "#! /bin/echo hi" > try
- $eunicefix try
- chmod 755 try
- try > today
- if test -s today; then
- echo "It does."
- sharpbang='#! '
- else
- echo "It doesn't."
- sharpbang=': use '
- fi
- fi
- else
- echo "Your sh doesn't grok # comments--I will strip them later on."
- shsharp=false
- echo "exec grep -v '^#'" >spitshell
- chmod 755 spitshell
- $eunicefix spitshell
- spitshell=`pwd`/spitshell
- echo "I presume that if # doesn't work, #! won't work either!"
- sharpbang=': use '
- fi
-
- : figure out how to guarantee sh startup
- echo " "
- echo "Checking out how to guarantee sh startup..."
- startsh=$sharpbang'/bin/sh'
- echo "Let's see if '$startsh' works..."
- cat >try <<EOSS
- $startsh
- set abc
- test "$?abc" != 1
- EOSS
-
- chmod 755 try
- $eunicefix try
- if try; then
- echo "Yup, it does."
- else
- echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
- fi
- rm -f try today
-
- : find out where common programs are
- echo " "
- echo "Locating common programs..."
- pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /usr/etc /usr/5bin"
- cat <<EOSC >loc
- $startsh
- thing=\$1
- shift
- dflt=\$1
- shift
- for dir in \$*; do
- case "\$thing" in
- .)
- if test -d \$dir/\$thing; then
- echo \$dir
- exit 0
- fi
- ;;
- *)
- if test -f \$dir/\$thing; then
- echo \$dir/\$thing
- exit 0
- fi
- ;;
- esac
- done
- echo \$dflt
- exit 1
- EOSC
- chmod 755 loc
- $eunicefix loc
- loclist="expr sed echo cat rm mv cp tail tr mkdir sort uniq grep"
- trylist="test inews egrep more pg Mcc nidump ypmatch"
- for file in $loclist; do
- xxx=`loc $file $file $pth`
- eval $file=$xxx
- case "$xxx" in
- /*)
- echo $file is in $xxx.
- ;;
- *)
- echo "I don't know where $file is. I hope it's in everyone's PATH."
- ;;
- esac
- done
- echo " "
- echo "Don't worry if any of the following aren't found..."
- for file in $trylist; do
- xxx=`loc $file $file $pth`
- eval $file=$xxx
- case "$xxx" in
- /*)
- echo $file is in $xxx.
- ;;
- *)
- echo "I don't see $file out there, offhand."
- ;;
- esac
- done
- case $egrep in
- egrep)
- echo "Substituting grep for egrep."
- egrep=$grep
- ;;
- esac
- case $test in
- test)
- echo "Hopefully test is built into your sh."
- ;;
- /bin/test)
- echo " "
- echo $n 'Is your "test" built into sh? [n] (OK to guess) '"$c"
- . myread
- case $ans in
- y*) test=test ;;
- esac
- ;;
- *)
- test=test
- ;;
- esac
- case $echo in
- echo)
- echo "Hopefully echo is built into your sh."
- ;;
- /bin/echo)
- echo " "
- echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
- $echo $n "hi there$c" >foo1
- echo $n "hi there$c" >foo2
- if cmp foo1 foo2 >/dev/null 2>&1; then
- echo "They are compatible. In fact, they may be identical."
- else
- echo "They are not compatible--the echo builtin will be used."
- echo=echo
- fi
- $rm -f foo1 foo2
- ;;
- *)
- echo=echo
- ;;
- esac
- $echo " "
- : test yp
- case $ypmatch in
- ypmatch)
- $echo "I don't see ypmatch out there, so YP is not available. We'll search the"
- $echo "passwd file the old fashioned way!"
- ;;
- *)
- $ypmatch 513/tcp services > /dev/null 2>/dev/null
- status=$?
- if $test $status -ne 0 ; then
- $echo "YP installed, but not operational. We won't use it."
- ypmatch=""
- else
- $echo "YP installed and operational."
- fi
-
- ;;
- esac
- if $test "$nidump" = "nidump"; then
- nidump=""
- fi
- if $test "$ypmatch" = "ypmatch"; then
- ypmatch=""
- fi
-
- : decide how portable to be
- case "$portable" in
- define) dflt=y;;
- *) dflt=n;;
- esac
- $cat <<'EOH'
-
- I can set things up so that your shell scripts and binaries are more portable,
- at what may be a noticable cost in performance. In particular, if you
- ask to be portable, the following happens:
-
- 1) shell scripts will rely on the PATH variable rather than using
- the paths derived above.
- 2) ~username interpretations will be done at run time rather than
- by Configure.
- 3) the system name will be determined at run time, if at all possible.
-
- EOH
- $echo $n "Do you expect to run these scripts and binaries on multiple machines? [$dflt] $c"
- . myread
- case $ans in
- '') ans=$dflt;;
- esac
- case $ans in
- y*) portable=define
- for file in $loclist; do
- eval $file=$file
- done
- ;;
- *) portable=undef ;;
- esac
-
- : set up shell script to do ~ expansion
- cat >filexp <<EOSS
- $startsh
- : expand filename
- case \$1 in
- ~/*|~)
- $echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
- ;;
- ~*)
- if $test -f /bin/csh; then
- /bin/csh -f -c "glob \$1"
- $echo ""
- else
- name=\`$expr x\$1 : '..\([^/]*\)'\`
- if $test "$ypmatch" != ""; then
- dir=\`$ypmatch \$name passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/"'\`
- elif $test "$nidump" != ""; then
- dir=\`$nidump passwd / | $sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
- fi
- if $test "\$dir" = ""; then
- dir=\`$sed </etc/passwd -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
- fi
- if $test ! -d "\$dir"; then
- me=\`basename \$0\`
- $echo "\$me: can't locate home directory for: \$name" >&2
- exit 1
- fi
- case \$1 in
- */*)
- $echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
- ;;
- *)
- $echo \$dir
- ;;
- esac
- fi
- ;;
- *)
- $echo \$1
- ;;
- esac
- EOSS
- chmod 755 filexp
- $eunicefix filexp
-
- : try to deal with domains
- $cat << 'EOH'
-
- Please enter your domain name. This will be used in conjunction with the
- site name for return addresses on news articles and mail. If you use the
- 4.3ism of having your domain in your hostname, all the posting programs
- will figure this out on the fly, so don't worry.
-
- Examples of some valid domains:
- berkeley.edu
- nasa.gov
- Example of an invalid domain in common use:
- uucp
- EOH
-
- case "$domain" in
- '') dflt="uucp";;
-