radare2/sys/ios-simulator.sh

86 lines
1.8 KiB
Bash
Raw Normal View History

2014-05-17 04:27:49 +02:00
#!/bin/sh
2014-05-17 04:53:11 +02:00
if [ -z "${CPU}" ]; then
export CPU=arm64+armv7
export CPU=arm64
export CPU=armv7
2014-05-17 04:53:11 +02:00
fi
export CPU=arm64+armv7
export CPU=arm64+armv7
export PLGCFG=plugins.tiny.cfg
export CPU=x86_64
export SDK=iphonesimulator
#export CPU=arm64
export CPU=x86_64
export SDK=appletvsimulator
export CPU=x86_64
export SDK=watchsimulator
export CPU=armv7k
export SDK=watchos
export CPU=i386
export SDK=watchsimulator
export CPU=arm64
export SDK=appletvos
2015-12-30 03:41:46 +01:00
export CPU=armv7k
export SDK=watchos
2015-06-16 23:47:36 -04:00
export BUILD=1
2014-05-17 04:27:49 +02:00
PREFIX="/usr"
# PREFIX=/var/mobile
if [ ! -d sys/ios-include ]; then
(
cd sys && \
wget http://lolcathost.org/b/ios-include.tar.gz && \
tar xzvf ios-include.tar.gz
)
fi
export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH
2015-06-16 23:47:36 -04:00
export PATH=$(pwd)/sys:${PATH}
2015-12-30 03:41:46 +01:00
export CC="$(pwd)/sys/ios-sdk-gcc"
2014-05-17 04:27:49 +02:00
# set only for arm64, otherwise it is armv7
# select ios sdk version
export IOSVER=9.1
2015-06-16 23:47:36 -04:00
export IOSINC=$(pwd)/sys/ios-include
2014-05-22 02:29:09 +02:00
export CFLAGS=-O2
export USE_SIMULATOR=1
export RANLIB="xcrun --sdk iphoneos ranlib"
2014-05-17 04:27:49 +02:00
if [ "$1" = "-s" ]; then
exec bash
exit $?
fi
2014-05-17 04:27:49 +02:00
if true ; then
# make clean
cp -f ${PLGCFG} plugins.cfg
2014-05-17 04:27:49 +02:00
./configure --prefix=${PREFIX} --with-ostype=darwin \
--without-fork --without-pic --with-nonpic \
--disable-debugger --with-compiler=ios-sdk \
--target=arm-unknown-darwin
2014-05-17 04:27:49 +02:00
fi
if [ $? = 0 ]; then
time make -j4
2014-05-17 04:27:49 +02:00
if [ $? = 0 ]; then
2014-05-18 02:53:17 +02:00
( cd binr/radare2 ; make ios_sdk_sign )
2014-05-17 04:27:49 +02:00
rm -rf /tmp/r2ios
make install DESTDIR=/tmp/r2ios
2015-04-13 14:16:46 +02:00
rm -rf /tmp/r2ios/usr/share/radare2/*/www/enyo/node_modules
2015-06-16 23:47:36 -04:00
( cd /tmp/r2ios && tar czvf ../r2ios-${CPU}.tar.gz ./* )
2014-05-18 03:15:38 +02:00
rm -rf sys/cydia/radare2/root
mkdir -p sys/cydia/radare2/root
sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C sys/cydia/radare2/root
( cd sys/cydia/radare2 ; sudo make clean ; sudo make )
2014-05-17 04:27:49 +02:00
fi
fi