Merge pull request #4031 from tianon/gopath

Add slightly better GOPATH detection/handling
This commit is contained in:
Michael Crosby 2014-02-10 13:06:41 -05:00
commit 6174bad135
1 changed files with 13 additions and 0 deletions

View File

@ -68,6 +68,19 @@ else
exit 1
fi
if [ "$AUTO_GOPATH" ]; then
rm -rf .gopath
mkdir -p .gopath/src/github.com/dotcloud
ln -sf ../../../.. .gopath/src/github.com/dotcloud/docker
export GOPATH="$(pwd)/.gopath:$(pwd)/vendor"
fi
if [ ! "$GOPATH" ]; then
echo >&2 'error: missing GOPATH; please see http://golang.org/doc/code.html#GOPATH'
echo >&2 ' alternatively, set AUTO_GOPATH=1'
exit 1
fi
# Use these flags when compiling the tests and final binary
LDFLAGS='-X main.GITCOMMIT "'$GITCOMMIT'" -X main.VERSION "'$VERSION'" -w'
LDFLAGS_STATIC='-X github.com/dotcloud/docker/utils.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'