Newer
Older
XinYang_IOS / Carthage / Checkouts / OpenVPNAdapter / Sources / OpenVPN3 / test / ovpncli / go
@zhangfeng zhangfeng on 7 Dec 1 KB 1.8.0
#!/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"
[ "$SITNL" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DOPENVPN_USE_SITNL"
[ "$MDNC" = "1" ] && GCC_EXTRA="$GCC_EXTRA -DMBEDTLS_DISABLE_NAME_CONSTRAINTS"
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