From bce9ed0e4c56b85c8a4a5ba2b1af45035deec9dd Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Thu, 20 Nov 2014 12:56:54 -0500 Subject: [PATCH] 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 (github: rhatdan) --- project/make.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/make.sh b/project/make.sh index d6da3057fa..36e5e161bf 100755 --- a/project/make.sh +++ b/project/make.sh @@ -96,10 +96,14 @@ fi # Use these flags when compiling the tests and final binary LDFLAGS=' - -w -X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'" -X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'" ' + +if [ -z "$DEBUG" ]; then + LDFLAGS="-w $LDFLAGS" +fi + LDFLAGS_STATIC='-linkmode external' EXTLDFLAGS_STATIC='-static' # ORIG_BUILDFLAGS is necessary for the cross target which cannot always build