2020-12-23 22:21:36 +01:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2020-01-14 10:42:24 +01:00
|
|
|
|
2021-02-12 15:01:09 +01:00
|
|
|
src_core_inc = include_directories('.')
|
2017-11-25 11:39:06 +01:00
|
|
|
|
build/meson: fix linking of core plugins to not include static helper libraries
We have many static helper libraries, like libnm-glib-aux or libnm-core.
These can be statically linked in any end-binary as internal API. However, they
must only be linked once.
Also, we have various plugins (device, settings, ppp, wwan) which are
dlopened by NetworkManager. They should use the symbols from
NetworkManager core. It is important that they do not link with the
static libraries already, because also NetworkManager core links with
it, so these symbols will be duplicate.
As the symbols are internal, you might think that it is not a real
problem to duplicate them. However, there are also global variables,
like the hash tables for NMRefStr or the seed for NMHash. These global
variables must be only be used once, and hence also these symbols must
no be duplicated.
Fix that by adding a new dependency that is for the core plugins. This
dependency only has "include_directories" but not "link_with".
2021-01-28 08:39:19 +01:00
|
|
|
core_plugin_dep = declare_dependency(
|
|
|
|
|
include_directories: [
|
2021-02-12 15:01:09 +01:00
|
|
|
src_core_inc,
|
build/meson: fix linking of core plugins to not include static helper libraries
We have many static helper libraries, like libnm-glib-aux or libnm-core.
These can be statically linked in any end-binary as internal API. However, they
must only be linked once.
Also, we have various plugins (device, settings, ppp, wwan) which are
dlopened by NetworkManager. They should use the symbols from
NetworkManager core. It is important that they do not link with the
static libraries already, because also NetworkManager core links with
it, so these symbols will be duplicate.
As the symbols are internal, you might think that it is not a real
problem to duplicate them. However, there are also global variables,
like the hash tables for NMRefStr or the seed for NMHash. These global
variables must be only be used once, and hence also these symbols must
no be duplicated.
Fix that by adding a new dependency that is for the core plugins. This
dependency only has "include_directories" but not "link_with".
2021-01-28 08:39:19 +01:00
|
|
|
top_inc,
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_public_inc,
|
build/meson: fix linking of core plugins to not include static helper libraries
We have many static helper libraries, like libnm-glib-aux or libnm-core.
These can be statically linked in any end-binary as internal API. However, they
must only be linked once.
Also, we have various plugins (device, settings, ppp, wwan) which are
dlopened by NetworkManager. They should use the symbols from
NetworkManager core. It is important that they do not link with the
static libraries already, because also NetworkManager core links with
it, so these symbols will be duplicate.
As the symbols are internal, you might think that it is not a real
problem to duplicate them. However, there are also global variables,
like the hash tables for NMRefStr or the seed for NMHash. These global
variables must be only be used once, and hence also these symbols must
no be duplicated.
Fix that by adding a new dependency that is for the core plugins. This
dependency only has "include_directories" but not "link_with".
2021-01-28 08:39:19 +01:00
|
|
|
],
|
|
|
|
|
dependencies: [
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_public_dep,
|
build/meson: fix linking of core plugins to not include static helper libraries
We have many static helper libraries, like libnm-glib-aux or libnm-core.
These can be statically linked in any end-binary as internal API. However, they
must only be linked once.
Also, we have various plugins (device, settings, ppp, wwan) which are
dlopened by NetworkManager. They should use the symbols from
NetworkManager core. It is important that they do not link with the
static libraries already, because also NetworkManager core links with
it, so these symbols will be duplicate.
As the symbols are internal, you might think that it is not a real
problem to duplicate them. However, there are also global variables,
like the hash tables for NMRefStr or the seed for NMHash. These global
variables must be only be used once, and hence also these symbols must
no be duplicated.
Fix that by adding a new dependency that is for the core plugins. This
dependency only has "include_directories" but not "link_with".
2021-01-28 08:39:19 +01:00
|
|
|
glib_dep,
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2021-01-28 08:46:29 +01:00
|
|
|
core_default_dep = declare_dependency(
|
2021-02-12 15:01:09 +01:00
|
|
|
include_directories: [
|
|
|
|
|
src_core_inc,
|
2021-02-18 17:37:47 +01:00
|
|
|
src_inc,
|
2021-02-12 15:01:09 +01:00
|
|
|
top_inc,
|
|
|
|
|
],
|
2020-12-25 16:35:47 +01:00
|
|
|
dependencies: [
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_public_dep,
|
2020-12-25 16:35:47 +01:00
|
|
|
],
|
2019-09-07 23:00:41 +02:00
|
|
|
)
|
|
|
|
|
|
2017-11-25 11:39:06 +01:00
|
|
|
install_data(
|
|
|
|
|
'org.freedesktop.NetworkManager.conf',
|
2018-10-18 12:50:20 +02:00
|
|
|
install_dir: dbus_conf_dir,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2018-01-07 15:39:42 +01:00
|
|
|
core_plugins = []
|
2017-11-25 11:39:06 +01:00
|
|
|
|
2021-01-27 21:15:32 +01:00
|
|
|
libNetworkManagerBase = static_library(
|
|
|
|
|
'NetworkManagerBase',
|
|
|
|
|
sources: files(
|
|
|
|
|
'dhcp/nm-dhcp-client.c',
|
|
|
|
|
'dhcp/nm-dhcp-manager.c',
|
|
|
|
|
'dhcp/nm-dhcp-nettools.c',
|
|
|
|
|
'dhcp/nm-dhcp-systemd.c',
|
|
|
|
|
'dhcp/nm-dhcp-utils.c',
|
|
|
|
|
'dhcp/nm-dhcp-options.c',
|
|
|
|
|
'ndisc/nm-lndp-ndisc.c',
|
|
|
|
|
'ndisc/nm-ndisc.c',
|
|
|
|
|
'main-utils.c',
|
|
|
|
|
'NetworkManagerUtils.c',
|
|
|
|
|
'nm-core-utils.c',
|
|
|
|
|
'nm-dbus-object.c',
|
|
|
|
|
'nm-dbus-utils.c',
|
|
|
|
|
'nm-netns.c',
|
|
|
|
|
'nm-l3-config-data.c',
|
|
|
|
|
'nm-l3-ipv4ll.c',
|
2021-08-25 11:30:35 +02:00
|
|
|
'nm-l3-ipv6ll.c',
|
2021-01-27 21:15:32 +01:00
|
|
|
'nm-l3cfg.c',
|
|
|
|
|
'nm-ip-config.c',
|
2021-03-03 09:07:17 +01:00
|
|
|
),
|
2021-01-27 21:15:32 +01:00
|
|
|
dependencies: [
|
2021-01-28 08:46:29 +01:00
|
|
|
core_default_dep,
|
2021-02-24 14:26:46 +01:00
|
|
|
libnm_core_public_dep,
|
2021-01-27 21:15:32 +01:00
|
|
|
libsystemd_dep,
|
|
|
|
|
libudev_dep,
|
|
|
|
|
],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2018-09-11 14:12:10 +02:00
|
|
|
nm_deps = [
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_public_dep,
|
2021-01-28 08:46:29 +01:00
|
|
|
core_default_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
dl_dep,
|
|
|
|
|
libndp_dep,
|
2018-01-07 15:39:42 +01:00
|
|
|
libudev_dep,
|
2018-08-26 20:14:35 +02:00
|
|
|
logind_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if enable_concheck
|
2018-09-11 14:12:10 +02:00
|
|
|
nm_deps += libcurl_dep
|
2017-11-25 11:39:06 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if enable_libaudit
|
2018-09-11 14:12:10 +02:00
|
|
|
nm_deps += libaudit_dep
|
2017-11-25 11:39:06 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if enable_libpsl
|
2018-09-11 14:12:10 +02:00
|
|
|
nm_deps += libpsl_dep
|
2017-11-25 11:39:06 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if enable_selinux
|
2018-09-11 14:12:10 +02:00
|
|
|
nm_deps += selinux_dep
|
2017-11-25 11:39:06 +01:00
|
|
|
endif
|
|
|
|
|
|
2021-01-27 21:15:32 +01:00
|
|
|
libNetworkManager = static_library(
|
|
|
|
|
'NetworkManager',
|
|
|
|
|
sources: files(
|
|
|
|
|
'devices/nm-device-6lowpan.c',
|
|
|
|
|
'devices/nm-device-bond.c',
|
|
|
|
|
'devices/nm-device-bridge.c',
|
|
|
|
|
'devices/nm-device.c',
|
2021-05-04 09:47:06 +02:00
|
|
|
'devices/nm-device-utils.c',
|
2021-01-27 21:15:32 +01:00
|
|
|
'devices/nm-device-dummy.c',
|
|
|
|
|
'devices/nm-device-ethernet.c',
|
|
|
|
|
'devices/nm-device-ethernet-utils.c',
|
|
|
|
|
'devices/nm-device-factory.c',
|
|
|
|
|
'devices/nm-device-generic.c',
|
|
|
|
|
'devices/nm-device-infiniband.c',
|
|
|
|
|
'devices/nm-device-ip-tunnel.c',
|
|
|
|
|
'devices/nm-device-macsec.c',
|
|
|
|
|
'devices/nm-device-macvlan.c',
|
|
|
|
|
'devices/nm-device-ppp.c',
|
|
|
|
|
'devices/nm-device-tun.c',
|
|
|
|
|
'devices/nm-device-veth.c',
|
|
|
|
|
'devices/nm-device-vlan.c',
|
|
|
|
|
'devices/nm-device-vrf.c',
|
|
|
|
|
'devices/nm-device-vxlan.c',
|
|
|
|
|
'devices/nm-device-wireguard.c',
|
|
|
|
|
'devices/nm-device-wpan.c',
|
|
|
|
|
'devices/nm-lldp-listener.c',
|
|
|
|
|
'dhcp/nm-dhcp-dhclient.c',
|
|
|
|
|
'dhcp/nm-dhcp-dhclient-utils.c',
|
|
|
|
|
'dhcp/nm-dhcp-dhcpcanon.c',
|
|
|
|
|
'dhcp/nm-dhcp-dhcpcd.c',
|
|
|
|
|
'dhcp/nm-dhcp-listener.c',
|
|
|
|
|
'dns/nm-dns-dnsmasq.c',
|
|
|
|
|
'dns/nm-dns-manager.c',
|
|
|
|
|
'dns/nm-dns-plugin.c',
|
|
|
|
|
'dns/nm-dns-systemd-resolved.c',
|
|
|
|
|
'dns/nm-dns-unbound.c',
|
|
|
|
|
'dnsmasq/nm-dnsmasq-manager.c',
|
|
|
|
|
'dnsmasq/nm-dnsmasq-utils.c',
|
|
|
|
|
'ppp/nm-ppp-manager-call.c',
|
2021-08-06 15:17:05 +02:00
|
|
|
'ppp/nm-ppp-mgr.c',
|
2021-01-27 21:15:32 +01:00
|
|
|
'settings/plugins/keyfile/nms-keyfile-plugin.c',
|
|
|
|
|
'settings/plugins/keyfile/nms-keyfile-reader.c',
|
2021-08-06 15:17:05 +02:00
|
|
|
'settings/plugins/keyfile/nms-keyfile-storage.c',
|
2021-01-27 21:15:32 +01:00
|
|
|
'settings/plugins/keyfile/nms-keyfile-utils.c',
|
|
|
|
|
'settings/plugins/keyfile/nms-keyfile-writer.c',
|
|
|
|
|
'settings/nm-agent-manager.c',
|
|
|
|
|
'settings/nm-secret-agent.c',
|
|
|
|
|
'settings/nm-settings.c',
|
|
|
|
|
'settings/nm-settings-connection.c',
|
|
|
|
|
'settings/nm-settings-plugin.c',
|
|
|
|
|
'settings/nm-settings-storage.c',
|
|
|
|
|
'settings/nm-settings-utils.c',
|
|
|
|
|
'supplicant/nm-supplicant-config.c',
|
|
|
|
|
'supplicant/nm-supplicant-interface.c',
|
|
|
|
|
'supplicant/nm-supplicant-manager.c',
|
|
|
|
|
'supplicant/nm-supplicant-settings-verify.c',
|
|
|
|
|
'vpn/nm-vpn-connection.c',
|
|
|
|
|
'vpn/nm-vpn-manager.c',
|
|
|
|
|
'nm-active-connection.c',
|
|
|
|
|
'nm-act-request.c',
|
|
|
|
|
'nm-audit-manager.c',
|
|
|
|
|
'nm-auth-manager.c',
|
|
|
|
|
'nm-auth-utils.c',
|
|
|
|
|
'nm-dbus-manager.c',
|
|
|
|
|
'nm-checkpoint.c',
|
|
|
|
|
'nm-checkpoint-manager.c',
|
|
|
|
|
'nm-config.c',
|
|
|
|
|
'nm-config-data.c',
|
|
|
|
|
'nm-connectivity.c',
|
|
|
|
|
'nm-dcb.c',
|
|
|
|
|
'nm-dhcp-config.c',
|
|
|
|
|
'nm-dispatcher.c',
|
2021-05-05 22:39:28 +02:00
|
|
|
'nm-firewall-utils.c',
|
2021-05-04 15:58:27 +02:00
|
|
|
'nm-firewalld-manager.c',
|
2021-01-27 21:15:32 +01:00
|
|
|
'nm-hostname-manager.c',
|
|
|
|
|
'nm-keep-alive.c',
|
|
|
|
|
'nm-manager.c',
|
|
|
|
|
'nm-pacrunner-manager.c',
|
|
|
|
|
'nm-policy.c',
|
|
|
|
|
'nm-rfkill-manager.c',
|
|
|
|
|
'nm-session-monitor.c',
|
|
|
|
|
'nm-sleep-monitor.c',
|
2021-12-13 16:06:16 +01:00
|
|
|
'nm-priv-helper-call.c',
|
2021-01-27 21:15:32 +01:00
|
|
|
),
|
2018-09-11 14:12:10 +02:00
|
|
|
dependencies: nm_deps,
|
2021-01-27 21:15:32 +01:00
|
|
|
link_with: [
|
|
|
|
|
libNetworkManagerBase,
|
|
|
|
|
libnm_systemd_core,
|
|
|
|
|
libnm_systemd_shared,
|
|
|
|
|
],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if enable_tests
|
2021-02-17 16:11:49 +01:00
|
|
|
test_c_flags = []
|
2019-09-10 12:54:46 +02:00
|
|
|
if require_root_tests
|
|
|
|
|
test_c_flags += ['-DREQUIRE_ROOT_TESTS=1']
|
|
|
|
|
endif
|
|
|
|
|
|
2021-01-27 21:15:32 +01:00
|
|
|
libNetworkManagerTest = static_library(
|
|
|
|
|
'NetworkManagerTest',
|
|
|
|
|
sources: files(
|
|
|
|
|
'ndisc/nm-fake-ndisc.c',
|
|
|
|
|
'platform/tests/test-common.c',
|
|
|
|
|
'platform/nm-fake-platform.c',
|
|
|
|
|
),
|
2021-01-28 08:46:29 +01:00
|
|
|
dependencies: core_default_dep,
|
2019-09-10 12:54:46 +02:00
|
|
|
c_args: test_c_flags,
|
2021-01-27 21:15:32 +01:00
|
|
|
link_with: libNetworkManager,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2021-01-27 21:15:32 +01:00
|
|
|
libNetworkManagerTest_dep = declare_dependency(
|
2021-01-28 08:46:29 +01:00
|
|
|
dependencies: core_default_dep,
|
2021-02-12 15:01:09 +01:00
|
|
|
link_with: [
|
|
|
|
|
libNetworkManagerTest,
|
2021-02-24 14:33:34 +01:00
|
|
|
libnm_core_aux_intern,
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_impl,
|
2021-02-24 14:33:34 +01:00
|
|
|
libnm_crypto,
|
2021-02-24 14:01:52 +01:00
|
|
|
libnm_platform,
|
|
|
|
|
libnm_base,
|
2021-02-24 13:13:01 +01:00
|
|
|
libnm_systemd_shared,
|
|
|
|
|
libnm_udev_aux,
|
2021-02-24 13:06:17 +01:00
|
|
|
libnm_log_core,
|
2021-02-24 11:52:51 +01:00
|
|
|
libnm_glib_aux,
|
|
|
|
|
libnm_std_aux,
|
build/meson: cleanup build for c-util and nettools helper libraries
We have a number of static helper libraries. When a user is using such a
library, they need to set the include search paths (-I) and link with
the static library at the right place.
The first part, the include search path, is now trivial. We no longer
add the individual search paths but everybody uses "-I. -Isrc/".
The second part means that when we build a shared library or an
executable that uses symbols from the static library, we need to link
it. But only then, and not earlier so that not multiple intermediate
build products (static libraries too) contain the same code. Note that
for libnm-device-plugin-*.so and other core plugins it's even that
those shared modules should not themselves link with the static
helpers. Instead, the need to use the symbols from NetworkManager.
Easy enough. Previously, we would sometimes define dependencies in
meson. But as it's really simple, I think that those dependencies
obfuscate more than help. Instead drop them, and only explicitly link
where we need it. The exception is libNetworkManagerTest_dep, which
is still a dependency. Maybe that dependency is fine, as it is much
later in the process. Or maybe that will also be replaced in the future.
2021-02-24 11:38:39 +01:00
|
|
|
libn_acd,
|
|
|
|
|
libn_dhcp4,
|
|
|
|
|
libc_siphash,
|
|
|
|
|
libc_rbtree,
|
2021-02-12 15:01:09 +01:00
|
|
|
],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
subdir('dnsmasq/tests')
|
|
|
|
|
subdir('ndisc/tests')
|
|
|
|
|
subdir('platform/tests')
|
|
|
|
|
subdir('supplicant/tests')
|
|
|
|
|
subdir('tests')
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
subdir('dhcp')
|
|
|
|
|
|
|
|
|
|
if enable_ppp
|
|
|
|
|
subdir('ppp')
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
subdir('devices')
|
|
|
|
|
subdir('settings/plugins')
|
2018-09-11 14:12:10 +02:00
|
|
|
|
|
|
|
|
# NetworkManager binary
|
|
|
|
|
|
2018-09-18 10:14:09 +02:00
|
|
|
# libNetworkManager.a, as built by meson doesn't contain all symbols
|
|
|
|
|
# from libNetworkManagerBase.a and other static libraries, unless we
|
|
|
|
|
# add dependencies with link_whole, only supported in meson >= 0.46.
|
|
|
|
|
# Create an executable with full symbols that we use in place of the
|
|
|
|
|
# library to enumerate the symbols.
|
2021-01-27 21:15:32 +01:00
|
|
|
NetworkManager_all_sym = executable(
|
build: fix generating "NetworkManager.ver" with LTO
We use a linker version script "NetworkManager.ver", to hide
symbols from NetworkManager that are not used. That is important
due to our habit of using internal helper libraries that we link
statically everywhere, without handpicking the symbols we actually
need. We want the tooling to get rid of unnecessary symbols.
However, NetworkManager loads shared libraries for settings and device
plugins. These libraries require symbols from the NetworkManager binary,
but which one depends on build options. Hence, we also generate
"NetworkManager.ver" by the "tools/create-exports-NetworkManager.sh"
script.
For that the script uses "nm" to find symbols that are undefined in the
plugin libraries but defined in NetworkManager. With autotools the
script looked at "./src/.libs/libNetworkManager.a" to find the present
symbols. Note that for meson that already didn't work, and we build
instead an intermediate NetworkManager binary first (with all symbols
exposed). With LTO, "nm" doesn't find all symbols in
"./src/.libs/libNetworkManager.a", and consequently they are not
exported and dropped/hidden.
This also causes unit tests to fail with LTO, because our test script
"tools/check-exports.sh" catches such bugs.
Fix that by also with autotools generate a complete "NetworkManager-all-sym"
binary that is used to generate "NetworkManager.ver", before rebuilding
"NetworkManager" again.
2020-08-12 12:30:30 +02:00
|
|
|
'NetworkManager-all-sym',
|
2018-09-18 10:14:09 +02:00
|
|
|
'main.c',
|
2021-02-24 13:13:01 +01:00
|
|
|
dependencies: [
|
|
|
|
|
nm_deps,
|
|
|
|
|
libudev_dep,
|
|
|
|
|
],
|
2021-08-31 13:31:27 +02:00
|
|
|
link_args: '-Wl,--no-gc-sections',
|
2021-01-27 21:15:32 +01:00
|
|
|
link_whole: [
|
|
|
|
|
libNetworkManager,
|
|
|
|
|
libNetworkManagerBase,
|
2021-02-24 14:33:34 +01:00
|
|
|
libnm_core_aux_intern,
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_impl,
|
2021-02-24 14:33:34 +01:00
|
|
|
libnm_crypto,
|
2021-02-24 14:01:52 +01:00
|
|
|
libnm_platform,
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_base,
|
2021-02-24 13:06:17 +01:00
|
|
|
libnm_log_core,
|
2021-02-24 13:13:01 +01:00
|
|
|
libnm_udev_aux,
|
2021-02-24 11:52:51 +01:00
|
|
|
libnm_glib_aux,
|
|
|
|
|
libnm_std_aux,
|
build/meson: cleanup build for c-util and nettools helper libraries
We have a number of static helper libraries. When a user is using such a
library, they need to set the include search paths (-I) and link with
the static library at the right place.
The first part, the include search path, is now trivial. We no longer
add the individual search paths but everybody uses "-I. -Isrc/".
The second part means that when we build a shared library or an
executable that uses symbols from the static library, we need to link
it. But only then, and not earlier so that not multiple intermediate
build products (static libraries too) contain the same code. Note that
for libnm-device-plugin-*.so and other core plugins it's even that
those shared modules should not themselves link with the static
helpers. Instead, the need to use the symbols from NetworkManager.
Easy enough. Previously, we would sometimes define dependencies in
meson. But as it's really simple, I think that those dependencies
obfuscate more than help. Instead drop them, and only explicitly link
where we need it. The exception is libNetworkManagerTest_dep, which
is still a dependency. Maybe that dependency is fine, as it is much
later in the process. Or maybe that will also be replaced in the future.
2021-02-24 11:38:39 +01:00
|
|
|
libn_acd,
|
|
|
|
|
libn_dhcp4,
|
|
|
|
|
libc_rbtree,
|
|
|
|
|
libc_siphash,
|
2021-01-27 21:15:32 +01:00
|
|
|
],
|
2018-09-18 10:14:09 +02:00
|
|
|
)
|
|
|
|
|
|
2018-09-11 14:12:10 +02:00
|
|
|
ver_script = custom_target(
|
2021-01-27 21:15:32 +01:00
|
|
|
'NetworkManager.ver',
|
|
|
|
|
output: 'NetworkManager.ver',
|
|
|
|
|
depends: [
|
|
|
|
|
NetworkManager_all_sym,
|
|
|
|
|
core_plugins,
|
|
|
|
|
],
|
|
|
|
|
command: [
|
|
|
|
|
join_paths(source_root, 'tools', 'create-exports-NetworkManager.sh'),
|
|
|
|
|
'--called-from-build',
|
|
|
|
|
source_root,
|
|
|
|
|
],
|
2018-09-11 14:12:10 +02:00
|
|
|
)
|
|
|
|
|
|
2021-01-27 21:15:32 +01:00
|
|
|
NetworkManager = executable(
|
|
|
|
|
'NetworkManager',
|
2018-09-11 14:12:10 +02:00
|
|
|
'main.c',
|
2021-02-24 13:13:01 +01:00
|
|
|
dependencies: [
|
|
|
|
|
nm_deps,
|
|
|
|
|
libudev_dep,
|
|
|
|
|
],
|
2021-02-12 15:01:09 +01:00
|
|
|
link_with: [
|
|
|
|
|
libNetworkManager,
|
|
|
|
|
libNetworkManagerBase,
|
2021-02-24 14:33:34 +01:00
|
|
|
libnm_core_aux_intern,
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_core_impl,
|
2021-02-24 14:33:34 +01:00
|
|
|
libnm_crypto,
|
2021-02-24 14:01:52 +01:00
|
|
|
libnm_platform,
|
2021-02-12 15:01:09 +01:00
|
|
|
libnm_base,
|
2021-02-24 13:13:01 +01:00
|
|
|
libnm_udev_aux,
|
2021-02-24 13:06:17 +01:00
|
|
|
libnm_log_core,
|
2021-02-24 11:52:51 +01:00
|
|
|
libnm_glib_aux,
|
|
|
|
|
libnm_std_aux,
|
build/meson: cleanup build for c-util and nettools helper libraries
We have a number of static helper libraries. When a user is using such a
library, they need to set the include search paths (-I) and link with
the static library at the right place.
The first part, the include search path, is now trivial. We no longer
add the individual search paths but everybody uses "-I. -Isrc/".
The second part means that when we build a shared library or an
executable that uses symbols from the static library, we need to link
it. But only then, and not earlier so that not multiple intermediate
build products (static libraries too) contain the same code. Note that
for libnm-device-plugin-*.so and other core plugins it's even that
those shared modules should not themselves link with the static
helpers. Instead, the need to use the symbols from NetworkManager.
Easy enough. Previously, we would sometimes define dependencies in
meson. But as it's really simple, I think that those dependencies
obfuscate more than help. Instead drop them, and only explicitly link
where we need it. The exception is libNetworkManagerTest_dep, which
is still a dependency. Maybe that dependency is fine, as it is much
later in the process. Or maybe that will also be replaced in the future.
2021-02-24 11:38:39 +01:00
|
|
|
libn_acd,
|
|
|
|
|
libn_dhcp4,
|
|
|
|
|
libc_rbtree,
|
|
|
|
|
libc_siphash,
|
2021-02-12 15:01:09 +01:00
|
|
|
],
|
2021-01-27 21:15:32 +01:00
|
|
|
link_args: [
|
|
|
|
|
'-rdynamic',
|
|
|
|
|
'-Wl,--version-script,@0@'.format(ver_script.full_path()),
|
2021-08-31 13:31:27 +02:00
|
|
|
],
|
2018-09-11 14:12:10 +02:00
|
|
|
link_depends: ver_script,
|
|
|
|
|
install: true,
|
2018-10-18 12:50:20 +02:00
|
|
|
install_dir: nm_sbindir,
|
2018-09-11 14:12:10 +02:00
|
|
|
)
|
2018-09-18 10:14:09 +02:00
|
|
|
|
|
|
|
|
if enable_tests
|
2019-09-10 12:54:46 +02:00
|
|
|
foreach plugin: core_plugins
|
|
|
|
|
plugin_path = plugin.full_path()
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'sym/' + plugin_path.split('/')[-1],
|
2021-01-27 21:15:32 +01:00
|
|
|
NetworkManager,
|
2019-09-10 12:54:46 +02:00
|
|
|
args: '--version',
|
|
|
|
|
env: ['LD_BIND_NOW=1', 'LD_PRELOAD=' + plugin_path],
|
|
|
|
|
)
|
2018-09-18 10:14:09 +02:00
|
|
|
endforeach
|
|
|
|
|
endif
|
2018-11-09 18:08:45 +01:00
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'check-config-options',
|
2019-08-28 11:54:11 +02:00
|
|
|
find_program(join_paths(source_root, 'tools', 'check-config-options.sh')),
|
|
|
|
|
args: source_root,
|
2018-11-09 18:08:45 +01:00
|
|
|
)
|