2014-11-06 11:05:28 +00:00
|
|
|
#!/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
|
|
|
|
|
2015-05-05 18:25:00 +00:00
|
|
|
if [ "$1" == "dynamic" ]; then
|
2015-11-25 12:48:56 +00:00
|
|
|
LIBTOOL_FLAGS="-dynamic -undefined dynamic_lookup -ios_version_min 8.0"
|
2015-05-05 18:25:00 +00:00
|
|
|
else
|
|
|
|
LIBTOOL_FLAGS="-static"
|
|
|
|
fi
|
|
|
|
|
2014-11-06 11:05:28 +00:00
|
|
|
echo "Creating $FWNAME.framework"
|
|
|
|
mkdir -p $FWNAME.framework/Headers
|
2015-05-05 18:25:00 +00:00
|
|
|
libtool -no_warning_for_no_symbols $LIBTOOL_FLAGS -o $FWNAME.framework/$FWNAME lib/libcrypto.a lib/libssl.a
|
2014-11-06 11:05:28 +00:00
|
|
|
cp -r include/$FWNAME/* $FWNAME.framework/Headers/
|
2016-05-19 04:17:22 +00:00
|
|
|
|
|
|
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
cp $DIR/"OpenSSL-for-iOS/OpenSSL-for-iOS-Info.plist" $FWNAME.framework/Info.plist
|
2014-11-06 11:05:28 +00:00
|
|
|
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
|
|
|
|
echo "INFO: $FWNAME.framework doesn't contains Bitcode"
|
|
|
|
else
|
|
|
|
echo "INFO: $FWNAME.framework contains Bitcode"
|
|
|
|
fi
|