Created
January 10, 2014 09:51
-
-
Save emonti/8349289 to your computer and use it in GitHub Desktop.
quick/dirty build a dynamic lib from xpwn - eric monti
WARNING: this was for something really specific -- YMMV...
drop this in your top-level directory where you checked out planetbeing/xpwn and cross your fingers ;)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# quick/dirty build a dynamic lib from xpwn - eric monti | |
# WARNING: this was for something really specific -- YMMV... | |
# drop this in your top-level directory where you checked out planetbeing/xpwn and cross your fingers ;) | |
cmake -f CMakeLists.txt | |
make || exit 1 | |
rm -rf ./sharedlib | |
mkdir -p ./sharedlib/lib | |
tmpdir=`mktemp -d .sharedlib_build.XXXX` | |
echo "[+] building in $tmpdir" | |
pushd $tmpdir | |
for staticlib in `find .. -name \*.a -type f`; do | |
cp $staticlib ../sharedlib/lib/ | |
ar -x $staticlib | |
done | |
cc -o ../sharedlib/lib/libxpwn.dylib -dynamiclib *.o -lpng -lcrypto -lz -lstdc++ -lbz2 -framework CoreFoundation -framework IOKit | |
popd | |
test -f sharedlib/lib/libxpwn.dylib || exit 1 | |
echo "[+] removing $tmpdir" | |
rm -rf $tmpdir | |
cp -r includes ./sharedlib/include | |
echo "[+] build finished. files in $(pwd)/sharedlib" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment