diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-11-13 16:16:39 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-11-14 15:56:59 +0100 |
commit | 07d5c86e780ed2155da491b408718b2e01f25ec4 (patch) | |
tree | 6de81d546c7cd02f86df8f4dd5808c63b59103ef /configure.ac | |
parent | 79482c9a9ec2c33d79a647329d475019d7dd4f0e (diff) | |
download | NetworkManager-07d5c86e780ed2155da491b408718b2e01f25ec4.tar.gz |
build: fix wrong jansson prerequisites
Currently there are multiple features that require Jansson support,
but WITH_JANSSON=1 is set only when configuring with
--enable-json-validation. Therefore a build with
"--disable-json-validation --enable-ovs" fails.
The availability of Jansson (WITH_JANSSON) should only be used:
- to check if dependent features can be enabled
- to determine compiler and linker flags in the Makefile
- in nm-jansson.h to define compatibility functions if needed
Everything else must be controlled by a configure switch.
https://bugzilla.gnome.org/show_bug.cgi?id=790233
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 14227e1aac..c358d48821 100644 --- a/configure.ac +++ b/configure.ac @@ -642,6 +642,14 @@ PKG_CHECK_MODULES(UUID, uuid) # Teamd control checks PKG_CHECK_MODULES(JANSSON, [jansson], [have_jansson=yes], [have_jansson=no]) +if test "$have_jansson" = "yes"; then + AC_DEFINE(WITH_JANSSON, 1, [Define if JANSSON is enabled]) +else + AC_DEFINE(WITH_JANSSON, 0, [Define if JANSSON is enabled]) +fi +AM_CONDITIONAL(WITH_JANSSON, test "${have_jansson}" = "yes") + + PKG_CHECK_MODULES(LIBTEAMDCTL, [libteamdctl >= 1.9], [have_teamdctl=yes],[have_teamdctl=no]) if test "$have_jansson" = "yes" -a "$have_teamdctl" = "yes"; then have_team_prereq=yes @@ -673,14 +681,13 @@ AC_ARG_ENABLE(json-validation, [enable_json_validation=${enableval}], [enable_json_validation=${have_jansson}]) if (test "${enable_json_validation}" == "no"); then - AC_DEFINE(WITH_JANSSON, 0, [Define if JANSSON is enabled]) + 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_JANSSON, 1, [Define if JANSSON is enabled]) + AC_DEFINE(WITH_JSON_VALIDATION, 1, [Define if JSON validation in libnm is enabled]) fi -AM_CONDITIONAL(WITH_JANSSON, 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 |