Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
| ... | ... |
@@ -94,14 +94,19 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then |
| 94 | 94 |
DOCKER_BUILDTAGS+=" daemon" |
| 95 | 95 |
fi |
| 96 | 96 |
|
| 97 |
-rm -f dockerversion/static.go |
|
| 97 |
+rm -f dockerversion/static.go dockerversion/details.go |
|
| 98 |
+cat > dockerversion/details.go <<EOF |
|
| 99 |
+// AUTOGENERATED FILE; see hack/make.sh |
|
| 100 |
+package dockerversion |
|
| 101 |
+ |
|
| 102 |
+func init() {
|
|
| 103 |
+ GITCOMMIT = "$GITCOMMIT" |
|
| 104 |
+ VERSION = "$VERSION" |
|
| 105 |
+} |
|
| 106 |
+EOF |
|
| 98 | 107 |
|
| 99 | 108 |
# Use these flags when compiling the tests and final binary |
| 100 |
-LDFLAGS=' |
|
| 101 |
- -w |
|
| 102 |
- -X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'" |
|
| 103 |
- -X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'" |
|
| 104 |
-' |
|
| 109 |
+LDFLAGS='-w' |
|
| 105 | 110 |
LDFLAGS_STATIC='-linkmode external' |
| 106 | 111 |
EXTLDFLAGS_STATIC='-static' |
| 107 | 112 |
# ORIG_BUILDFLAGS is necessary for the cross target which cannot always build |