From: Ondrej Zajicek (work) Date: Wed, 13 Dec 2017 18:18:30 +0000 (+0100) Subject: Use git describe for BIRD version X-Git-Tag: v2.0.1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c36a298c21f1aa5b4e61d2d4740811529175df09;p=thirdparty%2Fbird.git Use git describe for BIRD version Based on patch from Pavel Tvrdik --- diff --git a/Makefile.in b/Makefile.in index e1f8d9c27..fdd5e6c7b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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@ diff --git a/sysdep/config.h b/sysdep/config.h index 460cac8b7..96e371f8a 100644 --- a/sysdep/config.h +++ b/sysdep/config.h @@ -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"