mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 20:13:05 +02:00
63 lines
1.2 KiB
Plaintext
63 lines
1.2 KiB
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -e
|
||
|
if [ -z "$O3" ]; then
|
||
|
echo O3 var must point to ovpn3 tree
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ -z "$TARGET" ]; then
|
||
|
echo TARGET var must be defined
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# source vars
|
||
|
. $O3/vars-${TARGET}
|
||
|
. $O3/lib-versions
|
||
|
|
||
|
[ "$GCC_CMD" ] && export CC=$GCC_CMD
|
||
|
[ "$GPP_CMD" ] && export CXX=$GPP_CMD
|
||
|
[ "$LD_CMD" ] && export LD=$LD_CMD
|
||
|
[ "$AR_CMD" ] && export AR=$AR_CMD
|
||
|
[ "$RANLIB_CMD" ] && export RANLIB=$RANLIB_CMD
|
||
|
|
||
|
case $PLATFORM in
|
||
|
android*)
|
||
|
echo PLATFORM android
|
||
|
host=arm
|
||
|
target=arm
|
||
|
;;
|
||
|
ios*)
|
||
|
echo PLATFORM ios
|
||
|
host="x86_64-apple-darwin"
|
||
|
target=arm
|
||
|
;;
|
||
|
*)
|
||
|
host=""
|
||
|
target=""
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
if [ "$target" ]; then
|
||
|
targ_opt="--target=$target"
|
||
|
fi
|
||
|
|
||
|
if [ "$host" ]; then
|
||
|
host_opt="--host=$host"
|
||
|
fi
|
||
|
|
||
|
if [ "$NO_WIPE" != "1" ]; then
|
||
|
rm -rf $SNAPPY_VERSION
|
||
|
tar xfz ~/Downloads/$SNAPPY_VERSION.tar.gz
|
||
|
fi
|
||
|
|
||
|
DIST=$(pwd)/snappy/snappy-$PLATFORM
|
||
|
rm -rf $DIST
|
||
|
mkdir -p $DIST
|
||
|
cd $SNAPPY_VERSION
|
||
|
echo 'OPTIONS' $CC $LD $AR $RANLIB $host_opt $targ_opt
|
||
|
export CFLAGS="$PLATFORM_FLAGS $OTHER_COMPILER_FLAGS $LIB_OPT_LEVEL $LIB_FPIC"
|
||
|
export CXXFLAGS="$CFLAGS"
|
||
|
./configure --prefix=$DIST $host_opt $targ_opt --enable-static --disable-shared
|
||
|
make
|
||
|
make install
|