-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux and win support added (I hope)
- Loading branch information
Showing
16 changed files
with
165 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.ovpn | ||
*.ovpn | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
rm -rf openvpn3/bridge/*.a openvpn3/bridge/*.h | ||
docker run -it --rm -v `pwd`/build:/build -w /build -v `pwd`:/go-src-root --entrypoint /go-src-root/scripts/build-on-xgo.sh karalabe/xgo-base | ||
|
||
#We cross compile for windows on latest ubuntu because xgo-base has older ubuntu and older mingw with windows headers which are missing | ||
docker build -t mingw-crosscompile -f scripts/Dockerfile-mingw-ubuntu . && \ | ||
docker run -it --rm -v `pwd`/build:/build -w /build -v `pwd`:/go-src-root --entrypoint /go-src-root/scripts/build-on-mingw.sh mingw-crosscompile |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM ubuntu:18.04 | ||
|
||
# Make sure apt-get is up to date and dependent packages are installed | ||
RUN \ | ||
apt-get update && \ | ||
apt-get install -y automake autogen build-essential ca-certificates \ | ||
gcc-mingw-w64 g++-mingw-w64 \ | ||
make xz-utils cpio wget zip unzip git texinfo help2man \ | ||
--no-install-recommends | ||
|
||
# Fix any stock package issues | ||
RUN ln -s /usr/include/asm-generic /usr/include/asm | ||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
export O3=`pwd` | ||
export DEP_DIR=`pwd`/dep_dir | ||
mkdir -p $DEP_DIR | ||
export DL=/build/dls | ||
mkdir -p $DL | ||
|
||
echo "Deps are in: $DEP_DIR" | ||
echo "DLs go to: $DL" | ||
echo "O3 is: $O3" | ||
|
||
/go-src-root/scripts/x-compile-windows.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
. /go-src-root/scripts/helpers.sh | ||
rm -rf core | ||
fetch_openvpn3 | ||
|
||
cp -f core/adapter/library.h /go-src-root/openvpn3/bridge/. | ||
|
||
export O3=`pwd` | ||
export DEP_DIR=`pwd`/dep_dir | ||
mkdir -p $DEP_DIR | ||
export DL=/build/dls | ||
mkdir -p $DL | ||
|
||
echo "Deps are in: $DEP_DIR" | ||
echo "DLs go to: $DL" | ||
echo "O3 is: $O3" | ||
|
||
/go-src-root/scripts/x-compile-linux.sh | ||
/go-src-root/scripts/x-compile-mac.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
#Usage ./concat-libs.sh outputlib.a <list of o files> | ||
outputLib=$1 | ||
shift | ||
|
||
mkdir -p objs | ||
pushd objs | ||
for lib in ${MORE_LIBS[@]}; do | ||
echo "Extracting $lib" | ||
$AR_CMD x $lib | ||
done | ||
popd | ||
|
||
$AR_CMD rc $outputLib \ | ||
objs/*.o \ | ||
${@} | ||
rm -rf objs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
function fetch_openvpn3() { | ||
git clone https://github.com/MysteriumNetwork/openvpn3.git core | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
PLATFORM=linux | ||
SCRIPTS=linux | ||
LIBSUFFIX=linux_amd64 | ||
|
||
echo "Building for: $PLATFORM" | ||
|
||
core/scripts/$SCRIPTS/build-all | ||
|
||
. core/vars/setpath | ||
. core/vars/vars-linux | ||
|
||
cd core/adapter | ||
PROF=$PLATFORM MTLS=1 NOSSL=1 LZ4=1 ASIO=1 ECHO=1 CO=1 build library | ||
|
||
LIB_OUT="/go-src-root/openvpn3/bridge/libopenvpn3_${LIBSUFFIX}.a" | ||
rm -rf $LIB_OUT | ||
|
||
libs=("$DEP_DIR/mbedtls/mbedtls-$PLATFORM/library/libmbedtls.a" \ | ||
"$DEP_DIR/lz4/lz4-$PLATFORM/lib/liblz4.a" ) | ||
|
||
MORE_LIBS=${libs[@]} /go-src-root/scripts/concat-libs.sh $LIB_OUT library.o | ||
|
||
$RANLIB_CMD $LIB_OUT | grep -v "has no symbols" || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
#x-compile.sh <profile> | ||
#where profile can be linux | osx | mingw (windows) | ||
|
||
PLATFORM=osx | ||
SCRIPTS=mac | ||
LIBSUFFIX=darwin_amd64 | ||
|
||
echo "Building for: $PLATFORM" | ||
|
||
OSX_ONLY=1 "core/scripts/$SCRIPTS/build-all" | ||
|
||
. core/vars/setpath | ||
|
||
|
||
cd core/adapter | ||
PROF=$PLATFORM MTLS=1 NOSSL=1 LZ4=1 ASIO=1 ECHO=1 CO=1 build library | ||
|
||
LIB_OUT="/go-src-root/openvpn3/bridge/libopenvpn3_${LIBSUFFIX}.a" | ||
rm -rf $LIB_OUT | ||
|
||
x86_64-apple-darwin15-libtool -static -o $LIB_OUT \ | ||
$DEP_DIR/mbedtls/mbedtls-$PLATFORM/library/libmbedtls.a \ | ||
$DEP_DIR/lz4/lz4-$PLATFORM/lib/liblz4.a \ | ||
library.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
#x-compile.sh <profile> | ||
#where profile can be linux | osx | mingw (windows) | ||
|
||
PLATFORM=mingw | ||
SCRIPTS=win | ||
LIBSUFFIX=windows_amd64 | ||
|
||
echo "Building for: $PLATFORM" | ||
|
||
"core/scripts/$SCRIPTS/build-all" | ||
|
||
. core/vars/setpath | ||
. core/vars/vars-$PLATFORM | ||
cd core/adapter | ||
PROF=$PLATFORM MTLS=1 NOSSL=1 LZ4=1 ASIO=1 ECHO=1 CO=1 build library | ||
|
||
LIB_OUT="/go-src-root/openvpn3/bridge/libopenvpn3_${LIBSUFFIX}.a" | ||
rm -rf $LIB_OUT | ||
|
||
libs=("$DEP_DIR/mbedtls/mbedtls-$PLATFORM/library/libmbedtls.a" \ | ||
"$DEP_DIR/lz4/lz4-$PLATFORM/lib/liblz4.a" ) | ||
|
||
MORE_LIBS=${libs[@]} /go-src-root/scripts/concat-libs.sh $LIB_OUT library.o | ||
|
||
$RANLIB_CMD $LIB_OUT | grep -v "has no symbols" || true |