Merge pull request #183 from myfreeweb/master

fix freebsd build
This commit is contained in:
Armon Dadgar 2014-05-30 13:48:55 -07:00
commit 748a31d57d
1 changed files with 9 additions and 2 deletions

View File

@ -26,14 +26,21 @@ if [ "$(go env GOOS)" = "windows" ]; then
GOPATHSINGLE=${GOPATH%%;*} GOPATHSINGLE=${GOPATH%%;*}
fi fi
if [ "$(go env GOOS)" = "freebsd" ]; then
export CC="clang"
export CGO_LDFLAGS="$CGO_LDFLAGS -extld clang" # Workaround for https://code.google.com/p/go/issues/detail?id=6845
fi
# Install dependencies # Install dependencies
echo "--> Installing dependencies to speed up builds..." echo "--> Installing dependencies to speed up builds..."
go get ./... go get \
-ldflags "${CGO_LDFLAGS}" \
./...
# Build! # Build!
echo "--> Building..." echo "--> Building..."
go build \ go build \
-ldflags "-X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY}" \ -ldflags "${CGO_LDFLAGS} -X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY}" \
-v \ -v \
-o bin/consul${EXTENSION} -o bin/consul${EXTENSION}
cp bin/consul${EXTENSION} ${GOPATHSINGLE}/bin cp bin/consul${EXTENSION} ${GOPATHSINGLE}/bin