Use git describe for BIRD version

Based on patch from Pavel Tvrdik
This commit is contained in:
Ondrej Zajicek (work) 2017-12-13 19:18:30 +01:00
parent d807ea087f
commit c36a298c21
2 changed files with 12 additions and 0 deletions

View 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@

View 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"