2016-10-12 13:41:53 +00:00
|
|
|
#!/bin/bash
|
2016-10-13 09:54:06 +00:00
|
|
|
set -e -o pipefail
|
2016-10-12 13:41:53 +00:00
|
|
|
|
2016-10-13 10:02:36 +00:00
|
|
|
git clone --depth 1 https://github.com/keystone-engine/keystone.git
|
2016-10-12 13:41:53 +00:00
|
|
|
|
2016-10-12 15:49:55 +00:00
|
|
|
source ctf-tools-venv-activate
|
2016-10-12 13:41:53 +00:00
|
|
|
|
2016-10-13 11:39:55 +00:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2016-10-12 13:41:53 +00:00
|
|
|
mkdir -p keystone/build/
|
|
|
|
pushd keystone/build/
|
2016-10-13 11:39:55 +00:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX="$DIR" \
|
2016-10-12 13:41:53 +00:00
|
|
|
-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
|
2016-10-13 09:57:36 +00:00
|
|
|
pip install -U -e .
|
|
|
|
# create a symlink that the python bindings can find the keystone lib
|
2016-10-13 12:04:17 +00:00
|
|
|
ln -s $(readlink -f ../../../lib/libkeystone.so.0) keystone/libkeystone.so
|
2016-10-12 13:41:53 +00:00
|
|
|
popd
|
2016-10-12 15:49:55 +00:00
|
|
|
|
2016-10-13 09:57:36 +00:00
|
|
|
# kstool doesn't find the lib. so let's rm it
|
|
|
|
rm -r bin/
|