[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] I want to add more info with -v option

From: Christian Jullien
Subject: Re: [Tinycc-devel] I want to add more info with -v option
Date: Wed, 31 Mar 2021 22:28:54 +0200

It appears some prefer git hash so I added short hash.

Code is commited, you should get something like:


$ ./tcc -v

tcc version 0.9.27 - 65d00b1 (ARM eabihf Linux)


Now, anything wo. hash is not from mod.





From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On Behalf Of Christian Jullien
Sent: Wednesday, March 31, 2021 17:37
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] I want to add more info with -v option




More and more users complain with 0.9.27 bugs which are solved by mob.

They often tell us they are using ./tcc –v => 0.9.27 which is meaningless as 0.9.27 is anything form last >3y old official 0.9.27 to mob.


To improve this, I would like to add the git last date (or anything that can easily identify the source code version used to compile tcc).


./tcc –v

jullien@sims4:~/tinycc $ ./tcc -v

tcc version 0.9.27 (ARM eabihf Linux - git version Thu Mar 18 22:54:24 2021)


When tcc is compiled from a tarball (w.o. git info) it will tell:

jullien@sims4:~/tinycc $ ./tcc -v

tcc version 0.9.27 (ARM eabihf Linux - unknown git version)


Can I push this patch?


jullien@sims4:~/tinycc $ git diff

diff --git a/Makefile b/Makefile

index 6d09b65..691a2d3 100644

--- a/Makefile

+++ b/Makefile

@@ -24,6 +24,12 @@ CFLAGS += -I$(TOP)




+TCC_GIT_DATE=$(shell which gut > /dev/null 2>&1 && git log -1 --format=%ad --date=local || echo no)


+ifneq ($(TCC_GIT_DATE),no)




ifdef CONFIG_WIN32

  CFG = -win

  ifneq ($(CONFIG_static),yes)

diff --git a/tcc.c b/tcc.c

index bd9ce2f..36f4af1 100644

--- a/tcc.c

+++ b/tcc.c

@@ -181,6 +181,12 @@ static const char version[] =

         " NetBSD"


         " Linux"


+#ifdef TCC_GIT_DATE

+        " - git version "

+        TCC_GIT_DATE


+        " - unknown git version"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]