diff options
author | kali <kali@leap.se> | 2020-07-27 18:18:38 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2020-10-13 19:08:40 +0200 |
commit | 2cf32806dcce2d41920be28bd0e7d12e5d049357 (patch) | |
tree | 5ecad10f0c2804ab0ded8380431490e475f57998 /gui/build.sh | |
parent | 211fc457329b074fd4331aec0c4fc5d765e9023f (diff) |
[pkg] update build script for openvpn
Diffstat (limited to 'gui/build.sh')
-rwxr-xr-x | gui/build.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gui/build.sh b/gui/build.sh index 91be4fc..9c10341 100755 --- a/gui/build.sh +++ b/gui/build.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e - +set -x XBUILD=${XBUILD-no} WIN64="win64" @@ -30,6 +30,7 @@ else fi fi +PLATFORM=`uname -s` function init { mkdir -p lib @@ -38,10 +39,18 @@ function init { function buildGoLib { echo "[+] Using go in" $GO "[`go version`]" $GO generate ./pkg/config/version/genver/gen.go + if [ "$PLATFORM" == "Darwin" ] + then + OSX_TARGET=10.12 + GOOS=darwin + CC=clang + CGO_CFLAGS="-g -O2 -mmacosx-version-min=$OSX_TARGET" + CGO_LDFLAGS="-g -O2 -mmacosx-version-min=$OSX_TARGET" + fi if [ "$XBUILD" == "no" ] then echo "[+] Building Go library with standard Go compiler" - CGO_ENABLED=1 go build -buildmode=c-archive -o $TARGET_GOLIB $SOURCE_GOLIB + CGO_ENABLED=1 GOOS=$GOOS CC=$CC CGO_CFLAGS=$CGO_CFLAGS CGO_LDFLAGS=$CGO_LDFLAGS go build -buildmode=c-archive -o $TARGET_GOLIB $SOURCE_GOLIB fi if [ "$XBUILD" == "$WIN64" ] then |