summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-07-01 18:38:22 +0200
committerThomas Haller <thaller@redhat.com>2020-07-09 11:47:06 +0200
commitbbb1f5df2f2322b909d29921120a9bb1295ca326 (patch)
tree80e2591846210e01d28f233760fb166b323f70a3 /configure.ac
parent3814467b88afa64733f445ebb013619223a72657 (diff)
libnm: always build libnm with JSON validation
We anyway load libjansson with dlopen(), and already before it could happen that libjansson is not available. In that case, we would not crash, but simply proceed without json validation. Since libnm-core no longer uses libjansson directly, but only via "nm-glib-aux/nm-json.h", we can just always compile with that, and use it at runtime. That means, libjansson is not a build dependency for libnm anymore, so we don't need a compile time check. Note that if you build without libjansson, then JANSSON_SONAME is undefined, and loading it will still fail at runtime. So, even if we now always build with all our code enabled, it only works if you actually build with libjansson. Still, it's simpler to drop the conditional build, as the only benefit is a (minimally) smaller build.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 3 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 1e6823b494..4ea4dbf081 100644
--- a/configure.ac
+++ b/configure.ac
@@ -596,6 +596,8 @@ if test "$have_jansson" = "yes"; then
fi
AC_DEFINE_UNQUOTED(JANSSON_SONAME, "$JANSSON_SONAME", [Define to path to the Jansson shared library])
else
+ have_jansson=no
+ JANSSON_SONAME=
AC_DEFINE(WITH_JANSSON, 0, [Define if JANSSON is enabled])
fi
AM_CONDITIONAL(WITH_JANSSON, test "${have_jansson}" = "yes")
@@ -622,21 +624,6 @@ if test "${enable_teamdctl}" = "yes"; then
fi
AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")
-# Jansson for team configuration validation
-AC_ARG_ENABLE(json-validation,
- AS_HELP_STRING([--enable-json-validation], [Enable JSON validation in libnm]),
- [enable_json_validation=${enableval}],
- [enable_json_validation=${have_jansson}])
-if test "${enable_json_validation}" = "no"; then
- AC_DEFINE(WITH_JSON_VALIDATION, 0, [Define if JSON validation in libnm is enabled])
-else
- if test "$have_jansson" = "no"; then
- AC_MSG_ERROR([jansson is needed for team configuration validation. Use --disable-json-validation to build without it.])
- fi
- AC_DEFINE(WITH_JSON_VALIDATION, 1, [Define if JSON validation in libnm is enabled])
-fi
-AM_CONDITIONAL(WITH_JSON_VALIDATION, test "${enable_json_validation}" != "no")
-
# we usually compile with polkit support. --enable-polkit=yes|no only sets the
# default configuration for main.auth-polkit. User can always enable/disable polkit
# authorization via config.
@@ -1366,6 +1353,7 @@ echo " nmcli: $build_nmcli"
echo " nmtui: $build_nmtui"
echo " nm-cloud-setup: $with_nm_cloud_setup"
echo " iwd: $ac_with_iwd"
+echo " jansson: $have_jansson${JANSSON_SONAME:+ (soname: $JANSSON_SONAME)}"
echo
echo "Configuration plugins (main.plugins=${config_plugins_default})"
@@ -1398,7 +1386,6 @@ echo " valgrind: $with_valgrind $with_valgrind_suppressions"
echo " code coverage: $enable_code_coverage"
echo " LTO: $enable_lto"
echo " linker garbage collection: $enable_ld_gc"
-echo " JSON validation for libnm: $enable_json_validation"
echo " crypto: $with_crypto (have-gnutls: $have_crypto_gnutls, have-nss: $have_crypto_nss)"
echo " sanitizers: $sanitizers"
echo " Mozilla Public Suffix List: $with_libpsl"