Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically linked libraries with docker support #1190

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,30 @@ if [ -z $TABLES ] && [ -z $DEBUG ]; then
LDFLAGS="$LDFLAGS -s -w"
fi

for CMD in yggdrasil yggdrasilctl ; do

if [[ "$CGO_ENABLED" == "1" ]]; then
LIBNAME="yggdrasillib"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
LIBNAME="$LIBNAME.so"
echo "Building: $LIBNAME"
elif [[ "$OSTYPE" == "darwin"* ]]; then
LIBNAME="$LIBNAME.dylib"
echo "Building: $LIBNAME"
elif [[ "$OSTYPE" == "win32" ]]; then
LIBNAME="$LIBNAME.dll"
echo "Building: $LIBNAME"
fi
go build -ldflags="$LDFLAGS" -buildmode=c-shared -o="$LIBNAME" ./cmd/yggdrasillib
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


Loading