-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·55 lines (46 loc) · 1.24 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
55
#!/bin/sh
#
# Just Build It.
set -eu
die() { echo >&2 "$@"; exit 1; }
if [ ! -x "$(which meson)" ]; then
die "We need meson in the path; consider
pip3 install --user meson
ln -s ~/.local/bin/meson.py ~/bin/meson
or similar."
fi
if [ ! -x "$(which ninja)" ]; then die "We need ninja in the path"; fi
git submodule init
git submodule update
base=$(pwd)
build=$base/build
mkdir -p "$build"
(
if [ -f ./build/lib/elfutils/libebl_x86_64.so ]; then
echo Skipping elfutils
exit 0
fi
echo Building elfutils
cd vendor/elfutils
if [ ! -x ./configure ]; then
aclocal -I m4 && autoheader && libtoolize && autoconf && automake --add-missing --force-missing --copy
fi
./configure --enable-maintainer-mode --prefix="$build"
make all install
)
echo Building erlang-sample
(
if [ ! -f "$build/build.ninja" ]; then
mkdir -p "$build" && meson . "$build"
fi
ninja -C "$build"
)
(
if [ -f "vendor/perf/tools/perf/perf" ]; then
echo Skipping perf
exit 0
fi
echo Building perf
cd vendor/perf/tools/perf/
LD_LIBRARY_PATH="$build/lib" EXTRA_CFLAGS="-I$base/src -I$build/include" LIBDW_DIR="$build" NO_LIBUNWIND=1 WERROR=0 LDFLAGS="-L$build/lib -ldw" DEBUG=1 make
)