fix mac ida plugin build

This commit is contained in:
George Hotz 2014-07-04 23:40:46 -07:00
parent c7673e1148
commit 65ae3d6239

View File

@ -1,22 +1,25 @@
#!/bin/sh
#!/bin/bash
set -e
unamestr=$(uname)
if [[ "$unamestr" == 'Linux' ]]; then
SDKROOT=~/build/idasdk66
IDAROOT=~/ida-6.6
OUTPUT="qira.plx"
ln -sf linux_libwebsockets.a libwebsockets.a
elif [[ "$unamestr" == 'Darwin' ]]; then
SDKROOT=~/idasrc
IDAROOT="/Applications/IDA Pro 6.6/idaq.app/Contents/MacOS/"
OUTPUT="qira.pmc"
ln -sf mac_libwebsockets.a libwebsockets.a
fi
g++ template.cpp -m32 -fPIC -D__IDP__ -D__PLUGIN__ -c -D__LINUX__ -I . -I$SDKROOT/include
g++ -m32 --shared template.o "-L$IDAROOT" -lida -o qira.plx libwebsockets.a -lcrypto -lz -lssl -lpthread
sha1sum qira.plx
if [ "$(diff qira.plx "$IDAROOT/plugins/qira.plx")" != "" ]; then
g++ -m32 --shared template.o "-L$IDAROOT" -lida -o $OUTPUT libwebsockets.a -lcrypto -lz -lssl -lpthread
sha1sum $OUTPUT
if [ "$(diff $OUTPUT "$IDAROOT/plugins/$OUTPUT")" != "" ]; then
echo "copying plugin"
cp qira.plx $IDAROOT/plugins
cp $OUTPUT $IDAROOT/plugins
fi