blob: 1695dfedc491562e855f7c1c7c5a1e8d1f7f7afc (
plain)
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
|
#!/bin/sh
fail() {
echo "$0: $*" >&2
exit 1
}
ODIN_FLAGS="-vet -warnings-as-errors -reloc-mode=pic"
output="output"
for arg ; do
case "$arg" in
--runtime=*)
runtime="${arg#*=}"
;;
--output=*)
output="${arg#*=}"
;;
--release)
release=1
;;
--client)
ODIN_FLAGS="$ODIN_FLAGS -define:DJUP_CLIENT=true"
;;
--server)
ODIN_FLAGS="$ODIN_FLAGS -define:DJUP_SERVER=true"
;;
*)
echo "usage"
;;
esac
done
if [ -z "$runtime" ]; then
echo "Guessing runtime ..."
case "$(uname -s)" in
Linux)
case "$(uname -m)" in
x86_64)
runtime="linux-x64"
;;
esac
;;
esac
fi
case "$runtime" in
linux-x64)
sofile="libdjup.so"
target="linux_amd64"
;;
*)
fail "Unsupported runtime $runtime"
esac
if [ ! -z "$release" ]; then
optimize="-o=speed"
else
optimize="-o=none"
fi
echo Building for runtime "$runtime ..."
echo ODIN_FLAGS=$ODIN_FLAGS
mkdir -p "$output/$runtime" && \
odin build . -build-mode=shared -out="$output/$runtime/$sofile" $ODIN_FLAGS $optimize && \
echo Done
|