Always include the up-to-date abbreviated git hash if we are in the git repository.
This commit is contained in:
+4
-2
@@ -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)\"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user