2014-05-17 02:27:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH
|
|
|
|
|
2014-11-06 10:57:19 +00:00
|
|
|
CWD=`dirname $0`
|
2014-05-17 02:27:49 +00:00
|
|
|
if [ -z "${CPU}" ]; then
|
|
|
|
CPU=armv7
|
|
|
|
#CPU=arm64
|
|
|
|
fi
|
|
|
|
if [ -z "${IOSVER}" ]; then
|
2015-04-13 01:27:24 +00:00
|
|
|
IOSVER=8.3
|
2014-05-17 02:27:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
DEVROOT=/Applications/Xcode.app/Contents/Developer
|
|
|
|
SDKROOT=${DEVROOT}/Platforms/iPhoneOS.platform
|
|
|
|
IOSROOT=${SDKROOT}/Developer/SDKs/iPhoneOS${IOSVER}.sdk
|
|
|
|
|
|
|
|
CFLAGS="-isysroot ${SDKROOT} -I${SDKROOT} -D__arm=1"
|
|
|
|
LDFLAGS="-isysroot ${SDKROOT}"
|
|
|
|
# -Wl, -syslibroot ${SDKROOT}"
|
|
|
|
export PATH=${DEVROOT}/usr/bin:${SDKROOT}/Developer/usr/bin:${PATH}
|
|
|
|
CC=${DEVROOT}/usr/bin/gcc
|
|
|
|
LD=${CC}
|
|
|
|
CFLAGS="${CFLAGS} -arch ${CPU}"
|
2014-11-06 10:57:19 +00:00
|
|
|
if [ -z "${IOSINC}" ]; then
|
|
|
|
IOSINC=${CWD}/ios-include
|
|
|
|
IOSINC=/Users/pancake/prg/radare2/sys/ios-include
|
|
|
|
fi
|
2014-05-17 02:27:49 +00:00
|
|
|
if [ -n "${IOSINC}" ]; then
|
2014-11-06 10:57:19 +00:00
|
|
|
CFLAGS="${CFLAGS} -I${IOSINC}"
|
2014-05-17 02:27:49 +00:00
|
|
|
fi
|
|
|
|
CFLAGS="${CFLAGS} -I${IOSROOT}/usr/include"
|
2014-11-06 10:57:19 +00:00
|
|
|
#CFLAGS="${CFLAGS} -I${IOSROOT}/usr/include"
|
2014-05-17 02:27:49 +00:00
|
|
|
LDFLAGS="-L ${IOSROOT}/usr/lib/system ${LDFLAGS}"
|
|
|
|
LDFLAGS="-L ${IOSROOT}//usr/lib/ ${LDFLAGS}"
|
|
|
|
|
|
|
|
# Workaround
|
2014-11-06 10:57:19 +00:00
|
|
|
#if [ ! -e ${IOSROOT}/usr/lib/system/libcrypto.dylib ]; then
|
|
|
|
#sudo cp \
|
|
|
|
# ${IOSROOT}/usr/lib/system/libcorecrypto.dylib \
|
|
|
|
# ${IOSROOT}/usr/lib/system/libcrypto.dylib
|
|
|
|
#fi
|
2014-05-17 02:27:49 +00:00
|
|
|
|
|
|
|
# arm64
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} $@
|