diff options
author | Simon Rettberg | 2014-01-13 12:22:03 +0100 |
---|---|---|
committer | Simon Rettberg | 2014-01-13 12:22:03 +0100 |
commit | d2adcf51505484efd164d6c867a8157061d1ff29 (patch) | |
tree | 73a8dba7435b7b3019e03384c0a2b5dd787aefc0 /src | |
parent | [SERVER] Add example config (diff) | |
download | dnbd3-2.0.tar.gz dnbd3-2.0.tar.xz dnbd3-2.0.zip |
[*] Add automatic version string generationv2.0
Diffstat (limited to 'src')
-rw-r--r-- | src/client/client.c | 1 | ||||
-rw-r--r-- | src/server/server.c | 1 | ||||
-rw-r--r-- | src/version.c.in | 4 | ||||
-rw-r--r-- | src/version.h | 7 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/client/client.c b/src/client/client.c index c0d316b..bb5683b 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -638,6 +638,7 @@ static int dnbd3_daemon_send(int argc, char **argv) static void dnbd3_print_help(char *argv_0) { + printf( "Version: %s\n\n", VERSION_STRING ); printf( "\nUsage: %s\n" "\t-h <host> -i <image name> [-r <rid>] -d <device> [-a <KB>] || -c <device>\n\n", argv_0 ); printf( "Start the DNBD3 client.\n" ); diff --git a/src/server/server.c b/src/server/server.c index eef9fdc..968d59f 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -71,6 +71,7 @@ static void dnbd3_printClients(); */ void dnbd3_print_help(char *argv_0) { + printf( "Version: %s\n\n", VERSION_STRING ); printf( "Usage: %s [OPTIONS]...\n", argv_0 ); printf( "Start the DNBD3 server\n" ); printf( "-c or --config Configuration file (default /etc/dnbd3-server.conf)\n" ); diff --git a/src/version.c.in b/src/version.c.in new file mode 100644 index 0000000..54854c9 --- /dev/null +++ b/src/version.c.in @@ -0,0 +1,4 @@ +#include "version.h" + +const char * VERSION_STRING = "@VERSION@"; + diff --git a/src/version.h b/src/version.h index 60246b7..0c4a66b 100644 --- a/src/version.h +++ b/src/version.h @@ -21,7 +21,10 @@ #ifndef VERSION_H_ #define VERSION_H_ -#define VERSION_STRING "1.0.0" -#define VERSION_NUMBER 100 +extern const char *VERSION_STRING; + +// This is done in a little weird way but otherwise eclipse complains about +// unresolvable symbols etc... +#include "version.c" #endif /* VERSION_H_ */ |