mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
dynamically linked libraries support
Added compilation of dynamically linked libraries
This commit is contained in:
parent
fec96a38a4
commit
24198d353a
2 changed files with 407 additions and 1 deletions
15
build
15
build
|
@ -28,11 +28,24 @@ if [ -z $TABLES ] && [ -z $DEBUG ]; then
|
|||
LDFLAGS="$LDFLAGS -s -w"
|
||||
fi
|
||||
|
||||
for CMD in yggdrasil yggdrasilctl ; do
|
||||
LIBNAME="yggdrasillib"
|
||||
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
LIBNAME="$LIBNAME.so"
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
LIBNAME="$LIBNAME.dylib"
|
||||
elif [[ "$OSTYPE" == "win32" ]]; then
|
||||
LIBNAME="$LIBNAME.dll"
|
||||
fi
|
||||
|
||||
for CMD in yggdrasil yggdrasilctl; do
|
||||
echo "Building: $CMD"
|
||||
|
||||
go build $ARGS -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" ./cmd/$CMD
|
||||
|
||||
if [ $UPX ]; then
|
||||
upx --brute $CMD
|
||||
fi
|
||||
done
|
||||
|
||||
go build -ldflags="$LDFLAGS" -buildmode=c-shared -o="$LIBNAME" ./cmd/yggdrasillib
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue