diff options
author | Jakob Unterwurzacher | 2017-02-19 20:27:29 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-02-19 20:27:29 +0100 |
commit | 1139c27c36de723391b6a5935159feaef49be299 (patch) | |
tree | c0c29349323d2e96e51ee213d220eec992b03ad6 /build.bash | |
parent | 10361a907acaa1126b27113789069a74ae7d5ccc (diff) |
build.bash: deduplicate build call
Diffstat (limited to 'build.bash')
-rwxr-xr-x | build.bash | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -43,15 +43,18 @@ BUILDTIME=$(date +%s) # Make sure we have the go binary go version > /dev/null +# Go 1.5 changed the CLI syntax. Let's also support 1.3 and 1.4. # "go version go1.6.2 linux/amd64" -> "1.6" V=$(go version | cut -d" " -f3 | cut -c3-5) - if [[ $V == "1.3" || $V == "1.4" ]] ; then - go build -ldflags="-X main.GitVersion $GITVERSION -X main.GitVersionFuse $GITVERSIONFUSE -X main.BuildTime $BUILDTIME" $@ + LDFLAGS="-X main.GitVersion $GITVERSION -X main.GitVersionFuse $GITVERSIONFUSE -X main.BuildTime $BUILDTIME" else - # Go 1.5 wants an "=" here - go build -ldflags="-X main.GitVersion=$GITVERSION -X main.GitVersionFuse=$GITVERSIONFUSE -X main.BuildTime=$BUILDTIME" $@ + # Go 1.5+ wants an "=" here + LDFLAGS="-X main.GitVersion=$GITVERSION -X main.GitVersionFuse=$GITVERSIONFUSE -X main.BuildTime=$BUILDTIME" fi + +go build "-ldflags=$LDFLAGS" $@ + (cd gocryptfs-xray; go build $@) ./gocryptfs -version |