File: build

package info (click to toggle)
stalin 0.11-6
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 110,396 kB
  • ctags: 163,122
  • sloc: ansic: 1,757,574; lisp: 88,332; sh: 1,514; makefile: 229; sed: 100; csh: 30
file content (95 lines) | stat: -rwxr-xr-x 2,547 bytes parent folder | download
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
87
88
89
90
91
92
93
94
95
#!/bin/sh

set -e

# 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"${CC}" = x ]
then
  CC=gcc
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

# For now we use the internal libgc, even on Debian, because the
# Debian package for the Boehm GC doesn't make the mods in
# gc-Makefile.sed and runs out of RAM during a bootstrap build.

#if [ x"${DEBIAN_SYSTEM}" != x ]
#then
#  ARCH_OPTS="${ARCH_OPTS} -g -I/usr/include/gc"
#fi

if false
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 -
  (cd gc6.8 && patch -p1 < ../debian/patches/libgc-amd64.diff)
  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
${CC} -c -O2 -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-arch-`./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}"