-
Notifications
You must be signed in to change notification settings - Fork 24
/
build
executable file
·86 lines (73 loc) · 2.35 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
# On SPARCv9 under Solaris you need to use cc since gcc doesn't support
# SPARCv9 under Solaris.
# On PowerPC64 under AIX you cannot compile the compiler with gcc since you
# get errors of the form:
# 1252-171 The displacement must be greater than or equal to
# -32768 and less than or equal to 32767.
# It might be possible to compile smaller programs with gcc. To compile the
# compiler you need to use cc. It is not clear whethr you can compile libgc.a
# and libstalin.a with one compiler and Scheme programs such as Stalin with
# another.
if [ -r /etc/debian_version ]
then
DEBIAN_SYSTEM=t
fi
#if [ x"${DEBIAN_SYSTEM}" != x ]
#then
# ARCH_OPTS="${ARCH_OPTS} -g -I/usr/include/gc"
#fi
case `uname -s`/`uname -r` in
IRIX*/*) RANLIB=touch;;
SunOS/5.*) RANLIB=touch;;
*) RANLIB=ranlib;;
esac
# gc-Makefile.sed changed CC from cc to gcc and adds
# -DLARGE_CONFIG -DUSE_MMAP -DDONT_ADD_BYTE_AT_END
# to CFLAGS.
# Might also try -DSILENT and either
# -DUSE_I686_PREFETCH or -DUSE_3DNOW_PREFETCH
# The Debian conditionalization has been removed since the Debian package for
# the Boehm GC doesn't make the mods from gc-Makefile.sed.
#if [ x"${DEBIAN_SYSTEM}" = x ]
#then
# Under Debian, we have libgc, but otherwise, don't assume we have the Boehm
# GC available.
rm -rf gc6.8
gunzip -c gc6.8.tar.gz | tar xf -
rm -f gc6.8/Makefile.new
sed -f gc-Makefile.sed gc6.8/Makefile >gc6.8/Makefile.new
mv -f gc6.8/Makefile.new gc6.8/Makefile
cd gc6.8
make test
cd ..
cp -f gc6.8/include/gc.h include/.
cp -f gc6.8/gc.a include/libgc.a
cp -f gc6.8/include/gc_config_macros.h include/.
$RANLIB include/libgc.a
rm -rf gc6.8
#fi
cd include
rm -f libstalin.a
gcc -c -O3 -fomit-frame-pointer -freg-struct-return xlib-c.c
ar rc libstalin.a xlib-c.o
$RANLIB libstalin.a
rm xlib-c.o
cd ..
case `./include/stalin-architecture-name` in
unknown)
echo "Cannot (yet) run Stalin on this architecture"
exit 1;;
*)
cp -f stalin-`./include/stalin-architecture-name`.c stalin.c;;
esac
# Stalin can be compiled with -freg-struct-return on most platforms. But gcc
# and egcs have a bug on Linux/Alpha that causes them to crash when given
# -freg-struct-return.
case `uname -m`/`uname -s` in
alpha/Linux)
ARCH_OPTS="${ARCH_OPTS}";;
*)
ARCH_OPTS="${ARCH_OPTS} -freg-struct-return";;
esac
exec make ARCH_OPTS="${ARCH_OPTS}"