1991-10-15 16:02:38 +00:00
|
|
|
know_target=0
|
|
|
|
case $SYSNAME in
|
1993-10-07 09:09:16 +00:00
|
|
|
vax*|i386|sun*|sparc*|m68_sysV_0|m68020|mantra|pmds4|m68k4)
|
1991-10-15 16:02:38 +00:00
|
|
|
WS=4 ; PS=4
|
|
|
|
know_target=1
|
|
|
|
;;
|
|
|
|
m68_unisoft|m68k2|minixST|pmds)
|
|
|
|
WS=2 ; PS=4
|
|
|
|
know_target=1
|
|
|
|
;;
|
|
|
|
i86|minix|xenix3)
|
|
|
|
WS=2 ; PS=2
|
|
|
|
know_target=1
|
|
|
|
;;
|
1993-10-07 09:09:16 +00:00
|
|
|
*) trap "rm -f ws.c ws.o a.out t$$" 0 1 2 3 15
|
1991-10-15 16:02:38 +00:00
|
|
|
cat > ws.c <<'EOF'
|
|
|
|
#include <stdio.h>
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
printf("WS=%d ; PS=%d\n", sizeof(int), sizeof(char *));
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
EOF
|
1993-10-07 09:09:16 +00:00
|
|
|
if [ $TARGET_HOME = $UTIL_HOME ] && cc ws.c 2>/dev/null
|
|
|
|
then
|
|
|
|
: We can find out ourselves what the word-size and
|
|
|
|
: the pointer-size of the target machine is.
|
1991-10-15 16:02:38 +00:00
|
|
|
cc ws.c 2>/dev/null
|
2002-09-11 13:19:23 +00:00
|
|
|
./a.out > t$$
|
1991-10-15 16:02:38 +00:00
|
|
|
. t$$
|
|
|
|
rm -f t$$ a.out ws.[co]
|
|
|
|
else
|
|
|
|
: we will have to ask installer.
|
1991-11-18 09:53:58 +00:00
|
|
|
echo $E_FLAG "Please give the word-size of the target-machine (sizeof(int)) in bytes: [$WS] $E_SFX"
|
1991-10-15 16:02:38 +00:00
|
|
|
. $FDIR/get_answer
|
|
|
|
case $ANS in
|
|
|
|
'') ANS="$WS";;
|
|
|
|
esac
|
|
|
|
WS="$ANS"
|
1991-11-18 09:53:58 +00:00
|
|
|
echo $E_FLAG "Please give the pointer-size of the target-machine (sizeof(char *)) in bytes: [$PS] $E_SFX"
|
1991-10-15 16:02:38 +00:00
|
|
|
. $FDIR/get_answer
|
|
|
|
case $ANS in
|
|
|
|
'') ANS="$PS";;
|
|
|
|
esac
|
|
|
|
PS="$ANS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "# Paths:
|
|
|
|
SRC_HOME = $SRC_HOME
|
|
|
|
TARGET_HOME = $TARGET_HOME
|
|
|
|
UTIL_HOME = $UTIL_HOME
|
|
|
|
|
|
|
|
# Machine independent part created?
|
|
|
|
DO_MACHINE_INDEP = $DO_MACHINE_INDEP
|
1991-11-14 09:35:36 +00:00
|
|
|
|
|
|
|
# Target machine, only needed for fast compilers
|
|
|
|
MACH = $MACH
|
1991-10-15 16:02:38 +00:00
|
|
|
" > make_macros
|
|
|
|
|
|
|
|
if [ $TARGET_HOME = $UTIL_HOME ]
|
|
|
|
then
|
1991-12-18 14:51:08 +00:00
|
|
|
if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ]
|
|
|
|
then
|
1993-10-07 09:09:16 +00:00
|
|
|
sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros
|
1991-12-18 14:51:08 +00:00
|
|
|
else
|
1993-10-07 09:09:16 +00:00
|
|
|
sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros
|
1991-12-18 14:51:08 +00:00
|
|
|
fi
|
1993-11-10 16:07:31 +00:00
|
|
|
case $ACM in
|
|
|
|
sun3|sparc)
|
1995-08-14 08:08:56 +00:00
|
|
|
ed -s make_macros <<'EOF'
|
1991-10-15 16:02:38 +00:00
|
|
|
/cc-and-mkdep.sun/s/^..//
|
|
|
|
w
|
|
|
|
q
|
|
|
|
EOF
|
1993-11-10 16:07:31 +00:00
|
|
|
;;
|
|
|
|
esac
|
1991-10-15 16:02:38 +00:00
|
|
|
cat $FDIR/util_comp >> make_macros
|
|
|
|
else
|
1991-10-22 10:55:19 +00:00
|
|
|
case $know_target in
|
1993-10-07 09:09:16 +00:00
|
|
|
1) sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "/cc-and-mkdep.ack/s/^..//" -e "s/^CC=cc/CC=acc -m$ACM/" -e "s/^# AR=aal/AR=aal/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros
|
1991-10-15 16:02:38 +00:00
|
|
|
;;
|
1991-12-18 14:51:08 +00:00
|
|
|
*) if [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ]
|
|
|
|
then
|
1993-10-07 09:09:16 +00:00
|
|
|
sed "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" < $FDIR/target_comp >> make_macros
|
1991-12-18 14:51:08 +00:00
|
|
|
else
|
1993-10-07 09:09:16 +00:00
|
|
|
sed -e "s/^COPTIONS.*\$/COPTIONS=-O -D_EM_WSIZE=$WS -D_EM_PSIZE=$PS -D__${MACH}__/" -e "s/^# RANLIB=:/RANLIB=:/" < $FDIR/target_comp >> make_macros
|
1991-12-18 14:51:08 +00:00
|
|
|
fi
|
1991-10-15 16:02:38 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
sed "s/^#U/U/" < $FDIR/util_comp >> make_macros
|
|
|
|
fi
|
|
|
|
|
|
|
|
cat $FDIR/lint_params >> make_macros
|
|
|
|
|
|
|
|
echo "A file called 'make_macros' has been created. This file defines some
|
|
|
|
'make' variables that parameterize all Makefiles in ACK. You may want
|
|
|
|
to check it before attempting to actually install ACK."
|
1991-10-22 10:55:19 +00:00
|
|
|
case $know_target in
|
1991-10-15 16:02:38 +00:00
|
|
|
0) echo "In fact, this installation script does not know much about
|
|
|
|
your target machine, so expect some things to be wrong"
|
|
|
|
;;
|
|
|
|
esac
|