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

26
scripts/android/build-all Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Build Android dependencies (run after build-toolchain)
set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
export DEP_DIR=${DEP_DIR:-$HOME/src/android}
cd $DEP_DIR
rm -rf asio* boost* lz4* lzo* minicrypto openssl* polarssl* snappy* mbedtls*
echo "******* ASIO"
$O3/core/deps/asio/build-asio
echo "******* MBEDTLS"
$O3/core/scripts/android/build-mbedtls
echo "******* LZ4"
$O3/core/scripts/android/build-lz4
#echo "******* BOOST"
#$O3/core/scripts/android/build-boost
#echo "******* MINICRYPTO"
#$O3/core/scripts/android/build-minicrypto
#echo "******* OpenSSL"
#$O3/core/scripts/android/build-openssl-small
#echo "******* LZO"
#$O3/core/scripts/android/build-lzo
#echo "******* SNAPPY"
#$O3/core/scripts/android/build-snappy

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

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Note: thread library may fail with PAGE_SIZE undefined.
# The pthread.h header makes reference to the PAGE_SIZE define however
# this only gets defined in <asm/page.h> which is not pulled in by any
# of the pthread.h includes. A google-suggested fix was to add
# #include <sys/mman.h>, which does indeed work, but may not be the
# correct solution for all cases.
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
export TARGETS="android-a8a android-a8a-dbg android-a7a android-a7a-dbg android android-dbg"
export SDK_PATH_SCRIPT=$O3/core/vars/android-sdk-path
$O3/core/deps/boost/build-boost
exit 0

22
scripts/android/build-lz4 Executable file
View File

@@ -0,0 +1,22 @@
#!/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
. $O3/core/vars/android-sdk-path
rm -rf lz4
mkdir lz4
for target in android-a8a android-a8a-dbg android-a7a android-a7a-dbg android android-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/lz4/build-lz4
done
exit 0

22
scripts/android/build-lzo Executable file
View File

@@ -0,0 +1,22 @@
#!/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
. $O3/core/vars/android-sdk-path
rm -rf lzo
mkdir lzo
for target in android-a8a android-a8a-dbg android-a7a android-a7a-dbg android android-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/lzo/build-lzo
done
exit 0

25
scripts/android/build-mbedtls Executable file
View File

@@ -0,0 +1,25 @@
#!/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
. $O3/core/vars/android-sdk-path
# disable minicrypto for now
mini=0
rm -rf mbedtls
for target in android-a8a android-a8a-dbg android-a7a android-a7a-dbg android android-dbg ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target CMAKE_TARGET=android USE_MINICRYPTO=$mini MINICRYPTO_DIR=$(pwd)/minicrypto/minicrypto-$target $O3/core/deps/mbedtls/build-mbedtls
[ "$ANDROID_DBG_ONLY" = "1" ] && exit
done
exit 0

View File

@@ -0,0 +1,22 @@
#!/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
. $O3/core/vars/android-sdk-path
rm -rf minicrypto
mkdir minicrypto
for target in android android-dbg android-a7a android-a7a-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/minicrypto/build-minicrypto
done
exit 0

View File

@@ -0,0 +1,39 @@
#!/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
. $O3/core/deps/lib-versions
. $O3/core/vars/android-sdk-path
[ -z "$DL" ] && DL=~/Downloads
rm -rf openssl
mkdir openssl
for TARGET in android-a8a android-a8a-dbg android-a7a android-a7a-dbg android-dbg android ; do
. $O3/core/vars/vars-$TARGET
export OPENSSL=$OPENSSL_VERSION
export DIST=$(pwd)/openssl-$PLATFORM
export BIN=$TC/bin
rm -rf $DIST
rm -rf $OPENSSL
tar xfz $DL/$OPENSSL.tar.gz
pushd $OPENSSL
OSSL_FLAGS="no-shared threads no-idea no-mdc2 no-rc5 no-engine no-comp no-hw no-ssl2 no-ssl3 no-zlib no-rc2 no-cast no-md2 no-ripemd no-camellia no-seed no-krb5 no-socks no-ecdsa no-ec no-ecdh no-md2 no-whirlpool no-dsa no-cms no-jpake no-gost"
#OSSL_FLAGS="no-shared threads no-comp no-zlib"
./Configure linux-armv4 $OSSL_FLAGS --prefix=$DIST
sed -i "" -e "s|-O3|$LIB_OPT_LEVEL $LIB_FPIC $PLATFORM_FLAGS $OTHER_COMPILER_FLAGS|" Makefile
sed -i "" -e "s|ERR_load_COMP_strings()|//ERR_load_COMP_strings()|" crypto/err/err_all.c
make -j 4 build_libs
touch apps/openssl
touch openssl.pc
touch libcrypto.pc
touch libssl.pc
make install_sw
popd
mv $DIST openssl
done
exit 0

27
scripts/android/build-polarssl 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
. $O3/core/vars/android-sdk-path
# disable minicrypto for now
mini=0
rm -rf polarssl
mkdir polarssl
for target in android-a8a android-a8a-dbg android-a7a android-a7a-dbg android android-dbg ; do
echo '***************' TARGET $target
VERBOSE=1 TARGET=$target CMAKE_TARGET=android USE_MINICRYPTO=$mini MINICRYPTO_DIR=$(pwd)/minicrypto/minicrypto-$target $O3/core/deps/polarssl/build-polarssl
mv polarssl-$target polarssl/
[ "$ANDROID_DBG_ONLY" = "1" ] && exit
done
exit 0

22
scripts/android/build-snappy Executable file
View File

@@ -0,0 +1,22 @@
#!/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
. $O3/core/vars/android-sdk-path
rm -rf snappy
mkdir snappy
for target in android-a8a android-a8a-dbg android-a7a android-a7a-dbg android android-dbg ; do
echo '***************' TARGET $target
TARGET=$target $O3/core/deps/snappy/build-snappy
done
exit 0

43
scripts/android/build-toolchain Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Build the Android toolchain (run first)
#set -e
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
export DEP_DIR=${DEP_DIR:-$HOME/src/android}
export NO_MOD_PATH=1
. $O3/core/vars/android-sdk-path
# 64 bit
cd $DEP_DIR
DEST=$(pwd)/tc-arm64
rm -rf $DEST
ABI=aarch64-linux-android
$NDK/build/tools/make-standalone-toolchain.sh \
--verbose \
--ndk-dir=$NDK \
--toolchain=$ABI-4.9 \
--stl=gnustl \
--arch=arm64 \
--platform=android-21 \
--install-dir=$DEST
cd $DEST/$ABI/bin
ln -s ../../bin/$ABI-gcc cc
ln -s ../../bin/$ABI-gcc gcc
ln -s ../../bin/$ABI-g++ g++
# 32 bit
cd $DEP_DIR
DEST=$(pwd)/tc-arm
rm -rf $DEST
ABI=arm-linux-androideabi
$NDK/build/tools/make-standalone-toolchain.sh \
--verbose \
--ndk-dir=$NDK \
--toolchain=$ABI-4.8 \
--stl=gnustl \
--arch=arm \
--platform=android-14 \
--install-dir=$DEST
cd $DEST/$ABI/bin
ln -s ../../bin/$ABI-gcc cc