-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·55 lines (49 loc) · 1.28 KB
/
build.sh
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
#!/bin/sh
set -e
set -x
armv6 () {
echo "Building and packaging ARMv6 (hard float)"
TARGET_CFLAGS="-march=armv6+fp" cross build \
--release \
--target arm-unknown-linux-gnueabihf
CARGO_TARGET_DIR="./target" cargo deb \
--no-build \
--no-strip \
--variant v6 \
--target arm-unknown-linux-gnueabihf \
--output ./
}
armv7() {
echo "Building and packaging ARMv7 (hard float)"
# cross 0.21 has *ancient* versions fo GCC for the
# armv7-unknown-linux-gnueabihf docker image (4.6.2) so we need to use an
# older way to use neon instructions. If/when the images are upgraded, just
# `-march=armv7-a+simd` can be used.
TARGET_CFLAGS="-march=armv7-a -mfpu=neon" cross build \
--release \
--target armv7-unknown-linux-gnueabihf \
--features mozjpeg_simd
CARGO_TARGET_DIR="./target" cargo deb \
--no-build \
--no-strip \
--variant v7 \
--target armv7-unknown-linux-gnueabihf \
--output ./
}
armv8() {
echo "Building and packaging 64-bit ARM"
cross build \
--release \
--target aarch64-unknown-linux-gnu \
--features mozjpeg_simd
CARGO_TARGET_DIR="./target" cargo deb \
cargo deb \
--no-build \
--no-strip \
--target aarch64-unknown-linux-gnu \
--output ./
}
# Later I should add a way to just build one arch, but for now build them all
armv6
armv7
armv8