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

22
scripts/linux/build-all 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
export DEP_DIR=${DEP_DIR:-$HOME/linux}
cd $DEP_DIR
rm -rf asio* boost* lz4* lzo* minicrypto openssl* polarssl* snappy*
echo "******* ASIO"
$O3/core/deps/asio/build-asio
echo "******* MBEDTLS"
$O3/core/scripts/linux/build-mbedtls
echo "******* LZ4"
$O3/core/scripts/linux/build-lz4
echo "******* CITYHASH"
$O3/core/scripts/linux/build-cityhash
#$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

18
scripts/linux/build-boost Executable file
View File

@@ -0,0 +1,18 @@
#!/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 TARGETS="linux"
$O3/core/deps/boost/build-boost
exit 0

14
scripts/linux/build-cityhash Executable file
View File

@@ -0,0 +1,14 @@
#!/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 cityhash
mkdir cityhash
TARGET=linux $O3/core/deps/cityhash/build-cityhash
exit 0

14
scripts/linux/build-lz4 Executable file
View File

@@ -0,0 +1,14 @@
#!/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
TARGET=linux $O3/core/deps/lz4/build-lz4
exit 0

14
scripts/linux/build-lzo Executable file
View File

@@ -0,0 +1,14 @@
#!/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 lzo
mkdir lzo
TARGET=linux $O3/core/deps/lzo/build-lzo
exit 0

19
scripts/linux/build-mbedtls Executable file
View File

@@ -0,0 +1,19 @@
#!/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 [ "$LINK_MODE" = "shared" ]; then
SHARED=1
else
SHARED=0
fi
VERBOSE=1 TARGET=linux ENABLE_SERVER=1 SHARED=$SHARED $O3/core/deps/mbedtls/build-mbedtls
exit 0

35
scripts/linux/build-openssl Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -e
if [ -z "$1" ]; then
echo "usage: build-openssl x64|arm"
exit 1
fi
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
export LINK_MODE=shared
case $1 in
x64*)
export OPENSSL_TARGET=linux-x86_64
;;
arm*)
export OPENSSL_TARGET=linux-armv4
;;
*)
echo "unknown platform"
exit 1
;;
esac
TARGET=linux $O3/core/deps/openssl/build-openssl
exit 0

20
scripts/linux/build-polarssl Executable file
View File

@@ -0,0 +1,20 @@
#!/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 [ "$LINK_MODE" = "shared" ]; then
SHARED=1
else
SHARED=0
fi
VERBOSE=1 TARGET=linux ENABLE_SERVER=1 SHARED=$SHARED $O3/core/deps/polarssl/build-polarssl
mv polarssl-linux polarssl
exit 0

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# When running OpenVPN 2.x ./configure script, use the following command:
#
# POLARSSL_CFLAGS="-I$HOME/linux/polarssl/polarssl-linux/include" POLARSSL_LIBS="-L$HOME/linux/polarssl/polarssl-linux/library -lpolarssl" ./configure --with-crypto-library=polarssl
if [ -z "$O3" ]; then
echo O3 var must point to ovpn3 tree ; exit 1
fi
rm -rf polarssl
mkdir polarssl
VERBOSE=1 TARGET=linux ENABLE_SERVER=1 ENABLE_FS_IO=1 $O3/core/deps/polarssl/build-polarssl
mv polarssl-linux polarssl
exit 0

13
scripts/linux/build-snappy Executable file
View File

@@ -0,0 +1,13 @@
#!/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
TARGET=linux $O3/core/deps/snappy/build-snappy

10
scripts/linux/consolidate-so Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
rm -rf so
mkdir so
OPT=-d
[ -d boost ] && cp $OPT boost/stage-linux/lib/lib* so/
[ -d lzo ] && cp $OPT lzo/lzo-linux/lib/lib* so/
[ -d openssl ] && cp $OPT openssl/openssl-linux/lib/lib* so/
[ -d snappy ] && cp $OPT snappy/snappy-linux/lib/lib* so/
[ -d polarssl ] && cp $OPT polarssl/polarssl-linux/library/lib* so/
exit 0