ack/first/first

211 lines
5.4 KiB
Plaintext
Raw Normal View History

1991-10-15 16:02:38 +00:00
case $0 in
*/first)
FDIR=`expr $0 : '\(.*\)/first'`
;;
1991-10-15 16:02:38 +00:00
first) FDIR=.
;;
esac
if echo 'a\c' | grep 'c' >/dev/null ; then
1992-06-26 11:54:22 +00:00
: We have BSD-like echo command.
E_FLAG='-n'
E_SFX=''
else
1992-06-26 11:54:22 +00:00
: We have SystemV-like echo command.
E_FLAG=''
E_SFX='\c'
fi
export E_FLAG E_SFX
echo check write-ability of /tmp and /usr/tmp ...
if ( >/usr/tmp/aaax.$$ )
then
rm /usr/tmp/aaax.$$
else
echo /usr/tmp must exist and be writable.
exit 2
fi
if ( >/tmp/aaax.$$ )
then
rm /tmp/aaax.$$
else
echo /tmp must exist and be writable.
exit 2
fi
echo "/tmp and /usr/tmp ok"
1991-10-15 16:02:38 +00:00
if [ -f macros ]
1985-02-15 23:00:46 +00:00
then
1991-10-15 16:02:38 +00:00
. macros
1985-02-15 23:00:46 +00:00
fi
1991-10-15 16:02:38 +00:00
: "Now get system name and directories"
. $FDIR/get_sys
1985-02-15 23:00:46 +00:00
: "Take action according to the system used"
1991-10-15 16:02:38 +00:00
BM=1
OLDACM=$ACM
OLDSYS=$SYS
case $SYSNAME in
1991-11-14 09:35:36 +00:00
vax_bsd4_1a) ACM=vax4 ; SYS=BSD4_1 ; BYTE_ORDER=0123 ; MACH=vax4 ;;
vax_bsd4_2) ACM=vax4 ; SYS=BSD4_2 ; BYTE_ORDER=0123 ; MACH=vax4 ;;
vax_sysV_2) ACM=vax4 ; SYS=SYS_5 ; BYTE_ORDER=0123 ; MACH=vax4 ;;
i386) ACM=i386 ; SYS=SYS_5 ; BYTE_ORDER=0123 ; MACH=i386 ;;
sun3) ACM=sun3 ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=m68020 ;;
sun2) ACM=sun2 ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=m68k4 ;;
m68_unisoft|m68k2) ACM=m68k2 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;;
m68_sysV_0|mantra) ACM=mantra ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=m68k4 ;;
m68020) ACM=m68020 ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=m68020 ;;
sparc) ACM=sparc ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=sparc ;;
i86) ACM=i86 ; SYS=SYS_5; BYTE_ORDER=0123 ; MACH=i86 ;;
xenix3) ACM=xenix3 ; SYS=SYS_5; BYTE_ORDER=0123 ; MACH=i86 ;;
minix) ACM=minix ; SYS=V7; BYTE_ORDER=0123 ; MACH=i86 ;;
pmds) ACM=pmds ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;;
pmds4) ACM=pmds4 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k4 ;;
minixST) ACM=minixST ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;;
m68k4) ACM=m68k4 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k4 ;;
*) ACM=XXX ; SYS=XXX ; BYTE_ORDER=XXX ; MACH=XXX ;;
1985-02-15 23:00:46 +00:00
esac
1991-10-15 16:02:38 +00:00
: do not change the order in MACH_LIST. check limit_enquire first.
MACH_LIST="i86 xenix3 minix i386 6500 6800 6805 6809 i80 em22 em24 em44 m68k2 pmds minixST m68k4 pmds4 sun2 mantra m68020 sun3 sparc ns pdp s2650 vax4 z80 z8000 arm"
while :
1985-02-15 23:00:46 +00:00
do
1991-10-15 16:02:38 +00:00
for i in $MACH_LIST
do
if [ $i = $ACM ]
then break
fi
done
if [ $i = $ACM ]
then break
1985-02-15 23:00:46 +00:00
fi
1991-10-15 16:02:38 +00:00
echo "This installation script has no knowledge about $SYSNAME.
You will have to specify the default machine that you want ACK to
compile for. Choices:"
l=
x=
for i in $MACH_LIST
do
l="$l $i"
x=x$x
case $x in
xxxxxxxxxx) echo $l
x=
l=
;;
esac
done
ACM=$OLDACM
echo $l
echo $E_FLAG "Your choice: [$OLDACM] $E_SFX"
1991-10-15 16:02:38 +00:00
. $FDIR/get_answer
case $ANS in
'') ANS="$ACM";;
esac
ACM="$ANS"
1985-02-15 23:00:46 +00:00
done
while :
do
case $SYS in
V7|BSD4_1|BSD4_2|SYS_5)
break
;;
*)
1991-10-15 16:02:38 +00:00
SYS=$OLDSYS
echo 'What kind of Unix is the target system running?
Choices:
V7 for Unix V7, BSD 2.*
BSD4_1 for Berkeley 4.1
BSD4_2 for Berkeley 4.2, 4.3, SunOS
1991-10-15 16:02:38 +00:00
SYS_5 for Xenix, System III, System V'
echo $E_FLAG "Your choice (V7|BSD4_1|BSD4_2|SYS_5): [$OLDSYS] $E_SFX"
1991-10-15 16:02:38 +00:00
. $FDIR/get_answer
case $ANS in
'') ANS="$SYS";;
esac
SYS="$ANS"
;;
esac
done
1985-02-15 23:00:46 +00:00
rm -f local.h
1991-10-15 16:02:38 +00:00
sed -e /ACKM/s/'".*"'/'"'$ACM'"'/ -e /BIGMACH/s/'[01]'/$BM/ -e /SYSTEM/s/'^#[ ]*define[ ]*[a-zA-Z_][a-zA-Z0-9_]*'/"# define $SYS"/ < $FDIR/local.h.src >local.h
case $BYTE_ORDER in
XXX) ;;
*) echo '/* Optional definition of BYTE_ORDER: */' >> local.h
echo "#define BYTE_ORDER 0x$BYTE_ORDER" >> local.h
;;
1985-02-15 23:00:46 +00:00
esac
1991-10-15 16:02:38 +00:00
echo "Your default machine to compile for is $ACM"
echo "Installation of the complete ACK takes a long time. Limiting the
number of languages, runtime libraries, back-ends, and assemblers to be
installed may save a lot of time. If you want to install everything,
answer no to the next question. Otherwise, answer yes, and you will be
prompted for details"
while :
do
echo $E_FLAG "Do you want to limit the installation in any way? (y/n) [$LIMIT] $E_SFX"
1991-10-15 16:02:38 +00:00
. $FDIR/get_answer
case $ANS in
'') ANS="$LIMIT";;
esac
1991-10-15 16:02:38 +00:00
case X$ANS in
1992-07-27 14:32:53 +00:00
Xj*|Xy|X)
1991-10-15 16:02:38 +00:00
LIMIT=y
. $FDIR/limit_enquire
break
;;
1991-10-15 16:02:38 +00:00
Xn*) . $FDIR/get_sysvax
LIMIT=n
DO_MACHINE_INDEP=y
1992-09-04 09:22:11 +00:00
DO_FAST=n
if [ $TARGET_HOME = $UTIL_HOME ]
then
case $ACM in
sun3|m68020|i386|vax*)
DO_FAST=y
;;
esac
fi
break
;;
1991-10-15 16:02:38 +00:00
*) echo "I do not understand your answer ($ANS). Try again."
;;
esac
done
1991-10-15 16:02:38 +00:00
. $FDIR/get_makepars
1991-10-16 13:33:38 +00:00
echo "TARGET_HOME=\"$TARGET_HOME\"; export TARGET_HOME" > macros
echo "UTIL_HOME=\"$UTIL_HOME\"; export UTIL_HOME" >> macros
echo "SRC_HOME=\"$SRC_HOME\"; export SRC_HOME" >> macros
echo "SYSNAME=\"$SYSNAME\"; export SYSNAME" >> macros
echo "ACM=\"$ACM\"; export ACM" >> macros
echo "CURRENT=\"$CURRENT\"; export CURRENT" >> macros
echo "SYS=\"$SYS\"; export SYS" >> macros
echo "LIMIT=\"$LIMIT\"; export LIMIT" >> macros
echo "CONFIG=\"$CONFIG\"; export CONFIG" >> macros
echo "DISABLE_LANG=\"$DISABLE_LANG\"; export DISABLE_LANG" >> macros
echo "DISABLE_SUP=\"$DISABLE_SUP\"; export DISABLE_SUP" >> macros
echo "DO_MACHINE_INDEP=\"$DO_MACHINE_INDEP\"; export DO_MACHINE_INDEP" >> macros
echo "MACH_LIST=\"$MACH_LIST\"; export MACH_LIST" >> macros
echo "SYSVAX=\"$SYSVAX\"; export SYSVAX" >> macros
1991-11-14 09:35:36 +00:00
echo "MACH=\"$MACH\"; export MACH" >> macros
1991-10-16 13:33:38 +00:00
echo "WS=\"$WS\"; export WS" >> macros
echo "PS=\"$PS\"; export PS" >> macros
echo "DO_FAST=\"$DO_FAST\"; export DO_FAST" >> macros
1991-10-15 16:02:38 +00:00
cat macros $FDIR/install_tail > INSTALL
chmod +x INSTALL
1991-10-16 13:33:38 +00:00
echo "
A shell-script called 'INSTALL' has been created. Running it
installs ACK. Note that this may take a (very) long time, so run it
in the background, with its output redirected, f.i.:
sh INSTALL > INSTALL.out 2>&1 &
"
1988-08-05 13:50:27 +00:00
exit 0