diff options
author | Thomas Haller <thaller@redhat.com> | 2017-12-08 11:08:29 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-12-08 11:09:34 +0100 |
commit | 79d5a06c8b307c56e663dc9ed914b34e860cd2bf (patch) | |
tree | 09c775e2292aab5dcc00910c5d66d9c05c970e6a | |
parent | b1c65d32fe40cc26113e7848da6f764224fab21b (diff) | |
download | NetworkManager-79d5a06c8b307c56e663dc9ed914b34e860cd2bf.tar.gz |
build: don't link libnm against libjansson when building --without-json-validation
Also, don't add the CFLAGS for libjansson to dflt_cppflags_libnm_core.
dflt_cppflags_libnm_core is used also by core and libnm. But those
components do not (directly) link against libjansson. The cannot use
these flags.
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | configure.ac | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index 2a6a6f6da1..079ca443e3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -533,10 +533,6 @@ dflt_cppflags_libnm_core = \ $(GLIB_CFLAGS) \ $(LIBUDEV_CFLAGS) -if WITH_JANSSON -dflt_cppflags_libnm_core += $(JANSSON_CFLAGS) -endif - if WITH_GNUTLS dflt_cppflags_libnm_core += $(GNUTLS_CFLAGS) endif @@ -579,6 +575,10 @@ libnm_core_libnm_core_la_CPPFLAGS = \ -DLIBEXECDIR=\"$(libexecdir)\" \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB +if WITH_JSON_VALIDATION +libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS) +endif + libnm_core_libnm_core_la_SOURCES = \ $(libnm_core_lib_h_pub_real) \ $(libnm_core_lib_h_priv) \ @@ -593,7 +593,7 @@ libnm_core_libnm_core_la_LIBADD = \ $(UUID_LIBS) \ $(LIBUDEV_LIBS) -if WITH_JANSSON +if WITH_JSON_VALIDATION libnm_core_libnm_core_la_LIBADD += $(JANSSON_LIBS) endif diff --git a/configure.ac b/configure.ac index c358d48821..0f3933eaed 100644 --- a/configure.ac +++ b/configure.ac @@ -688,6 +688,7 @@ else 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 |