#!/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
