diff --git a/scripts/linux/build-all b/scripts/linux/build-all index 8582c62a..3930e1e7 100755 --- a/scripts/linux/build-all +++ b/scripts/linux/build-all @@ -1,23 +1,25 @@ #!/usr/bin/env bash set -e -if [ -z "$O3" ]; then +set -u +if [ -z "${O3:-}" ]; then echo O3 var must point to ovpn3 tree ; exit 1 fi -export DEP_DIR=${DEP_DIR:-$HOME/linux} -export TARGET=${TARGET:-linux} -cd $DEP_DIR +export DEP_DIR="${DEP_DIR:-$HOME/linux}" +export TARGET="${TARGET:-linux}" +cd "$DEP_DIR" rm -rf asio* boost* lz4* lzo* minicrypto openssl* polarssl* snappy* echo "******* ASIO" -$O3/core/deps/asio/build-asio +"$O3"/core/deps/asio/build-asio echo "******* xxHash" -$O3/core/deps/xxHash/build-xxHash -echo "******* MBEDTLS" -$O3/core/scripts/linux/build-mbedtls +"$O3"/core/deps/xxHash/build-xxHash +if [ "${MTLS:-1}" = 0 ] ; then + echo "******* MBEDTLS (skipped)" +else + echo "******* MBEDTLS" + "$O3"/core/scripts/linux/build-mbedtls +fi echo "******* LZ4" -$O3/core/scripts/linux/build-lz4 +"$O3"/core/scripts/linux/build-lz4 #$O3/core/scripts/linux/build-openssl x64 #$O3/core/scripts/linux/build-lzo -#$O3/core/scripts/linux/build-boost -#$O3/core/scripts/linux/build-snappy -#$O3/core/scripts/linux/consolidate-so diff --git a/scripts/mac/build-all b/scripts/mac/build-all index 089af63a..918131f7 100755 --- a/scripts/mac/build-all +++ b/scripts/mac/build-all @@ -1,41 +1,36 @@ #!/usr/bin/env bash set -e -export DEP_DIR=${DEP_DIR:-$HOME/src/mac} -if [ -z "$O3" ]; then +set -u +export DEP_DIR="${DEP_DIR:-$HOME/src/mac}" +if [ -z "${O3:-}" ]; then echo O3 var must point to ovpn3 tree ; exit 1 fi cd $DEP_DIR rm -rf asio* boost* lz4* lzo* minicrypto openssl* polarssl* mbedtls* snappy* jsoncpp* echo "******* ASIO" -$O3/core/deps/asio/build-asio +"$O3"/core/deps/asio/build-asio -if [ "$MTLS" = 0 ] ; then +if [ "${MTLS:-1}" = 0 ] ; then echo "******* MBEDTLS (skipped)" else echo "******* MBEDTLS" # consider OSX_SERVER=0 - $O3/core/scripts/mac/build-mbedtls + "$O3"/core/scripts/mac/build-mbedtls fi -if [ "$OSSL" = 1 ] ; then +if [ "${OSSL:-0}" = 1 ] ; then echo "******* OPENSSL" - $O3/core/scripts/mac/build-openssl + "$O3"/core/scripts/mac/build-openssl else echo "******* OPENSSL (skipped)" fi echo "******* LZ4" -$O3/core/scripts/mac/build-lz4 +"$O3"/core/scripts/mac/build-lz4 echo "******* xxHash" -$O3/core/deps/xxHash/build-xxHash +"$O3"/core/deps/xxHash/build-xxHash echo "******* JSONCPP" -$O3/core/scripts/mac/build-jsoncpp - - -#echo "******* MINICRYPTO" -#$O3/core/scripts/mac/build-minicrypto -#echo "******* SNAPPY" -#$O3/core/scripts/mac/build-snappy +"$O3"/core/scripts/mac/build-jsoncpp