mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-28 20:45:18 +00:00
Add -p for PIE builds, preserve environment LDFLAGS
This commit is contained in:
parent
a5bcc227ca
commit
da9f02a381
5
build
5
build
@ -6,10 +6,10 @@ PKGSRC=${PKGSRC:-github.com/yggdrasil-network/yggdrasil-go/src/version}
|
|||||||
PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)}
|
PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)}
|
||||||
PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}
|
PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}
|
||||||
|
|
||||||
LDFLAGS="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
|
LDFLAGS="$LDFLAGS -X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
|
||||||
ARGS="-v"
|
ARGS="-v"
|
||||||
|
|
||||||
while getopts "uaitc:l:dro:" option
|
while getopts "uaitc:l:dro:p" option
|
||||||
do
|
do
|
||||||
case "$option"
|
case "$option"
|
||||||
in
|
in
|
||||||
@ -22,6 +22,7 @@ do
|
|||||||
d) ARGS="$ARGS -tags debug" DEBUG=true;;
|
d) ARGS="$ARGS -tags debug" DEBUG=true;;
|
||||||
r) ARGS="$ARGS -race";;
|
r) ARGS="$ARGS -race";;
|
||||||
o) ARGS="$ARGS -o $OPTARG";;
|
o) ARGS="$ARGS -o $OPTARG";;
|
||||||
|
p) ARGS="$ARGS -buildmode=pie";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user