Browse code

Allow developers to build docker with debuginfo included

If you execute

DEBUG=-g hack/make.sh dynbinary

Docker will be build with the debug info making it easier to use
cgdb or lightide to debug.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)

Dan Walsh authored on 2014/11/21 02:56:54
Showing 1 changed files
... ...
@@ -96,10 +96,14 @@ fi
96 96
 
97 97
 # Use these flags when compiling the tests and final binary
98 98
 LDFLAGS='
99
-	-w
100 99
 	-X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'"
101 100
 	-X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'"
102 101
 '
102
+
103
+if [ -z "$DEBUG" ]; then
104
+    LDFLAGS="-w $LDFLAGS"
105
+fi
106
+
103 107
 LDFLAGS_STATIC='-linkmode external'
104 108
 EXTLDFLAGS_STATIC='-static'
105 109
 # ORIG_BUILDFLAGS is necessary for the cross target which cannot always build