0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00
openvpn3/test/ovpncli/go
David Sommerseth 4a25059f5c
test/ovpncli: Don't override PROF env variable
If the PROF env variable is already set, respect that original value
instead of enforcing a value which might be wrong on the build host.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2018-11-07 17:57:08 +01:00

44 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Options:
# OSSL=1 -- build using OpenSSL
# MTLS=1 -- build using mbedTLS
# PTPROXY=1 -- build using Private Tunnel proxy
# Other options
GCC_EXTRA="$GCC_EXTRA -DOPENVPN_SHOW_SESSION_TOKEN"
[ "$EER" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DTEST_EER"
[ "$NULL" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_FORCE_TUN_NULL"
[ "$EXIT" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DTUN_NULL_EXIT"
[ "$GREMLIN" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_GREMLIN"
[ "$DEX" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_DISABLE_EXPLICIT_EXIT"
[ "$BS64" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_BS64_DATA_LIMIT=2500000"
[ "$ROVER" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_REMOTE_OVERRIDE"
[ "$TLS" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_TLS_LINK"
if [ "$AGENT" = "1" ]; then
GCC_EXTRA="$GCC_EXTRA -DOPENVPN_COMMAND_AGENT"
fi
GCC_EXTRA="$GCC_EXTRA -DOPENVPN_VERSION=\"$($(dirname $0)/../../scripts/version)\""
export GCC_EXTRA
# determine platform
if [ "$(uname)" == "Darwin" ]; then
export PROF=${PROF:-osx64}
elif [ "$(uname)" == "Linux" ]; then
export PROF=${PROF:-linux}
else
echo this script only knows how to build on Mac OS or Linux
fi
# use mbedTLS by default
[[ -z "$OSSL" && -z "$MTLS" ]] && export MTLS=1
# don't link with OpenSSL if mbedTLS is specified
if [ "$MTLS" = "1" ]; then
export OSSL=0
export NOSSL=1
fi
# build
ASIO=1 LZ4=1 ../../scripts/build cli