[mod.sources] v09i032: New Configure.sh for ELM, Patch1

sources-request@mirror.UUCP (03/13/87)

Submitted by: hplabs!taylor (Dave Taylor)
Mod.sources: Volume 9, Issue 32
Archive-name: elm2/Patch1

NOTE!  The "Configure.sh" file distributed with ELM is badly broken.
It unpacks correctly, and appears to be missing like a 512 bytes or
so.  Here it is, re-loaded from the tape, re-verified, re-packed,
etc.  Sorry for the confusion.
	/r$

#! /bin/sh
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
# If this archive is complete, you will see the message:
#		"End of shell archive."
# Contents:  Configure.sh
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
echo shar: Extracting \"Configure.sh\" \(20310 characters\)
if test -f Configure.sh ; then 
  echo shar: Will not over-write existing file \"Configure.sh\"
else
sed "s/^X//" >Configure.sh <<'END_OF_Configure.sh'
X: Use /bin/sh
X#
X# Configure.sh, a shell script for configuring the Elm mail system for
X# 	your site and desires.  This script uses some ideas ripped out
X#	of the 'rn' install script.  Thanks Larry!
X#
X
Xexport PATH || (sh $0 ; kill $$)
X
XSHELL=/bin/sh
X
XSED1=/tmp/Elm.sed1
XSED2=/tmp/Elm.sed2
X
Xif [ -f /bin/rm ]
Xthen
X  rm=/bin/rm
Xelse
X  rm=rm
Xfi
X
X$rm -f $SED1 $SED2
Xtouch $SED1 $SED2
Xchmod 777 $SED1 $SED2
X
X# first test - is stdin still free for answering questions??
Xif [ ! -t 0 ]
Xthen
X  echo "Please use 'sh Configure.sh' rather than 'sh < Configure.sh'"
X  exit 1
Xfi
X
X# next let's see what sorta echo flag we have here...
X
Xif [ "`echo -n`" = "-n" ]
Xthen
X  nflag=""
X  cflag="\\c" 
Xelse
X  nflag="-n"
X  cflag=""
Xfi
X
X# now the intro blurb
X
Xcat << END_OF_INTRO
X
X       		    Elm Configuration Script, v4
X       
X      
X    This is the configuration script for the Elm mail system.  By using
X    it rather than editing the "hdrs/sysdefs.h" file, it is hoped that
X    the installation process will be considerably easier.
X
X    On all questions, the value in [square brackets] is the default that 
X    will be used if you just press RETURN...
X
X
XEND_OF_INTRO
X
Xecho "Trying to figure out what sort of OS you're on..."
X
X# next interesting part - figure out what OS we're on
X
Xos_name=""
X
X$rm -f .osname
Xtouch .osname
X
Xcat << 'EOF' > .get_osname
X
Xuname
X
Xif [ $? != 0 ] 
Xthen
X  if [ -f /vmunix ]
X  then
X    echo "bsd" > .osname
X  else
X    exit 0
X  fi
Xfi
X
Xif [ "`uname -s`" != "" ]
Xthen
X   uname -s | tr '[A-Z]' '[a-z]' > .osname
Xfi
X
Xexit 0
X 
XEOF
X
Xsh .get_osname > /dev/null 2>&1
X
Xif [ -f .osname ] 
Xthen
X  os_name="`cat .osname`"
X  $rm -f .osname
Xfi
X
X$rm -f .get_osname
X
Xif [ "$os_name" = "" ] 
Xthen
X  cat << THE_END
X
XI cannot figure out what sort of operating system you're running here.  Please
Xtype in the NAME of the OS you're running or the name of the machine you're
XTHE_END
X
X  echo $nflag "running on.  I'll check the name in a minute : " $cflag
X
X  read junk morejunk
X  
X  os_name=`echo $junk | tr '[A-Z]' '[a-z]'`
Xfi
X
XOS_FLAG="HUH??"
X
Xwhile [ "$OS_FLAG" = "HUH??" ]
Xdo
X
X  case $os_name in
X    hp)		NAME="HP-UX"; OS_FLAG=""		;;
X    hp-ux) 	NAME="HP-UX"; OS_FLAG="";   		;;
X    vax)	NAME="BSD"; OS_FLAG="BSD";  	;;
X    vaxen)	NAME="BSD"; OS_FLAG="BSD";  	;;
X    bsd)	NAME="BSD"; OS_FLAG="BSD";  	;;
X    uts)	NAME="UTS"; OS_FLAG="UTS";  	;;
X    sun)	NAME="BSD"; OS_FLAG="";		;;
X    pyramid)	NAME="Pyramid BSD"; OS_FLAG="PYRAMID";	;;
X    amdahl)	NAME="UTS"; OS_FLAG="UTS";  	;;
X    sv_*)	NAME="System V"; OS_FLAG="";		;;
X    svii_*)	NAME="System VII"; OS_FLAG="";		;;
X    v5)		NAME="System V"; OS_FLAG="";		;;
X    v7)		NAME="System VII"; OS_FLAG="";		;;
X    eunice)	NAME="Eunice"; OS_FLAG="";		;;
X    convergent)	NAME="Convergent BSD"; OS_FLAG="BSD";		;;
X    berkeley)	NAME="BSD"; OS_FLAG="BSD";		;;
X    ultrix)	cat << THE_END
X
XI know that this is a breed of Unix, but I don't know what TYPE of OS it
Xis like.  Please enter the NAME of the OS that this is most like (e.g. "BSD")
Xand we'll go from there.
X
XTHE_END
X					;;
X    xenix)	cat << THE_END
X
XYou're outta luck.  Xenix (dumb OS that it is only allows 6 character 
Xidentifier names.  You'll need to go in and LABORIOUSLY translate all the
XVERY LONG identifier names to the right length.   The correct response to 
Xseeing this message is to call your vendor and get ANGRY!!!!
X
XMeanwhile, we might as well just quit here.  Sorry.
XTHE_END
Xexit 1
X					;;
X    *)		cat << THE_END
X
XI don't know what OS you're specifying!  The only one's I know of are;
X
X  HP-UX, BSD, UTS, Eunice, Xenix, Ultrix, V5, and V7
X
XI also know the machines
X
X  HP, Amdahl, Sun, Vaxen, Convergent and Pyramid
X
XIf you're not among this list, you'll need to pick the closest OS name.  
XTHE_END
X
X    echo " "
X    echo $nflag "Please choose again: " $cflag
X    read os_name
X    ;;
X  esac
X
Xdone
X
Xecho " "
Xecho " "
Xecho you\'re on the following version of Unix: $NAME
X
Xecho " "
Xecho "Now we can get down to those questions..."
Xecho " "
X
Xcat << THE_END
X
XFirst off, should the program use "uuname" rather than trying to read 
XTHE_END
X
Xnot_using_lsys_file=0
X
Xanswer="yes"
Xecho $nflag "the L.sys file (y/n) [yes] ? "  $cflag
Xread answer
X
Xif [ "$answer" = "n" -o "$answer" = "no" ]
Xthen
X  not_using_lsys_file=1
X  echo "s/#define USE_UUNAME/\/** #define USE_UUNAME **\//" >> $SED1
Xfi
X
Xcat << THE_END
X
XNext, are you running smail, a "gateway" configuration of sendmail, or some 
Xother program that means the program shouldn't touch any of the addresses 
XTHE_END
X
Xanswer="no"
Xdont_touch_addresses=0
Xecho $nflag "that users type in (y/n) [no] ? " $cflag
Xread answer
X
Xif [ "$answer" = "y" -o "$answer" = "yes" ]
Xthen
X  dont_touch_addresses=1
X  echo \
X"s/\/\*\* #define DONT_TOUCH_ADDRESSES \*\*\//#define DONT_TOUCH_ADDRESSES /" \
X  >> $SED1
X  echo \
X"s/\/\*\* #define DONT_OPTIMIZE_RETURN \*\*\//#define DONT_OPTIMIZE_RETURN /" \
X  >> $SED1
Xfi
X
Xcat << THE_END
X
XDoes your site receive mail with valid "Reply-To:" and "From:" fields in
XTHE_END
X
Xanswer="no"
Xecho $nflag "the headers (y/n) [no] ? " $cflag
Xread answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" ]
Xthen
X  echo \
X"s/#define USE_EMBEDDED_ADDRESSES/\/** #define USE_EMBEDDED_ADDRESSES **\//" \
X  >> $SED1
Xfi
X
Xcat << THE_END
X
X-------------------------------------------------------------------------------
X
XHow about memory?  If you have a lot, you can enter a fairly large number
Xfor the next few questions...if not, you'll probably want to enter the
Xsuggested small-system values.  (This applies to the speed of the swapping
Xon your system too - if you're on a FAST system, use the big values!)
X
XFirst, how many aliases should be allowed for an individual user? The suggested
Xvalues are 503 for blindly fast systems, 251 for average systems and 127 for
XTHE_END
X
Xmax_ualiases="NONE"
X
Xwhile [ "$max_ualiases" = "NONE" ] 
Xdo 
X
X  echo $nflag "slow systems.  Number of aliases [251] ? " $cflag 
X
X  read junk
X
X  if [ "$junk" = "" ] 
X  then
X    junk=251
X  fi
X
X  if [ $junk -lt 50 -o $junk -gt 1000 ] 
X  then
X    echo \
X"Pretty strange answer!  I think you should reconsider and try this question "\
X    echo "again..."
X    echo " "
X  else
X    max_ualiases=$junk
X    echo "s/>251</$max_ualiases/" >> $SED1
X    case $junk in
X	127) default=223	;;
X	503) default=739	;;
X	*  ) default=503	;;
X    esac
X  fi
Xdone
X
Xmax_saliases="NONE"
X
Xwhile [ "$max_saliases" = "NONE" ] 
Xdo 
X
X  echo $nflag "Max number of system aliases available  [$default] ? " $cflag
X
X  read junk
X
X  if [ "$junk" = "" ] 
X  then
X   junk=$default
X  fi
X
X  if [ $junk -lt 50 -o $junk -gt 1000 ] 
X  then
X    echo "Pretty far out value for this question!  I think you should reconsider"
X    echo "your answer and try this question again..."
X    echo " "
X  else
X    max_saliases=$junk
X    echo "s/>503</$max_saliases/" >> $SED1
X  fi
Xdone
X
Xcat << THE_END
X
XThe next pair of questions have to do with what to do when another program has 
Xlocked a mailbox...
X
XFirst, how many times should the program check for the removal of the lock
XTHE_END
X
Xdefault=6
X
Xmax_attempts="NONE"
X
Xwhile [ "$max_attempts" = "NONE" ] 
Xdo 
X
X  echo $nflag "file before giving up? [6] " $cflag
X
X  read junk
X
X  if [ "$junk" = "" ] 
X  then
X   junk=$default
X  fi
X
X  if [ $junk -lt 3 -o $junk -gt 10 ] 
X  then
X    echo \
X"The recommended range is 3-10   ...Number of times to check lock"
X  else
X    max_attempts=$junk
X    echo "s/>6</$max_attempts/" >> $SED1
X  fi
Xdone
X
Xecho " "
Xanswer="no"
Xecho $nflag "Should it REMOVE the lockfile after $max_attempts checks [no] ?" \
X     $cflag
Xread answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" ]
Xthen
X  echo \
X"s/#define REMOVE_AT_LAST/\/** #define REMOVE_AT_LAST **\//" \
X  >> $SED1
Xfi
X
Xif [ "$NAME" = "BSD" ]
Xthen 
X  ps="ps -cax"
Xelse
X  ps="ps -ef"
Xfi
X
Xecho " "
Xecho " "
Xecho "poking about a bit.."
X
Xresult="`$ps | grep sendmail | grep -v grep`"
X
Xif [ "$result" = "" ]
Xthen
X  if [ -f /usr/lib/sendmail -a -f /usr/lib/sendmail.cf ]
X  then
X    echo \(sendmail available - assuming you don\'t run it as a daemon\)
X    result="ok"
X  fi
Xfi
X
Xif [ "$result" != "" ]
Xthen
X  echo "You're running sendmail.  Well done, I guess..."
X  echo "s/\/\*\* #define ALLOW_BCC \*\*\//#define ALLOW_BCC/" \
X    >> $SED1
X  echo "s/\/\*\* #define DONT_ADD_FROM \*\*\//#define DONT_ADD_FROM/" \
X    >> $SED1
X    echo \
X "s/#define USE_DOMAIN/\/** #define USE_DOMAIN **\//" \
X    >> $SED1
Xelse
X
X  cat << THE_END
X
XSince you're not running sendmail, should I check local user entered addresses
XTHE_END
X
Xanswer="yes"
Xecho $nflag "against the valid mailboxes on this system [yes] ? " $cflag
Xread answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" -a "$answer" != "" ]
Xthen
X  echo \
X"s/#define NOCHECK_VALIDNAME/\/** #define NOCHECK_VALIDNAME **\//" \
X  >> $SED1
Xfi
X
Xcat << THE_END
X
XAre you running a machine where you want to have a domain name appended to the
XTHE_END
X
Xanswer="yes"
Xecho $nflag "hostname on outbound mail [no] ? " $cflag
Xread answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" ]
Xthen
X    echo \
X "s/#define USE_DOMAIN/\/** #define USE_DOMAIN **\//" \
X    >> $SED1
Xelse
X  echo " "
X  echo $nflag "Enter the domain name (include leading '.') : " $cflag
X  read answer
X  echo "s/<enter your domain here>/$answer/" >> $SED1
Xfi
X
Xfi
X
X# next let's see if we can find the vfork command on this system..
X
Xcat << EOF > .test.c
Xmain()
X{
X	(void) vfork();
X}
XEOF
X
Xif [ "$NAME" = "UTS" ]
Xthen
Xcat << EOF > .vfork
Xcc -la .test.c
XEOF
Xelse
Xcat << EOF > .vfork
Xcc .test.c
XEOF
Xfi
X
Xsh .vfork > .log 2>& 1
X
Xif [ "`cat .log | wc -l`" -eq "0" ]
Xthen
X  echo "You have virtual memory system calls available.  Cool..."
Xelse
X  cat << THE_END
X
XYour machine doesn't seem to have the vfork command available.  Should I assume
XTHE_END
X
X  answer="no"
X  echo $nflag "you have it, anyway [no] ? " $cflag
X  read answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" ]
X  then
X    echo "s/\/\*\* #define NO_VM \*\*\//#define NO_VM/" >> $SED1
X  fi
Xfi
X
X$rm -f a.out .test.c .vfork .log
X
X# next let's see if we have the gethostname() system call...
X
Xcat << EOF > .test.c
Xmain()
X{
X	(void) gethostname();
X}
XEOF
X
Xcat << EOF > .hostname
Xcc .test.c
XEOF
X
Xsh .hostname > .log 2>& 1
X
Xif [ "`cat log | wc -l`" -eq "0" ]
Xthen
X  echo "You have the 'gethostname()' system call..."
Xelse
X  echo "s/\/\*\* #define NEED_GETHOSTNAME \*\*\//#define NEED_GETHOSTNAME/" \
X  >> $SED1
Xfi
X
X$rm -f a.out .test.c .hostname .log
X
X# next let's see if we have long variable names...
X
Xcat << EOF > .test.c
Xmain()
X{
X	int this_is_a_long_variable=0;
X
X	(void) this_is_a_long_variable_routine_name(this_is_a_long_variable);
X	
X}
Xthis_is_a_long_variable_routine_name() { }
XEOF
X
Xcat << EOF > .varname
Xcc .test.c
XEOF
X
Xsh .varname > .log 2>& 1
X
Xif [ "`cat .log | wc -l`" -eq "0" ]
Xthen
X  echo "You have long variable names.  Well done!!!!!"
Xelse
X  echo "How embarassing.  Your C compiler doesn't support long variables..."
X  echo "s/\/\*\* #define SHORTNAMES \*\*\//#define SHORTNAMES/" \
X  >> $SED1
Xfi
X
X$rm -f a.out .test.c .varname .log
X
Xif [ $dont_touch_addresses = 0 ]
Xthen
Xcat << THE_END
X
XWhen given a machine that you talk to directly, should the 'pathalias' route to
XTHE_END
X
X answer="no"
X echo $nflag "the machine be used instead [no] ? " $cflag
X read answer
X
X if [ "$answer" != "y" -a "$answer" != "yes" ]
X then
X    echo \
X "s/#define LOOK_CLOSE_AFTER_SEARCH/\/** #define LOOK_CLOSE_AFTER_SEARCH **\//"\
X    >> $SED1
X fi
Xfi
X
Xanswer="yes"
Xecho " "
Xecho $nflag "Is the preferred address notation 'user@host' [yes] ?" $cflag
Xread answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" -a  "$answer" != "" ]
Xthen
X    echo \
X "s/#define INTERNET_ADDRESS_FORMAT/\/** #define INTERNET_ADDRESS_FORMAT **\//" \
X    >> $SED1
Xfi
X
Xecho " "
Xanswer="yes"
Xecho $nflag "Am I going to be running as a setgid program [yes] ? "$cflag
Xread answer
X
Xif [ "$answer" != "y" -a "$answer" != "yes" -a "$answer" != "" ]
Xthen
X  echo answer is currently equal to \"$answer\"
X  echo \
X "s/#define SAVE_GROUP_MAILBOX_ID/\/** #define SAVE_GROUP_MAILBOX_ID **\//" \
X    >> $SED1
Xfi
X    
Xcat << THE_END
X
X
XFor any of the questions after this point, you can press RETURN if the 
Xquestions doesn't apply, or there's no reasonable answer...
X
XTHE_END
X
Xif [ $dont_touch_addresses = 0 ]
Xthen 
X if [ ! -f /usr/lib/nmail.paths ] 
X then
X   echo $nflag "Where does the output of pathalias live ? " $cflag
X   read answer
X
X   if [ "$answer" != "" ]
X   then
X     echo "s^/usr/lib/nmail.paths^$answer^" >> $SED1
X   fi
X fi
Xfi
X
Xuse_dbm=0
X
Xif [ $dont_touch_addresses = 0 ]
Xthen
X  if [ -f $answer.pag -a -f $answer.dir ]
X  then
X    echo "You have pathalias as a DBM file...I'll use that instead."
X    echo "s^/\*\* #define USE_DBM \*\*/^#define USE_DBM^" >> $SED1
X    use_dbm=1
X  fi
Xfi
X
Xcase $OS_FLAG in 
X  BSD) echo "s/>os-define</-DBSD/"    >> $SED2
X       echo "s/>lib2</-lcurses/"      >> $SED2
X       if [ $use_dbm = 1 ]
X       then
X         echo "s/>libs</-ltermcap -ldbm/" >> $SED2
X       else
X         echo "s/>libs</-ltermcap/"       >> $SED2
X       fi
X       ;;
X
X  PYRAMID) echo "s/>os-define</"-DBSD -DNO_VAR_ARGS"/" >> $SED2
X       echo "s/>lib2</-lcurses/"      >> $SED2
X       if [ $use_dbm = 1 ]
X       then
X         echo "s/>libs</-ltermcap -ldbm/"     >> $SED2
X       else
X         echo "s/>libs</-ltermcap/"     >> $SED2
X       fi
X       ;;
X
X  UTS) echo "s/>os-define</-DUTS/"    >> $SED2
X       echo "s/>lib2</-la -lq/"       >> $SED2
X       if [ $use_dbm = 1 ]
X       then
X         echo "s/>libs</-lcurses -ldbm/" >> $SED2
X       else
X         echo "s/>libs</-lcurses/"       >> $SED2
X       fi
X       ;;
X
X  *)   echo "s/>os-define<//"         >> $SED2
X       echo "s/>lib2<//"              >> $SED2
X       if [ $use_dbm = 1 ] 
X       then
X         echo "s/>libs</-ltermcap -ldbm/" >> $SED2
X       else
X         echo "s/>libs</-ltermcap/"       >> $SED2
X       fi
X       ;;
X
Xesac
X
X 
Xif [ $dont_touch_addresses = 0 ]
Xthen
X if [ ! -f /usr/lib/domains ] 
X then
X   echo $nflag "Where does the 'domains' file live ? " $cflag
X   read answer
X
X   if [ "$answer" != "" ]
X   then
X     echo "s^/usr/lib/domains^$answer^" >> $SED1
X   fi
X fi
Xfi
X
Xif [ $not_using_lsys_file = 1 ]
Xthen
X  if [ ! -f /usr/lib/uucp/L.sys ]
X  then
X    echo $nflag "Where does the 'L.sys' file live ? " $cflag
X    read answer
X
X    if [ "$answer" != "" ]
X    then
X      echo "s^/usr/lib/uucp/L.sys^$answer^" >> $SED1
X    fi
X  fi
Xfi
X 
Xif [ ! -d /tmp ]
Xthen 
X  echo $nflag "/tmp isn't a directory!  What should I use?? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/tmp^$answer^" >> $SED1
X  fi
Xfi
X
Xif [ ! -f /usr/ucb/vi -a "$os_name" = "BSD" ]
Xthen
X  echo $nflag "I can't find the 'vi' editor!  Where is it? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/usr/ucb/vi^$answer^" >> $SED1
X  fi
Xelif [ ! -f /usr/bin/vi -a "$os_name" = "" ]
Xthen
X  echo $nflag \
X    "I can't find the 'vi' editor!  Where is it? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/usr/bin/vi^$answer^" >> $SED1
X  fi
Xfi
X
Xif [ ! -d /usr/spool/mail -a "$os_name" = "BSD" ]
Xthen
X  echo $nflag "I can't find your inbound mail directory!  Where is it? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/usr/spool/mail^$answer^" >> $SED1
X  fi
Xelif [ ! -d /usr/mail -a "$os_name" = "" ]
Xthen
X  echo $nflag "I can't find your inbound mail directory!  Where is it? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/usr/mail^$answer^" >> $SED1
X  fi
Xfi
X
Xif [ ! -f /bin/rm ]
Xthen
X  echo $nflag "Where's the 'rm' program? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/bin/rm^$answer^" >> $SED1
X  fi
Xfi
X
Xif [ ! -f /bin/cat ]
Xthen
X  echo $nflag "Where's the 'cat' program? " $cflag
X  read answer
X
X  if [ "$answer" != "" ]
X  then
X    echo "s^/bin/rm^$answer^" >> $SED1
X  fi
Xfi
X 
Xif [ ! -c /dev/rct ]
Xthen
X  if [ ! -c /dev/rmt ]
X  then
X    echo $nflag "What's the name of your remote-tape unit? " $cflag
X    read answer
X
X    if [ "$answer" = "" ]
X    then
X      echo "s^>tapeunit<^unknown-remote-tape-unit^" >> $SED2
X    else
X      if [ ! -c $answer ] 
X      then
X	if [ -c /dev/$answer ]
X	then
X          echo "s^>tapeunit<^/dev/$answer^" >> $SED2
X        else
X          echo \
X           "I can't find either $answer or /dev/$answer.  I'll set it to junk" 
X          echo "s^>tapeunit<^unknown-remote-tape-unit^" >> $SED2
X        fi
X      else
X        echo "s^>tapeunit<^$answer^" >> $SED2
X      fi
X    fi
X  else
X    echo "s^>tapeunit<^/dev/rmt^" >> $SED2
X  fi
Xelse
X  echo "s^>tapeunit<^/dev/rct^" >> $SED2
Xfi
X
Xif [ ! -d /usr/local/bin ]
Xthen
X  echo $nflag "Where do you want the system software installed? " $cflag
X  read answer
X
X  if [ "$answer" = "" ]
X  then
X    echo "s^>dest-dir<^unknown-destination-directory^" >> $SED2
X  else
X    if [ -d $answer ]
X    then
X      echo "s^>dest-dir<^$answer^" >> $SED2
X    else
X      echo "I don't know what you're talking about.  I'll set it to junk" 
X      echo "s^>dest-dir<^unknown-destination-directory^" >> $SED2
X    fi
X  fi
Xelse
X  echo "s^>dest-dir<^/usr/local/bin^" >> $SED2
Xfi
X
Xif [ ! -f /usr/bin/troff ]
Xthen
X  if [ ! -f /usr/local/bin/troff ]
X  then
X    if [ ! -f /usr/contrib/bin/troff ]
X    then
X      if [ ! -f /usr/ucb/troff ]
X      then
X        if [ ! -f /bin/troff ]
X        then
X          echo $nflag "Where does the 'troff' program live? " $cflag
X 	  read answer
X
X	  if [ "$answer" = "" ]
X	  then
X            echo "s/>troff</nroff/" >> $SED2
X	  else
X            if [ -f $answer ]
X	    then
X              echo "s^>troff<^$answer^" >> $SED2
X              troff=$answer
X	    else
X	      echo "Still can't find it.  I'll set it to \"nroff\" instead."
X              echo "s/>troff</nroff/" >> $SED2
X	    fi
X	  fi
X	else
X          echo "s^>troff<^/bin/troff^" >> $SED2
X          troff=/bin/troff
X        fi
X      else
X        echo "s^>troff<^/usr/ucb/troff^" >> $SED2
X        troff=/usr/ucb/troff
X      fi
X    else
X      echo "s^>troff<^/usr/contrib/bin/troff^" >> $SED2
X      troff=/usr/contribbin/troff
X    fi
X  else
X    echo "s^>troff<^/usr/local/bin/troff^" >> $SED2
X    troff=/usr/local/bin/troff
X  fi
Xelse
X  echo "s^>troff<^/usr/bin/troff^" >> $SED2
X  troff=/usr/bin/troff
Xfi
X
X# phew!
X
Xtroffdir=`dirname $troff`
X
Xif [ -f $troffdir/tbl ]
Xthen
X  echo "s^>tbl<^$troffdir/tbl^" >> $SED2
Xelse
X  echo $nflag "Where does the 'tbl' program live? " $cflag
X  read answer
X
X  if [ "$answer" = "" ]
X  then
X    echo "s^>tbl<^cat^" >> $SED2
X  elif [ -f $answer ]
X  then
X    echo "s^>tbl<^$answer^" >> $SED2
X  else
X    echo "I can't find that either.  I'll just set it to junk..."
X    echo "s^>tbl<^cat^" >> $SED2
X  fi
Xfi
X
Xif [ -f /bin/cc ]
Xthen
X  echo "s^>cc<^/bin/cc^" >> $SED2
Xelse
X  echo $nflag "Where does the 'C' compiler live? " $cflag
X  read answer
X
X  if [ "$answer" = "" ]
X  then
X    cat << THE_END
X
XI hope you realize that without a "C" compiler there's no point in doing any
Xof this.  If we can't compile anything then this is just so much disk filler.
X
XIn fact, thinking about it, let's just quit right now.
X
XTHE_END
X
X    exit 1
X  fi
X
X  if [ -f $answer ]
X  then
X    echo "s^>cc<^$answer^" >> $SED2
X  else
X    cat << THE_END
X
XI couldn't find what you specified, pal.  I hope you realize that without a 
X"C" compiler there's no point in doing any of this.  If we can't compile 
Xanything then this system is just so much disk filler.
X
XIn fact, thinking about it, let's just quit right now.
X
XTHE_END
X    exit 1
X  fi
Xfi
X
Xecho "s^>rm<^$rm -f^" >> $SED2
X
Xif [ -f /bin/mv ]
Xthen
X  echo "s^>mv<^/bin/mv -f^" >> $SED2
Xelse
X  echo "s^>mv<^mv -f^" >> $SED2  
Xfi
X
Xif [ -f /bin/cp ]
Xthen
X  echo "s^>cp<^/bin/cp^" >> $SED2
Xelse
X  echo "s^>cp<^cp^" >> $SED2  
Xfi
X
Xcat << END
X
XThat's it.  Just  have to do some patching up and such...hang loose for a 
Xminute or two, please...
X
XEND
X
X# process the four Makefiles accordingly...
X
Xecho "1 - processing the file \"Makefile\"..."
Xcat Makefile.mstr | sed -f $SED2 > Makefile
X
Xecho "2 - processing the file \"src/Makefile\"..."
Xcat src/Makefile.mstr | sed -f $SED2 > src/Makefile
X
Xecho "3 - processing the file \"utils/Makefile\"..."
Xcat utils/Makefile.mstr | sed -f $SED2 > utils/Makefile
X
Xecho "4 - processing the file \"filter/Makefile\"..."
Xcat filter/Makefile.mstr | sed -f $SED2 > filter/Makefile
X
X# then filter the sysdefs file through the sed script we've created!
X
Xecho "Finally, processing the file \"hdrs/sysdefs.h\"..."
X
Xif [ -f hdrs/sysdefs.h ]
Xthen
X  mv hdrs/sysdefs.h hdrs/sysdefs.old
Xfi
X
Xcat hdrs/sysdefs.master | sed -f $SED1 > hdrs/sysdefs.h
X
Xecho Done\!
X
X$rm -f $SED1 $SED2
Xexit 0
END_OF_Configure.sh
if test 20310 -ne `wc -c <Configure.sh`; then
    echo shar: \"Configure.sh\" unpacked with wrong size!?
fi
chmod +x Configure.sh
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0