create-version.sh: Generate a version from the git revision
Commit Message
If git is available and able to identify a revision string,
it will be appended to the -scm tag at the end of the version string
Should git not be available, the string will not be adjusted
gdb/Changelog:
* common/create-version.sh (git): Provide git commit identifier
on -git branches
---
gdb/ChangeLog | 4 ++++
gdb/common/create-version.sh | 4 ++++
2 files changed, 8 insertions(+)
@@ -1,3 +1,7 @@
+2016-02-25 Kieran Bingham <kieran.bingham@linaro.org>
+ * common/create-version.sh (git): Provide git commit identifier
+ on -git branches
+
2016-02-25 Antoine Tremblay <antoine.tremblay@ericsson.com>
* ax-general.c (ax_reg): Call gdbarch_remote_register_number.
@@ -30,6 +30,10 @@ output="$4"
rm -f version.c-tmp $output version.tmp
date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
+gitver=`git -C $srcdir describe --always --dirty`
+if [ -n "$gitver" ]; then
+ sed -i -e "s/-git/-git-$gitver/" version.tmp
+fi
echo '#include "version.h"' >> version.c-tmp
echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp