summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2018-05-03 11:14:49 +0200
committerJan Maria Matejka <mq@ucw.cz>2018-05-03 11:14:49 +0200
commit29958745c8f58cffd24e1793702524ce84545e5a (patch)
tree88ceef59de57f9d03a184d4376b6f59101d63b03 /Makefile.in
parent823ad12191e66e243dd088a81c66e4a518563e40 (diff)
Makefile: Only set git version if BIRD is build from its repository.
Thanks to Toke Høiland-Jørgensen <toke@toke.dk> for reporting this bug.
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in
index c8168bbe..eb6cc5c9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,11 +21,6 @@ INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
-git-label:=$(strip $(shell git describe --always --dirty=-x 2>/dev/null))
-ifneq ($(git-label),)
- CFLAGS += -DGIT_LABEL="$(git-label)"
-endif
-
client=$(addprefix $(exedir)/,@CLIENT@)
daemon=$(exedir)/bird
protocols=@protocols@
@@ -42,6 +37,11 @@ srcdir := @srcdir@
objdir := @objdir@
exedir := @exedir@
+git-label:=$(strip $(shell cd $(srcdir) && [ "$$(git rev-parse --show-toplevel)" = "$$(readlink -f .)" ] && git describe --always --dirty=-x 2>/dev/null))
+ifneq ($(git-label),)
+ CFLAGS += -DGIT_LABEL="$(git-label)"
+endif
+
ifeq ($(objdir),.)
objdir := $(realpath .)
endif