-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·74 lines (62 loc) · 1.61 KB
/
build.sh
File metadata and controls
executable file
·74 lines (62 loc) · 1.61 KB
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
#!/bin/bash
set -e
if [ -z "${C_LIBRARY_DIR}" ] || [ -z "${CC_BUILD_DIR}" ];
then
echo "This script is supposed to be run by \`build.rs\`!" >&2
exit 1
fi
if ! [ "${TARGET}" = "armv7-linux-androideabi" ];
then
CC=cc
CFLAGS=
CXX=c++
CXXFLAGS=
fi
cmd() {
echo " • Running: $* …" >&2
"$@"
}
configure() {
if [ "${TARGET}" = "armv7-linux-androideabi" ];
then
#patch for fix compile conflict in wchar.h
cmd rm -f src/common/android/testing/include/wchar.h
cmd ./configure --host="${TARGET}" \
--disable-processor \
--disable-tools
else
cmd ./configure
fi
}
if test $(uname) = "Linux"; then
if ! [ -e "${CC_BUILD_DIR}/.git" ];
then
cmd git clone ssh://git@git.kaiostech.com/KaiOS/breakpad.git ./${CC_BUILD_DIR}
cmd git clone ssh://git@git.kaiostech.com/KaiOS/linux-syscall-support.git ./${CC_BUILD_DIR}/src/third_party/lss
cmd pushd "${CC_BUILD_DIR}"
configure
cmd popd
fi
if ! [ -d "src/generated" ];
then
cmd mkdir src/generated
fi
fi
cmd pushd "${CC_BUILD_DIR}"
# Update breakpad.
cmd git pull
# If any file changed, clean the build and re-configure
if ! [[ $(git diff-tree -r --name-only ORIG_HEAD HEAD) = "" ]];
then
cmd make clean
configure
fi
cmd make -j4
cmd popd
if test $(uname) = "Linux"; then
cmd $CXX -lstdc++ -std=c++11 -fPIC -c -static -pthread ${CXXFLAGS} \
-Isrc -I${CC_BUILD_DIR}/src src/rust_breakpad_linux.cc
ar -M < link.mri
mv librust_breakpad_client.a "$OUT_DIR"
rm rust_breakpad_linux.o
fi