From 03dd1a494b1d128f847d116e8011a13766d72db8 Mon Sep 17 00:00:00 2001 From: Richard Larkin Date: Thu, 15 May 2014 11:47:38 +0200 Subject: [PATCH] Skip building if binaries exist --- tools/build-openssl.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/build-openssl.sh b/tools/build-openssl.sh index 4859f1c..e147b42 100755 --- a/tools/build-openssl.sh +++ b/tools/build-openssl.sh @@ -15,17 +15,21 @@ if [ ! -d $TMPROOT/openssl/ios-openssl ] ; then try popd fi -# Build the required binaries -if [ -d $TMPROOT/openssl/ios-openssl ] ; then - echo "ios-openssl repo found. Building now..." - if [ ! -d $TMPROOT/openssl/ios-openssl/lib ] ; then - try mkdir $TMPROOT/openssl/ios-openssl/lib +# Build the required binaries if not found (long process) +if [ ! -f $BUILDROOT/lib/libssl.a ] ; then + if [ -d $TMPROOT/openssl/ios-openssl ] ; then + echo "ios-openssl repo found. Building now..." + if [ ! -d $TMPROOT/openssl/ios-openssl/lib ] ; then + try mkdir $TMPROOT/openssl/ios-openssl/lib + fi + try pushd . + cd $TMPROOT/openssl/ios-openssl + # Please refer to the script below for details of the OpenSSL build + sh build.sh + try popd fi - try pushd . - cd $TMPROOT/openssl/ios-openssl - # Please refer to the script below for details of the OpenSSL build - sh build.sh - try popd +else + echo "Skipping build. Binary found: $BUILDROOT/lib/libssl.a" fi echo "Copying built OpenSSL binaries..."