[network-manager-vpnc/th/vpn-editor-split-bgo766170: 6/20] build: add "--with-more-asserts" configure option
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-vpnc/th/vpn-editor-split-bgo766170: 6/20] build: add "--with-more-asserts" configure option
- Date: Wed, 11 May 2016 09:10:53 +0000 (UTC)
commit cb4babd5969fcc7263999333cb6a3d8257b18ca4
Author: Thomas Haller <thaller redhat com>
Date: Mon May 9 12:06:25 2016 +0200
build: add "--with-more-asserts" configure option
There is an assertion macro nm_assert() which is disabled
to be a NOP by default, unless explicitly enabling via
"--with-more-asserts". So, add the same configuration option
as also for NetworkManager to support this kind of assertions.
We already have g_assert(), assert() and g_return*() as other
ways to assert. While all of these can be disabled at compile time,
they are enabled by default.
Most users and distributions don't bother or don't dare to disable them,
so we always run with these assertions enabled. Also, once you always
run with assertions enabled, hardly anybody tests disabling them. So,
it might be even fail to disable these commonly enabled assertions.
configure.ac | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ee31814..f53e2a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,6 +121,17 @@ if ! test x"$ac_distver" = x""; then
AC_DEFINE_UNQUOTED(DIST_VERSION, "$ac_distver", [Define the distribution version string])
fi
+AC_ARG_WITH(more-asserts,
+ AS_HELP_STRING([--with-more-asserts=level], [Enable more assertions for debugging (default: 0)]),
+ [more_asserts=${with_more_asserts}],
+ [more_asserts=no])
+if test "${more_asserts}" = "no"; then
+ more_asserts=0
+elif test "${more_asserts}" = "yes" -o "#${more_asserts}#" != "$(printf '%s' "${more_asserts}" | sed -n
'1s/^[0-9]\+$/#\0#/p')"; then
+ more_asserts=100
+fi
+AC_DEFINE_UNQUOTED(NM_MORE_ASSERTS, $more_asserts, [Define if more asserts are enabled])
+
AC_CONFIG_FILES([
Makefile
src/Makefile
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]