Squashed 'Sources/OpenVPN3/' content from commit 0a6e0b6e54

git-subtree-dir: Sources/OpenVPN3
git-subtree-split: 0a6e0b6e542c2d19de1f416c4caccd899d72831a
This commit is contained in:
Sergey Abramchuk
2020-02-24 14:43:11 +03:00
commit 86cc97e55f
655 changed files with 146468 additions and 0 deletions

37
scripts/mac/build-all Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -e
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*
echo "******* ASIO"
$O3/core/deps/asio/build-asio
if [ $MTLS = 0 ] ; then
echo "******* MBEDTLS (skipped)"
else
echo "******* MBEDTLS"
# consider OSX_SERVER=0
$O3/core/scripts/mac/build-mbedtls
fi
#
$O3/core/deps/asio/build-asio
if [ $OSSL = 1 ] ; then
echo "******* OPENSSL"
$O3/core/scripts/mac/build-openssl
else
echo "******* OPENSSL (skipped)"
fi
echo "******* LZ4"
$O3/core/scripts/mac/build-lz4
#echo "******* MINICRYPTO"
#$O3/core/scripts/mac/build-minicrypto
#echo "******* SNAPPY"
#$O3/core/scripts/mac/build-snappy

23
scripts/mac/build-boost Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf boost
mkdir boost
export LINK_MODE=static
if [ "$OSX_ONLY" == "1" ]; then
export TARGETS="osx osx-dbg"
else
export TARGETS="ios ios-dbg iossim iossim-dbg osx osx-dbg"
fi
$O3/core/deps/boost/build-boost
exit 0

27
scripts/mac/build-lz4 Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf lz4
mkdir lz4
if [ "$OSX_ONLY" != "1" ]; then
for target in ios ios-dbg iossim iossim-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/lz4/build-lz4
done
fi
for target in osx osx-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/lz4/build-lz4
done
exit 0

28
scripts/mac/build-lzo Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
[ "$DEP_DIR" ] && cd $DEP_DIR
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf lzo
mkdir lzo
if [ "$OSX_ONLY" != "1" ]; then
for target in ios ios-dbg iossim iossim-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/lzo/build-lzo
done
fi
for target in osx64 osx64-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/lzo/build-lzo
done
exit 0

37
scripts/mac/build-mbedtls Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf mbedtls
if [ "$OSX_ONLY" != "1" ]; then
# for ios, build with minicrypto
for target in ios-dbg ios ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target USE_MINICRYPTO=0 $O3/core/deps/mbedtls/build-mbedtls
[ "$IOS_DBG_ONLY" = "1" ] && exit
done
# ios simulators
for target in iossim iossim-dbg ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target $O3/core/deps/mbedtls/build-mbedtls
done
fi
# osx
[ -z "$OSX_MINICRYPTO" ] && OSX_MINICRYPTO=0
[ -z "$OSX_SERVER" ] && OSX_SERVER=1
for target in osx osx-dbg ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target USE_MINICRYPTO=$OSX_MINICRYPTO MINICRYPTO_NO_AES=1 ENABLE_SERVER=$OSX_SERVER $O3/core/deps/mbedtls/build-mbedtls
done
exit 0

27
scripts/mac/build-minicrypto Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
[ "$DEP_DIR" ] && cd $DEP_DIR
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf minicrypto
mkdir minicrypto
for target in osx osx-dbg ; do
echo '***************' Minicrypto-32 $target
TARGET=$target ARCH=i386 $O3/core/deps/minicrypto/build-minicrypto-osx
echo '***************' Minicrypto-64 $target
TARGET=$target ARCH=x86_64 $O3/core/deps/minicrypto/build-minicrypto-osx
cd minicrypto/minicrypto-$target
lipo -create */libminicrypto.a -output libminicrypto.a
lipo -info libminicrypto.a
cd ../..
done
exit 0

39
scripts/mac/build-openssl Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -e
[ "$DEP_DIR" ] && cd $DEP_DIR
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf openssl
mkdir openssl
for target in ios osx; do
echo '***************' OpenSSL-64 $target
if [ "$target" = "osx" ]; then
TARGET=$target OPENSSL_TARGET=darwin64-x86_64-cc $O3/core/deps/openssl/build-openssl
else
ARCH=arm64 CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer \
CROSS_SDK=iPhoneOS.sdk TARGET=$target OPENSSL_TARGET="ios64-cross no-dso no-engine" \
$O3/core/deps/openssl/build-openssl
ARCH=armv7 CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer \
CROSS_SDK=iPhoneOS.sdk TARGET=$target OPENSSL_TARGET="ios-cross no-dso no-engine" \
$O3/core/deps/openssl/build-openssl
fi
done
cd openssl/openssl-ios
mkdir -p fat/lib
for l in libcrypto.a libssl.a ; do
lipo -create arm64/lib/$l armv7/lib/$l -output fat/lib/$l
done
exit 0

41
scripts/mac/build-polarssl Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf polarssl
mkdir polarssl
if [ "$OSX_ONLY" != "1" ]; then
# for ios, build with minicrypto
for target in ios-dbg ios ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target USE_MINICRYPTO=0 $O3/core/deps/polarssl/build-polarssl
mv polarssl-$target polarssl
[ "$IOS_DBG_ONLY" = "1" ] && exit
done
# ios simulators
for target in iossim iossim-dbg ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target $O3/core/deps/polarssl/build-polarssl
mv polarssl-$target polarssl/
done
fi
# osx
[ -z "$OSX_MINICRYPTO" ] && OSX_MINICRYPTO=0
[ -z "$OSX_SERVER" ] && OSX_SERVER=1
for target in osx osx-dbg ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target USE_MINICRYPTO=$OSX_MINICRYPTO MINICRYPTO_NO_AES=1 ENABLE_SERVER=$OSX_SERVER $O3/core/deps/polarssl/build-polarssl
mv polarssl-$target polarssl/
done
exit 0

27
scripts/mac/build-snappy Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
if [ -z "$DEP_DIR" ]; then
echo DEP_DIR var must point to ovpn3 dependency tree
exit 1
fi
cd $DEP_DIR
rm -rf snappy
mkdir snappy
if [ "$OSX_ONLY" != "1" ]; then
for target in ios ios-dbg iossim iossim-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/snappy/build-snappy
done
fi
for target in osx osx-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/snappy/build-snappy
done
exit 0