ctf-tools/keystone/install
Steven Van Acker 7144e756e5 fail hard on any error + verify that all scripts use bash -ex to fail
early on any error + anticipate that some tools can't be installed by
now, but we still want the test to return success to satisfy travis-ci
2017-02-16 22:40:17 +01:00

27 lines
701 B
Bash
Executable file

#!/bin/bash -ex
set -e -o pipefail
git clone --depth 1 https://github.com/keystone-engine/keystone.git
source ctf-tools-venv-activate
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
mkdir -p keystone/build/
pushd keystone/build/
cmake -DCMAKE_INSTALL_PREFIX="$DIR" \
-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 $(readlink -f ../../../lib/libkeystone.so.0) keystone/libkeystone.so
popd
# kstool doesn't find the lib. so let's rm it
rm -r bin/