HS 2.0 server: Command line option to fetch the version information
This can be used to report automatically generated version strings from the SPP server. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
2d1762fa4a
commit
59c6930641
2 changed files with 15 additions and 1 deletions
|
@ -21,6 +21,16 @@ LIBS += -lsqlite3
|
|||
# Using glibc < 2.17 requires -lrt for clock_gettime()
|
||||
LIBS += -lrt
|
||||
|
||||
ifndef CONFIG_NO_GITVER
|
||||
# Add VERSION_STR postfix for builds from a git repository
|
||||
ifeq ($(wildcard ../../.git),../../.git)
|
||||
GITVER := $(shell git describe --dirty=+)
|
||||
ifneq ($(GITVER),)
|
||||
CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
OBJS=spp_server.o
|
||||
OBJS += hs20_spp_server.o
|
||||
OBJS += ../../src/utils/xml-utils.o
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <sqlite3.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "common/version.h"
|
||||
#include "xml-utils.h"
|
||||
#include "spp_server.h"
|
||||
|
||||
|
@ -158,7 +159,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
os_memset(&ctx, 0, sizeof(ctx));
|
||||
for (;;) {
|
||||
int c = getopt(argc, argv, "f:r:");
|
||||
int c = getopt(argc, argv, "f:r:v");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
|
@ -174,6 +175,9 @@ int main(int argc, char *argv[])
|
|||
case 'r':
|
||||
ctx.root_dir = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
printf("hs20_spp_server v" VERSION_STR "\n");
|
||||
return 0;
|
||||
default:
|
||||
usage();
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue