支持Debian静态构建

This commit is contained in:
aixiao 2025-01-14 18:05:01 +08:00
parent 52d1c4aa05
commit 4c09dce14a
2 changed files with 10 additions and 0 deletions

10
build-static-bin.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -x
libcap=$(pkg-config --libs --static libcap)
libpcap=$(pkg-config --libs --static libpcap)
dbus=$(pkg-config --libs --static dbus-1)
a="'"
eval "CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -ldflags ${a}-extldflags \"-static ${libpcap} ${dbus} ${libcap} -lc\"${a}"

BIN
denyip

Binary file not shown.