From b6dd1dbcf77afcf12d6156c5996ceb7a9f86414c Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Sat, 12 Oct 2013 14:05:36 +0200 Subject: [PATCH] Add support for x86_64 Fixes #21 --- README.md | 3 ++- build-libssl.sh | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3fca7cf..d189e0d 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,12 @@ You must build the OpenSSL-Libraries before running the sample with: This repository contains a iOS 6.1 XCode Project with usese the OpenSSL Libaries. The examples uses the MD5 or SHA256-algorithm to calculate an md5 or sha256 hash from an UITextfield. ## System support -**iOS 4.3 - iOS 7.0 (i386, armv7, armv7s, armv64) is currently supported.** +**iOS 4.3 - iOS 7.0 (i386, x86_64, armv7, armv7s, armv64) is currently supported.** For iOS < 4.3 you must use iOS SDK < 6.0 and an older version of the build script. ## Changelog +* 2013-10-12: x86_64 support * 2013-09-23: iOS 7.0 support * 2013-03-01: OpenSSL 1.0.1e, iOS 6.1 * 2012-09-21: Support for iOS 6.0 and iPhone 5 (armv7s) - Remove armv6 support diff --git a/build-libssl.sh b/build-libssl.sh index 24436bd..5394d57 100755 --- a/build-libssl.sh +++ b/build-libssl.sh @@ -32,7 +32,7 @@ SDKVERSION="7.0" # CURRENTPATH=`pwd` -ARCHS="i386 armv7 armv7s arm64" +ARCHS="i386 x86_64 armv7 armv7s arm64" DEVELOPER=`xcode-select -print-path` if [ ! -d "$DEVELOPER" ]; then @@ -62,7 +62,7 @@ cd "${CURRENTPATH}/src/openssl-${VERSION}" for ARCH in ${ARCHS} do - if [ "${ARCH}" == "i386" ]; + if [[ "${ARCH}" == "i386" || "${ARCH}" == "x86_64" ]]; then PLATFORM="iPhoneSimulator" else @@ -83,12 +83,14 @@ do if [[ "$VERSION" =~ 1.0.0. ]]; then ./Configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1 + elif [ "${ARCH}" == "x86_64" ]; then + ./Configure darwin64-x86_64-cc --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1 else ./Configure iphoneos-cross --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1 fi # add -isysroot to CC= - sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/Platforms/${PLATFORM}.platform/Developer/SDKs/${CROSS_SDK} -miphoneos-version-min=7.0 !" "Makefile" + sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=7.0 !" "Makefile" make >> "${LOG}" 2>&1 make install >> "${LOG}" 2>&1 @@ -96,9 +98,9 @@ do done echo "Build library..." -lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7s.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/lib/libssl.a -output ${CURRENTPATH}/lib/libssl.a +lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-x86_64.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7s.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/lib/libssl.a -output ${CURRENTPATH}/lib/libssl.a -lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7s.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/lib/libcrypto.a -output ${CURRENTPATH}/lib/libcrypto.a +lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-x86_64.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7s.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-arm64.sdk/lib/libcrypto.a -output ${CURRENTPATH}/lib/libcrypto.a mkdir -p ${CURRENTPATH}/include cp -R ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}-i386.sdk/include/openssl ${CURRENTPATH}/include/