forked from st3fan/ios-openssl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·85 lines (67 loc) · 2.88 KB
/
build.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
# Yay shell scripting! This script builds a static version of
# OpenSSL 1.0.0a for iOS 4.2 that contains code for armv6, armv7 and i386.
set -x
OPENSSL_CONFIGURE_OPTIONS=
rm -rf include lib *.log
rm -rf /tmp/openssl-1.0.0a-*
rm -rf /tmp/openssl-1.0.0a-*.log
# ARMv6
rm -rf openssl-1.0.0a
tar xfz openssl-1.0.0a.tar.gz
pushd .
cd openssl-1.0.0a
./configure BSD-generic32 --openssldir=/tmp/openssl-1.0.0a-armv6 $OPENSSL_CONFIGURE_OPTIONS &> /tmp/openssl-1.0.0a-armv6.log
perl -i -pe 's|static volatile sig_atomic_t intr_signal|static volatile int intr_signal|' crypto/ui/ui_openssl.c
perl -i -pe 's|^CC= gcc|CC= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6|g' Makefile
perl -i -pe 's|^CFLAG= (.*)|CFLAG= -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk $1|g' Makefile
make &> /tmp/openssl-1.0.0a-armv6.log
make install &> /tmp/openssl-1.0.0a-armv6.log
popd
rm -rf openssl-1.0.0a
# ARMv7
rm -rf openssl-1.0.0a
tar xfz openssl-1.0.0a.tar.gz
pushd .
cd openssl-1.0.0a
./configure BSD-generic32 --openssldir=/tmp/openssl-1.0.0a-armv7 $OPENSSL_CONFIGURE_OPTIONS >> /tmp/openssl-1.0.0a-armv7.log
perl -i -pe 's|static volatile sig_atomic_t intr_signal|static volatile int intr_signal|' crypto/ui/ui_openssl.c
perl -i -pe 's|^CC= gcc|CC= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7|g' Makefile
perl -i -pe 's|^CFLAG= (.*)|CFLAG= -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk $1|g' Makefile
make &> /tmp/openssl-1.0.0a-armv7.log
make install &> /tmp/openssl-1.0.0a-armv7.log
popd
rm -rf openssl-1.0.0a
# i386
rm -rf openssl-1.0.0a
tar xfz openssl-1.0.0a.tar.gz
pushd .
cd openssl-1.0.0a
./configure BSD-generic32 --openssldir=/tmp/openssl-1.0.0a-i386 $OPENSSL_CONFIGURE_OPTIONS >> /tmp/openssl-1.0.0a-i386.log
perl -i -pe 's|static volatile sig_atomic_t intr_signal|static volatile int intr_signal|' crypto/ui/ui_openssl.c
perl -i -pe 's|^CC= gcc|CC= /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386|g' Makefile
perl -i -pe 's|^CFLAG= (.*)|CFLAG= -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk $1|g' Makefile
make &> /tmp/openssl-1.0.0a-i386.log
make install &> /tmp/openssl-1.0.0a-i386.log
popd
rm -rf openssl-1.0.0a
#
mkdir include
cp -r /tmp/openssl-1.0.0a-i386/include/openssl include/
mkdir lib
lipo \
/tmp/openssl-1.0.0a-armv6/lib/libcrypto.a \
/tmp/openssl-1.0.0a-armv7/lib/libcrypto.a \
-create -output lib/libcrypto-iphoneos.a
lipo \
/tmp/openssl-1.0.0a-armv6/lib/libssl.a \
/tmp/openssl-1.0.0a-armv7/lib/libssl.a \
-create -output lib/libssl-iphoneos.a
lipo \
/tmp/openssl-1.0.0a-i386/lib/libcrypto.a \
-create -output lib/libcrypto-iphonesimulator.a
lipo \
/tmp/openssl-1.0.0a-i386/lib/libssl.a \
-create -output lib/libssl-iphonesimulator.a
#rm -rf /tmp/openssl-1.0.0a-*
#rm -rf /tmp/openssl-1.0.0a-*.log