Log the exact version at init (#22)
This commit is contained in:
6
Makefile
6
Makefile
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user