diff --git a/build_openssl_dist.sh b/build_openssl_dist.sh index 10e3920..3557755 100755 --- a/build_openssl_dist.sh +++ b/build_openssl_dist.sh @@ -31,6 +31,7 @@ function build_for () function pack_for () { LIBNAME=$1 + mkdir -p ${TMP_DIR}/lib/ ${DEVROOT}/usr/bin/lipo \ -arch i386 ${TMP_DIR}/i386/lib/lib${LIBNAME}.a \ -arch x86_64 ${TMP_DIR}/x86_64/lib/lib${LIBNAME}.a \ @@ -53,10 +54,10 @@ pack_for ssl || exit 6 pack_for crypto || exit 7 cp -r ${TMP_DIR}/armv7s/include ${TMP_DIR}/ -sed -i.old -e "90,96d" ${TMP_DIR}/include/openssl/opensslconf.h +sed -i.old -e "96,102d" ${TMP_DIR}/include/openssl/opensslconf.h rm -f ${TMP_DIR}/include/openssl/opensslconf.h.old curl -O https://raw.githubusercontent.com/sinofool/build-openssl-ios/master/patch-include.patch -patch ${TMP_DIR}/include/openssl/opensslconf.h < patch-include.patch +patch -p3 ${TMP_DIR}/include/openssl/opensslconf.h < patch-include.patch DIST_DIR=${HOME}/Desktop/openssl-ios-dist/ rm -rf ${DIST_DIR} diff --git a/patch-include.patch b/patch-include.patch index 6592a05..1e04ece 100644 --- a/patch-include.patch +++ b/patch-include.patch @@ -1,14 +1,28 @@ -137a138,140 -> #if defined(__LP64__) -> #undef BN_LLONG -> #else -138a142 -> #endif -142a147,151 -> #if defined(__LP64__) -> #define SIXTY_FOUR_BIT_LONG -> #undef SIXTY_FOUR_BIT -> #undef THIRTY_TWO_BIT -> #else -146a156 -> #endif +--- armv7s/include/openssl/opensslconf.h 2014-09-30 11:49:06.000000000 -0700 ++++ openssl-ios-dist/include/openssl/opensslconf.h 2014-09-30 11:58:34.000000000 -0700 +@@ -142,15 +142,25 @@ + + #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) + #define CONFIG_HEADER_BN_H ++#ifdef __LP64__ ++#undef BN_LLONG ++#else + #define BN_LLONG ++#endif + + /* Should we define BN_DIV2W here? */ + + /* Only one for the following should be defined */ ++#ifdef __LP64__ ++#define SIXTY_FOUR_BIT_LONG ++#undef SIXTY_FOUR_BIT ++#undef THIRTY_TWO_BIT ++#else + #undef SIXTY_FOUR_BIT_LONG + #undef SIXTY_FOUR_BIT + #define THIRTY_TWO_BIT + #endif ++#endif + + #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) + #define CONFIG_HEADER_RC4_LOCL_H