ack/first/first

263 lines
5.1 KiB
Plaintext
Raw Normal View History

1985-02-15 23:00:46 +00:00
: check $PATH first
if sh ckpath
then :
else
exit 1
fi
: 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
1985-02-15 23:00:46 +00:00
: set ACK HOME Directory in ../h/em_path.h
rm -f em_path.h
sed -e "/^#define[ ]*EM_DIR/s@\".*\"@\"`cd .. ; pwd`\"@" <../h/em_path.h >em_path.h
if cmp ../h/em_path.h em_path.h >/dev/null 2>&1
then
: Don't touch ../h/em_path.h, it's already correct
else
rm -f ../h/em_path.h
if mv em_path.h ../h >/dev/null 2>&1
then : success
else
echo "Sorry, can't replace ../h/em_path.h"
exit 7
fi
fi
: translate myecho
if cc -o myecho myecho.c > /dev/null 2>&1
then
:
else
echo "Sorry, cc does not seem to work"
exit 8
fi
: find cc option for lex library
if fixlexlib
then
:
else
exit 9
fi
1985-02-15 23:00:46 +00:00
: remove non-system as and ld from descr files
if (ack_sys) >/dev/null 2>&1
then
: echo Your system is: `ack_sys`.
else
myecho -n "Give me the type of your system, the current choice is:
pdp_v7 PDP11 with sep I/D and version 7 (or BSD 2.8, 2.9)
1985-02-15 23:00:46 +00:00
vax_bsd4_1a VAX11 with BSD4.1a
vax_bsd4_2 VAX11 with BSD4.2
vax_sysV_2 VAX11 with System V.2
1985-02-15 23:00:46 +00:00
pc_ix IBM PC with PC/IX
1988-04-19 14:33:58 +00:00
xenix3 IBM AT running Microsoft Xenix V3.2
1985-02-15 23:00:46 +00:00
m68_unisoft Motorola 68000 with Unisoft UNIX
sun3 Sun 3 M68020 workstation
sun2 Sun 2 M68000 workstation
m68_sysV_0 Motorola 68000 with Uniplus System V.0 Unix
1987-10-05 09:59:16 +00:00
m68020 Motorola M68020 VME131 running Unix System V/68 R2V2.1
1985-02-15 23:00:46 +00:00
ANY Neither of the above
system type: "
if read SYSNAME
then
echo echo "$SYSNAME" >../bin/ack_sys
chmod +x ../bin/ack_sys
case `ack_sys` in
1988-04-19 14:33:58 +00:00
pdp_v7|vax_bsd4_1a|vax_bsd4_2|vax_sysV_2|pc_ix|m68_unisoft|sun3|sun2|m68_sysV_0|xenix3|m68020) ;;
*) echo None of the software especially intended for the named systems will work ;;
1985-02-15 23:00:46 +00:00
esac
else
echo Sorry, got EOF when reading system name.
exit 10
1985-02-15 23:00:46 +00:00
fi
fi
1987-03-26 10:33:30 +00:00
myecho -n "Your system is `ack_sys`, are you satisfied with that? (y/n) "
1985-02-15 23:00:46 +00:00
if read YESNO
then
case $YESNO in
j*|y*) ;;
n*) echo Ok, I will give you another chance....
rm -f ../bin/ack_sys
exec sh $0
;;
*) echo "I do not understand your answer ($YESNO). Bye"
exit 11
1985-02-15 23:00:46 +00:00
;;
esac
else
echo Sorry, got EOF when reading your answer.
exit 12
1985-02-15 23:00:46 +00:00
fi
: "Take action according to the system used"
: 'Prevent the use of the system assembler on for certain systems'
1987-03-17 00:33:41 +00:00
: 'prevent the use of ranlib on pdp 11s'
1985-02-15 23:00:46 +00:00
case `ack_sys` in
1987-03-17 00:33:41 +00:00
pdp_*) RMD="vax4"
1987-03-18 09:44:56 +00:00
echo 'echo "no ranlib on this system"; exit 93' > ../bin/ranlib
1987-03-17 00:33:41 +00:00
chmod +x ../bin/ranlib
ranlib > /dev/null 2>&1
case X$? in
X93) ;;
*) echo "Sorry, there still is an error in your PATH."
echo "It finds the system ranlib before ours, which is in the ACK bin directory."
exit 13
esac
;;
1988-04-19 14:33:58 +00:00
*) RMD="vax4" ;;
1985-02-15 23:00:46 +00:00
esac
for i in $RMD
do
( cd ../lib/$i
if grep '^name as$' descr >/dev/null 2>&1
then
cp descr descr.orig
1985-02-15 23:00:46 +00:00
ed - descr <<'ABC'
/^name as$/;/^end$/d
/^name ld$/;/^end$/d
w
q
ABC
fi
)
done
case `ack_sys` in
vax_bsd4_2) ( cd ../lib/vax4
cp descr descr.orig
ed - descr <<'ABC'
1987-04-03 10:51:37 +00:00
/CPP_F/s/$/ -D__BSD4_2/
w
q
ABC
)
;;
vax_sysV_2) ( cd ../lib/vax4
cp descr descr.orig
ed - descr <<'ABC'
1987-04-03 10:51:37 +00:00
/CPP_F/s/$/ -D__USG/
w
q
ABC
)
;;
esac
1985-02-15 23:00:46 +00:00
: 'Set the default machine in ../h/local.h'
BM=1
1985-02-15 23:00:46 +00:00
case `ack_sys` in
pdp_v7) ACM=pdp ; BM=0 ;;
vax_bsd4_1a) ACM=vax4 ;;
vax_bsd4_2) ACM=vax4 ;;
vax_sysV_2) ACM=vax4 ;;
pc_ix) ACM=i86 ; BM=0;;
1988-04-19 14:33:58 +00:00
xenix3) ACM=xenix3 ; BM=0;;
sun3) ACM=sun3 ;;
sun2) ACM=sun2 ;;
1985-02-15 23:00:46 +00:00
m68_unisoft) ACM=m68k2 ;;
m68_sysV_0) ACM=mantra ;;
1987-10-05 09:59:16 +00:00
m68020) ACM=m68020 ;;
*) ACM=m68k2 ;;
1985-02-15 23:00:46 +00:00
esac
rm -f local.h
sed -e /ACKM/s/'".*"'/'"'$ACM'"'/ -e /BIGMACH/s/'[01]'/$BM/ < ../h/local.h >local.h
1985-02-15 23:00:46 +00:00
if cmp -s ../h/local.h local.h
then :
else
cp local.h ../h
rm -f local.h
fi
echo "Your default machine to compile for is $ACM"
case `ack_sys` in
vax_bsd4_2)
( cd ../mach/vax4
echo "Copying mach/vax4/libbsd4_2 to mach/vax4/libsys"
1987-04-02 16:59:27 +00:00
mkdir libsys > /dev/null 2>&1
rm -f libsys/*
cp libbsd4_2/* libsys
1987-04-02 16:59:27 +00:00
)
;;
vax_bsd4_1a)
( cd ../mach/vax4
echo "Copying mach/vax4/libbsd4_1a to mach/vax4/libsys"
mkdir libsys > /dev/null 2>&1
rm -f libsys/*
cp libbsd4_1a/* libsys
)
;;
vax_sysV_2)
( cd ../mach/vax4
echo "Copying mach/vax4/libsysV_2 to mach/vax4/libsys"
1987-04-02 16:59:27 +00:00
mkdir libsys > /dev/null 2>&1
rm -f libsys/*
cp libsysV_2/* libsys
)
;;
esac
case X$BM in
X0)
( cd ../lang/cem/cemcom
cp SmallPars Parameters
cd ../../../lib/descr
cp fe fe.orig
ed - fe << ABC
/em_cemcom/i
prep always
.
1987-03-26 12:45:16 +00:00
/CPP_F/;.+2d
/CPP_F/;.+2d
1985-02-15 23:00:46 +00:00
w
q
ABC
)
1987-04-23 14:52:34 +00:00
for i in ../mach/vax4/cg ../mach/m68k2/cg ../mach/m68020/ncg
do
( cd $i
cp tables1.c tables.c
cp tables1.h tables.h
)
done
1987-03-25 17:39:18 +00:00
( cd ../modules/src/malloc
cp param.h param.h.orig
1988-04-19 14:33:58 +00:00
ed - param.h <<ABC
1987-03-25 17:39:18 +00:00
/STORE/s/define/undef/
w
q
ABC
)
1988-04-11 10:36:24 +00:00
( cd ../lang/m2/comp
cp SmallPars Parameters
cp Makefile Makefile.orig
ed - Makefile <<ABC
/MALLOC/s/=/=#/
w
q
ABC
1988-04-11 10:36:24 +00:00
)
;;
*) ( cd ../lang/cem/cemcom
cp BigPars Parameters
1988-04-11 10:36:24 +00:00
cd ../../m2/comp
cp BigPars Parameters
)
;;
1985-02-15 23:00:46 +00:00
esac
: find varargs include file
: if not present use our own
if [ -f /usr/include/varargs.h ]
then
:
else
cp ../include/_tail_cc/varargs.h ../modules/h
fi