aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-02-19 20:27:29 +0100
committerJakob Unterwurzacher2017-02-19 20:27:29 +0100
commit1139c27c36de723391b6a5935159feaef49be299 (patch)
treec0c29349323d2e96e51ee213d220eec992b03ad6
parent10361a907acaa1126b27113789069a74ae7d5ccc (diff)
build.bash: deduplicate build call
-rwxr-xr-xbuild.bash11
1 files changed, 7 insertions, 4 deletions
diff --git a/build.bash b/build.bash
index 4cb04ed..0dcc272 100755
--- a/build.bash
+++ b/build.bash
@@ -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