ctf-tools/keystone/install

26 lines
656 B
Text
Raw Normal View History

#!/bin/bash
set -e -o pipefail
git clone --depth 1 https://github.com/keystone-engine/keystone.git
source ctf-tools-venv-activate
mkdir -p keystone/build/
pushd keystone/build/
cmake -DCMAKE_INSTALL_PREFIX="$(realpath $PWD/../../)" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_TARGETS_TO_BUILD="all" \
-G "Unix Makefiles" ..
make -j$(getconf _NPROCESSORS_ONLN) install
popd
pushd keystone/bindings/python
pip install -U -e .
# create a symlink that the python bindings can find the keystone lib
ln -s $(realpath ../../../lib/libkeystone.so.0) keystone/libkeystone.so
popd
# kstool doesn't find the lib. so let's rm it
rm -r bin/