Squashed 'OpenVPN Adapter/Vendors/openvpn/' content from commit da99df6

git-subtree-dir: OpenVPN Adapter/Vendors/openvpn
git-subtree-split: da99df69492256d7a18bbea303ae98457782a4bf
This commit is contained in:
Sergey Abramchuk
2017-04-09 14:13:07 +03:00
commit f65d76170b
519 changed files with 88163 additions and 0 deletions

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

@@ -0,0 +1,20 @@
#!/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
echo "******* MBEDTLS"
# consider OSX_SERVER=0
$O3/core/scripts/mac/build-mbedtls
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 osx osx-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

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

@@ -0,0 +1,32 @@
#!/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 osx ; do
echo '***************' OpenSSL-32 $target
TARGET=$target OPENSSL_TARGET=darwin-i386-cc ARCH=i386 $O3/core/deps/openssl/build-openssl
echo '***************' OpenSSL-64 $target
TARGET=$target OPENSSL_TARGET=darwin64-x86_64-cc ARCH=x86_64 $O3/core/deps/openssl/build-openssl
cd openssl/openssl-$target
cp -a x86_64/include .
rm include/openssl/opensslconf.h # contains 32/64-bit specific references
for l in libcrypto.a libssl.a ; do
lipo -create */lib/$l -output $l
done
mkdir lib
mv *.a lib
cd ../..
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