2014-05-02 09:18:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. $(dirname $0)/environment.sh
|
|
|
|
|
|
|
|
if [ ! -d $TMPROOT/openssl ] ; then
|
|
|
|
mkdir $TMPROOT/openssl
|
|
|
|
fi
|
|
|
|
|
2014-05-02 09:42:47 +02:00
|
|
|
# Check we have a cloned repo
|
2014-05-02 09:18:41 +02:00
|
|
|
if [ ! -d $TMPROOT/openssl/ios-openssl ] ; then
|
2014-05-02 09:42:47 +02:00
|
|
|
try pushd .
|
|
|
|
cd $TMPROOT/openssl
|
2014-05-02 09:18:41 +02:00
|
|
|
try git clone -b master https://github.com/zen-code/ios-openssl
|
2014-05-02 09:42:47 +02:00
|
|
|
try popd
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Build the required binaries
|
2014-05-03 08:55:16 +02:00
|
|
|
echo "About to test ..."
|
2014-05-02 23:13:31 +02:00
|
|
|
if [ -d $TMPROOT/openssl/ios-openssl ] ; then
|
2014-05-03 08:55:16 +02:00
|
|
|
echo "ios-openssl folder found. Looking for binary..."
|
2014-05-02 10:46:15 +02:00
|
|
|
if [ ! $TMPROOT/openssl/ios-openssl/lib/libssl.a ] ; then
|
2014-05-03 08:55:16 +02:00
|
|
|
echo "Binary not found. Building..."
|
2014-05-02 22:59:34 +02:00
|
|
|
try mkdir $TMPROOT/openssl/ios-openssl/lib
|
2014-05-02 10:46:15 +02:00
|
|
|
try pushd .
|
|
|
|
cd $TMPROOT/openssl/ios-openssl
|
2014-05-03 08:56:53 +02:00
|
|
|
# Please refer to the script below for details of the OpenSSL build
|
2014-05-02 10:46:15 +02:00
|
|
|
sh build.sh
|
|
|
|
try popd
|
|
|
|
fi
|
2014-05-02 09:18:41 +02:00
|
|
|
fi
|
|
|
|
|
2014-05-02 10:46:15 +02:00
|
|
|
# Copy the binaries to the appropriate places.
|
|
|
|
if [ $TMPROOT/openssl/ios-openssl/lib/libssl.a ] ; then
|
|
|
|
cp $TMPROOT/openssl/ios-openssl/lib/libssl.a $BUILDROOT/lib/libssl.a
|
|
|
|
cp $TMPROOT/openssl/ios-openssl/lib/libcrypto.a $BUILDROOT/lib/libcrypto.a
|
|
|
|
fi
|