This can be used to report automatically generated version strings from
the SPP server.
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
# 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
#include <sqlite3.h>
#include "common.h"
+#include "common/version.h"
#include "xml-utils.h"
#include "spp_server.h"
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) {
case 'r':
ctx.root_dir = optarg;
break;
+ case 'v':
+ printf("hs20_spp_server v" VERSION_STR "\n");
+ return 0;
default:
usage();
return -1;