diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-17 08:33:56 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-17 08:33:56 +0000 |
commit | c20bdfa5eafb8ac776092c816018de0b07045c97 (patch) | |
tree | 767a45a2e028663afadf78ad563ac0cebb889ea7 /src | |
parent | c5eec553984f937b1f1682378ab7096b7f6b3933 (diff) |
Implement GSMD version printout (Matt Mets <matt.mets@cibomahto.com>)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2727 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src')
-rw-r--r-- | src/gsmd/Makefile.am | 6 | ||||
-rw-r--r-- | src/gsmd/gsmd.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/gsmd/Makefile.am b/src/gsmd/Makefile.am index 1ff1970..bdb39d0 100644 --- a/src/gsmd/Makefile.am +++ b/src/gsmd/Makefile.am @@ -2,6 +2,12 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/include AM_CFLAGS = -std=gnu99 plugindir = $(libdir)/gsmd +gsmd-version.h: + echo -e '#ifndef GSMD_VERSION' \ + '\n#define GSMD_VERSION "'`svnversion`'"' \ + '\n#endif' > gsmd-version.h + +BUILT_SOURCES = gsmd-version.h sbin_PROGRAMS = gsmd gsmd_CFLAGS = -D PLUGINDIR=\"$(plugindir)\" diff --git a/src/gsmd/gsmd.c b/src/gsmd/gsmd.c index 3d52eeb..de0d25e 100644 --- a/src/gsmd/gsmd.c +++ b/src/gsmd/gsmd.c @@ -36,6 +36,7 @@ #include <sys/stat.h> #include "gsmd.h" +#include "gsmd-version.h" #include <gsmd/gsmd.h> #include <gsmd/atcmd.h> @@ -325,6 +326,11 @@ static void print_header(void) "This program is FREE SOFTWARE under the terms of GNU GPL\n\n"); } +static void print_version(void) +{ + printf("gsmd, version %s\n",GSMD_VERSION); +} + static void print_usage(void) { printf("Usage:\n" @@ -382,7 +388,8 @@ int main(int argc, char **argv) while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:", opts, NULL)) != -1) { switch (argch) { case 'V': - /* FIXME */ + print_version(); + exit(0); break; case 'L': talloc_enable_leak_report_full(); |