-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathw2c2.sh
executable file
·44 lines (34 loc) · 1.3 KB
/
w2c2.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
#!/bin/bash
# TODO make it wasm
. ${CONFIG:-config}
mkdir -p src native build/libdwarf build/zstd
DPIC="-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
pushd src
[ -d libdwarf-code ] || git clone --recursive --no-tags --depth 1 --single-branch --branch main https://github.com/davea42/libdwarf-code
[ -d w2c2 ] || git clone --recursive --no-tags --depth 1 --single-branch --branch main https://github.com/pygame-web/w2c2
wget -c -q https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz
tar xfz zstd-1.5.6.tar.gz
popd
if [ -f $HOST_PREFIX/lib/libzstd.a ]
then
echo "zstd already built"
else
pushd build/zstd
cmake $DPIC -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=$HOST_PREFIX ../../src/zstd-1.5.6/build/cmake
make -j $(nproc) && make install
popd
fi
if [ -f $HOST_PREFIX/bin/dwarfdump ]
then
echo "libdarwf already built"
else
pushd build/libdwarf
cmake $DPIC -DCMAKE_INSTALL_LIBDIR=lib -DENABLE_DECOMPRESSION=False -DCMAKE_INSTALL_PREFIX=$HOST_PREFIX ../../src/libdwarf-code
make install
popd
fi
pushd native
cmake $DPIC -DCMAKE_INSTALL_PREFIX=$HOST_PREFIX ${SDKROOT}/src/w2c2 \
-DDWARF_FOUND=1 -DDWARF_LIBRARIES="-ldwarf -lzstd" -DDWARF_LIBRARY_DIRS=$HOST_PREFIX/lib -DDWARF_INCLUDE_DIRS=$HOST_PREFIX/include
make
popd