Skip to content
Browse files

Initial import

  • Loading branch information...
0 parents commit 743790319b84fd29d755c2df77f7486880d11275 @st3fan st3fan committed Oct 4, 2010
Showing with 99 additions and 0 deletions.
  1. +20 −0 README
  2. +79 −0 build.sh
  3. BIN openssl-1.0.0a.tar.gz
20 README
@@ -0,0 +1,20 @@
+This script builds OpenSSL 1.0.0a for iOS.
+
+It builds multi-architecture libaries with armv6, armv7 and i386.
+
+This script is known to work with the following combination of software versions:
+
+ * MacOS X 10.6.4
+ * XCode 3.2.4 & iOS SDK 4.1
+
+Building is done by invoking the build.sh script:
+
+ ./build.sh
+
+It will take about 5 minutes on a modern Mac. The result of the build can be found at:
+
+ lib/ - will contain libssl.a and libcrypto.a
+ include/ - will contain all OpenSSL headers
+
+Enjoy.
+
79 build.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+# Yay shell scripting! This script builds a static version of
+# OpenSSL 1.0.0a for iOS 4.1 that contains code for armv6, armv7 and i386.
+
+set -x
+
+OPENSSL_CONFIGURE_OPTIONS=experimental-jpake
+
+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.1.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.1.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.1.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 \
+ /tmp/openssl-1.0.0a-i386/lib/libcrypto.a \
+ -create -output lib/libcrypto.a
+lipo \
+ /tmp/openssl-1.0.0a-armv6/lib/libssl.a \
+ /tmp/openssl-1.0.0a-armv7/lib/libssl.a \
+ /tmp/openssl-1.0.0a-i386/lib/libssl.a \
+ -create -output lib/libssl.a
+
+#rm -rf /tmp/openssl-1.0.0a-*
+#rm -rf /tmp/openssl-1.0.0a-*.log
+
BIN openssl-1.0.0a.tar.gz
Binary file not shown.

0 comments on commit 7437903

Please sign in to comment.
Something went wrong with that request. Please try again.