kivy-ios/tools/build-openssl.sh

42 lines
1.3 KiB
Bash
Raw Normal View History

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-05 22:06:42 +02:00
echo "ios-openssl repo not found. Pulling latest..."
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-02 23:13:31 +02:00
if [ -d $TMPROOT/openssl/ios-openssl ] ; then
2014-05-05 22:06:42 +02:00
echo "ios-openssl repo found. Looking for binary..."
2014-05-05 21:40:05 +02:00
if [ ! -e $TMPROOT/openssl/ios-openssl/lib/libssl.a ] ; then
2014-05-03 08:55:16 +02:00
echo "Binary not found. Building..."
2014-05-05 21:40:05 +02:00
if [ ! -d $TMPROOT/openssl/ios-openssl/lib ] ; then
try mkdir $TMPROOT/openssl/ios-openssl/lib
fi
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
2014-05-05 21:40:05 +02:00
else
echo "Binaries found. Skipping build..."
2014-05-02 10:46:15 +02:00
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
2014-05-05 21:40:05 +02:00
echo "Copying built OpenSSL binaries..."
2014-05-02 10:46:15 +02:00
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