1
0

Log the exact version at init (#22)

This commit is contained in:
NiLuJe
2020-05-13 18:07:59 +02:00
committed by GitHub
parent 043dfb37e6
commit fbef20c4e2
3 changed files with 12 additions and 0 deletions

View File

@@ -39,6 +39,12 @@ LDFLAGS ?= -Wl,--as-needed
override CFLAGS += -std=gnu11 -Wall -Wextra -Werror
override CXXFLAGS += -std=gnu++11 -Wall -Wextra -Werror
override LDFLAGS += -Wl,--no-undefined -Wl,-rpath,/usr/local/Kobo -Wl,-rpath,/usr/local/Qt-5.2.1-arm/lib
NM_VERSION := $(shell git describe --tags --always --dirty)
# Only use it if we got something useful out of git describe...
ifdef NM_VERSION
override CPPFLAGS += -DNM_VERSION='"$(NM_VERSION)"'
endif
endif
define GITIGNORE_HEAD

View File

@@ -21,6 +21,7 @@ __attribute__((constructor)) void nm_init() {
char *err;
NM_LOG("version: " NM_VERSION);
NM_LOG("init: creating failsafe");
nm_failsafe_t *fs;
if (!(fs = nm_failsafe_create(&err)) && err) {

View File

@@ -13,6 +13,11 @@ extern "C" {
#include <string.h>
#include <syslog.h>
// Fallback version tag
#ifndef NM_VERSION
#define NM_VERSION "dev"
#endif
// strtrim trims ASCII whitespace in-place (i.e. don't give it a string literal)
// from the left/right of the string.
inline char *strtrim(char *s){