From 63593a19d8e7d7fb5e844f0e3c8ac847e68699cb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 10 Apr 2015 07:39:14 +0200 Subject: [PATCH] build: add --enable-more-logging configure option NM core uses nm-logging which is entirely configurable at runtime. Other components use glib-logging, which can also be partly configured via G_MESSAGES_DEBUG. It makes sense to have a compile time option to enable some logging statements that are only useful for heavy debugging. For glib-logging, this is a way to enable/disable extra logging. For nm-logging, we could alternatively configure a least log-level that is enabled at compile time (that way, we could configure to prune all LOGL_TRACE logging). While that might be useful (too), this gives an alternative way to disable/enable logging. Add a configure option --enable-more-logging and a NM_MORE_LOGGING define for that. If we don't find this useful after a while, we can simply remove it, because our logging statements are not part of a "stable" behavior. --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index ce3ea7b6a..e2a452bf8 100644 --- a/configure.ac +++ b/configure.ac @@ -856,6 +856,12 @@ if test "${enable_more_asserts}" = "yes"; then AC_DEFINE(NM_MORE_ASSERTS, [1], [Define if more asserts are enabled]) fi +AC_ARG_ENABLE(more-logging, + AS_HELP_STRING([--enable-more-logging], [Enable more debug logging (default: no)])) +if test "${enable_more_logging}" = "yes"; then + AC_DEFINE(NM_MORE_LOGGING, [1], [Define if more asserts are enabled]) +fi + AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size (default: no)])) if (test "${enable_lto}" = "yes"); then CFLAGS="-flto $CFLAGS"