Always include the up-to-date abbreviated git hash if we are in the git repository.

This commit is contained in:
Mike Brady
2019-04-16 22:45:45 +01:00
parent 9aa8f91c0e
commit db8fc8057f
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -12,8 +12,10 @@ shairport_sync_SOURCES = build_details.h shairport.c rtsp.c mdns.c common.c rtp.
# from Stack Overflow, with thanks: https://stackoverflow.com/questions/54303270/how-to-execute-shell-commands-in-automake-makefile-am
build_details.h:
echo "#define GITDESCRIPTION \"`git describe --dirty --always 2>/dev/null`\"" >$@
build_details.h: FORCE
( [ -e $(CURDIR)/.git ] && echo "#define GITDESCRIPTION \"`git describe --dirty --always 2>/dev/null`\"" >$@ ) || echo "" >$@
FORCE:
if BUILD_FOR_FREEBSD
AM_CXXFLAGS = -I/usr/local/include -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
AM_CFLAGS = -Wno-multichar -Wall -Wextra -pthread -DSYSCONFDIR=\"$(sysconfdir)\"
+2
View File
@@ -1284,10 +1284,12 @@ char *get_version_string() {
char *version_string = malloc(1024);
if (version_string) {
strcpy(version_string, PACKAGE_VERSION);
#ifdef GITDESCRIPTION
if (strlen(GITDESCRIPTION)) {
strcat(version_string, "-");
strcat(version_string, GITDESCRIPTION);
}
#endif
#ifdef CONFIG_LIBDAEMON
strcat(version_string, "-libdaemon");
#endif