build: add initial support for meson build system

meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

[thaller@redhat.com: rebased patch and adjusted for iwd support]

https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00022.html
This commit is contained in:
Iñigo Martínez 2017-11-25 11:39:06 +01:00 committed by Thomas Haller
parent e96fabfc18
commit 03637ad8b5
65 changed files with 5208 additions and 0 deletions

11
check-distro.py Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import errno
import os
import sys
for location in sys.argv[1:]:
if os.path.isfile(location):
sys.exit(0)
sys.exit(errno.ENOENT)

59
clients/cli/meson.build Normal file
View file

@ -0,0 +1,59 @@
# FIXME: nmcli-completion should be renamed to nmcli
install_data(
'nmcli-completion',
install_dir: join_paths(nm_datadir, 'bash-completion', 'completions')
)
sources = files(
'agent.c',
'common.c',
'connections.c',
'devices.c',
'general.c',
'nmcli.c',
'polkit-agent.c',
'settings.c',
'utils.c'
)
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
glib_dep,
libnm_dep,
libnmc_dep,
libnmc_base_dep,
readline_dep
]
cflags = [
'-DG_LOG_DOMAIN="nmcli"',
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir)
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
if enable_polkit_agent
sources += nm_polkit_listener
deps += polkit_agent_dep
endif
executable(
'nmcli',
sources + [libnm_core_enums_h],
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_args: ldflags,
link_depends: linker_script_binary,
install: true,
install_dir: nm_bindir
)

View file

@ -0,0 +1,92 @@
common_inc = include_directories('.')
nm_polkit_listener = files('nm-polkit-listener.c')
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
glib_dep,
libnm_dep
]
cflags = [
'-DG_LOG_DOMAIN="libnmc"',
'-DNMLOCALEDIR="@0@"'.format(nm_localedir)
]
sources = shared_utils + files(
'nm-client-utils.c',
'nm-secret-agent-simple.c',
'nm-vpn-helpers.c'
)
libnmc_base = static_library(
'nmc-base',
sources: sources + [libnm_core_enums_h],
include_directories: incs,
dependencies: deps,
c_args: common_cflags
)
libnmc_base_dep = declare_dependency(
link_with: libnmc_base,
include_directories: common_inc
)
sources = shared_meta_setting + files(
'nm-meta-setting-access.c',
'nm-meta-setting-desc.c'
)
settings_docs = 'settings-docs.c'
# FIXME: there is a problem with the generated file
#if enable_introspection
if false
settings_docs_source = custom_target(
settings_docs,
input: nm_property_docs,
output: settings_docs,
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), '@INPUT@']
)
# FIXME: if enabled the check happens even if the settings_docs_source is not set
'''
if get_option('check_settings_docs')
res = run_command(find_program('cmp'), '-s', settings_docs + '.in', settings_docs_source.full_path())
if res.returncode() != 0
message('The generated file ' + settings_docs_source.full_path() + ' differs from the source file ' + settings_docs + '.in' + '. You probably should copy the generated file over to the source file. You can skip this test by setting -Dcheck_settings_docs=false')
endif
endif
'''
else
settings_docs_source = configure_file(
input: settings_docs + '.in',
output: settings_docs,
configuration: configuration_data()
)
endif
sources += settings_docs_source
libnmc = static_library(
'nmc',
sources: sources + [libnm_core_enums_h],
include_directories: incs,
dependencies: deps,
c_args: common_cflags,
link_with: libnmc_base,
link_depends: settings_docs_source
)
libnmc_dep = declare_dependency(
link_with: libnmc,
include_directories: common_inc
)
if (enable_introspection or enable_nmtui) and enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,18 @@
test_unit = 'test-general'
name = 'client-' + test_unit
deps += [
libnmc_dep,
libnmc_base_dep
]
exe = executable(
name,
test_unit + '.c',
include_directories: incs,
dependencies: deps,
c_args: cflags
)
test(name, exe)

44
clients/meson.build Normal file
View file

@ -0,0 +1,44 @@
name = 'nm-online'
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
glib_dep,
libnm_dep
]
cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(name),
'-DNMLOCALEDIR="@0@"'.format(nm_localedir)
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
executable(
name,
[name + '.c', libnm_core_enums_h],
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_args: ldflags,
link_depends: linker_script_binary,
install: true,
install_dir: nm_bindir
)
subdir('common')
if enable_nmcli
subdir('cli')
endif
if enable_nmtui
subdir('tui')
endif

82
clients/tui/meson.build Normal file
View file

@ -0,0 +1,82 @@
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
glib_dep,
newt_dep
]
cflags = ['-DG_LOG_DOMAIN="nmtui"']
subdir('newt')
sources = files(
'nm-editor-bindings.c',
'nm-editor-utils.c',
'nmt-address-list.c',
'nmt-connect-connection-list.c',
'nmt-device-entry.c',
'nmt-edit-connection-list.c',
'nmt-editor.c',
'nmt-editor-grid.c',
'nmt-editor-page.c',
'nmt-editor-page-device.c',
'nmt-editor-section.c',
'nmt-ip-entry.c',
'nmt-mac-entry.c',
'nmt-mtu-entry.c',
'nmt-page-bond.c',
'nmt-page-bridge.c',
'nmt-page-bridge-port.c',
'nmt-page-dsl.c',
'nmt-page-ethernet.c',
'nmt-page-infiniband.c',
'nmt-page-ip4.c',
'nmt-page-ip6.c',
'nmt-page-ip-tunnel.c',
'nmt-page-ppp.c',
'nmt-page-team.c',
'nmt-page-team-port.c',
'nmt-page-vlan.c',
'nmt-page-wifi.c',
'nmt-password-dialog.c',
'nmt-password-fields.c',
'nmt-route-editor.c',
'nmt-route-entry.c',
'nmt-route-table.c',
'nmt-slave-list.c',
'nmtui.c',
'nmtui-connect.c',
'nmtui-edit.c',
'nmtui-hostname.c',
'nmt-utils.c',
'nmt-widget-list.c'
)
deps += [
libnm_dep,
libnmc_base_dep,
libnmt_newt_dep
]
cflags += '-DLOCALEDIR="@0@"'.format(nm_localedir)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
executable(
'nmtui',
sources + [libnm_core_enums_h],
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_args: ldflags,
link_depends: linker_script_binary,
install: true,
install_dir: nm_bindir
)

View file

@ -0,0 +1,35 @@
sources = files(
'nmt-newt-button-box.c',
'nmt-newt-button.c',
'nmt-newt-checkbox.c',
'nmt-newt-component.c',
'nmt-newt-container.c',
'nmt-newt-entry.c',
'nmt-newt-entry-numeric.c',
'nmt-newt-form.c',
'nmt-newt-grid.c',
'nmt-newt-hacks.c',
'nmt-newt-label.c',
'nmt-newt-listbox.c',
'nmt-newt-popup.c',
'nmt-newt-section.c',
'nmt-newt-separator.c',
'nmt-newt-stack.c',
'nmt-newt-textbox.c',
'nmt-newt-toggle-button.c',
'nmt-newt-utils.c',
'nmt-newt-widget.c'
)
libnmt_newt = static_library(
'nmt-newt',
sources: sources + [libnm_core_enums_h],
include_directories: incs,
dependencies: deps,
c_args: cflags
)
libnmt_newt_dep = declare_dependency(
link_with: libnmt_newt,
include_directories: include_directories('.')
)

260
config.h.meson Normal file
View file

@ -0,0 +1,260 @@
/* Define if building universal (internal helper macro) */
#mesondefine AC_APPLE_UNIVERSAL_BUILD
/* Path to ConsoleKit database */
#mesondefine CKDB_PATH
/* Define to path of dhclient binary */
#mesondefine DHCLIENT_PATH
/* Define to path of dhcpcanon binary */
#mesondefine DHCPCANON_PATH
/* Define to path of dhcpcd binary */
#mesondefine DHCPCD_PATH
/* Define if dhcpcd supports IPv6 (6.x+) */
#mesondefine DHCPCD_SUPPORTS_IPV6
/* Define to path of dnsmasq binary */
#mesondefine DNSMASQ_PATH
/* Define to path of unbound dnssec-trigger-script */
#mesondefine DNSSEC_TRIGGER_SCRIPT
/* Gettext package */
#mesondefine GETTEXT_PACKAGE
/* Define to 1 if you have the declaration of `explicit_bzero', and to 0 if
you don't. */
#mesondefine HAVE_DECL_EXPLICIT_BZERO
/* has getrandom */
#mesondefine HAVE_GETRANDOM
/* Define if you have libaudit support */
#mesondefine HAVE_LIBAUDIT
/* Define to 1 if libsystemd is available */
#mesondefine HAVE_LIBSYSTEMD
/* Define if nl80211 has critical protocol support */
#mesondefine HAVE_NL80211_CRITICAL_PROTOCOL_CMDS
/* Define to 1 if you have the `secure_getenv' function. */
#mesondefine HAVE_SECURE_GETENV
/* Define if you have SELinux support */
#mesondefine HAVE_SELINUX
/* Define to 1 if you have the <sys/auxv.h> header file. */
#mesondefine HAVE_SYS_AUXV_H
/* Define if systemd support is available */
#mesondefine HAVE_SYSTEMD
/* Define if you have VLAN_FLAG_LOOSE_BINDING */
#mesondefine HAVE_VLAN_FLAG_LOOSE_BINDING
/* Define if you have Linux Wireless Extensions support */
#mesondefine HAVE_WEXT
/* Define to 1 if you have the `__secure_getenv' function. */
#mesondefine HAVE___SECURE_GETENV
/* Enable Gentoo hostname persist method */
#mesondefine HOSTNAME_PERSIST_GENTOO
/* Enable Slackware hostname persist method */
#mesondefine HOSTNAME_PERSIST_SLACKWARE
/* Enable SuSE hostname persist method */
#mesondefine HOSTNAME_PERSIST_SUSE
/* Define to path of iptables binary */
#mesondefine IPTABLES_PATH
/* Define to path of the kernel firmware directory */
#mesondefine KERNEL_FIRMWARE_DIR
/* Path to netconfig */
#mesondefine NETCONFIG_PATH
/* The default value of the logging.audit configuration option */
#mesondefine NM_CONFIG_DEFAULT_LOGGING_AUDIT
/* Default configuration option for logging.backend */
#mesondefine NM_CONFIG_DEFAULT_LOGGING_BACKEND
/* The default value of the auth-polkit configuration option */
#mesondefine NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT
/* Default configuration option for main.dhcp setting */
#mesondefine NM_CONFIG_DEFAULT_MAIN_DHCP
/* Default configuration option for main.plugins setting */
#mesondefine NM_CONFIG_DEFAULT_MAIN_PLUGINS
/* Default value for main.rc-manager setting */
#mesondefine NM_CONFIG_DEFAULT_MAIN_RC_MANAGER
/* Define the distribution version string */
#mesondefine NM_DIST_VERSION
/* Define if more asserts are enabled */
#mesondefine NM_MORE_ASSERTS
/* Define if more debug logging is enabled */
#mesondefine NM_MORE_LOGGING
/* Define to the full name and version of this package. */
#mesondefine PACKAGE_STRING
/* Path to resolvconf */
#mesondefine RESOLVCONF_PATH
/* Define to 1 if ConsoleKit is available */
#mesondefine SESSION_TRACKING_CONSOLEKIT
/* Define to 1 if libelogin is available */
#mesondefine SESSION_TRACKING_ELOGIND
/* Define to 1 if libsystemd-login is available */
#mesondefine SESSION_TRACKING_SYSTEMD
/* The size of `dev_t', as computed by sizeof. */
#mesondefine SIZEOF_DEV_T
/* The size of `time_t', as computed by sizeof. */
#mesondefine SIZEOF_TIME_T
/* Define to 1 to use ConsoleKit2 suspend api */
#mesondefine SUSPEND_RESUME_CONSOLEKIT
/* Define to 1 to use elogind suspend api */
#mesondefine SUSPEND_RESUME_ELOGIND
/* Define to 1 to use systemd suspend api */
#mesondefine SUSPEND_RESUME_SYSTEMD
/* Define to 1 to use UPower suspend api */
#mesondefine SUSPEND_RESUME_UPOWER
/* Define to 1 if libsystemd-journald is available */
#mesondefine SYSTEMD_JOURNAL
/* Define to path to system CA certificates */
#mesondefine SYSTEM_CA_PATH
/* Define python path for test binary */
#mesondefine TEST_NM_PYTHON
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* sys/random.h is usable */
#mesondefine USE_SYS_RANDOM_H
/* Version number of package */
#mesondefine VERSION
/* Define if you have Bluez 5 libraries */
#mesondefine WITH_BLUEZ5_DUN
/* Define if you want connectivity checking support */
#mesondefine WITH_CONCHECK
/* Define if you have dhclient */
#mesondefine WITH_DHCLIENT
/* Define if you have dhcpcanon */
#mesondefine WITH_DHCPCANON
/* Define if you have dhcpcd */
#mesondefine WITH_DHCPCD
/* Define for libnm to prevent GIR from loading libnm-glib */
#mesondefine WITH_FAKE_TYPELIBS
/* Define if JANSSON is enabled */
#mesondefine WITH_JANSSON
/* Define if JSON validation in libnm is enabled */
#mesondefine WITH_JSON_VALIDATION
/* Define if you have libpsl */
#mesondefine WITH_LIBPSL
/* Define if you have oFono support (experimental) */
#mesondefine WITH_OFONO
/* whether to compile polkit support */
#mesondefine WITH_POLKIT
/* Define if you have polkit agent */
#mesondefine WITH_POLKIT_AGENT
/* Define if you have PPP support */
#mesondefine WITH_PPP
/* Whether compilation of ibft setting plugin is enabled */
#mesondefine WITH_SETTINGS_PLUGIN_IBFT
/* Define if you have Wi-Fi support */
#mesondefine WITH_WIFI
/* Define if you have iwd support */
#mesondefine WITH_IWD
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if on MINIX. */
#mesondefine _MINIX
/* Define whether the compiler support gcc __auto_type */
#mesondefine _NM_CC_SUPPORT_AUTO_TYPE
/* Define whether the compiler supports C11 _Generic() */
#mesondefine _NM_CC_SUPPORT_GENERIC
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#mesondefine _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#mesondefine _POSIX_SOURCE
/* Define to `int' if <sys/types.h> does not define. */
#mesondefine pid_t

79
data/meson.build Normal file
View file

@ -0,0 +1,79 @@
data_conf = configuration_data()
data_conf.set('bindir', nm_bindir)
data_conf.set('libexecdir', nm_libexecdir)
data_conf.set('sbindir', nm_sbindir)
data_conf.set('sysconfdir', nm_sysconfdir)
data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : ''))
data_conf.set('NM_MODIFY_SYSTEM_POLICY', (enable_modify_system ? 'yes' : 'auth_admin_keep'))
server = 'server.conf'
configure_file(
input: server + '.in',
output: server,
install: true,
install_dir: join_paths(nm_datadir, 'doc', nm_name, 'examples'),
configuration: data_conf
)
if install_systemd_unit_dir
services = [
['NetworkManager-dispatcher.service', systemd_system_unit_dir],
['NetworkManager.service', systemd_system_unit_dir],
['org.freedesktop.NetworkManager.service', dbus_sys_dir]
]
if have_systemd_200
services += [['NetworkManager-wait-online.service', systemd_system_unit_dir]]
else
services += [['NetworkManager-wait-online-systemd-pre200.service', systemd_system_unit_dir]]
endif
foreach service: services
configure_file(
input: service[0] + '.in',
output: service[0],
install: true,
install_dir: service[1],
configuration: data_conf
)
endforeach
if enable_ovs
install_data(
'NetworkManager-ovs.conf',
install_dir: join_paths(systemd_system_unit_dir, 'NetworkManager.service.d')
)
endif
endif
if install_udev_dir
data = files(
'84-nm-drivers.rules',
'85-nm-unmanaged.rules'
)
install_data(
data,
install_dir: join_paths(udev_dir, 'rules.d')
)
endif
if enable_polkit
policy = 'org.freedesktop.NetworkManager.policy'
policy_in = configure_file(
input: policy + '.in.in',
output: policy + '.in',
configuration: data_conf
)
custom_target(
policy,
input: policy_in,
output: policy,
command: intltool_xml_cmd,
install: true,
install_dir: polkit_dir
)
endif

82
dispatcher/meson.build Normal file
View file

@ -0,0 +1,82 @@
dispatcher_inc = include_directories('.')
name = 'nm-dispatcher'
service_conf = configuration_data()
service_conf.set('sbindir', nm_sbindir)
service_conf.set('sysconfdir', nm_sysconfdir)
service_conf.set('localstatedir', nm_localstatedir)
service_conf.set('libexecdir', nm_libexecdir)
service = 'org.freedesktop.nm_dispatcher.service'
configure_file(
input: service + '.in',
output: service,
install: true,
install_dir: dbus_sys_dir,
configuration: service_conf
)
install_data(
'nm-dispatcher.conf',
install_dir: dbus_conf_dir
)
sources = files('nm-dispatcher-utils.c')
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
glib_dep,
libnm_dep
]
cflags = [
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir),
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir)
]
libnm_dispatcher_core = static_library(
name + '-core',
sources: sources,
include_directories: incs,
dependencies: deps,
c_args: cflags
)
sources = files('nm-dispatcher.c')
sources += gnome.gdbus_codegen(
'nmdbus-dispatcher',
name + '.xml',
interface_prefix: 'org.freedesktop',
namespace: 'NMDBus'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
executable(
name,
sources,
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_with: libnm_dispatcher_core,
link_args: ldflags,
link_depends: linker_script_binary,
install: true,
install_dir: nm_libexecdir
)
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,21 @@
test_unit = 'test-dispatcher-envp'
incs = [
top_inc,
shared_inc,
libnm_core_inc,
dispatcher_inc
]
cflags = '-DSRCDIR="@0@"'.format(meson.current_source_dir())
exe = executable(
test_unit,
[test_unit + '.c', libnm_core_enums_h],
include_directories: incs,
dependencies: glib_dep,
c_args: cflags,
link_with: libnm_dispatcher_core
)
test(test_unit, exe)

32
docs/api/meson.build Normal file
View file

@ -0,0 +1,32 @@
doc_module = 'NetworkManager'
settings = 'settings-spec'
output = settings + '.xml'
settings_xml = custom_target(
output,
input: nm_settings_docs,
output: output,
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), settings + '.xsl'), '@INPUT@'],
# FIXME: used to built properly api documentation
build_by_default: true
)
configure_file(
input: version_xml + '.in',
output: version_xml,
configuration: version_conf
)
content_files += join_paths(meson.source_root(), 'COPYING')
doc_path = join_paths(nm_datadir, 'gtk-doc', 'html', doc_module)
gnome.gtkdoc(
doc_module,
main_xml: 'network-manager-docs.xml',
src_dir: meson.current_source_dir(),
content_files: content_files,
install: true,
install_dir: doc_path
)

View file

@ -0,0 +1,42 @@
doc_module = 'libnm-glib'
private_headers = [
'common.h',
'nm-dbus-helpers-private.h',
'nm-device-private.h',
'nm-object-cache.h',
'nm-object-private.h',
'nm-remote-connection-private.h',
'nm-types-private.h',
'nm-secret-agent-glue.h',
'nm-vpn-plugin-glue.h'
]
configure_file(
input: version_xml + '.in',
output: version_xml,
configuration: version_conf
)
doc_path = join_paths(nm_datadir, 'gtk-doc', 'html', doc_module)
gnome.gtkdoc(
doc_module,
main_xml: doc_module + '-docs.xml',
src_dir: join_paths(meson.source_root(), 'libnm-glib'),
dependencies: [
libnm_glib_dep,
libnm_glib_vpn_dep
],
scan_args: [
'--rebuild-types',
'--rebuild-sections',
'--ignore-headers=' + ' '.join(private_headers),
],
scanobjs_args: '--type-init-func="g_type_init();"',
fixxref_args: '--html-dir=' + doc_path,
gobject_typesfile: doc_module + '.types',
html_assets: doc_module + '.png',
install: true,
install_dir: doc_path
)

View file

@ -0,0 +1,36 @@
doc_module = 'libnm-util'
private_headers = [
'crypto.h',
'nm-setting-template.h',
'nm-utils-private.h',
'nm-setting-private.h',
'nm-param-spec-specialized.h',
'nm-test-utils.h',
'nm-version.h'
]
configure_file(
input: version_xml + '.in',
output: version_xml,
configuration: version_conf
)
doc_path = join_paths(nm_datadir, 'gtk-doc', 'html', doc_module)
gnome.gtkdoc(
doc_module,
main_xml: doc_module + '-docs.sgml',
src_dir: libnm_util_inc,
dependencies: libnm_util_dep,
scan_args: [
'--rebuild-types',
'--rebuild-sections',
'--ignore-headers=' + ' '.join(private_headers)
],
scanobjs_args: '--type-init-func="g_type_init();"',
fixxref_args: '--html-dir=' + doc_path,
gobject_typesfile: doc_module + '.types',
install: true,
install_dir: doc_path
)

55
docs/libnm/meson.build Normal file
View file

@ -0,0 +1,55 @@
doc_module = 'libnm'
private_headers = [
'common.h',
'crypto.h',
'nm-dbus-helpers.h',
'nm-core-internal.h',
'nm-core-types-internal.h',
'nm-device-private.h',
'nm-dhcp4-config.h',
'nm-dhcp6-config.h',
'nm-dns-manager.h',
'nm-ip4-config.h',
'nm-ip6-config.h',
'nm-manager.h',
'nm-object-private.h',
'nm-property-compare.h',
'nm-remote-connection-private.h',
'nm-remote-settings.h',
'nm-setting-private.h',
'nm-utils-private.h',
'nm-core-tests-enum-types.h',
'nm-keyfile-internal.h',
'nm-keyfile-utils.h',
'test-general-enums.h'
]
configure_file(
input: version_xml + '.in',
output: version_xml,
configuration: version_conf
)
doc_path = join_paths(nm_datadir, 'gtk-doc', 'html', doc_module)
gnome.gtkdoc(
doc_module,
main_xml: doc_module + '-docs.xml',
src_dir: [
libnm_core_inc,
libnm_inc
],
dependencies: libnm_dep,
scan_args: [
'--rebuild-types',
'--rebuild-sections',
'--ignore-headers=' + ' '.join(private_headers)
],
scanobjs_args: '--type-init-func="g_type_init();"',
fixxref_args: '--html-dir=' + doc_path,
gobject_typesfile: doc_module + '.types',
html_assets: doc_module + '.png',
install: true,
install_dir: doc_path
)

12
docs/meson.build Normal file
View file

@ -0,0 +1,12 @@
version_conf = configuration_data()
version_conf.set('VERSION', nm_version)
version_xml = 'version.xml'
subdir('libnm')
subdir('api')
if enable_libnm_glib
subdir('libnm-util')
subdir('libnm-glib')
endif

View file

@ -0,0 +1,27 @@
examples = [
['add-connection-gdbus', [uuid_dep], [libnm_core_enums_h, libnm_enums_h]],
['add-connection-libnm', [libnm_dep], []],
['get-active-connections-gdbus', [], [libnm_core_enums_h, libnm_enums_h]],
['get-ap-info-libnm', [libnm_dep], []],
['list-connections-gdbus', [], []],
['list-connections-libnm', [libnm_dep], []],
['monitor-nm-running-gdbus', [], []],
['monitor-nm-state-gdbus', [], []]
]
incs = [
top_inc,
shared_inc,
libnm_core_inc,
libnm_inc
]
foreach example: examples
executable(
example[0],
[example[0] + '.c'] + example[2],
include_directories: incs,
dependencies: [glib_dep] + example[1],
c_args: '-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE'
)
endforeach

47
examples/C/qt/meson.build Normal file
View file

@ -0,0 +1,47 @@
examples = [
['add-connection-wired', []],
['list-connections', []],
['change-ipv4-addresses', []]
]
incs = [
top_inc,
libnm_core_inc
]
qt_core_dep = dependency('QtCore', version: '>= 4')
deps = [
dbus_dep,
dbus_glib_dep,
qt_core_dep,
dependency('QtDBus'),
dependency('QtNetwork')
]
moc = find_program('moc-qt4', required: false)
if not moc.found()
moc = qt_core_dep.get_pkgconfig_variable('moc_location')
endif
example = 'monitor-nm-running'
output = example + '.moc'
example_moc = custom_target(
output,
input: example + '.cpp',
output: output,
command: [moc, '-i', '@INPUT@', '-o', '@OUTPUT@']
)
examples += [[example, [example_moc]]]
foreach example: examples
executable(
example[0],
example[0] + '.cpp',
include_directories: incs,
dependencies: deps,
link_depends: example[1]
)
endforeach

98
introspection/meson.build Normal file
View file

@ -0,0 +1,98 @@
ifaces_secret_agent_xml = files('org.freedesktop.NetworkManager.SecretAgent.xml')
ifaces_vpn_plugin_xml = files('org.freedesktop.NetworkManager.VPN.Plugin.xml')
ifaces = [
'org.freedesktop.NetworkManager.AccessPoint',
'org.freedesktop.NetworkManager.AgentManager',
'org.freedesktop.NetworkManager.Checkpoint',
'org.freedesktop.NetworkManager.Connection.Active',
'org.freedesktop.NetworkManager.Device.Adsl',
'org.freedesktop.NetworkManager.Device.Bluetooth',
'org.freedesktop.NetworkManager.Device.Bond',
'org.freedesktop.NetworkManager.Device.Bridge',
'org.freedesktop.NetworkManager.Device.Dummy',
'org.freedesktop.NetworkManager.Device.Generic',
'org.freedesktop.NetworkManager.Device.Infiniband',
'org.freedesktop.NetworkManager.Device.IPTunnel',
'org.freedesktop.NetworkManager.Device.Macsec',
'org.freedesktop.NetworkManager.Device.Macvlan',
'org.freedesktop.NetworkManager.Device.Modem',
'org.freedesktop.NetworkManager.Device.OlpcMesh',
'org.freedesktop.NetworkManager.Device.OvsInterface',
'org.freedesktop.NetworkManager.Device.OvsPort',
'org.freedesktop.NetworkManager.Device.OvsBridge',
'org.freedesktop.NetworkManager.Device.Ppp',
'org.freedesktop.NetworkManager.Device.Statistics',
'org.freedesktop.NetworkManager.Device.Team',
'org.freedesktop.NetworkManager.Device.Tun',
'org.freedesktop.NetworkManager.Device.Veth',
'org.freedesktop.NetworkManager.Device.Vlan',
'org.freedesktop.NetworkManager.Device.Vxlan',
'org.freedesktop.NetworkManager.Device.WiMax',
'org.freedesktop.NetworkManager.Device.Wired',
'org.freedesktop.NetworkManager.Device.Wireless',
'org.freedesktop.NetworkManager.Device',
'org.freedesktop.NetworkManager.DHCP4Config',
'org.freedesktop.NetworkManager.DHCP6Config',
'org.freedesktop.NetworkManager.DnsManager',
'org.freedesktop.NetworkManager.IP4Config',
'org.freedesktop.NetworkManager.IP6Config',
'org.freedesktop.NetworkManager',
'org.freedesktop.NetworkManager.PPP',
'org.freedesktop.NetworkManager.SecretAgent',
'org.freedesktop.NetworkManager.Settings.Connection',
'org.freedesktop.NetworkManager.Settings',
'org.freedesktop.NetworkManager.VPN.Connection',
'org.freedesktop.NetworkManager.VPN.Plugin',
'org.freedesktop.NetworkManager.WiMax.Nsp'
]
ifaces_xmls = []
sources = []
# FIXME?: DBUS_INTERFACE_DOCS/docbook files are generated in
# "meson.current_build_dir()" instead of "meson.source_root()/docs/api"
foreach iface: ifaces
iface_xml = iface + '.xml'
ifaces_xmls += files(iface_xml)
sources += gnome.gdbus_codegen(
iface,
iface_xml,
interface_prefix: 'org.freedesktop.NetworkManager',
namespace: 'NMDBus',
docbook: 'dbus'
)
# FIXME: gnome.gdbus_codegen should return the docbook as a target result
content_files += join_paths(meson.current_build_dir(), 'dbus-' + iface_xml)
endforeach
install_data(
ifaces_xmls,
install_dir: dbus_ifaces_dir
)
'''
# gdbus-codegen 2.38 will emit code that requires glib 2.38, which
# will then cause availability warnings if we define
# GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32.
#
# This is fixed in GLib 2.40 (it emits code that takes
# GLIB_VERSION_MAX_ALLOWED into account), so this workaround can go
# away when we depend on that.
introspection_libnmdbus_la_CPPFLAGS = $(filter-out -DGLIB_VERSION_MAX_ALLOWED%,$(GLIB_CFLAGS))
'''
libnmdbus = static_library(
'nmdbus',
sources: sources,
include_directories: top_inc,
dependencies: glib_dep
)
libnmdbus_dep = declare_dependency(
link_with: libnmdbus,
include_directories: include_directories('.')
)

200
libnm-core/meson.build Normal file
View file

@ -0,0 +1,200 @@
libnm_core_inc = include_directories('.')
libnm_core_headers = files(
'nm-connection.h',
'nm-core-types.h',
'nm-dbus-interface.h',
'nm-errors.h',
'nm-setting-8021x.h',
'nm-setting-adsl.h',
'nm-setting-bluetooth.h',
'nm-setting-bond.h',
'nm-setting-bridge-port.h',
'nm-setting-bridge.h',
'nm-setting-cdma.h',
'nm-setting-connection.h',
'nm-setting-dcb.h',
'nm-setting-dummy.h',
'nm-setting-generic.h',
'nm-setting-gsm.h',
'nm-setting-infiniband.h',
'nm-setting-ip-config.h',
'nm-setting-ip-tunnel.h',
'nm-setting-ip4-config.h',
'nm-setting-ip6-config.h',
'nm-setting-macsec.h',
'nm-setting-macvlan.h',
'nm-setting-olpc-mesh.h',
'nm-setting-ovs-bridge.h',
'nm-setting-ovs-interface.h',
'nm-setting-ovs-patch.h',
'nm-setting-ovs-port.h',
'nm-setting-ppp.h',
'nm-setting-pppoe.h',
'nm-setting-proxy.h',
'nm-setting-serial.h',
'nm-setting-tc-config.h',
'nm-setting-team-port.h',
'nm-setting-team.h',
'nm-setting-tun.h',
'nm-setting-user.h',
'nm-setting-vlan.h',
'nm-setting-vpn.h',
'nm-setting-vxlan.h',
'nm-setting-wimax.h',
'nm-setting-wired.h',
'nm-setting-wireless-security.h',
'nm-setting-wireless.h',
'nm-setting.h',
'nm-simple-connection.h',
'nm-utils.h',
'nm-version.h',
'nm-vpn-dbus-interface.h',
'nm-vpn-editor-plugin.h',
'nm-vpn-plugin-info.h'
)
libnm_core_sources = files(
'crypto.c',
'crypto_' + crypto + '.c',
'nm-connection.c',
'nm-dbus-utils.c',
'nm-errors.c',
'nm-keyfile-reader.c',
'nm-keyfile-utils.c',
'nm-keyfile-writer.c',
'nm-property-compare.c',
'nm-setting-8021x.c',
'nm-setting-adsl.c',
'nm-setting-bluetooth.c',
'nm-setting-bond.c',
'nm-setting-bridge-port.c',
'nm-setting-bridge.c',
'nm-setting-cdma.c',
'nm-setting-connection.c',
'nm-setting-dcb.c',
'nm-setting-dummy.c',
'nm-setting-generic.c',
'nm-setting-gsm.c',
'nm-setting-infiniband.c',
'nm-setting-ip-config.c',
'nm-setting-ip-tunnel.c',
'nm-setting-ip4-config.c',
'nm-setting-ip6-config.c',
'nm-setting-macsec.c',
'nm-setting-macvlan.c',
'nm-setting-olpc-mesh.c',
'nm-setting-ovs-bridge.c',
'nm-setting-ovs-interface.c',
'nm-setting-ovs-patch.c',
'nm-setting-ovs-port.c',
'nm-setting-ppp.c',
'nm-setting-pppoe.c',
'nm-setting-proxy.c',
'nm-setting-serial.c',
'nm-setting-tc-config.c',
'nm-setting-team-port.c',
'nm-setting-team.c',
'nm-setting-tun.c',
'nm-setting-user.c',
'nm-setting-vlan.c',
'nm-setting-vpn.c',
'nm-setting-vxlan.c',
'nm-setting-wimax.c',
'nm-setting-wired.c',
'nm-setting-wireless-security.c',
'nm-setting-wireless.c',
'nm-setting.c',
'nm-simple-connection.c',
'nm-utils.c',
'nm-vpn-editor-plugin.c',
'nm-vpn-plugin-info.c'
)
enums_headers = libnm_core_headers + [version_header]
enums = 'nm-core-enum-types'
libnm_core_enums_h = gnome.mkenums(
enums + '.h',
sources: enums_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_CORE_ENUM_TYPES_H__\n#define __NM_CORE_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
ftail: 'G_END_DECLS\n\n#endif /* __NM_CORE_ENUM_TYPES_H__ */',
install_header: true,
install_dir: libnm_pkgincludedir
)
libnm_core_enums_c = gnome.mkenums(
enums + '.c',
sources: enums_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-core-enum-types.h"\n#include "nm-default.h"\n\n#include "nm-version-macros.h" \n#include "nm-connection.h" \n#include "nm-core-types.h" \n#include "nm-dbus-interface.h" \n#include "nm-errors.h" \n#include "nm-setting-8021x.h" \n#include "nm-setting-adsl.h" \n#include "nm-setting-bluetooth.h" \n#include "nm-setting-bond.h" \n#include "nm-setting-bridge-port.h" \n#include "nm-setting-bridge.h" \n#include "nm-setting-cdma.h" \n#include "nm-setting-connection.h" \n#include "nm-setting-dcb.h" \n#include "nm-setting-dummy.h" \n#include "nm-setting-generic.h" \n#include "nm-setting-gsm.h" \n#include "nm-setting-infiniband.h" \n#include "nm-setting-ip-config.h" \n#include "nm-setting-ip-tunnel.h" \n#include "nm-setting-ip4-config.h" \n#include "nm-setting-ip6-config.h" \n#include "nm-setting-macsec.h" \n#include "nm-setting-macvlan.h" \n#include "nm-setting-olpc-mesh.h" \n#include "nm-setting-ovs-bridge.h" \n#include "nm-setting-ovs-interface.h" \n#include "nm-setting-ovs-patch.h" \n#include "nm-setting-ovs-port.h" \n#include "nm-setting-ppp.h" \n#include "nm-setting-pppoe.h" \n#include "nm-setting-proxy.h" \n#include "nm-setting-serial.h" \n#include "nm-setting-team-port.h" \n#include "nm-setting-team.h" \n#include "nm-setting-tun.h" \n#include "nm-setting-user.h" \n#include "nm-setting-vlan.h" \n#include "nm-setting-vpn.h" \n#include "nm-setting-vxlan.h" \n#include "nm-setting-wimax.h" \n#include "nm-setting-wired.h" \n#include "nm-setting-wireless-security.h" \n#include "nm-setting-wireless.h" \n#include "nm-setting.h" \n#include "nm-simple-connection.h" \n#include "nm-utils.h" \n#include "nm-version.h" \n#include "nm-vpn-dbus-interface.h" \n#include "nm-vpn-editor-plugin.h" \n#include "nm-vpn-plugin-info.h" \n\n',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
)
libnm_core_enums = [libnm_core_enums_c, libnm_core_enums_h]
incs = [
top_inc,
shared_inc
]
deps = [
crypto_dep,
dl_dep,
glib_dep,
libudev_dep,
uuid_dep
]
cflags = [
'-DG_LOG_DOMAIN="libnm"',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
'-DLOCALEDIR="@0@"'.format(nm_localedir),
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
'-DNMLIBDIR="@0@"'.format(nm_pkglibdir),
'-DNMPLUGINDIR="@0@"'.format(nm_pkglibdir)
]
if enable_json_validation
deps += jansson_dep
endif
libnm_core = static_library(
'nm-core',
sources: libnm_core_sources + libnm_core_enums + shared_sources + [version_header],
include_directories: incs,
dependencies: deps,
c_args: cflags
)
enums_to_docbook = join_paths(meson.source_root(), 'tools', 'enums-to-docbook.pl')
docbooks = [
['nm-dbus-types', 'nm-dbus-interface.h', 'NetworkManager D-Bus API Types'],
['nm-vpn-dbus-types', 'nm-vpn-dbus-interface.h', 'VPN Plugin D-Bus API Types']
]
foreach docbook: docbooks
output = docbook[0] + '.xml'
xml = custom_target(
output,
input: docbook[1],
output: output,
capture: true,
command: [perl, enums_to_docbook, docbook[0], docbook[2], '@INPUT@'],
# FIXME: used to built properly api documentation
build_by_default: true
)
content_files += xml.full_path()
endforeach
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,65 @@
# test-cert.p12 created with:
#
# openssl pkcs12 -export \
# -in test_key_and_cert.pem \
# -inkey test_key_and_cert.pem \
# -certfile test_ca_cert.pem \
# -name "test-pkcs12" \
# -out test-cert.p12
enums_header = files('test-general-enums.h')
enums = 'nm-core-tests-enum-types'
enums_h = gnome.mkenums(
enums + '.h',
sources: enums_header,
identifier_prefix: 'NM',
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_CORE_TESTS_ENUM_TYPES_H__\n#define __NM_CORE_TESTS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
ftail: 'G_END_DECLS\n\n#endif /* __NM_CORE_TESTS_ENUM_TYPES_H__ */'
)
enums_c = gnome.mkenums(
enums + '.c',
sources: enums_header,
identifier_prefix: 'NM',
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-core-tests-enum-types.h"\n\n#include "test-general-enums.h" \n\n',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
)
test_units = [
'test-compare',
'test-crypto',
'test-general',
'test-keyfile',
'test-secrets',
'test-setting',
'test-settings-defaults'
]
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
test_cert_dir = join_paths(meson.current_source_dir(), 'certs')
cflags = '-DTEST_CERT_DIR="@0@"'.format(test_cert_dir)
foreach test_unit: test_units
name = 'libnm-core-' + test_unit
exe = executable(
name,
[test_unit + '.c', enums_c, enums_h],
include_directories: incs,
dependencies: glib_dep,
c_args: cflags,
link_with: libnm_core
)
test(name, exe)
endforeach

326
libnm-glib/meson.build Normal file
View file

@ -0,0 +1,326 @@
dbus_binding_tool = find_program('dbus-binding-tool')
common_incs = [
top_inc,
shared_inc
]
common_deps = [
dbus_dep,
dbus_glib_dep,
glib_dep
]
common_cflags = [
'-DG_LOG_DOMAIN="libnm-glib"',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY'
]
libnm_glib_inc = include_directories('.')
vpn_headers = files(
'nm-vpn-plugin.h',
'nm-vpn-plugin-ui-interface.h',
'nm-vpn-plugin-utils.h'
)
headers = files(
'nm-access-point.h',
'nm-active-connection.h',
'nm-client.h',
'nm-device-adsl.h',
'nm-device-bond.h',
'nm-device-bridge.h',
'nm-device-bt.h',
'nm-device-ethernet.h',
'nm-device-generic.h',
'nm-device.h',
'nm-device-infiniband.h',
'nm-device-modem.h',
'nm-device-olpc-mesh.h',
'nm-device-team.h',
'nm-device-vlan.h',
'nm-device-wifi.h',
'nm-device-wimax.h',
'nm-dhcp4-config.h',
'nm-dhcp6-config.h',
'nm-ip4-config.h',
'nm-ip6-config.h',
'nm-object.h',
'nm-remote-connection.h',
'nm-remote-settings.h',
'nm-secret-agent.h',
'nm-types.h',
'nm-vpn-connection.h',
'nm-wimax-nsp.h'
)
deprecated_headers = files('libnm_glib.h')
install_headers(
headers + vpn_headers + deprecated_headers,
subdir: 'libnm-glib'
)
incs = common_incs + [libnm_util_inc]
cflags = common_cflags + [
'-Wno-deprecated-declarations',
'-Wno-deprecated'
]
libdeprecated_nm_glib = static_library(
'deprecated-nm-glib',
sources: 'libnm_glib.c',
include_directories: incs,
dependencies: common_deps,
c_args: cflags
)
sources = files(
'nm-vpn-plugin.c',
'nm-vpn-plugin-ui-interface.c',
'nm-vpn-plugin-utils.c'
)
glue = 'nm-vpn-plugin-glue.h'
sources += custom_target(
glue,
input: ifaces_vpn_plugin_xml,
output: glue,
command: [dbus_binding_tool, '--prefix=nm_vpn_plugin', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@']
)
enums = 'nm-vpn-enum-types'
libnm_glib_vpn_enums_h = gnome.mkenums(
enums + '.h',
sources: vpn_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_VPN_ENUM_TYPES_H__\n#define __NM_VPN_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
ftail: 'G_END_DECLS\n\n#endif /* __NM_VPN_ENUM_TYPES_H__ */',
install_header: true,
install_dir: libnm_glib_pkgincludedir
)
libnm_glib_vpn_enums_c = gnome.mkenums(
enums + '.c',
sources: vpn_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-vpn-enum-types.h"\n\n#include "nm-vpn-plugin.h" \n#include "nm-vpn-plugin-ui-interface.h" \n#include "nm-vpn-plugin-utils.h"\n\n',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
)
libnm_glib_vpn_enums = [libnm_glib_vpn_enums_c, libnm_glib_vpn_enums_h]
deps = common_deps + [libnm_util_dep]
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
libnm_glib_vpn = shared_library(
'nm-glib-vpn',
sources: sources + libnm_glib_vpn_enums + [libnm_utils_enums_h],
version: libnm_glib_vpn_version,
include_directories: common_incs,
dependencies: deps,
c_args: common_cflags,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: get_option('libdir')
)
libnm_glib_vpn_dep = declare_dependency(
link_with: libnm_glib_vpn,
include_directories: libnm_glib_inc
)
pkg.generate(
libraries: libnm_glib_vpn,
version: nm_version,
name: 'libnm-glib-vpn',
description: 'Convenience library for NetworkManager VPN plugins',
filebase: 'libnm-glib-vpn',
subdirs: 'libnm-glib',
requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1',
variables: 'exec_prefix=${prefix}',
install_dir: join_paths(nm_libdir, 'pkgconfig')
)
sources = shared_udev_utils + files(
'nm-access-point.c',
'nm-active-connection.c',
'nm-client.c',
'nm-dbus-helpers.c',
'nm-device-adsl.c',
'nm-device-bond.c',
'nm-device-bridge.c',
'nm-device-bt.c',
'nm-device.c',
'nm-device-ethernet.c',
'nm-device-generic.c',
'nm-device-infiniband.c',
'nm-device-olpc-mesh.c',
'nm-device-modem.c',
'nm-device-team.c',
'nm-device-vlan.c',
'nm-device-wifi.c',
'nm-device-wimax.c',
'nm-dhcp4-config.c',
'nm-dhcp6-config.c',
'nm-ip4-config.c',
'nm-ip6-config.c',
'nm-object.c',
'nm-object-cache.c',
'nm-remote-connection.c',
'nm-remote-settings.c',
'nm-secret-agent.c',
'nm-types.c',
'nm-vpn-connection.c',
'nm-wimax-nsp.c'
)
glue = 'nm-secret-agent-glue.h'
nm_secret_agent_glue = custom_target(
glue,
input: ifaces_secret_agent_xml,
output: glue,
command: [dbus_binding_tool, '--prefix=nm_secret_agent', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@']
)
enums = 'nm-glib-enum-types'
libnm_glib_enums_h = gnome.mkenums(
enums + '.h',
sources: headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_GLIB_ENUM_TYPES_H__\n#define __NM_GLIB_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
ftail: 'G_END_DECLS\n\n#endif /* __NM_GLIB_ENUM_TYPES_H__ */',
install_header: true,
install_dir: libnm_glib_pkgincludedir
)
libnm_glib_enums_c = gnome.mkenums(
enums + '.c',
sources: headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-glib-enum-types.h"\n\n#include "nm-object.h" \n#include "nm-client.h" \n#include "nm-device.h" \n#include "nm-device-ethernet.h" \n#include "nm-device-infiniband.h" \n#include "nm-device-adsl.h" \n#include "nm-device-wifi.h" \n#include "nm-device-bt.h" \n#include "nm-device-olpc-mesh.h" \n#include "nm-device-bond.h" \n#include "nm-device-team.h" \n#include "nm-device-bridge.h" \n#include "nm-device-vlan.h" \n#include "nm-device-generic.h" \n#include "nm-access-point.h" \n#include "nm-ip4-config.h" \n#include "nm-device-modem.h" \n#include "nm-vpn-connection.h" \n#include "nm-types.h" \n#include "nm-active-connection.h" \n#include "nm-dhcp4-config.h" \n#include "nm-ip6-config.h" \n#include "nm-dhcp6-config.h" \n#include "nm-remote-connection.h" \n#include "nm-remote-settings.h" \n#include "nm-secret-agent.h" \n#include "nm-device-wimax.h" \n#include "nm-wimax-nsp.h"\n\n',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
)
libnm_glib_enums = [libnm_glib_enums_c, libnm_glib_enums_h]
deps = common_deps + [
libudev_dep,
libnm_util_dep
]
cflags = common_cflags + ['-DNMRUNDIR="@0@"'.format(nm_pkgrundir)]
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
libnm_glib = shared_library(
'nm-glib',
sources: sources + libnm_glib_enums + [nm_secret_agent_glue, libnm_utils_enums_h],
version: libnm_glib_version,
include_directories: common_incs,
dependencies: deps,
c_args: cflags,
link_with: libdeprecated_nm_glib,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: get_option('libdir')
)
libnm_glib_dep = declare_dependency(
link_with: libnm_glib,
include_directories: libnm_glib_inc
)
pkg.generate(
libraries: libnm_glib,
version: nm_version,
name: 'libnm-glib',
description: 'Convenience library for clients of NetworkManager',
filebase: 'libnm-glib',
subdirs: 'libnm-glib',
requires: 'libnm-util >= ' + nm_version + ' NetworkManager >= ' + nm_version + ' gobject-2.0 dbus-glib-1',
variables: 'exec_prefix=${prefix}',
install_dir: join_paths(nm_libdir, 'pkgconfig')
)
if enable_introspection
gir_sources = sources + headers + libnm_glib_enums
deps = [
dbus_glib_dep,
libnm_glib_dep,
libnm_util_gir_dep
]
gir_includes = [
'DBusGLib-1.0',
'Gio-2.0'
]
gir_dir = join_paths(nm_datadir, 'gir-' + nm_gir_version)
typelib_dir = join_paths(nm_libdir, 'girepository-' + nm_gir_version)
libnm_glib_gir = gnome.generate_gir(
libnm_glib,
sources: gir_sources,
dependencies: deps,
nsversion: nm_gir_version,
namespace: 'NMClient',
identifier_prefix: nm_id_prefix,
symbol_prefix: nm_id_prefix.to_lower(),
export_packages: ['libnm-glib', 'libnm-glib-vpn'],
includes: gir_includes,
extra_args: common_cflags + ['--include-uninstalled=' + libnm_util_gir[0].full_path()],
install: true,
install_dir_gir: gir_dir,
install_dir_typelib: typelib_dir
)
endif
name = 'libnm-glib-test'
deps = common_deps + [libnm_util_dep]
executable(
name,
[name + '.c', libnm_utils_enums_h],
include_directories: common_incs,
dependencies: deps,
c_args: common_cflags,
link_with: libnm_glib
)
run_target(
'check-local-exports-libnm-glib',
command: [check_exports, libnm_glib.full_path(), symbol_map],
depends: libnm_glib
)
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,36 @@
incs = [
top_inc,
shared_inc
]
deps = [
dbus_dep,
dbus_glib_dep,
glib_dep,
libnm_glib_dep,
libnm_util_dep
]
cflags = [
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY',
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py'))
]
test_units = [
'test-nm-client',
'test-remote-settings-client'
]
foreach test_unit: test_units
name = 'libnm-glib-' + test_unit
exe = executable(
name,
[test_unit + '.c', libnm_utils_enums_h] + shared_test_utils,
include_directories: incs,
dependencies: deps,
c_args: cflags
)
test(name, exe)
endforeach

220
libnm-util/meson.build Normal file
View file

@ -0,0 +1,220 @@
libnm_util_inc = include_directories('.')
enums_headers = [version_header] + files(
'nm-connection.h',
'nm-setting-8021x.h',
'nm-setting-adsl.h',
'nm-setting-bluetooth.h',
'nm-setting-bond.h',
'nm-setting-bridge.h',
'nm-setting-bridge-port.h',
'nm-setting-cdma.h',
'nm-setting-connection.h',
'nm-setting-dcb.h',
'nm-setting-generic.h',
'nm-setting-gsm.h',
'nm-setting.h',
'nm-setting-infiniband.h',
'nm-setting-ip4-config.h',
'nm-setting-ip6-config.h',
'nm-setting-olpc-mesh.h',
'nm-setting-ppp.h',
'nm-setting-pppoe.h',
'nm-setting-serial.h',
'nm-setting-team.h',
'nm-setting-team-port.h',
'nm-setting-vlan.h',
'nm-setting-vpn.h',
'nm-setting-wimax.h',
'nm-setting-wired.h',
'nm-setting-wireless.h',
'nm-setting-wireless-security.h',
'nm-utils.h',
'nm-version.h'
)
headers = enums_headers + files(
'NetworkManager.h',
'NetworkManagerVPN.h'
)
install_headers(
headers,
subdir: nm_name
)
enums = 'nm-utils-enum-types'
libnm_utils_enums_h = gnome.mkenums(
enums + '.h',
sources: enums_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_UTILS_ENUM_TYPES_H__\n#define __NM_UTILS_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
ftail: 'G_END_DECLS\n\n#endif /* __NM_UTILS_ENUM_TYPES_H__ */',
install_header: true,
install_dir: nm_pkgincludedir
)
libnm_utils_enums_c = gnome.mkenums(
enums + '.c',
sources: enums_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-utils-enum-types.h"\n\n#include "nm-version-macros.h" \n#include "nm-connection.h" \n#include "nm-setting.h" \n#include "nm-setting-8021x.h" \n#include "nm-setting-adsl.h" \n#include "nm-setting-bluetooth.h" \n#include "nm-setting-bond.h" \n#include "nm-setting-team.h" \n#include "nm-setting-team-port.h" \n#include "nm-setting-bridge.h" \n#include "nm-setting-bridge-port.h" \n#include "nm-setting-connection.h" \n#include "nm-setting-dcb.h" \n#include "nm-setting-infiniband.h" \n#include "nm-setting-ip4-config.h" \n#include "nm-setting-vlan.h" \n#include "nm-setting-ip6-config.h" \n#include "nm-setting-ppp.h" \n#include "nm-setting-pppoe.h" \n#include "nm-setting-serial.h" \n#include "nm-setting-generic.h" \n#include "nm-setting-gsm.h" \n#include "nm-setting-cdma.h" \n#include "nm-setting-olpc-mesh.h" \n#include "nm-setting-wimax.h" \n#include "nm-setting-wired.h" \n#include "nm-setting-wireless.h" \n#include "nm-setting-wireless-security.h" \n#include "nm-setting-vpn.h" \n#include "nm-utils.h" \n#include "nm-version.h"\n\n',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
)
libnm_utils_enums = [libnm_utils_enums_c, libnm_utils_enums_h]
sources = shared_utils + files(
'crypto.c',
'crypto_' + crypto + '.c',
'nm-connection.c',
'nm-param-spec-specialized.c',
'nm-setting-8021x.c',
'nm-setting-adsl.c',
'nm-setting-bluetooth.c',
'nm-setting-bridge.c',
'nm-setting-bridge-port.c',
'nm-setting-bond.c',
'nm-setting.c',
'nm-setting-cdma.c',
'nm-setting-connection.c',
'nm-setting-dcb.c',
'nm-setting-generic.c',
'nm-setting-gsm.c',
'nm-setting-infiniband.c',
'nm-setting-ip4-config.c',
'nm-setting-ip6-config.c',
'nm-setting-olpc-mesh.c',
'nm-setting-ppp.c',
'nm-setting-pppoe.c',
'nm-setting-serial.c',
'nm-setting-team.c',
'nm-setting-team-port.c',
'nm-setting-wimax.c',
'nm-setting-wired.c',
'nm-setting-wireless.c',
'nm-setting-wireless-security.c',
'nm-setting-vlan.c',
'nm-setting-vpn.c',
'nm-utils.c',
'nm-value-transforms.c'
)
incs = [
top_inc,
shared_inc
]
deps = [
crypto_dep,
dbus_dep,
dbus_glib_dep,
glib_dep,
uuid_dep
]
cflags = [
'-DG_LOG_DOMAIN="libnm-util"',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY',
'-DLOCALEDIR="@0@"'.format(nm_localedir)
]
symbol_map = join_paths(meson.current_source_dir(), 'libnm-util.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
libnm_util = shared_library(
'nm-util',
sources: sources + libnm_utils_enums,
version: libnm_util_version,
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: get_option('libdir')
)
libnm_util_dep = declare_dependency(
link_with: libnm_util,
include_directories: libnm_util_inc
)
pkg.generate(
libraries: libnm_util,
version: nm_version,
name: 'libnm-util',
description: 'Convenience library for clients of NetworkManager',
filebase: 'libnm-util',
subdirs: nm_name,
requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1',
variables: 'exec_prefix=${prefix}',
install_dir: join_paths(nm_libdir, 'pkgconfig')
)
if enable_introspection
gir_sources = sources + headers + libnm_utils_enums
gir_includes = [
'DBusGLib-1.0',
'GObject-2.0'
]
gir_dir = join_paths(nm_datadir, 'gir-' + nm_gir_version)
typelib_dir = join_paths(nm_libdir, 'girepository-' + nm_gir_version)
libnm_util_gir = gnome.generate_gir(
libnm_util,
sources: gir_sources,
nsversion: nm_gir_version,
namespace: nm_name,
identifier_prefix: nm_id_prefix,
symbol_prefix: nm_id_prefix.to_lower(),
export_packages: 'libnm-util',
includes: gir_includes,
install: true,
install_dir_gir: gir_dir,
install_dir_typelib: typelib_dir
)
libnm_util_gir_dep = declare_dependency(
link_with: libnm_util,
sources: libnm_util_gir
)
endif
run_target(
'check-local-exports-libnm-util',
command: [check_exports, libnm_util.full_path(), symbol_map],
depends: libnm_util
)
sources = files(
'crypto.c',
'crypto_' + crypto + '.c'
)
deps = [
crypto_dep,
glib_dep
]
libtest_crypto = static_library(
'test-crypto',
sources: sources,
include_directories: incs,
dependencies: deps,
c_args: cflags
)
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,51 @@
incs = [
top_inc,
shared_inc
]
deps = [
dbus_dep,
dbus_glib_dep,
glib_dep,
libnm_util_dep
]
cflags = [
'-DBUILD_DIR="@0@"'.format(meson.current_source_dir()),
'-DTEST_CERT_DIR="@0@"'.format(test_cert_dir)
]
test = 'test-libnm-linking'
test_libnm_linking = executable(
test,
[test + '.c', libnm_utils_enums_h],
include_directories: incs,
dependencies: deps + [libnm_dep],
c_args: cflags
)
test_units = [
['test-crypto', [libtest_crypto], []],
['test-general', [], [test_libnm_linking]],
['test-secrets', [], []],
['test-setting-8021x', [], []],
['test-setting-dcb', [], []],
['test-settings-defaults', [], []]
]
foreach test_unit: test_units
name = 'libnm-utils-' + test_unit[0]
exe = executable(
name,
[test_unit[0] + '.c', libnm_utils_enums_h],
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_with: test_unit[1],
link_depends: test_unit[2]
)
test(name, exe)
endforeach

View file

@ -0,0 +1,30 @@
g_ir_compiler = find_program('g-ir-compiler')
girs = [
'NetworkManager',
'NMClient'
]
resource_data = []
foreach gir: girs
gir_typelib = gir + '.typelib'
resource_data += custom_target(
gir_typelib,
input: gir + '.gir',
output: gir_typelib,
command: [g_ir_compiler, '@INPUT@', '-o', '@OUTPUT@']
)
endforeach
resource = 'typelibs'
sources += gnome.compile_resources(
resource,
resource + '.gresource.xml',
source_dir: '.',
dependencies: resource_data,
extra_args: '--manual-register',
export: true
)

316
libnm/meson.build Normal file
View file

@ -0,0 +1,316 @@
libnm_inc = include_directories('.')
sources = files('nm-libnm-utils.c')
if have_fake_typelibs
subdir('fake-typelib')
endif
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
# FIXME: this makes GIR mandatory?
gir_dep,
glib_dep,
libnmdbus_dep
]
cflags = [
'-DG_LOG_DOMAIN="libnm"',
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
]
libnm_utils = static_library(
'nm-utils',
sources: sources,
include_directories: incs,
dependencies: deps,
c_args: cflags
)
libnm_headers = files(
'NetworkManager.h',
'nm-access-point.h',
'nm-active-connection.h',
'nm-checkpoint.h',
'nm-client.h',
'nm-device-adsl.h',
'nm-device-bond.h',
'nm-device-bridge.h',
'nm-device-bt.h',
'nm-device-dummy.h',
'nm-device-ethernet.h',
'nm-device-generic.h',
'nm-device.h',
'nm-device-infiniband.h',
'nm-device-ip-tunnel.h',
'nm-device-macsec.h',
'nm-device-macvlan.h',
'nm-device-modem.h',
'nm-device-olpc-mesh.h',
'nm-device-ovs-interface.h',
'nm-device-ovs-port.h',
'nm-device-ovs-bridge.h',
'nm-device-ppp.h',
'nm-device-team.h',
'nm-device-tun.h',
'nm-device-vlan.h',
'nm-device-vxlan.h',
'nm-device-wifi.h',
'nm-device-wimax.h',
'nm-dhcp-config.h',
'nm-ip-config.h',
'nm-object.h',
'nm-remote-connection.h',
'nm-types.h',
'nm-vpn-connection.h',
'nm-vpn-editor.h',
'nm-wimax-nsp.h'
)
libnm_headers_nointrospect = files(
'nm-secret-agent-old.h',
'nm-vpn-plugin-old.h',
'nm-vpn-service-plugin.h'
)
enums_headers = libnm_headers + libnm_headers_nointrospect + [version_header]
enums = 'nm-enum-types'
libnm_enums_h = gnome.mkenums(
enums + '.h',
sources: enums_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_ENUM_TYPES_H__\n#define __NM_ENUM_TYPES_H__\n\n#include <nm-core-enum-types.h>\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
ftail: 'G_END_DECLS\n\n#endif /* __NM_ENUM_TYPES_H__ */',
install_header: true,
install_dir: libnm_pkgincludedir
)
libnm_enums_c = gnome.mkenums(
enums + '.c',
sources: enums_headers,
identifier_prefix: nm_id_prefix,
fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-enum-types.h"\n#include "nm-default.h"\n\n#include "nm-version-macros.h" \n#include "NetworkManager.h" \n#include "nm-access-point.h" \n#include "nm-active-connection.h" \n#include "nm-checkpoint.h" \n#include "nm-client.h" \n#include "nm-device-adsl.h" \n#include "nm-device-bond.h" \n#include "nm-device-bridge.h" \n#include "nm-device-bt.h" \n#include "nm-device-dummy.h" \n#include "nm-device-ethernet.h" \n#include "nm-device-generic.h" \n#include "nm-device-infiniband.h" \n#include "nm-device-ip-tunnel.h" \n#include "nm-device-macsec.h" \n#include "nm-device-macvlan.h" \n#include "nm-device-modem.h" \n#include "nm-device-olpc-mesh.h" \n#include "nm-device-ovs-interface.h" \n#include "nm-device-ovs-port.h" \n#include "nm-device-ovs-bridge.h" \n#include "nm-device-ppp.h" \n#include "nm-device-team.h" \n#include "nm-device-tun.h" \n#include "nm-device-vlan.h" \n#include "nm-device-vxlan.h" \n#include "nm-device-wifi.h" \n#include "nm-device-wimax.h" \n#include "nm-device.h" \n#include "nm-dhcp-config.h" \n#include "nm-ip-config.h" \n#include "nm-object.h" \n#include "nm-remote-connection.h" \n#include "nm-types.h" \n#include "nm-vpn-connection.h" \n#include "nm-vpn-editor.h" \n#include "nm-wimax-nsp.h" \n#include "nm-secret-agent-old.h" \n#include "nm-vpn-plugin-old.h" \n#include "nm-vpn-service-plugin.h"\n\n',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
vtail: ' { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n'
)
libnm_enums = [libnm_enums_c, libnm_enums_h]
libnm_sources = files(
'nm-access-point.c',
'nm-active-connection.c',
'nm-checkpoint.c',
'nm-client.c',
'nm-dbus-helpers.c',
'nm-device-adsl.c',
'nm-device-bond.c',
'nm-device-bridge.c',
'nm-device-bt.c',
'nm-device.c',
'nm-device-dummy.c',
'nm-device-ethernet.c',
'nm-device-generic.c',
'nm-device-infiniband.c',
'nm-device-ip-tunnel.c',
'nm-device-macsec.c',
'nm-device-macvlan.c',
'nm-device-modem.c',
'nm-device-olpc-mesh.c',
'nm-device-ovs-interface.c',
'nm-device-ovs-port.c',
'nm-device-ovs-bridge.c',
'nm-device-ppp.c',
'nm-device-team.c',
'nm-device-tun.c',
'nm-device-vlan.c',
'nm-device-vxlan.c',
'nm-device-wifi.c',
'nm-device-wimax.c',
'nm-dhcp-config.c',
'nm-dhcp4-config.c',
'nm-dhcp6-config.c',
'nm-dns-manager.c',
'nm-ip-config.c',
'nm-ip4-config.c',
'nm-ip6-config.c',
'nm-manager.c',
'nm-object.c',
'nm-remote-connection.c',
'nm-remote-settings.c',
'nm-secret-agent-old.c',
'nm-vpn-connection.c',
'nm-vpn-plugin-old.c',
'nm-vpn-editor.c',
'nm-vpn-service-plugin.c',
'nm-wimax-nsp.c'
)
deps = [
dl_dep,
glib_dep,
libudev_dep,
uuid_dep
]
symbol_map = join_paths(meson.current_source_dir(), 'libnm.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
libnm = shared_library(
'nm',
sources: libnm_sources + libnm_enums,
version: libnm_version,
include_directories: incs + [libnm_core_inc],
dependencies: deps,
c_args: cflags,
link_with: libnm_utils,
link_whole: libnm_core,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: get_option('libdir')
)
libnm_dep = declare_dependency(
link_with: libnm,
include_directories: libnm_inc
)
pkg.generate(
libraries: libnm,
version: nm_version,
name: 'libnm',
description: 'Convenience library for clients of NetworkManager',
filebase: 'libnm',
subdirs: 'libnm',
requires: 'gio-2.0',
variables: [
'exec_prefix=${prefix}',
'vpnservicedir=' + join_paths(nm_pkglibdir, 'VPN')
],
install_dir: join_paths(nm_libdir, 'pkgconfig')
)
run_target(
'check-local-exports-libnm',
command: [check_exports, libnm.full_path(), symbol_map],
depends: libnm
)
if enable_introspection
gir_sources = libnm_core_enums + libnm_core_headers + libnm_core_sources + libnm_enums + libnm_headers + libnm_headers_nointrospect + libnm_sources + [version_header]
gir_dir = join_paths(nm_datadir, 'gir-' + nm_gir_version)
typelib_dir = join_paths(nm_libdir, 'girepository-' + nm_gir_version)
libnm_gir = gnome.generate_gir(
libnm,
sources: gir_sources,
nsversion: nm_gir_version,
namespace: 'NM',
identifier_prefix: nm_id_prefix,
symbol_prefix: nm_id_prefix.to_lower(),
export_packages: 'libnm',
includes: 'Gio-2.0',
extra_args: cflags,
install: true,
install_dir_gir: gir_dir,
install_dir_typelib: typelib_dir
)
# FIXME: the script parses the meson.source_root()/Makefile.am file
generate_plugin_docs = join_paths(meson.current_source_dir(), 'generate-plugin-docs.pl')
name = 'nm-settings-keyfile-docs.xml'
nm_settings_keyfile_docs = custom_target(
name,
input: meson.source_root(),
output: name,
command: [perl, generate_plugin_docs, 'keyfile', '@INPUT@', '@OUTPUT@']
)
name = 'nm-settings-docs-overrides.xml'
nm_settings_docs_overrides = custom_target(
name,
input: meson.source_root(),
output: name,
command: [perl, generate_plugin_docs, 'dbus', '@INPUT@', '@OUTPUT@']
)
if enable_ifcfg_rh
name = 'nm-settings-ifcfg-rh-docs.xml'
nm_settings_ifcfg_rh_docs = custom_target(
name,
input: meson.source_root(),
output: name,
command: [perl, generate_plugin_docs, 'ifcfg-rh', '@INPUT@', '@OUTPUT@']
)
endif
# FIXME: uses the following variables
# GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH};',
# LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH};',
generate_setting_docs = join_paths(meson.current_source_dir(), 'generate-setting-docs.py')
name = 'nm-property-docs.xml'
nm_property_docs = custom_target(
name,
input: libnm_gir[0],
output: name,
command: [generate_setting_docs, '--gir', '@INPUT@', '--output', '@OUTPUT@']
)
# FIXME: the makefile command
'''
# When the python scripts loads libnm and the address sanitizers is
# enabled, we must LD_PRELOAD libasan otherwise it will complain that
# it was not loaded as initial library.
'nm-property-docs.xml: libnm/generate-setting-docs.py $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la
$(AM_V_GEN)',
export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH};',
export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH};',
$(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so);',
"$(PYTHON)"',
$(srcdir)/libnm/generate-setting-docs.py',
--gir $(builddir)/libnm/NM-1.0.gir',
--output $@
'''
name = 'nm-settings-docs.xml'
nm_settings_docs = custom_target(
name,
input: libnm_gir[0],
output: name,
command: [generate_setting_docs, '--gir', '@INPUT@', '--overrides', nm_settings_docs_overrides, '--output', '@OUTPUT@']
)
# FIXME: the makefile command
'''
'nm-settings-docs.xml: libnm/generate-setting-docs.py libnm/nm-settings-docs-overrides.xml $(libnm_docs_sources) | libnm/NM-1.0.gir libnm/NM-1.0.typelib libnm/libnm.la
$(AM_V_GEN)',
export GI_TYPELIB_PATH=$(abs_builddir)/libnm$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH};',
export LD_LIBRARY_PATH=$(abs_builddir)/libnm/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH};',
$(call set_sanitizer_env,$(abs_builddir)/libnm/.libs/libnm.so);',
"$(PYTHON)"',
$(srcdir)/libnm/generate-setting-docs.py',
--gir $(builddir)/libnm/NM-1.0.gir',
--overrides $(word 2,$^)',
--output $@
'''
endif
if enable_tests
subdir('tests')
endif

53
libnm/tests/meson.build Normal file
View file

@ -0,0 +1,53 @@
test_units = [
['test-general', shared_utils, [libnm_utils]],
# FIXME: these tests fails usually
#['test-nm-client', shared_test_utils, []],
#['test-remote-settings-client', shared_test_utils, []],
#['test-secret-agent', shared_test_utils, []]
]
incs = [
top_inc,
shared_inc,
libnm_core_inc
]
deps = [
glib_dep,
libnm_dep
]
cflags = [
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py'))
]
foreach test_unit: test_units
name = 'libnm-' + test_unit[0]
exe = executable(
name,
[test_unit[0] + '.c'] + test_unit[1],
include_directories: incs,
dependencies: deps,
c_args: cflags,
link_with: test_unit[2]
)
test(name, exe)
endforeach
incs = [
top_inc,
shared_inc,
libnm_core_inc,
libnm_inc
]
# just test, that we can build "nm-vpn-plugin-utils.c"
libnm_vpn_plugin_utils_test = static_library(
'nm-vpn-plugin-utils-test',
sources: shared_vpn_plugin_utils + [libnm_enums_h],
include_directories: incs,
dependencies: glib_dep
)

98
man/meson.build Normal file
View file

@ -0,0 +1,98 @@
common_conf = configuration_data()
common_conf.set('NM_VERSION', nm_version)
common_conf.set('sysconfdir', nm_sysconfdir)
common_conf.set('nmrundir', nm_pkgrundir)
common_conf.set('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT', config_default_main_auth_polkit)
common_conf.set('NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT', config_logging_backend_default)
common_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit)
common_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default)
common_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
common = 'common.ent'
configure_file(
input: common + '.in',
output: common,
configuration: common_conf
)
xsltproc_options = [
xsltproc,
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30'
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
mans = [
['NetworkManager', '8'],
['NetworkManager.conf', '5'],
['nm-online', '1'],
['nmcli-examples', '7'],
['nmcli', '1'],
['nmtui', '1']
]
if enable_ovs
mans += [['nm-openvswitch', '7']]
endif
foreach man: mans
input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input)
output = '@0@.@1@'.format(man[0], man[1])
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1])
)
endforeach
if enable_introspection
mans = [
['nm-settings-keyfile', '5', nm_settings_keyfile_docs],
['nm-settings', '5', nm_settings_docs]
]
if enable_ifcfg_rh
mans += [['nm-settings-ifcfg-rh', '5', nm_settings_ifcfg_rh_docs]]
endif
foreach man: mans
output = man[0] + '.xml'
input = custom_target(
output,
input: man[2],
output: output,
command: xsltproc_options + [join_paths(meson.current_source_dir(), man[0] + '.xsl'), '@INPUT@']
)
content_files += input.full_path()
output = '@0@.@1@'.format(man[0], man[1])
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1])
)
endforeach
endif

1136
meson.build Normal file

File diff suppressed because it is too large Load diff

79
meson_options.txt Normal file
View file

@ -0,0 +1,79 @@
# system paths
option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files')
option('system_ca_path', type: 'string', value: '/etc/ssl/certs', description: 'path to system CA certificates')
option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory. Set to \'no\' not to install the udev rule')
option('dbus_conf_dir', type: 'string', value: '', description: 'where D-Bus system.d directory is')
option('dbus_ifaces_dir', type: 'string', value: '', description: 'where D-Bus interfaces directory is')
option('dbus_sys_dir', type: 'string', value: '', description: 'where D-Bus system service directory is')
option('polkit_dir', type: 'string', value: '', description: 'where PolicyKit policy directory is')
option('kernel_firmware_dir', type: 'string', value: '/lib/firmware', description: 'where kernel firmware directory is (default is /lib/firmware)')
option('iptables', type: 'string', value: '', description: 'path to iptables')
option('dnsmasq', type: 'string', value: '', description: 'path to dnsmasq')
option('dnssec_trigger', type: 'string', value: '', description: 'path to unbound dnssec-trigger-script')
# platform
option('dist_version', type: 'string', value: '', description: 'Define the NM\'s distribution version string')
option('consolekit', type: 'boolean', value: true, description: 'Support consolekit session tracking')
option('session_tracking', type: 'combo', choices: ['systemd', 'elogind', 'no'], value: 'systemd', description: 'Compatibility option to choose one session tracking module')
option('suspend_resume', type: 'boolean', value: true, description: 'Build NetworkManager with specific suspend/resume support')
option('polkit', type: 'combo', choices: ['yes', 'no', 'disabled'], value: 'yes', description: 'set default value for auth-polkit configuration option. This value can be overwritten by NM configuration. \'disabled\' compiles NM without any support')
option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections')
option('polkit_agent', type: 'boolean', value: false, description: 'enable polkit agent for clients')
option('selinux', type: 'boolean', value: true, description: 'Build with SELinux')
option('systemd_journal', type: 'boolean', value: true, description: 'Use systemd journal for logging')
option('config_logging_backend_default', type: 'combo', choices: ['default', 'debug', 'syslog', 'journal', 'journal-syslog-style'], value: 'default', description: 'Default value for logging.backend')
option('hostname_persist', type: 'combo', choices: ['default', 'suse', 'gentoo', 'slackware'], value: 'default', description: 'Hostname persist method')
option('libaudit', type: 'combo', choices: ['yes', 'yes-disabled-by-default', 'no'], value: 'yes', description: 'Build with audit daemon support. yes-disabled-by-default enables support, but disables it unless explicitly configured via NetworkManager.conf')
# features
option('wext', type: 'boolean', value: true, description: 'Enable or disable Linux Wireless Extensions')
option('wifi', type: 'boolean', value: true, description: 'enable Wi-Fi support')
option('iwd', type: 'boolean', value: false, description: 'enable iwd support (experimental)')
option('ppp', type: 'boolean', value: true, description: 'enable PPP/PPPoE support')
option('pppd', type: 'string', value: '', description: 'path to pppd binary')
option('pppd_plugin_dir', type: 'string', value: '', description: 'path to the pppd plugins directory')
option('modem_manager', type: 'boolean', value: true, description: 'Enable new ModemManager1 interface support')
option('ofono', type: 'boolean', value: false, description: 'Enable oFono support (experimental)')
option('concheck', type: 'boolean', value: true, description: 'enable connectivity checking support')
option('teamdctl', type: 'boolean', value: false, description: 'enable Teamd control support')
option('ovs', type: 'boolean', value: true, description: 'enable OpenVSwitch support')
option('libnm_glib', type: 'boolean', value: true, description: 'don\'t build legacy libraries')
option('nmcli', type: 'boolean', value: true, description: 'Build nmcli')
option('nmtui', type: 'boolean', value: true, description: 'Build nmtui')
option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support')
# configuration plugins
option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset')
option('config_plugin_ibft', type: 'boolean', value: true, description: 'enable ibft configuration plugin')
option('ifcfg_rh', type: 'boolean', value: false, description: 'enable ifcfg-rh configuration plugin (Fedora/RHEL)')
option('ifcfg_suse', type: 'boolean', value: false, description: 'enable ifcfg-suse configuration plugin (SUSE) (deprecated)')
option('ifupdown', type: 'boolean', value: false, description: 'enable ifupdown configuration plugin (Debian/Ubuntu)')
option('ifnet', type: 'boolean', value: false, description: 'enable ifnet configuration plugin (Gentoo)')
# handlers for resolv.conf
option('resolvconf', type: 'string', value: '', description: 'Enable resolvconf support')
option('netconfig', type: 'string', value: '', description: 'Enable SUSE netconfig support')
option('config_dns_rc_manager_default', type: 'combo', choices: ['symlink', 'file', 'netconfig', 'resolvconf'], value: 'symlink', description: 'Configure default value for main.rc-manager setting')
# dhcp clients
option('dhcpcanon', type: 'string', value: '', description: 'Enable dhcpcanon support (experimental)')
option('dhclient', type: 'string', value: '', description: 'Enable dhclient 4.x support')
option('dhcpcd', type: 'string', value: '', description: 'Enable dhcpcd 4.x support')
option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient', 'dhcpcd', 'internal'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset')
option('dhcpcd_supports_ipv6', type: 'boolean', value: true, description: 'Whether using dhcpcd >= 6.x which has IPv6 support')
# miscellaneous
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
option('vapi', type: 'boolean', value: true, description: 'build Vala bindings')
option('docs', type: 'boolean', value: false, description: 'use to build documentation')
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
option('more_asserts', type: 'string', value: 'all', description: 'Enable more assertions for debugging (0 = none, 100 = all, default: all)')
option('more_logging', type: 'boolean', value: true, description: 'Enable more debug logging')
option('valgrind', type: 'string', value: 'no', description: 'Use valgrind to memory-check the tests')
option('valgrind_suppressions', type: 'string', value: '', description: 'Use specific valgrind suppression file')
option('ld_gc', type: 'boolean', value: true, description: 'Enable garbage collection of unused symbols on linking')
option('libpsl', type: 'boolean', value: true, description: 'Link against libpsl')
option('json_validation', type: 'boolean', value: true, description: 'Enable JSON validation in libnm')
option('crypto', type: 'combo', choices: ['nss', 'gnutls'], value: 'nss', description: 'Cryptography library to use for certificate and key operations')
option('qt', type: 'boolean', value: true, description: 'enable Qt examples')
option('check_settings_docs', type: 'boolean', value: false, description: 'compare check settings-docs.c file')

46
meson_post_install.py Normal file
View file

@ -0,0 +1,46 @@
#!/usr/bin/env python3
import os
import sys
if not os.environ.get('DESTDIR'):
datadir = sys.argv[1]
bindir = sys.argv[2]
pkgconfdir = sys.argv[3]
pkglibdir = sys.argv[4]
localstatedir = sys.argv[5]
completions_dir = os.path.join(datadir, 'bash-completion', 'completions')
os.rename(os.path.join(completions_dir, 'nmcli-completion'), os.path.join(completions_dir, 'nmcli'))
nmtui_alias = ['nmtui-connect', 'nmtui-edit', 'nmtui-hostname']
src = os.path.join(bindir, 'nmtui')
[os.symlink(src, os.path.join(bindir, dst))
for dst in nmtui_alias]
dst_dirs = [
os.path.join(pkgconfdir, 'conf.d'),
os.path.join(pkgconfdir, 'system-connections'),
os.path.join(pkgconfdir, 'dispatcher.d', 'no-wait.d'),
os.path.join(pkgconfdir, 'dispatcher.d', 'pre-down.d'),
os.path.join(pkgconfdir, 'dispatcher.d', 'pre-up.d'),
os.path.join(pkgconfdir, 'dnsmasq.d'),
os.path.join(pkgconfdir, 'dnsmasq-shared.d'),
os.path.join(pkglibdir, 'conf.d'),
os.path.join(pkglibdir, 'VPN'),
os.path.join(localstatedir, 'lib', 'NetworkManager')
]
[os.makedirs(dst_dir)
for dst_dir in dst_dirs
if not os.path.exists(dst_dir)]
if sys.argv[6] == 'install_docs':
mandir = sys.argv[7]
src = os.path.join(mandir, 'man1', 'nmtui.1')
[os.symlink(src, os.path.join(mandir, 'man1', dst + '.1'))
for dst in nmtui_alias]
src = os.path.join(mandir, 'man5', 'NetworkManager.conf.5')
dst = os.path.join(mandir, 'man5', 'nm-system-settings.conf.5')
os.symlink(src, dst)

1
po/meson.build Normal file
View file

@ -0,0 +1 @@
i18n.gettext(nm_name, preset: 'glib')

39
shared/meson.build Normal file
View file

@ -0,0 +1,39 @@
shared_inc = include_directories(
'.',
'nm-utils'
)
version_conf = configuration_data()
version_conf.set('NM_MAJOR_VERSION', nm_major_version)
version_conf.set('NM_MINOR_VERSION', nm_minor_version)
version_conf.set('NM_MICRO_VERSION', nm_micro_version)
version = 'nm-version-macros.h'
version_header = configure_file(
input: version + '.in',
output: version,
configuration: version_conf
)
shared_meta_setting = files('nm-meta-setting.c')
shared_test_utils = files('nm-test-utils-impl.c')
shared_siphash = files('nm-utils/siphash24.c')
shared_udev_utils = files('nm-utils/nm-udev-utils.c')
shared_utils = files(
'nm-utils/nm-enum-utils.c',
'nm-utils/nm-hash-utils.c',
'nm-utils/nm-random-utils.c',
'nm-utils/nm-shared-utils.c'
)
shared_vpn_plugin_utils = files('nm-utils/nm-vpn-plugin-utils.c')
shared_sources = shared_utils + shared_meta_setting + shared_udev_utils + files(
'nm-utils/c-list-util.c',
'nm-utils/nm-dedup-multi.c'
)

View file

@ -0,0 +1,40 @@
sources = files(
'nm-atm-manager.c',
'nm-device-adsl.c'
)
deps = [
core_dep,
libnmdbus_dep,
libudev_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
libnm_device_plugin_adsl = shared_module(
'nm-device-plugin-adsl',
sources: sources,
dependencies: deps,
link_args: ldflags,
link_depends: linker_script_devices,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_device_plugin_adsl
run_target(
'check-local-devices-adsl',
command: [check_exports, libnm_device_plugin_adsl.full_path(), linker_script_devices],
depends: libnm_device_plugin_adsl
)
# FIXME: check_so_symbols replacement
'''
check-local-devices-adsl: src/devices/adsl/libnm-device-plugin-adsl.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/adsl/.libs/libnm-device-plugin-adsl.so "$(srcdir)/linker-script-devices.ver"
$(call check_so_symbols,$(builddir)/src/devices/adsl/.libs/libnm-device-plugin-adsl.so)
'''

View file

@ -0,0 +1,51 @@
sources = files(
'nm-bluez-device.c',
'nm-bluez-manager.c',
'nm-bluez4-adapter.c',
'nm-bluez4-manager.c',
'nm-bluez5-manager.c',
'nm-bt-error.c',
'nm-device-bt.c'
)
deps = [
core_dep,
libnm_wwan_dep,
libnmdbus_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
if enable_bluez5_dun
sources += files('nm-bluez5-dun.c')
deps += bluez5_dep
endif
libnm_device_plugin_bluetooth = shared_module(
'nm-device-plugin-bluetooth',
sources: sources,
dependencies: deps,
link_args: ldflags,
link_depends: linker_script_devices,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_device_plugin_bluetooth
run_target(
'check-local-devices-bluetooth',
command: [check_exports, libnm_device_plugin_bluetooth.full_path(), linker_script_devices],
depends: libnm_device_plugin_bluetooth
)
# FIXME: check_so_symbols replacement
'''
check-local-devices-bluetooth: src/devices/bluetooth/libnm-device-plugin-bluetooth.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/bluetooth/.libs/libnm-device-plugin-bluetooth.so "$(srcdir)/linker-script-devices.ver"
$(call check_so_symbols,$(builddir)/src/devices/bluetooth/.libs/libnm-device-plugin-bluetooth.so)
'''

22
src/devices/meson.build Normal file
View file

@ -0,0 +1,22 @@
subdir('adsl')
if enable_modem_manager
subdir('wwan')
subdir('bluetooth')
endif
if enable_wifi
subdir('wifi')
endif
if enable_teamdctl
subdir('team')
endif
if enable_ovs
subdir('ovs')
endif
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,46 @@
sources = files(
'nm-device-ovs-bridge.c',
'nm-device-ovs-interface.c',
'nm-device-ovs-port.c',
'nm-ovsdb.c',
'nm-ovs-factory.c'
)
deps = [
core_dep,
jansson_dep,
libnmdbus_dep
]
cflags = '-DRUNSTATEDIR="@0@"'.format(nm_runstatedir)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
libnm_device_plugin_ovs = shared_module(
'nm-device-plugin-ovs',
sources: sources,
dependencies: deps,
c_args: cflags,
link_args: ldflags,
link_depends: linker_script_devices,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_device_plugin_ovs
run_target(
'check-local-devices-ovs',
command: [check_exports, libnm_device_plugin_ovs.full_path(), linker_script_devices],
depends: libnm_device_plugin_ovs
)
# FIXME: check_so_symbols replacement
'''
check-local-devices-ovs: src/devices/ovs/libnm-device-plugin-ovs.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/ovs/.libs/libnm-device-plugin-ovs.so "$(srcdir)/linker-script-devices.ver"
$(call check_so_symbols,$(builddir)/src/devices/ovs/.libs/libnm-device-plugin-ovs.so)
'''

View file

@ -0,0 +1,41 @@
sources = files(
'nm-device-team.c',
'nm-team-factory.c'
)
deps = [
core_dep,
jansson_dep,
libnmdbus_dep,
libteamdctl_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
libnm_device_plugin_team = shared_module(
'nm-device-plugin-team',
sources: sources,
dependencies: deps,
link_args: ldflags,
link_depends: linker_script_devices,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_device_plugin_team
run_target(
'check-local-devices-team',
command: [check_exports, libnm_device_plugin_team.full_path(), linker_script_devices],
depends: libnm_device_plugin_team
)
# FIXME: check_so_symbols replacement
'''
check-local-devices-team: src/devices/team/libnm-device-plugin-team.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/team/.libs/libnm-device-plugin-team.so "$(srcdir)/linker-script-devices.ver"
$(call check_so_symbols,$(builddir)/src/devices/team/.libs/libnm-device-plugin-team.so)
'''

View file

@ -0,0 +1,14 @@
test_units = [
'test-arping',
'test-lldp'
]
foreach test_unit: test_units
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep
)
test(test_unit, exe)
endforeach

View file

@ -0,0 +1,56 @@
common_sources = files(
'nm-wifi-ap.c',
'nm-wifi-utils.c'
)
sources = common_sources + files(
'nm-wifi-factory.c',
'nm-device-wifi.c',
'nm-device-olpc-mesh.c'
)
if enable_iwd
sources += files(
'nm-device-iwd.c',
'nm-iwd-manager.c',
)
endif
deps = [
core_dep,
libnmdbus_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
libnm_device_plugin_wifi = shared_module(
'nm-device-plugin-wifi',
sources: sources,
dependencies: deps,
link_args: ldflags,
link_depends: linker_script_devices,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_device_plugin_wifi
run_target(
'check-local-devices-wifi',
command: [check_exports, libnm_device_plugin_wifi.full_path(), linker_script_devices],
depends: libnm_device_plugin_wifi
)
# FIXME: check_so_symbols replacement
'''
check-local-devices-wifi: src/devices/wifi/libnm-device-plugin-wifi.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/wifi/.libs/libnm-device-plugin-wifi.so "$(srcdir)/linker-script-devices.ver"
$(call check_so_symbols,$(builddir)/src/devices/wifi/.libs/libnm-device-plugin-wifi.so)
'''
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,11 @@
test_unit = 'test-general'
name = 'wifi-' + test_unit
exe = executable(
name,
[test_unit + '.c'] + common_sources,
dependencies: test_core_dep
)
test(name, exe)

View file

@ -0,0 +1,85 @@
sources = files(
'nm-modem-broadband.c',
'nm-modem.c',
'nm-modem-manager.c'
)
deps = [
core_dep,
libsystemd_dep,
mm_glib_dep
]
if enable_ofono
sources += files('nm-modem-ofono.c')
endif
symbol_name = join_paths(meson.current_source_dir(), 'libnm-wwan.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_name)
endif
libnm_wwan = shared_module(
'nm-wwan',
sources: sources,
dependencies: deps,
link_args: ldflags,
link_depends: symbol_name,
install: true,
install_dir: nm_pkglibdir
)
libnm_wwan_dep = declare_dependency(
link_with: libnm_wwan,
include_directories: include_directories('.')
)
core_plugins += libnm_wwan
run_target(
'check-wwan',
command: [check_exports, libnm_wwan.full_path(), symbol_name],
depends: libnm_wwan
)
sources = files(
'nm-device-modem.c',
'nm-wwan-factory.c'
)
deps += libnmdbus_dep
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
libnm_device_plugin_wwan = shared_module(
'nm-device-plugin-wwan',
sources: sources,
dependencies: deps,
link_with: libnm_wwan,
link_args: ldflags,
link_depends: linker_script_devices,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_device_plugin_wwan
run_target(
'check-local-devices-wwan',
command: [check_exports, libnm_device_plugin_wwan.full_path(), linker_script_devices],
depends: libnm_device_plugin_wwan
)
# FIXME: check_so_symbols replacement
'''
check-local-devices-wwan: src/devices/wwan/libnm-device-plugin-wwan.la src/devices/wwan/libnm-wwan.la
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/wwan/.libs/libnm-device-plugin-wwan.so "$(srcdir)/linker-script-devices.ver"
$(call check_so_symbols,$(builddir)/src/devices/wwan/.libs/libnm-device-plugin-wwan.so)
$(srcdir)/tools/check-exports.sh $(builddir)/src/devices/wwan/.libs/libnm-wwan.so "$(srcdir)/src/devices/wwan/libnm-wwan.ver"
$(call check_so_symbols,$(builddir)/src/devices/wwan/.libs/libnm-wwan.so)
'''

27
src/dhcp/meson.build Normal file
View file

@ -0,0 +1,27 @@
name = 'nm-dhcp-helper'
cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(name),
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
executable(
name,
name + '.c',
include_directories: core_incs,
dependencies: glib_dep,
c_args: cflags,
link_args: ldflags,
link_depends: linker_script_binary,
install: true,
install_dir: nm_libexecdir
)
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,17 @@
test_units = [
'test-dhcp-dhclient',
'test-dhcp-utils'
]
cflags = '-DTESTDIR="@0@"'.format(meson.current_source_dir())
foreach test_unit: test_units
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags
)
test(test_unit, exe)
endforeach

View file

@ -0,0 +1,12 @@
test_unit = 'test-dnsmasq-utils'
cflags = '-DTESTDIR="@0@"'.format(meson.source_root())
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags
)
test(test_unit, exe)

327
src/meson.build Normal file
View file

@ -0,0 +1,327 @@
src_inc = include_directories('.')
install_data(
'org.freedesktop.NetworkManager.conf',
install_dir: dbus_conf_dir
)
subdir('systemd')
core_cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(nm_name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON'
]
core_incs = [
top_inc,
shared_inc,
libnm_core_inc,
src_inc
]
core_dep = declare_dependency(
sources: libnm_core_enums_h,
include_directories: core_incs,
dependencies: glib_dep,
compile_args: core_cflags
)
core_plugins = []
common_cflags = [
'-DPREFIX="@0@"'.format(nm_prefix),
'-DBINDIR="@0@"'.format(nm_bindir),
'-DDATADIR="@0@"'.format(nm_datadir),
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
'-DLOCALSTATEDIR="@0@"'.format(nm_localstatedir),
'-DRUNSTATEDIR="@0@"'.format(nm_runstatedir),
'-DSBINDIR="@0@"'.format(nm_sbindir),
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir),
'-DRUNDIR="@0@"'.format(nm_pkgrundir),
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
'-DNMLOCALEDIR="@0@"'.format(nm_localedir),
'-DNMPLUGINDIR="@0@"'.format(nm_pkglibdir),
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
'-DNMSTATEDIR="@0@"'.format(nm_pkgstatedir),
'-DNMLIBDIR="@0@"'.format(nm_pkglibdir),
'-DDHCPCANON_PATH="@0@"'.format(dhcpcanon_path),
'-DDHCLIENT_PATH="@0@"'.format(dhclient_path),
'-DDHCPCD_PATH="@0@"'.format(dhcpcd_path)
]
sources = files(
'dhcp/nm-dhcp-client.c',
'dhcp/nm-dhcp-manager.c',
'dhcp/nm-dhcp-systemd.c',
'dhcp/nm-dhcp-utils.c',
'ndisc/nm-lndp-ndisc.c',
'ndisc/nm-ndisc.c',
'platform/wifi/wifi-utils-nl80211.c',
'platform/wifi/wifi-utils.c',
'platform/nm-linux-platform.c',
'platform/nm-platform.c',
'platform/nm-platform-utils.c',
'platform/nmp-netns.c',
'platform/nmp-object.c',
'main-utils.c',
'NetworkManagerUtils.c',
'nm-core-utils.c',
'nm-exported-object.c',
'nm-ip4-config.c',
'nm-ip6-config.c',
'nm-logging.c'
)
deps = [
core_dep,
libnl_dep,
libnmdbus_dep,
libsystemd_dep,
libudev_dep
]
if enable_wext
sources += files('platform/wifi/wifi-utils-wext.c')
endif
libnetwork_manager_base = static_library(
'NetworkManagerBase',
sources: sources,
dependencies: deps,
c_args: common_cflags,
link_with: libnm_core
)
sources = files(
'devices/nm-arping-manager.c',
'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',
'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',
'nm-bus-manager.c',
'nm-checkpoint.c',
'nm-checkpoint-manager.c',
'nm-config.c',
'nm-config-data.c',
'nm-dcb.c',
'nm-dhcp4-config.c',
'nm-dhcp6-config.c',
'nm-dispatcher.c',
'nm-firewall-manager.c',
'nm-hostname-manager.c',
'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',
'nm-sleep-monitor.c'
)
deps = [
core_dep,
dl_dep,
libndp_dep,
libnl_dep,
libudev_dep
]
if enable_concheck
sources += files('nm-connectivity.c')
deps += libcurl_dep
endif
if enable_libaudit
deps += libaudit_dep
endif
if enable_libpsl
deps += libpsl_dep
endif
if enable_selinux
deps += selinux_dep
endif
if enable_session_tracking
deps += logind_dep
endif
libnetwork_manager = static_library(
'NetworkManager',
sources: sources,
dependencies: deps,
c_args: common_cflags,
link_with: [libnetwork_manager_base, libsystemd_nm]
)
ldflags = ['-rdynamic']
# FIXME: this doesn't work and it depends on libtool
'''
src/NetworkManager.ver: src/libNetworkManager.la $(core_plugins)
$(AM_V_GEN) NM="$(NM)" "$(srcdir)/tools/create-exports-NetworkManager.sh" --called-from-make "$(srcdir)"
src_NetworkManager_LDFLAGS = \
-rdynamic \
-Wl,--version-script="src/NetworkManager.ver"
nm = find_program('gcc-nm', 'nm')
create_exports_networkmanager = join_paths(meson.source_root(), 'tools', 'create-exports-NetworkManager.sh')
symbol_map_name = 'NetworkManager.ver'
symbol_map = custom_target(
symbol_map_name,
input: meson.source_root(),
output: symbol_map_name,
capture: true,
#command: ['NM=' + nm.path(), create_exports_networkmanager, '--called-from-make', '@INPUT@']
command: [create_exports_networkmanager, '--called-from-make', '@INPUT@']
)
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
'''
network_manager = executable(
meson.project_name(),
'main.c',
dependencies: deps,
c_args: common_cflags,
link_with: libnetwork_manager,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: nm_sbindir
)
deps = [
core_dep,
dl_dep,
libndp_dep,
libnl_dep,
libudev_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
name = 'nm-iface-helper'
executable(
name,
name + '.c',
dependencies: deps,
c_args: common_cflags,
link_with: [libnetwork_manager_base, libsystemd_nm],
link_args: ldflags,
link_depends: linker_script_binary,
install: true,
install_dir: nm_libexecdir
)
if enable_tests
sources = files(
'ndisc/nm-fake-ndisc.c',
'platform/tests/test-common.c',
'platform/nm-fake-platform.c'
)
deps = [
core_dep,
libnl_dep,
libudev_dep
]
test_cflags = []
if require_root_tests
test_cflags += ['-DREQUIRE_ROOT_TESTS=1']
endif
platform = (host_machine.system().contains('linux') ? 'linux' : 'fake')
test_cflags_platform = '-DSETUP=nm_' + platform + '_platform_setup'
libnetwork_manager_test = static_library(
'NetworkManagerTest',
sources: sources,
dependencies: deps,
c_args: test_cflags,
link_with: libnetwork_manager
)
test_core_dep = declare_dependency(
dependencies: core_dep,
compile_args: test_cflags,
link_with: libnetwork_manager_test
)
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')

View file

@ -0,0 +1,15 @@
test_units = [
'test-ndisc-fake',
'test-ndisc-linux'
]
foreach test_unit: test_units
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: test_cflags_platform
)
test(test_unit, exe)
endforeach

View file

@ -0,0 +1,34 @@
test_units = [
['test-link-fake', 'test-link.c'],
['test-link-linux', 'test-link.c'],
['test-address-fake', 'test-address.c'],
['test-address-linux', 'test-address.c'],
['test-general', 'test-general.c'],
['test-nmp-object', 'test-nmp-object.c'],
['test-route-fake', 'test-route.c'],
['test-route-linux', 'test-route.c'],
['test-cleanup-fake', 'test-cleanup.c'],
['test-cleanup-linux', 'test-cleanup.c'],
]
foreach test_unit: test_units
name = 'platform-' + test_unit[0]
exe = executable(
name,
test_unit[1],
dependencies: test_core_dep,
c_args: test_cflags_platform
)
test(name, exe)
endforeach
test = 'monitor'
executable(
test,
test + '.c',
dependencies: test_core_dep,
c_args: test_cflags_platform
)

49
src/ppp/meson.build Normal file
View file

@ -0,0 +1,49 @@
name = 'nm-pppd-plugin'
deps = [
dl_dep,
glib_dep
]
cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON'
]
nm_pppd_plugin = shared_module(
name,
name_prefix: '',
sources: [name + '.c', libnm_core_enums_h],
include_directories: core_incs,
dependencies: deps,
c_args: cflags,
install: true,
install_dir: pppd_plugin_dir
)
name = 'nm-ppp-plugin'
deps = [
core_dep,
libnmdbus_dep
]
cflags = '-DPPPD_PLUGIN_DIR="@0@"'.format(pppd_plugin_dir)
symbol_map = join_paths(meson.current_source_dir(), name + '.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
core_plugins += shared_module(
name,
sources: 'nm-ppp-manager.c',
dependencies: deps,
c_args: cflags,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_dir: nm_pkglibdir
)

View file

@ -0,0 +1,53 @@
name = 'nm-settings-plugin-ibft'
cflags = [
'-DSBINDIR="@0@"'.format(nm_sbindir),
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
]
libnms_ibft_core = static_library(
'nms-ibft-core',
'nms-ibft-reader.c',
dependencies: core_dep,
c_args: cflags
)
sources = files(
'nms-ibft-connection.c',
'nms-ibft-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
libnm_settings_plugin_ibft = shared_module(
name,
sources: sources,
dependencies: core_dep,
c_args: cflags,
link_with: libnms_ibft_core,
link_args: ldflags,
link_depends: linker_script_settings,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_settings_plugin_ibft
# FIXME: check_so_symbols replacement
'''
run_target(
'check-local-symbols-settings-ibft',
command: [check_so_symbols, libnm_settings_plugin_ibft.full_path()],
depends: libnm_settings_plugin_ibft
)
check-local-symbols-settings-ibft: src/settings/plugins/ibft/libnm-settings-plugin-ibft.la
$(call check_so_symbols,$(builddir)/src/settings/plugins/ibft/.libs/libnm-settings-plugin-ibft.so)
'''
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,18 @@
test_unit = 'test-ibft'
test_ibft_dir = meson.current_source_dir()
cflags = [
'-DTEST_IBFT_DIR="@0@"'.format(test_ibft_dir),
'-DTEST_SCRATCH_DIR="@0@"'.format(test_ibft_dir)
]
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags,
link_with: libnms_ibft_core
)
test(test_unit, exe)

View file

@ -0,0 +1,82 @@
install_data(
'nm-ifcfg-rh.conf',
install_dir: dbus_conf_dir
)
cflags = [
'-DSBINDIR="@0@"'.format(nm_sbindir),
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
]
name = 'nmdbus-ifcfg-rh'
dbus_sources = gnome.gdbus_codegen(
name,
'nm-ifcfg-rh.xml',
interface_prefix: 'com.redhat',
namespace: 'NMDBus'
)
libnmdbus_ifcfg_rh = static_library(
name,
sources: dbus_sources,
dependencies: glib_dep,
c_args: cflags
)
sources = files(
'nm-inotify-helper.c',
'nms-ifcfg-rh-reader.c',
'nms-ifcfg-rh-utils.c',
'nms-ifcfg-rh-writer.c',
'shvar.c'
)
deps = [
core_dep,
crypto_dep
]
libnms_ifcfg_rh_core = static_library(
'nms-ifcfg-rh-core',
sources: sources,
dependencies: deps,
c_args: cflags
)
sources = [dbus_sources] + files('nms-ifcfg-rh-connection.c')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
libnm_settings_plugin_ifcfg_rh = shared_module(
'nm-settings-plugin-ifcfg-rh',
sources: sources,
dependencies: deps,
c_args: cflags,
link_with: [libnmdbus_ifcfg_rh, libnms_ifcfg_rh_core],
link_args: ldflags,
link_depends: linker_script_settings,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_settings_plugin_ifcfg_rh
# FIXME: check_so_symbols replacement
'''
run_target(
'check-local-symbols-settings-ifcfg-rh',
command: [check_so_symbols, libnm_settings_plugin_ifcfg_rh.full_path()],
depends: libnm_settings_plugin_ifcfg_rh
)
check-local-symbols-settings-ifcfg-rh: src/settings/plugins/ifcfg-rh/libnm-settings-plugin-ifcfg-rh.la
$(call check_so_symbols,$(builddir)/src/settings/plugins/ifcfg-rh/.libs/libnm-settings-plugin-ifcfg-rh.so)
'''
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,18 @@
test_unit = 'test-ifcfg-rh'
test_ifcfg_dir = meson.current_source_dir()
cflags = [
'-DTEST_IFCFG_DIR="@0@"'.format(test_ifcfg_dir),
'-DTEST_SCRATCH_DIR="@0@"'.format(test_ifcfg_dir)
]
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags,
link_with: libnms_ifcfg_rh_core
)
test(test_unit, exe)

View file

@ -0,0 +1,58 @@
sources = files(
'nms-ifnet-connection-parser.c',
'nms-ifnet-net-parser.c',
'nms-ifnet-net-utils.c',
'nms-ifnet-wpa-parser.c'
)
cflags = [
'-DSBINDIR="@0@"'.format(nm_sbindir),
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
]
libnms_ifnet_core = static_library(
'nms-ifnet-core',
sources: sources,
dependencies: core_dep,
c_args: cflags
)
sources = files(
'nms-ifnet-connection.c',
'nms-ifnet-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
libnm_settings_plugin_ifnet = shared_module(
'nm-settings-plugin-ifnet',
sources: sources,
dependencies: core_dep,
c_args: cflags,
link_with: libnms_ifnet_core,
link_args: ldflags,
link_depends: linker_script_settings,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_settings_plugin_ifnet
# FIXME: check_so_symbols replacement
'''
run_target(
'check-local-symbols-settings-ifnet',
command: [check_so_symbols, libnm_settings_plugin_ifnet.full_path()],
depends: libnm_settings_plugin_ifnet
)
check-local-symbols-settings-ifnet: src/settings/plugins/ifnet/libnm-settings-plugin-ifnet.la
$(call check_so_symbols,$(builddir)/src/settings/plugins/ifnet/.libs/libnm-settings-plugin-ifnet.so)
'''
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,20 @@
test_unit = 'test-ifnet'
test_ifnet_dir = meson.current_source_dir()
cflags = [
'-DSYSCONFDIR="nonexistent"',
'-DTEST_IFNET_DIR="@0@"'.format(test_ifnet_dir),
'-DTEST_SCRATCH_DIR="@0@"'.format(test_ifnet_dir),
'-DTEST_WPA_SUPPLICANT_CONF="@0@"'.format(join_paths(test_ifnet_dir, 'wpa_supplicant.conf'))
]
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags,
link_with: libnms_ifnet_core
)
test(test_unit, exe)

View file

@ -0,0 +1,58 @@
sources = files(
'nms-ifupdown-interface-parser.c',
'nms-ifupdown-parser.c'
)
deps = [
core_dep,
libudev_dep
]
cflags = '-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
libnms_ifupdown_core = static_library(
'nms-ifupdown-core',
sources: sources,
dependencies: deps,
c_args: cflags
)
sources = files(
'nms-ifupdown-connection.c',
'nms-ifupdown-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
libnm_settings_plugin_ifupdown = shared_module(
'nm-settings-plugin-ifupdown',
sources: sources,
dependencies: deps,
c_args: cflags,
link_with: libnms_ifupdown_core,
link_args: ldflags,
link_depends: linker_script_settings,
install: true,
install_dir: nm_pkglibdir
)
core_plugins += libnm_settings_plugin_ifupdown
# FIXME: check_so_symbols replacement
'''
run_target(
'check-local-symbols-settings-ifupdown',
command: [check_so_symbols, libnm_settings_plugin_ifupdown.full_path()],
depends: libnm_settings_plugin_ifupdown
)
check-local-symbols-settings-ifupdown: src/settings/plugins/ifupdown/libnm-settings-plugin-ifupdown.la
$(call check_so_symbols,$(builddir)/src/settings/plugins/ifupdown/.libs/libnm-settings-plugin-ifupdown.so)
'''
if enable_tests
subdir('tests')
endif

View file

@ -0,0 +1,13 @@
test_unit = 'test-ifupdown'
cflags = '-DTEST_ENI_DIR="@0@"'.format(meson.current_source_dir())
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags,
link_with: libnms_ifupdown_core
)
test(test_unit, exe)

View file

@ -0,0 +1,17 @@
test_unit = 'test-keyfile'
test_keyfiles_dir = join_paths(meson.current_source_dir(), 'keyfiles')
cflags = [
'-DTEST_KEYFILES_DIR="@0@"'.format(test_keyfiles_dir),
'-DTEST_SCRATCH_DIR="@0@"'.format(test_keyfiles_dir)
]
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: cflags
)
test(test_unit, exe)

View file

@ -0,0 +1,19 @@
if enable_tests
subdir('keyfile/tests')
endif
if enable_ifcfg_rh
subdir('ifcfg-rh')
endif
if enable_ifupdown
subdir('ifupdown')
endif
if enable_ifnet
subdir('ifnet')
endif
if enable_config_plugin_ibft
subdir('ibft')
endif

View file

@ -0,0 +1,10 @@
test_unit = 'test-supplicant-config'
exe = executable(
test_unit,
test_unit + '.c',
dependencies: test_core_dep,
c_args: '-DTEST_CERT_DIR="@0@"'.format(join_paths(meson.current_source_dir(), 'certs'))
)
test(test_unit, exe)

76
src/systemd/meson.build Normal file
View file

@ -0,0 +1,76 @@
sources = files(
'sd-adapt/nm-sd-adapt.c',
'src/basic/alloc-util.c',
'src/basic/escape.c',
'src/basic/ether-addr-util.c',
'src/basic/extract-word.c',
'src/basic/fd-util.c',
'src/basic/fileio.c',
'src/basic/fs-util.c',
'src/basic/hash-funcs.c',
'src/basic/hashmap.c',
'src/basic/hexdecoct.c',
'src/basic/hostname-util.c',
'src/basic/in-addr-util.c',
'src/basic/io-util.c',
'src/basic/mempool.c',
'src/basic/parse-util.c',
'src/basic/path-util.c',
'src/basic/prioq.c',
'src/basic/process-util.c',
'src/basic/random-util.c',
'src/basic/socket-util.c',
'src/basic/string-table.c',
'src/basic/string-util.c',
'src/basic/strv.c',
'src/basic/time-util.c',
'src/basic/utf8.c',
'src/basic/util.c',
'src/libsystemd-network/arp-util.c',
'src/libsystemd-network/dhcp-identifier.c',
'src/libsystemd-network/dhcp-network.c',
'src/libsystemd-network/dhcp-option.c',
'src/libsystemd-network/dhcp-packet.c',
'src/libsystemd-network/dhcp6-network.c',
'src/libsystemd-network/dhcp6-option.c',
'src/libsystemd-network/lldp-neighbor.c',
'src/libsystemd-network/lldp-network.c',
'src/libsystemd-network/network-internal.c',
'src/libsystemd-network/sd-dhcp-client.c',
'src/libsystemd-network/sd-dhcp-lease.c',
'src/libsystemd-network/sd-dhcp6-client.c',
'src/libsystemd-network/sd-dhcp6-lease.c',
'src/libsystemd-network/sd-ipv4acd.c',
'src/libsystemd-network/sd-ipv4ll.c',
'src/libsystemd-network/sd-lldp.c',
'src/libsystemd/sd-event/sd-event.c',
'src/libsystemd/sd-id128/id128-util.c',
'src/libsystemd/sd-id128/sd-id128.c',
'src/shared/dns-domain.c',
'nm-sd.c'
)
incs = [
top_inc,
shared_inc,
libnm_core_inc,
libnm_inc,
src_inc,
include_directories(
'sd-adapt',
'src/basic',
'src/libsystemd-network',
'src/shared',
'src/systemd'
)
]
cflags = '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD'
libsystemd_nm = static_library(
'systemd-nm',
sources: sources + [libnm_core_enums_h],
include_directories: incs,
dependencies: glib_dep,
c_args: cflags
)

View file

@ -0,0 +1,22 @@
test_unit = 'test-config'
sources = files(
'nm-test-device.c',
'test-config.c'
)
test_config_dir = meson.current_source_dir()
cflags = [
'-DSRCDIR="@0@"'.format(test_config_dir),
'-DBUILDDIR="@0@"'.format(test_config_dir)
]
exe = executable(
test_unit,
sources,
dependencies: test_core_dep,
c_args: cflags
)
test(test_unit, exe)

40
src/tests/meson.build Normal file
View file

@ -0,0 +1,40 @@
subdir('config')
test_units = [
'test-general',
'test-general-with-expect',
'test-ip4-config',
'test-ip6-config',
'test-dcb',
'test-resolvconf-capture',
'test-wired-defname',
'test-utils'
]
foreach test_unit: test_units
name = 'tests-' + test_unit
exe = executable(
name,
test_unit + '.c',
dependencies: test_core_dep
)
test(name, exe)
endforeach
test_unit = 'test-systemd'
name = 'tests-' + test_unit
cflags = '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD'
exe = executable(
name,
[test_unit + '.c', libnm_core_enums_h] + shared_siphash,
include_directories: core_incs,
dependencies: glib_dep,
c_args: cflags,
link_with: libsystemd_nm
)
test(name, exe)

29
vapi/meson.build Normal file
View file

@ -0,0 +1,29 @@
gnome.generate_vapi(
'libnm',
sources: libnm_gir[0],
packages: 'gio-2.0',
install: true
)
if enable_libnm_glib
packages = [
'dbus-glib-1',
'gio-2.0'
]
libnm_util_vapi = gnome.generate_vapi(
'libnm-util',
sources: libnm_util_gir[0],
packages: packages,
install: true
)
packages += libnm_util_vapi
gnome.generate_vapi(
'libnm-glib',
sources: libnm_glib_gir[0],
packages: packages,
install: true
)
endif