diff options
author | Thomas Haller <thaller@redhat.com> | 2020-07-01 17:58:44 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-07-08 12:12:42 +0200 |
commit | d35190ef37d673fa05f2c3a9be41b7a47dfa9adc (patch) | |
tree | 361af05647b7b23063d902ee347553055d350d17 | |
parent | 597cb7eb6807a88a0088f18da84621ce9b4d5d73 (diff) | |
download | NetworkManager-d35190ef37d673fa05f2c3a9be41b7a47dfa9adc.tar.gz |
libnm,shared: move nm-json.[hc] to shared/nm-glib-aux
nm-json.[hc] uses libjansson, but only loads it at runtime with dlopen. There
is no more run compile time dependency. Move it to shared, so that it can be
(theoretically) used by other components.
Also, drop the conditional compilation. Granted, if you don't build with
libjansson enabled, then the JANSSON_SONAME define is unset and the code
will fail to load at runtime (which is fine). However, we can still build
against our JSON wrappers. The code savings of conditional build are minimal
so drop it.
-rw-r--r-- | Makefile.am | 14 | ||||
-rw-r--r-- | libnm-core/meson.build | 6 | ||||
-rw-r--r-- | libnm-core/nm-team-utils.c | 2 | ||||
-rw-r--r-- | libnm-core/nm-utils.c | 5 | ||||
-rw-r--r-- | shared/meson.build | 1 | ||||
-rw-r--r-- | shared/nm-glib-aux/nm-json.c (renamed from libnm-core/nm-json.c) | 0 | ||||
-rw-r--r-- | shared/nm-glib-aux/nm-json.h (renamed from libnm-core/nm-json.h) | 0 |
7 files changed, 5 insertions, 23 deletions
diff --git a/Makefile.am b/Makefile.am index e6d55b0bc1..7f694d755a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -403,6 +403,8 @@ shared_nm_glib_aux_libnm_glib_aux_la_SOURCES = \ shared/nm-glib-aux/nm-jansson.h \ shared/nm-glib-aux/nm-json-aux.c \ shared/nm-glib-aux/nm-json-aux.h \ + shared/nm-glib-aux/nm-json.c \ + shared/nm-glib-aux/nm-json.h \ shared/nm-glib-aux/nm-keyfile-aux.c \ shared/nm-glib-aux/nm-keyfile-aux.h \ shared/nm-glib-aux/nm-logging-base.c \ @@ -1031,13 +1033,6 @@ libnm_core_lib_c_real = \ libnm-core/nm-vpn-plugin-info.c \ $(NULL) -if WITH_JSON_VALIDATION -libnm_core_lib_h_priv += \ - libnm-core/nm-json.h -libnm_core_lib_c_real += \ - libnm-core/nm-json.c -endif - libnm_core_lib_c_mkenums = \ libnm-core/nm-core-enum-types.c @@ -1092,11 +1087,6 @@ libnm_core_libnm_core_la_CPPFLAGS = \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \ $(NULL) -if WITH_JSON_VALIDATION -libnm_core_libnm_core_la_CPPFLAGS += $(JANSSON_CFLAGS) -libnm_core_libnm_core_la_CPPFLAGS += -fcommon -endif - libnm_core_libnm_core_la_SOURCES = \ $(libnm_core_lib_h_pub_real) \ $(libnm_core_lib_h_priv) \ diff --git a/libnm-core/meson.build b/libnm-core/meson.build index 89acaf72ad..0509deaa54 100644 --- a/libnm-core/meson.build +++ b/libnm-core/meson.build @@ -196,12 +196,6 @@ links = [ libnm_core_c_args = common_c_flags -if enable_json_validation - libnm_core_sources += files('nm-json.c') - deps += jansson_dep - libnm_core_c_args += ['-fcommon'] -endif - libnm_core = static_library( 'nm-core', sources: libnm_core_sources + libnm_core_enum_sources + nm_meta_setting_source + [nm_version_macro_header], diff --git a/libnm-core/nm-team-utils.c b/libnm-core/nm-team-utils.c index 758766a251..1e0ddc79c8 100644 --- a/libnm-core/nm-team-utils.c +++ b/libnm-core/nm-team-utils.c @@ -11,7 +11,7 @@ #include "nm-errors.h" #include "nm-utils-private.h" -#include "nm-json.h" +#include "nm-glib-aux/nm-json.h" #include "nm-glib-aux/nm-json-aux.h" #include "nm-core-internal.h" #include "nm-setting-team.h" diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index f188ec8250..d04dca5596 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -16,10 +16,7 @@ #include <sys/stat.h> #include <linux/pkt_sched.h> -#if WITH_JSON_VALIDATION -#include "nm-json.h" -#endif - +#include "nm-glib-aux/nm-json.h" #include "nm-glib-aux/nm-str-buf.h" #include "nm-glib-aux/nm-enum-utils.h" #include "nm-glib-aux/nm-time-utils.h" diff --git a/shared/meson.build b/shared/meson.build index 0f46a00cbb..0041c5cba3 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -134,6 +134,7 @@ sources = files( 'nm-glib-aux/nm-hash-utils.c', 'nm-glib-aux/nm-io-utils.c', 'nm-glib-aux/nm-json-aux.c', + 'nm-glib-aux/nm-json.c', 'nm-glib-aux/nm-keyfile-aux.c', 'nm-glib-aux/nm-logging-base.c', 'nm-glib-aux/nm-random-utils.c', diff --git a/libnm-core/nm-json.c b/shared/nm-glib-aux/nm-json.c index 9c66d61027..9c66d61027 100644 --- a/libnm-core/nm-json.c +++ b/shared/nm-glib-aux/nm-json.c diff --git a/libnm-core/nm-json.h b/shared/nm-glib-aux/nm-json.h index 5042cf0f80..5042cf0f80 100644 --- a/libnm-core/nm-json.h +++ b/shared/nm-glib-aux/nm-json.h |