ctf-tools/panda/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

34 lines
924 B
Bash
Executable file

#!/bin/bash -ex
[ -e panda ] || git clone --depth 1 https://github.com/moyix/panda
curl -O http://ragestorm.net/distorm/distorm3.3-package.zip
rm -rf distorm3
unzip distorm3.3-package.zip
make -C distorm3/make/linux -j
mkdir -p lib
cp distorm3/make/linux/*.so distorm3/*.a lib
mkdir -p include
cp distorm3/include/*.h include
ctf-tools-pip install -U pycparser
sed -i -e "s|/usr/local|$PWD|" panda/qemu/build.sh
export QEMU_CFLAGS="-I $PWD/include -L $PWD/lib"
export QEMU_CXXFLAGS="-I $PWD/include -L $PWD/lib"
#export LDFLAGS="-L $PWD/lib"
cd panda/qemu
./build.sh
cd ../../
# link binaries
mkdir -p bin
cd bin
ln -s ../panda/qemu/i386-softmmu/qemu-system-i386 ./panda-qemu-system-i386
ln -s ../panda/qemu/arm-softmmu/qemu-system-arm ./panda-qemu-system-arm
ln -s ../panda/qemu/x86_64-softmmu/qemu-system-x86_64 ./panda-qemu-system-x86_64
for i in ../panda/scripts/*.py
do
ln -s $i ./panda-$(basename $i)
done
cd ..