2017-11-25 11:39:06 +01:00
|
|
|
src_inc = include_directories('.')
|
|
|
|
|
|
|
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
|
|
subdir('systemd')
|
|
|
|
|
|
2018-01-07 15:39:42 +01:00
|
|
|
core_plugins = []
|
2017-11-25 11:39:06 +01:00
|
|
|
|
2018-01-07 15:39:42 +01:00
|
|
|
nm_cflags = ['-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON']
|
2017-11-25 11:39:06 +01:00
|
|
|
|
2018-01-07 15:39:42 +01:00
|
|
|
nm_dep = declare_dependency(
|
|
|
|
|
include_directories: src_inc,
|
2019-04-15 16:46:54 +02:00
|
|
|
dependencies: libnm_core_dep,
|
2018-10-18 12:50:20 +02:00
|
|
|
compile_args: nm_cflags,
|
2018-01-07 15:39:42 +01:00
|
|
|
)
|
2017-11-25 11:39:06 +01:00
|
|
|
|
build: create "config-extra.h" header instead of passing directory variables via CFLAGS
1) the command line gets shorter. I frequently run `make V=1` to see
the command line arguments for the compiler, and there is a lot
of noise.
2) define each of these variables at one place. This makes it easy
to verify that for all compilation units, a particular
define has the same value. Previously that was not obvious or
even not the case (see commit e5d1a71396e107d1909744d26ad401f206c0c915
and commit d63cf1ef2faba57595112a82e962b9643cce4718).
The point is to avoid redundancy.
3) not all compilation units need all defines. In fact, most modules
would only need a few of these defines. We aimed to pass the necessary
minium of defines to each compilation unit, but that was non-obvious
to get right and often we set a define that wasn't used. See for example
"src_settings_plugins_ibft_cppflags" which needlessly had "-DSYSCONFDIR".
This question is now entirely avoided by just defining all variables in
a header. We don't care to find the minimum, because every component
gets anyway all defines from the header.
4) this also avoids the situation, where a module that previously did
not use a particular define gets modified to require it. Previously,
that would have required to identify the missing define, and add
it to the CFLAGS of the complation unit. Since every compilation
now includes "config-extra.h", all defines are available everywhere.
5) the fact that each define is now available in all compilation units
could be perceived as a downside. But it isn't, because these defines
should have a unique name and one specific value. Defining the same
name with different values, or refer to the same value by different
names is a bug, not a desirable feature. Since these defines should
be unique accross the entire tree, there is no problem in providing
them to every compilation unit.
6) the reason why we generate "config-extra.h" this way, instead of using
AC_DEFINE() in configure.ac, is due to the particular handling of
autoconf for directory variables. See [1].
With meson, it would be trivial to put them into "config.h.meson".
While that is not easy with autoconf, the "config-extra.h" workaround
seems still preferable to me.
[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
2018-07-12 10:58:23 +02:00
|
|
|
cflags = nm_cflags
|
2017-12-18 20:33:30 +01:00
|
|
|
|
2017-11-25 11:39:06 +01:00
|
|
|
sources = files(
|
|
|
|
|
'dhcp/nm-dhcp-client.c',
|
|
|
|
|
'dhcp/nm-dhcp-manager.c',
|
dhcp: add nettools dhcp4 client
This is inspired by the existing systemd integration, with a few differences:
* This parses the WPAD option, which systemd requested, but did not use.
* We hook into the DAD handling, only making use of the configured address
once DAD has completed successfully, and declining the lease if it fails.
There are still many areas of possible improvement. In particular, we need
to ensure the parsing of all options are compliant, as n-dhcp4 treats all
options as opaque, unlike sd-dhcp4. We probably also need to look at how
to handle failures and retries (in particular if we decline a lease).
We need to query the current MTU at client startu, as well as the hardware
broadcast address. Both these are provided by the kernel over netlink, so
it should simply be a matter of hooking that up with NM's netlink layer.
Contribution under LGPL2.0+, in addition to stated licenses.
2019-05-13 20:02:48 +02:00
|
|
|
'dhcp/nm-dhcp-nettools.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'dhcp/nm-dhcp-systemd.c',
|
|
|
|
|
'dhcp/nm-dhcp-utils.c',
|
|
|
|
|
'ndisc/nm-lndp-ndisc.c',
|
|
|
|
|
'ndisc/nm-ndisc.c',
|
2018-01-14 14:43:34 +01:00
|
|
|
'platform/nm-netlink.c',
|
2018-06-09 13:56:21 +02:00
|
|
|
'platform/wifi/nm-wifi-utils-nl80211.c',
|
|
|
|
|
'platform/wifi/nm-wifi-utils.c',
|
2018-05-18 16:40:28 +02:00
|
|
|
'platform/wpan/nm-wpan-utils.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'platform/nm-linux-platform.c',
|
|
|
|
|
'platform/nm-platform.c',
|
|
|
|
|
'platform/nm-platform-utils.c',
|
|
|
|
|
'platform/nmp-netns.c',
|
|
|
|
|
'platform/nmp-object.c',
|
2019-03-11 11:37:40 +01:00
|
|
|
'platform/nmp-rules-manager.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'main-utils.c',
|
|
|
|
|
'NetworkManagerUtils.c',
|
|
|
|
|
'nm-core-utils.c',
|
core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API
Previously, we used the generated GDBusInterfaceSkeleton types and glued
them via the NMExportedObject base class to our NM types. We also used
GDBusObjectManagerServer.
Don't do that anymore. The resulting code was more complicated despite (or
because?) using generated classes. It was hard to understand, complex, had
ordering-issues, and had a runtime and memory overhead.
This patch refactors this entirely and uses the lower layer API GDBusConnection
directly. It replaces the generated code, GDBusInterfaceSkeleton, and
GDBusObjectManagerServer. All this is now done by NMDbusObject and NMDBusManager
and static descriptor instances of type GDBusInterfaceInfo.
This adds a net plus of more then 1300 lines of hand written code. I claim
that this implementation is easier to understand. Note that previously we
also required extensive and complex glue code to bind our objects to the
generated skeleton objects. Instead, now glue our objects directly to
GDBusConnection. The result is more immediate and gets rid of layers of
code in between.
Now that the D-Bus glue us more under our control, we can address issus and
bottlenecks better, instead of adding code to bend the generated skeletons
to our needs.
Note that the current implementation now only supports one D-Bus connection.
That was effectively the case already, although there were places (and still are)
where the code pretends it could also support connections from a private socket.
We dropped private socket support mainly because it was unused, untested and
buggy, but also because GDBusObjectManagerServer could not export the same
objects on multiple connections. Now, it would be rather straight forward to
fix that and re-introduce ObjectManager on each private connection. But this
commit doesn't do that yet, and the new code intentionally supports only one
D-Bus connection.
Also, the D-Bus startup was simplified. There is no retry, either nm_dbus_manager_start()
succeeds, or it detects the initrd case. In the initrd case, bus manager never tries to
connect to D-Bus. Since the initrd scenario is not yet used/tested, this is good enough
for the moment. It could be easily extended later, for example with polling whether the
system bus appears (like was done previously). Also, restart of D-Bus daemon isn't
supported either -- just like before.
Note how NMDBusManager now implements the ObjectManager D-Bus interface
directly.
Also, this fixes race issues in the server, by no longer delaying
PropertiesChanged signals. NMExportedObject would collect changed
properties and send the signal out in idle_emit_properties_changed()
on idle. This messes up the ordering of change events w.r.t. other
signals and events on the bus. Note that not only NMExportedObject
messed up the ordering. Also the generated code would hook into
notify() and process change events in and idle handle, exhibiting the
same ordering issue too.
No longer do that. PropertiesChanged signals will be sent right away
by hooking into dispatch_properties_changed(). This means, changing
a property in quick succession will no longer be combined and is
guaranteed to emit signals for each individual state. Quite possibly
we emit now more PropertiesChanged signals then before.
However, we are now able to group a set of changes by using standard
g_object_freeze_notify()/g_object_thaw_notify(). We probably should
make more use of that.
Also, now that our signals are all handled in the right order, we
might find places where we still emit them in the wrong order. But that
is then due to the order in which our GObjects emit signals, not due
to an ill behavior of the D-Bus glue. Possibly we need to identify
such ordering issues and fix them.
Numbers (for contrib/rpm --without debug on x86_64):
- the patch changes the code size of NetworkManager by
- 2809360 bytes
+ 2537528 bytes (-9.7%)
- Runtime measurements are harder because there is a large variance
during testing. In other words, the numbers are not reproducible.
Currently, the implementation performs no caching of GVariants at all,
but it would be rather simple to add it, if that turns out to be
useful.
Anyway, without strong claim, it seems that the new form tends to
perform slightly better. That would be no surprise.
$ time (for i in {1..1000}; do nmcli >/dev/null || break; echo -n .; done)
- real 1m39.355s
+ real 1m37.432s
$ time (for i in {1..2000}; do busctl call org.freedesktop.NetworkManager /org/freedesktop org.freedesktop.DBus.ObjectManager GetManagedObjects > /dev/null || break; echo -n .; done)
- real 0m26.843s
+ real 0m25.281s
- Regarding RSS size, just looking at the processes in similar
conditions, doesn't give a large difference. On my system they
consume about 19MB RSS. It seems that the new version has a
slightly smaller RSS size.
- 19356 RSS
+ 18660 RSS
2018-02-26 13:51:52 +01:00
|
|
|
'nm-dbus-object.c',
|
|
|
|
|
'nm-dbus-utils.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'nm-ip4-config.c',
|
|
|
|
|
'nm-ip6-config.c',
|
2018-10-18 12:50:20 +02:00
|
|
|
'nm-logging.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
libsystemd_dep,
|
2018-01-07 15:39:42 +01:00
|
|
|
libudev_dep,
|
2019-04-15 16:46:54 +02:00
|
|
|
libnm_core_dep,
|
dhcp: add nettools dhcp4 client
This is inspired by the existing systemd integration, with a few differences:
* This parses the WPAD option, which systemd requested, but did not use.
* We hook into the DAD handling, only making use of the configured address
once DAD has completed successfully, and declining the lease if it fails.
There are still many areas of possible improvement. In particular, we need
to ensure the parsing of all options are compliant, as n-dhcp4 treats all
options as opaque, unlike sd-dhcp4. We probably also need to look at how
to handle failures and retries (in particular if we decline a lease).
We need to query the current MTU at client startu, as well as the hardware
broadcast address. Both these are provided by the kernel over netlink, so
it should simply be a matter of hooking that up with NM's netlink layer.
Contribution under LGPL2.0+, in addition to stated licenses.
2019-05-13 20:02:48 +02:00
|
|
|
shared_n_dhcp4_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if enable_wext
|
2018-06-09 13:56:21 +02:00
|
|
|
sources += files('platform/wifi/nm-wifi-utils-wext.c')
|
2017-11-25 11:39:06 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
libnetwork_manager_base = static_library(
|
2018-01-09 08:05:15 +01:00
|
|
|
nm_name + 'Base',
|
2017-11-25 11:39:06 +01:00
|
|
|
sources: sources,
|
|
|
|
|
dependencies: deps,
|
2018-01-07 15:39:42 +01:00
|
|
|
c_args: cflags,
|
2018-10-18 12:50:20 +02:00
|
|
|
link_with: libnm_core,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
sources = files(
|
2018-04-05 15:19:27 +02:00
|
|
|
'devices/nm-acd-manager.c',
|
2018-05-22 16:25:54 +02:00
|
|
|
'devices/nm-device-6lowpan.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'devices/nm-device-bond.c',
|
|
|
|
|
'devices/nm-device-bridge.c',
|
|
|
|
|
'devices/nm-device.c',
|
|
|
|
|
'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-vxlan.c',
|
2018-03-13 13:42:38 +00:00
|
|
|
'devices/nm-device-wireguard.c',
|
2018-03-09 16:26:25 +01:00
|
|
|
'devices/nm-device-wpan.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'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',
|
|
|
|
|
'settings/plugins/keyfile/nms-keyfile-connection.c',
|
|
|
|
|
'settings/plugins/keyfile/nms-keyfile-plugin.c',
|
|
|
|
|
'settings/plugins/keyfile/nms-keyfile-reader.c',
|
|
|
|
|
'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',
|
|
|
|
|
'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-subject.c',
|
|
|
|
|
'nm-auth-utils.c',
|
2018-03-02 05:55:21 +01:00
|
|
|
'nm-dbus-manager.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'nm-checkpoint.c',
|
|
|
|
|
'nm-checkpoint-manager.c',
|
|
|
|
|
'nm-config.c',
|
|
|
|
|
'nm-config-data.c',
|
2018-02-19 19:50:18 +01:00
|
|
|
'nm-connectivity.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'nm-dcb.c',
|
|
|
|
|
'nm-dhcp4-config.c',
|
|
|
|
|
'nm-dhcp6-config.c',
|
|
|
|
|
'nm-dispatcher.c',
|
|
|
|
|
'nm-firewall-manager.c',
|
|
|
|
|
'nm-hostname-manager.c',
|
2018-10-10 17:10:01 +02:00
|
|
|
'nm-keep-alive.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
'nm-manager.c',
|
|
|
|
|
'nm-netns.c',
|
|
|
|
|
'nm-pacrunner-manager.c',
|
|
|
|
|
'nm-policy.c',
|
|
|
|
|
'nm-proxy-config.c',
|
|
|
|
|
'nm-rfkill-manager.c',
|
|
|
|
|
'nm-session-monitor.c',
|
2018-10-18 12:50:20 +02:00
|
|
|
'nm-sleep-monitor.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2018-09-11 14:12:10 +02:00
|
|
|
nm_deps = [
|
2017-11-25 11:39:06 +01:00
|
|
|
dl_dep,
|
|
|
|
|
libndp_dep,
|
2018-01-07 15:39:42 +01:00
|
|
|
libudev_dep,
|
2019-04-15 16:46:54 +02:00
|
|
|
libnm_core_dep,
|
2018-08-26 20:14:35 +02:00
|
|
|
shared_n_acd_dep,
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
libnetwork_manager = static_library(
|
2018-01-09 08:05:15 +01:00
|
|
|
nm_name,
|
2017-11-25 11:39:06 +01:00
|
|
|
sources: sources,
|
2018-09-11 14:12:10 +02:00
|
|
|
dependencies: nm_deps,
|
2018-01-07 15:39:42 +01:00
|
|
|
c_args: cflags,
|
2018-12-28 18:11:16 +01:00
|
|
|
link_with: [
|
|
|
|
|
libnetwork_manager_base,
|
|
|
|
|
libnm_systemd_core,
|
|
|
|
|
libnm_systemd_shared,
|
|
|
|
|
],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
dl_dep,
|
|
|
|
|
libndp_dep,
|
2018-01-07 15:39:42 +01:00
|
|
|
libudev_dep,
|
2019-04-15 16:46:54 +02:00
|
|
|
libnm_core_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
name = 'nm-iface-helper'
|
|
|
|
|
|
|
|
|
|
executable(
|
|
|
|
|
name,
|
|
|
|
|
name + '.c',
|
|
|
|
|
dependencies: deps,
|
2018-01-07 15:39:42 +01:00
|
|
|
c_args: cflags,
|
2018-12-28 18:11:16 +01:00
|
|
|
link_with: [
|
|
|
|
|
libnetwork_manager_base,
|
|
|
|
|
libnm_systemd_core,
|
|
|
|
|
libnm_systemd_shared,
|
|
|
|
|
],
|
2018-01-11 12:34:40 +01:00
|
|
|
link_args: ldflags_linker_script_binary,
|
2017-11-25 11:39:06 +01:00
|
|
|
link_depends: linker_script_binary,
|
|
|
|
|
install: true,
|
2018-10-18 12:50:20 +02:00
|
|
|
install_dir: nm_libexecdir,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if enable_tests
|
|
|
|
|
sources = files(
|
|
|
|
|
'ndisc/nm-fake-ndisc.c',
|
|
|
|
|
'platform/tests/test-common.c',
|
2018-10-18 12:50:20 +02:00
|
|
|
'platform/nm-fake-platform.c',
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
deps = [
|
2018-01-07 15:39:42 +01:00
|
|
|
libudev_dep,
|
2019-04-15 16:46:54 +02:00
|
|
|
libnm_core_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
2018-01-07 15:39:42 +01:00
|
|
|
test_cflags = ['-DNETWORKMANAGER_COMPILATION_TEST']
|
2017-11-25 11:39:06 +01:00
|
|
|
if require_root_tests
|
|
|
|
|
test_cflags += ['-DREQUIRE_ROOT_TESTS=1']
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
libnetwork_manager_test = static_library(
|
2018-01-09 08:05:15 +01:00
|
|
|
nm_name + 'Test',
|
2017-11-25 11:39:06 +01:00
|
|
|
sources: sources,
|
|
|
|
|
dependencies: deps,
|
2018-01-07 15:39:42 +01:00
|
|
|
c_args: cflags + test_cflags,
|
2018-10-18 12:50:20 +02:00
|
|
|
link_with: libnetwork_manager,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2018-01-07 15:39:42 +01:00
|
|
|
test_nm_dep = declare_dependency(
|
|
|
|
|
dependencies: nm_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
compile_args: test_cflags,
|
2018-10-18 12:50:20 +02:00
|
|
|
link_with: libnetwork_manager_test,
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
2018-10-19 18:48:43 +02:00
|
|
|
test_nm_dep_fake = declare_dependency(
|
|
|
|
|
dependencies: test_nm_dep,
|
|
|
|
|
compile_args: ['-DSETUP=nm_fake_platform_setup']
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
test_nm_dep_linux = declare_dependency(
|
|
|
|
|
dependencies: test_nm_dep,
|
|
|
|
|
compile_args: ['-DSETUP=nm_linux_platform_setup']
|
|
|
|
|
)
|
|
|
|
|
|
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')
|
2018-09-19 13:34:55 +02:00
|
|
|
subdir('initrd')
|
2017-11-25 11:39:06 +01:00
|
|
|
subdir('settings/plugins')
|
2018-09-11 14:12:10 +02:00
|
|
|
|
|
|
|
|
# NetworkManager binary
|
|
|
|
|
|
|
|
|
|
create_exports_networkmanager = join_paths(meson.source_root(), 'tools', 'create-exports-NetworkManager.sh')
|
|
|
|
|
symbol_map_name = 'NetworkManager.ver'
|
|
|
|
|
|
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.
|
|
|
|
|
network_manager_sym = executable(
|
|
|
|
|
'nm-full-symbols',
|
|
|
|
|
'main.c',
|
|
|
|
|
c_args: nm_cflags,
|
|
|
|
|
link_args: '-Wl,--no-gc-sections',
|
|
|
|
|
dependencies: nm_deps,
|
|
|
|
|
link_whole: [libnetwork_manager, libnetwork_manager_base, libnm_core],
|
|
|
|
|
install: false,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# this uses symbols from nm-full-symbols instead of libNetworkManager.a
|
2018-09-11 14:12:10 +02:00
|
|
|
ver_script = custom_target(
|
|
|
|
|
symbol_map_name,
|
|
|
|
|
input: meson.source_root(),
|
|
|
|
|
output: symbol_map_name,
|
2018-09-18 10:14:09 +02:00
|
|
|
depends: [ network_manager_sym, core_plugins ],
|
2018-10-18 12:50:20 +02:00
|
|
|
command: [create_exports_networkmanager, '--called-from-build', '@INPUT@'],
|
2018-09-11 14:12:10 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ldflags = ['-rdynamic', '-Wl,--version-script,@0@'.format(ver_script.full_path())]
|
|
|
|
|
|
|
|
|
|
network_manager = executable(
|
|
|
|
|
nm_name,
|
|
|
|
|
'main.c',
|
|
|
|
|
dependencies: nm_deps,
|
|
|
|
|
c_args: nm_cflags,
|
|
|
|
|
link_with: libnetwork_manager,
|
|
|
|
|
link_args: ldflags,
|
|
|
|
|
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
|
|
|
|
|
foreach plugin : core_plugins
|
|
|
|
|
test ('sym/' + plugin.full_path().split('/')[-1],
|
|
|
|
|
network_manager,
|
|
|
|
|
args: '--version',
|
|
|
|
|
env: ['LD_BIND_NOW=1', 'LD_PRELOAD=' + plugin.full_path()])
|
|
|
|
|
endforeach
|
|
|
|
|
endif
|
2018-11-09 18:08:45 +01:00
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'check-config-options',
|
|
|
|
|
find_program(join_paths(meson.source_root(), 'tools', 'check-config-options.sh')),
|
|
|
|
|
args: [meson.source_root()]
|
|
|
|
|
)
|