openssl-apple/create-openssl-framework.sh

37 lines
981 B
Bash
Raw Normal View History

#!/bin/sh
FWNAME=openssl
if [ ! -d lib ]; then
echo "Please run build-libssl.sh first!"
exit 1
fi
if [ -d $FWNAME.framework ]; then
echo "Removing previous $FWNAME.framework copy"
rm -rf $FWNAME.framework
fi
if [ "$1" == "dynamic" ]; then
LIBTOOL_FLAGS="-dynamic -undefined dynamic_lookup -ios_version_min 8.0"
else
LIBTOOL_FLAGS="-static"
fi
echo "Creating $FWNAME.framework"
mkdir -p $FWNAME.framework/Headers
libtool -no_warning_for_no_symbols $LIBTOOL_FLAGS -o $FWNAME.framework/$FWNAME lib/libcrypto.a lib/libssl.a
cp -r include/$FWNAME/* $FWNAME.framework/Headers/
DIR="$(cd "$(dirname "$0")" && pwd)"
cp $DIR/"OpenSSL-for-iOS/OpenSSL-for-iOS-Info.plist" $FWNAME.framework/Info.plist
echo "Created $FWNAME.framework"
2016-09-18 18:07:59 +00:00
check_bitcode=`otool -arch arm64 -l $FWNAME.framework/$FWNAME | grep __bitcode`
if [ -z "$check_bitcode" ]
then
2016-09-28 19:54:59 +00:00
echo "INFO: $FWNAME.framework doesn't contain Bitcode"
2016-09-18 18:07:59 +00:00
else
echo "INFO: $FWNAME.framework contains Bitcode"
fi