Use my latest proposed patch for improved -v message. It is simpler and gives a better message, especially when repository has been locally modified: 'tcc version 0.9.27 mob:fef701b 2022-12-02T07:11:55+01:00 locally modified (ARM eabihf Linux)'. Hope it's Ok for maintainers

This commit is contained in:
Christian Jullien 2022-12-02 08:05:01 +01:00
parent fef701b57f
commit 7015838f51
2 changed files with 5 additions and 10 deletions

View File

@ -241,14 +241,12 @@ $(TCC_FILES) : DEFINES += -DONE_SOURCE=0
$(X)tccpp.o : $(TCCDEFS_H)
endif
GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)
ifneq ($(GITHASH),no)
DEF_GITHASH := -DTCC_GITHASH="\"$(shell git rev-parse --abbrev-ref HEAD):$(GITHASH)$(shell git diff --quiet || echo ' - modified')\""
endif
FROM_GIT := $(shell git rev-parse >/dev/null 2>&1 && echo yes || echo no)
GITDATE := $(shell git log -1 >/dev/null 2>&1 && git log -1 --pretty='format:%cI' || echo no)
ifneq ($(GITDATE),no)
DEF_GITDATE := -DTCC_GITDATE="\"$(shell git log -1 --pretty='format:%cI')\""
ifeq ($(FROM_GIT),yes)
GITHASH:=$(shell git rev-parse --abbrev-ref HEAD):$(shell git rev-parse --short HEAD) $(shell git log -1 --pretty='format:%cI')
GITHASH+=$(shell git diff --quiet || echo locally modified)
DEF_GITHASH := -DTCC_GITHASH="\"$(GITHASH)\""
endif
ifeq ($(CONFIG_debug),yes)

3
tcc.c
View File

@ -155,9 +155,6 @@ static const char version[] =
"tcc version "TCC_VERSION
#ifdef TCC_GITHASH
" "TCC_GITHASH
#endif
#ifdef TCC_GITDATE
" on "TCC_GITDATE
#endif
" ("
#ifdef TCC_TARGET_I386