]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use git describe for BIRD version
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 13 Dec 2017 18:18:30 +0000 (19:18 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 13 Dec 2017 18:18:30 +0000 (19:18 +0100)
Based on patch from Pavel Tvrdik

Makefile.in
sysdep/config.h

index e1f8d9c27e90395316d679eccf2135efbf86fd78..fdd5e6c7bbeb7af93825beeadef39d72d3a26da6 100644 (file)
@@ -21,6 +21,11 @@ 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@
index 460cac8b737a50de1f2d9d0555c85c9f6f83b983..96e371f8a260ee636dc0a571c219de0c905691c6 100644 (file)
@@ -6,8 +6,15 @@
 #ifndef _BIRD_CONFIG_H_
 #define _BIRD_CONFIG_H_
 
+#define XSTR2(X) #X
+#define XSTR1(X) XSTR2(X)
+
 /* BIRD version */
+#ifdef GIT_LABEL
+#define BIRD_VERSION XSTR1(GIT_LABEL)
+#else
 #define BIRD_VERSION "2.0.0"
+#endif
 
 /* Include parameters determined by configure script */
 #include "sysdep/autoconf.h"