-
Notifications
You must be signed in to change notification settings - Fork 49
/
build_tools.sh
executable file
·67 lines (57 loc) · 2.31 KB
/
build_tools.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
if [ ! $(uname) == "Darwin" ]
then
echo "Script for Mac OS X only"
exit
fi
for VER in 5.0 5.1 6.0 6.1 7.0 7.1 8.0 8.1
do
if [ -d "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$VER.sdk/" ];
then
SDKVER=$VER
SDKPATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$VER.sdk/"
echo "Found iOS SDK at $SDKPATH"
break
fi
done
if [ "$SDKVER" == "" ]; then
echo "iOS SDK not found, make sure Xcode is installed"
exit -1
fi
if [ "$ARCH" == "armv6" ] && [ `echo "$VER >= 7.0" | bc` == "1" ]; then
echo "Need iOS 6 SDK for armv6 target"
exit -1
fi
if [ ! -f "$SDKPATH/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h" ]; then
echo "IOKit headers missing"
IOKIT_HDR="/System/Library/Frameworks/IOKit.framework/Headers"
IOKIT_HDR_109="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/IOKit.framework/Headers"
if [ -d $IOKIT_HDR_109 ]; then
echo "Symlinking headers"
set -x
sudo ln -s $IOKIT_HDR_109 "$SDKPATH/System/Library/Frameworks/IOKit.framework/Headers"
sudo ln -s "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libkern/OSTypes.h" "$SDKPATH/usr/include/libkern/OSTypes.h"
set +x
elif [ -d $IOKIT_HDR ]; then
echo "Symlinking headers"
set -x
sudo ln -s $IOKIT_HDR "$SDKPATH/System/Library/Frameworks/IOKit.framework/Headers"
set +x
fi
fi
if [ ! -f "$SDKPATH/System/Library/Frameworks/IOKit.framework/IOKit" ]; then
echo "IOKit binary missing"
if [ -f "$SDKPATH/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit" ]; then
echo "Creating IOKit symlink for iOS 7.0 SDK"
set -x
sudo ln -s "$SDKPATH/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit" "$SDKPATH/System/Library/Frameworks/IOKit.framework/IOKit"
set +x
fi
fi
if [ -f "$SDKPATH/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h" ] \
&& [ -f "$SDKPATH/System/Library/Frameworks/IOKit.framework/IOKit" ]; then
export SDKVER
export ARCH
make -C ramdisk_tools clean
make -C ramdisk_tools
fi