From 0d26e5ca99c9a541e3bfbbf2dc03e1520004dda2 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 20 Dec 2004 04:37:50 +0000 Subject: [PATCH] New function LibVEX_Version, returning version string automagically generated by 'svnversion -n .'. Only updated when you do 'make version'. git-svn-id: svn://svn.valgrind.org/vex/trunk@674 --- VEX/Makefile | 8 +++++++- VEX/priv/main/vex_main.c | 10 ++++++++++ VEX/pub/libvex.h | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/VEX/Makefile b/VEX/Makefile index 7ad1f565e..b6058590b 100644 --- a/VEX/Makefile +++ b/VEX/Makefile @@ -76,9 +76,15 @@ libvex.a: $(LIB_OBJS) ar clq libvex.a $(LIB_OBJS) clean: - rm -f $(LIB_OBJS) libvex.a vex test_main.o + rm -f $(LIB_OBJS) libvex.a vex test_main.o priv/main/vex_svnversion.h (cd head20041019 && make --quiet clean) +version: + rm -f priv/main/vex_svnversion.h + echo -n "\"" > priv/main/vex_svnversion.h + svnversion -n . >> priv/main/vex_svnversion.h + echo "\"" >> priv/main/vex_svnversion.h + ALL_HEADERS = $(PUB_HEADERS) $(PRIV_HEADERS) ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES) diff --git a/VEX/priv/main/vex_main.c b/VEX/priv/main/vex_main.c index b93ee5718..911ad8a9f 100644 --- a/VEX/priv/main/vex_main.c +++ b/VEX/priv/main/vex_main.c @@ -53,6 +53,16 @@ /* --------- Initialise the library. --------- */ +/* Exported to library client. */ + +HChar* LibVEX_Version ( void ) +{ +return +#include "main/vex_svnversion.h" + ; +} + + /* Exported to library client. */ void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon ) diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index ea5a85cf0..20efe5a81 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -81,6 +81,11 @@ typedef extern void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon ); +/* Returns the Vex SVN version. */ + +extern HChar* LibVEX_Version ( void ); + + /* Initialise the translator. */ extern void LibVEX_Init (