This flag turns on/off the persistent statistic numbers support.
---
Makefile.am | 4 ++++
configure.ac | 5 +++++
src/stats.c | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index d70725c..fd38bb9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -223,6 +223,10 @@ else
AM_CPPFLAGS = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
endif
+if STATS
+AM_CPPFLAGS += -DCONNMAN_WITH_STATS
+endif
+
src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
@GNUTLS_CFLAGS@ $(builtin_cflags) \
-DCONNMAN_PLUGIN_BUILTIN \
diff --git a/configure.ac b/configure.ac
index c330314..a8a03a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -352,6 +352,11 @@ AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
[enable_tools=${enableval}])
AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
+AC_ARG_ENABLE(stats, AC_HELP_STRING([--disable-stats],
+ [disable stats file support]),
+ [enable_stats=${enableval}])
+AM_CONDITIONAL(STATS, test "${enable_stats}" != "no")
+
if (test "${enable_tools}" != "no"); then
AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
$PATH:/sbin:/usr/sbin)
diff --git a/src/stats.c b/src/stats.c
index 26343b1..8fb2139 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -37,6 +37,7 @@
#include "connman.h"
+#ifdef CONNMAN_WITH_STATS
#define MODE (S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | \
S_IXGRP | S_IROTH | S_IXOTH)
@@ -823,3 +824,38 @@ void __connman_stats_cleanup(void)
g_hash_table_destroy(stats_hash);
stats_hash = NULL;
}
+
+#else
+
+int __connman_stats_service_register(struct connman_service *service)
+{
+ return -ENOTSUP;
+}
+
+void __connman_stats_service_unregister(struct connman_service *service)
+{
+}
+
+int __connman_stats_update(struct connman_service *service,
+ bool roaming,
+ struct connman_stats_data *data)
+{
+ return 0;
+}
+
+int __connman_stats_get(struct connman_service *service,
+ bool roaming,
+ struct connman_stats_data *data)
+{
+ return 0;
+}
+
+int __connman_stats_init(void)
+{
+ return 0;
+}
+
+void __connman_stats_cleanup(void)
+{
+}
+#endif /* CONNMAN_WITH_STATS */
--
2.8.0.rc3.226.g39d4020