Hello,
I was wondering if you'd be interested in modifying 'configure' script,
to add the git information to the version string.
The current string is taken from the VERSION file,
and there's no way to know which changeset was used.
Example of such output:
$ ./tcc -v
tcc version 0.9.26-release_0_9_26-534-g97826e (x86-64 Linux)
The exact string can be of course improved/manipulated.
The attached patch adds this functionality (and is no-op if
tinycc is not compiled from git but from a tarball).
regards,
- assaf
>From 35c40e9abef416c8f11d3d33548c7719381733e1 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <[email protected]>
Date: Fri, 11 Sep 2015 20:42:31 -0400
Subject: [PATCH] configure: add git version to version string (if exists)
---
configure | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure b/configure
index 6a796f3..d91e3e1 100755
--- a/configure
+++ b/configure
@@ -558,6 +558,9 @@ if test "$enable_assert" = "yes" ; then
fi
version=`head $source_path/VERSION`
+gitver=$(test -d "$source_path/.git" \
+ && cd "$source_path" && git describe --dirty --abbrev=6)
+test "$gitver" && version="$version-$gitver"
echo "VERSION=$version" >>config.mak
echo "#define TCC_VERSION \"$version\"" >> $TMPH
echo "@set VERSION $version" > config.texi
--
1.9.1
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel