Skip to content

Commit

Permalink
Merge pull request #1355 from meganz/release/v3.4.6
Browse files Browse the repository at this point in the history
Release/v3.4.6
  • Loading branch information
sergiohs84 authored Feb 11, 2019
2 parents 4dea1c5 + 642c257 commit 31196cb
Show file tree
Hide file tree
Showing 78 changed files with 1,482 additions and 2,075 deletions.
53 changes: 28 additions & 25 deletions bindings/ios/3rdparty/build-cryptopp.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
#!/bin/sh

PROJECT_NAME="cryptopp"
CRYPTOPP_VERSION="565"
CURRENTPATH=`pwd`

UNIVERSAL_OUTPUTFOLDER="lib"
BUILD_DIR="cryptopp"
CONFIGURATION="Release"
BUILD_ROOT="cryptopp"

##############################################
CRYPTOPP_VERSION="982655845a784a9a4cfbc92221359a25a74184a3"

set -e

if [ ! -e "cryptopp${CRYPTOPP_VERSION}.zip" ]
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)

if [ ! -e "${CRYPTOPP_VERSION}.tar.gz" ]
then
curl -LO "http://www.cryptopp.com/cryptopp${CRYPTOPP_VERSION}.zip"
curl -LO "https://github.com/weidai11/cryptopp/archive/${CRYPTOPP_VERSION}.tar.gz"
fi

unzip cryptopp${CRYPTOPP_VERSION}.zip -d cryptopp

# Step 1. Build versions for devices and simulator
xcodebuild -jobs 8 -target cryptopp ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
xcodebuild -jobs 8 -target cryptopp ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

# Make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

# Step 2. Create universal binary file, using lipo
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"
ARCHS="x86_64 armv7 armv7s arm64"

for ARCH in ${ARCHS}
do
tar zxf ${CRYPTOPP_VERSION}.tar.gz
pushd cryptopp-${CRYPTOPP_VERSION}
source setenv-ios.sh ${ARCH}
mkdir -p "${CURRENTPATH}/bin/${ARCH}.sdk"
make -f GNUmakefile-cross lean -j ${NPROCESSORS}
mv libcryptopp.a "${CURRENTPATH}/bin/${ARCH}.sdk"
popd
rm -rf cryptopp-${CRYPTOPP_VERSION}
done

mkdir -p lib

lipo -create "${CURRENTPATH}/bin/x86_64.sdk/libcryptopp.a" "${CURRENTPATH}/bin/armv7.sdk/libcryptopp.a" "${CURRENTPATH}/bin/armv7s.sdk/libcryptopp.a" "${CURRENTPATH}/bin/arm64.sdk/libcryptopp.a" -output "${CURRENTPATH}/libcryptopp.a"

tar zxf ${CRYPTOPP_VERSION}.tar.gz
mkdir -p include/cryptopp || true
cp -f cryptopp/*.h include/cryptopp
sed -i '' $'s/\#ifdef CRYPTOPP_DISABLE_X86ASM/\#define CRYPTOPP_DISABLE_X86ASM\\\n\#ifdef CRYPTOPP_DISABLE_X86ASM/' include/cryptopp/config.h
cp -f cryptopp-${CRYPTOPP_VERSION}/*.h include/cryptopp
rm -rf cryptopp-${CRYPTOPP_VERSION}
mv -f libcryptopp.a lib/

rm -rf cryptopp
rm -rf build
rm -rf bin
rm -rf ${CRYPTOPP_VERSION}.tar.gz

echo "Done."
1,013 changes: 0 additions & 1,013 deletions bindings/ios/3rdparty/cryptopp.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 31196cb

Please sign in to comment.