From 03637ad8b5d21fcc12a536a25caf46445aabde73 Mon Sep 17 00:00:00 2001 From: Iñigo Martínez Date: Sat, 25 Nov 2017 11:39:06 +0100 Subject: 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 --- check-distro.py | 11 + clients/cli/meson.build | 59 ++ clients/common/meson.build | 92 ++ clients/common/tests/meson.build | 18 + clients/meson.build | 44 + clients/tui/meson.build | 82 ++ clients/tui/newt/meson.build | 35 + config.h.meson | 260 ++++++ data/meson.build | 79 ++ dispatcher/meson.build | 82 ++ dispatcher/tests/meson.build | 21 + docs/api/meson.build | 32 + docs/libnm-glib/meson.build | 42 + docs/libnm-util/meson.build | 36 + docs/libnm/meson.build | 55 ++ docs/meson.build | 12 + examples/C/glib/meson.build | 27 + examples/C/qt/meson.build | 47 + introspection/meson.build | 98 ++ libnm-core/meson.build | 200 ++++ libnm-core/tests/meson.build | 65 ++ libnm-glib/meson.build | 326 +++++++ libnm-glib/tests/meson.build | 36 + libnm-util/meson.build | 220 +++++ libnm-util/tests/meson.build | 51 + libnm/fake-typelib/meson.build | 30 + libnm/meson.build | 316 +++++++ libnm/tests/meson.build | 53 ++ man/meson.build | 98 ++ meson.build | 1136 +++++++++++++++++++++++ meson_options.txt | 79 ++ meson_post_install.py | 46 + po/meson.build | 1 + shared/meson.build | 39 + src/devices/adsl/meson.build | 40 + src/devices/bluetooth/meson.build | 51 + src/devices/meson.build | 22 + src/devices/ovs/meson.build | 46 + src/devices/team/meson.build | 41 + src/devices/tests/meson.build | 14 + src/devices/wifi/meson.build | 56 ++ src/devices/wifi/tests/meson.build | 11 + src/devices/wwan/meson.build | 85 ++ src/dhcp/meson.build | 27 + src/dhcp/tests/meson.build | 17 + src/dnsmasq/tests/meson.build | 12 + src/meson.build | 327 +++++++ src/ndisc/tests/meson.build | 15 + src/platform/tests/meson.build | 34 + src/ppp/meson.build | 49 + src/settings/plugins/ibft/meson.build | 53 ++ src/settings/plugins/ibft/tests/meson.build | 18 + src/settings/plugins/ifcfg-rh/meson.build | 82 ++ src/settings/plugins/ifcfg-rh/tests/meson.build | 18 + src/settings/plugins/ifnet/meson.build | 58 ++ src/settings/plugins/ifnet/tests/meson.build | 20 + src/settings/plugins/ifupdown/meson.build | 58 ++ src/settings/plugins/ifupdown/tests/meson.build | 13 + src/settings/plugins/keyfile/tests/meson.build | 17 + src/settings/plugins/meson.build | 19 + src/supplicant/tests/meson.build | 10 + src/systemd/meson.build | 76 ++ src/tests/config/meson.build | 22 + src/tests/meson.build | 40 + vapi/meson.build | 29 + 65 files changed, 5208 insertions(+) create mode 100755 check-distro.py create mode 100644 clients/cli/meson.build create mode 100644 clients/common/meson.build create mode 100644 clients/common/tests/meson.build create mode 100644 clients/meson.build create mode 100644 clients/tui/meson.build create mode 100644 clients/tui/newt/meson.build create mode 100644 config.h.meson create mode 100644 data/meson.build create mode 100644 dispatcher/meson.build create mode 100644 dispatcher/tests/meson.build create mode 100644 docs/api/meson.build create mode 100644 docs/libnm-glib/meson.build create mode 100644 docs/libnm-util/meson.build create mode 100644 docs/libnm/meson.build create mode 100644 docs/meson.build create mode 100644 examples/C/glib/meson.build create mode 100644 examples/C/qt/meson.build create mode 100644 introspection/meson.build create mode 100644 libnm-core/meson.build create mode 100644 libnm-core/tests/meson.build create mode 100644 libnm-glib/meson.build create mode 100644 libnm-glib/tests/meson.build create mode 100644 libnm-util/meson.build create mode 100644 libnm-util/tests/meson.build create mode 100644 libnm/fake-typelib/meson.build create mode 100644 libnm/meson.build create mode 100644 libnm/tests/meson.build create mode 100644 man/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 meson_post_install.py create mode 100644 po/meson.build create mode 100644 shared/meson.build create mode 100644 src/devices/adsl/meson.build create mode 100644 src/devices/bluetooth/meson.build create mode 100644 src/devices/meson.build create mode 100644 src/devices/ovs/meson.build create mode 100644 src/devices/team/meson.build create mode 100644 src/devices/tests/meson.build create mode 100644 src/devices/wifi/meson.build create mode 100644 src/devices/wifi/tests/meson.build create mode 100644 src/devices/wwan/meson.build create mode 100644 src/dhcp/meson.build create mode 100644 src/dhcp/tests/meson.build create mode 100644 src/dnsmasq/tests/meson.build create mode 100644 src/meson.build create mode 100644 src/ndisc/tests/meson.build create mode 100644 src/platform/tests/meson.build create mode 100644 src/ppp/meson.build create mode 100644 src/settings/plugins/ibft/meson.build create mode 100644 src/settings/plugins/ibft/tests/meson.build create mode 100644 src/settings/plugins/ifcfg-rh/meson.build create mode 100644 src/settings/plugins/ifcfg-rh/tests/meson.build create mode 100644 src/settings/plugins/ifnet/meson.build create mode 100644 src/settings/plugins/ifnet/tests/meson.build create mode 100644 src/settings/plugins/ifupdown/meson.build create mode 100644 src/settings/plugins/ifupdown/tests/meson.build create mode 100644 src/settings/plugins/keyfile/tests/meson.build create mode 100644 src/settings/plugins/meson.build create mode 100644 src/supplicant/tests/meson.build create mode 100644 src/systemd/meson.build create mode 100644 src/tests/config/meson.build create mode 100644 src/tests/meson.build create mode 100644 vapi/meson.build diff --git a/check-distro.py b/check-distro.py new file mode 100755 index 0000000000..b84acac7d5 --- /dev/null +++ b/check-distro.py @@ -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) diff --git a/clients/cli/meson.build b/clients/cli/meson.build new file mode 100644 index 0000000000..373bf75c35 --- /dev/null +++ b/clients/cli/meson.build @@ -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 +) diff --git a/clients/common/meson.build b/clients/common/meson.build new file mode 100644 index 0000000000..f1741d2cf6 --- /dev/null +++ b/clients/common/meson.build @@ -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 diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build new file mode 100644 index 0000000000..a60a7a46fe --- /dev/null +++ b/clients/common/tests/meson.build @@ -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) diff --git a/clients/meson.build b/clients/meson.build new file mode 100644 index 0000000000..6c00fc0a28 --- /dev/null +++ b/clients/meson.build @@ -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 diff --git a/clients/tui/meson.build b/clients/tui/meson.build new file mode 100644 index 0000000000..2ed137b260 --- /dev/null +++ b/clients/tui/meson.build @@ -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 +) diff --git a/clients/tui/newt/meson.build b/clients/tui/newt/meson.build new file mode 100644 index 0000000000..2920a8f9fe --- /dev/null +++ b/clients/tui/newt/meson.build @@ -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('.') +) diff --git a/config.h.meson b/config.h.meson new file mode 100644 index 0000000000..1e79fa50ba --- /dev/null +++ b/config.h.meson @@ -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 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 does not define. */ +#mesondefine pid_t diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000000..e493e5154b --- /dev/null +++ b/data/meson.build @@ -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 diff --git a/dispatcher/meson.build b/dispatcher/meson.build new file mode 100644 index 0000000000..20e64e628f --- /dev/null +++ b/dispatcher/meson.build @@ -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 diff --git a/dispatcher/tests/meson.build b/dispatcher/tests/meson.build new file mode 100644 index 0000000000..6e2beb1f82 --- /dev/null +++ b/dispatcher/tests/meson.build @@ -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) diff --git a/docs/api/meson.build b/docs/api/meson.build new file mode 100644 index 0000000000..904adc0ab7 --- /dev/null +++ b/docs/api/meson.build @@ -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 +) diff --git a/docs/libnm-glib/meson.build b/docs/libnm-glib/meson.build new file mode 100644 index 0000000000..c2a21d8f15 --- /dev/null +++ b/docs/libnm-glib/meson.build @@ -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 +) diff --git a/docs/libnm-util/meson.build b/docs/libnm-util/meson.build new file mode 100644 index 0000000000..fb8042072a --- /dev/null +++ b/docs/libnm-util/meson.build @@ -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 +) diff --git a/docs/libnm/meson.build b/docs/libnm/meson.build new file mode 100644 index 0000000000..c275455e40 --- /dev/null +++ b/docs/libnm/meson.build @@ -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 +) diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 0000000000..78ace8b297 --- /dev/null +++ b/docs/meson.build @@ -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 diff --git a/examples/C/glib/meson.build b/examples/C/glib/meson.build new file mode 100644 index 0000000000..f6412643e5 --- /dev/null +++ b/examples/C/glib/meson.build @@ -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 diff --git a/examples/C/qt/meson.build b/examples/C/qt/meson.build new file mode 100644 index 0000000000..d92205b1bd --- /dev/null +++ b/examples/C/qt/meson.build @@ -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 diff --git a/introspection/meson.build b/introspection/meson.build new file mode 100644 index 0000000000..cac63bc77a --- /dev/null +++ b/introspection/meson.build @@ -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('.') +) diff --git a/libnm-core/meson.build b/libnm-core/meson.build new file mode 100644 index 0000000000..13155138fd --- /dev/null +++ b/libnm-core/meson.build @@ -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 \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 diff --git a/libnm-core/tests/meson.build b/libnm-core/tests/meson.build new file mode 100644 index 0000000000..92ecd22330 --- /dev/null +++ b/libnm-core/tests/meson.build @@ -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 \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 diff --git a/libnm-glib/meson.build b/libnm-glib/meson.build new file mode 100644 index 0000000000..4c3e68937a --- /dev/null +++ b/libnm-glib/meson.build @@ -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 \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 \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 diff --git a/libnm-glib/tests/meson.build b/libnm-glib/tests/meson.build new file mode 100644 index 0000000000..8e0fc7bb1d --- /dev/null +++ b/libnm-glib/tests/meson.build @@ -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 diff --git a/libnm-util/meson.build b/libnm-util/meson.build new file mode 100644 index 0000000000..bca88a91e9 --- /dev/null +++ b/libnm-util/meson.build @@ -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 \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 diff --git a/libnm-util/tests/meson.build b/libnm-util/tests/meson.build new file mode 100644 index 0000000000..387b0db922 --- /dev/null +++ b/libnm-util/tests/meson.build @@ -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 diff --git a/libnm/fake-typelib/meson.build b/libnm/fake-typelib/meson.build new file mode 100644 index 0000000000..c0a779a2fd --- /dev/null +++ b/libnm/fake-typelib/meson.build @@ -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 +) diff --git a/libnm/meson.build b/libnm/meson.build new file mode 100644 index 0000000000..6abfaf580a --- /dev/null +++ b/libnm/meson.build @@ -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 \n#include \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 diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build new file mode 100644 index 0000000000..28f91772f5 --- /dev/null +++ b/libnm/tests/meson.build @@ -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 +) diff --git a/man/meson.build b/man/meson.build new file mode 100644 index 0000000000..044ddcaba4 --- /dev/null +++ b/man/meson.build @@ -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 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..c1c8f4a57b --- /dev/null +++ b/meson.build @@ -0,0 +1,1136 @@ +project( + 'NetworkManager', 'c', + version: '1.11.1', + license: 'GPL2+', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=gnu99' + ], + meson_version: '>= 0.43.0' +) + +nm_name = meson.project_name() + +nm_version = meson.project_version() +version_array = nm_version.split('.') +nm_major_version = version_array[0].to_int() +nm_minor_version = version_array[1].to_int() +nm_micro_version = version_array[2].to_int() + +nm_id_prefix = 'NM' + +nm_gir_version = '1.0' + +nm_prefix = get_option('prefix') +nm_bindir = join_paths(nm_prefix, get_option('bindir')) +nm_datadir = join_paths(nm_prefix, get_option('datadir')) +nm_includedir = join_paths(nm_prefix, get_option('includedir')) +nm_libdir = join_paths(nm_prefix, get_option('libdir')) +nm_libexecdir = join_paths(nm_prefix, get_option('libexecdir')) +nm_localedir = join_paths(nm_prefix, get_option('localedir')) +nm_localstatedir = join_paths(nm_prefix, get_option('localstatedir')) +nm_mandir = join_paths(nm_prefix, get_option('mandir')) +nm_runstatedir = join_paths(nm_localstatedir, 'run') +nm_sbindir = join_paths(nm_prefix, get_option('sbindir')) +nm_sysconfdir = join_paths(nm_prefix, get_option('sysconfdir')) + +nm_pkgsbindir = join_paths(nm_sbindir, nm_name) +nm_pkgconfdir = join_paths(nm_sysconfdir, nm_name) +nm_pkgdatadir = join_paths(nm_datadir, nm_name) +nm_pkgincludedir = join_paths(nm_includedir, nm_name) +nm_pkglibdir = join_paths(nm_libdir, nm_name) +nm_pkgrundir = join_paths(nm_runstatedir, nm_name) +nm_pkgstatedir = join_paths(nm_localstatedir, nm_name) + +current = 1 +revision = 0 +age = 1 +libnm_version = '@0@.@1@.@2@'.format(current - age, age, revision) + +libnm_pkgincludedir = join_paths(nm_includedir, 'libnm') + +current = 9 +revision = 0 +age = 7 +libnm_util_version = '@0@.@1@.@2@'.format(current - age, age, revision) + +current = 13 +revision = 0 +age = 9 +libnm_glib_version = '@0@.@1@.@2@'.format(current - age, age, revision) + +libnm_glib_pkgincludedir = join_paths(nm_includedir, 'libnm-glib') + +current = 3 +revision = 0 +age = 2 +libnm_glib_vpn_version = '@0@.@1@.@2@'.format(current - age, age, revision) + +nm_debug = get_option('buildtype').contains('debug') + +cc = meson.get_compiler('c') + +config_h = configuration_data() + +# defines +set_defines = [ + ['GETTEXT_PACKAGE', nm_name], + ['PACKAGE_STRING', '@0@ @1@'.format(nm_name, nm_version)], + ['VERSION', nm_version] +] + +foreach define: set_defines + config_h.set_quoted(define[0], define[1]) +endforeach + +# headers +config_h.set10('HAVE_SYS_AUXV_H', cc.has_header('sys/auxv.h')) + +use_sys_random = cc.has_function('getrandom', prefix: '#include') +config_h.set10('USE_SYS_RANDOM_H', use_sys_random) +config_h.set10('HAVE_GETRANDOM', use_sys_random or cc.has_function('getrandom', prefix: '#include')) + +# functions +# FIXME secure_getenv check is not useful? +config_h.set('HAVE_SECURE_GETENV', cc.has_function('secure_getenv')) +config_h.set('HAVE___SECURE_GETENV', cc.has_function('__secure_getenv')) +config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include')) + +# types +config_h.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix: '#include')) +config_h.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix: '#include')) + +if not cc.has_type('pid_t', prefix: '#include') + config_h.set('pid_t', 'int') +endif + +# compiler flags +common_flags = [] +common_ldflags = [] + +enable_ld_gc = get_option('ld_gc') +if enable_ld_gc + test_cflags = [ + '-fdata-sections', + '-ffunction-sections', + ] + + test_ldflags = ['-Wl,--gc-sections'] + + foreach cflag: test_cflags + test_ldflags + assert(cc.has_argument(cflag), 'Unused symbol eviction requested but not supported. Use -Dld_gc=false to build without it.') + endforeach + + common_flags += test_cflags + common_ldflags += test_ldflags +endif + +if nm_debug + test_cflags = [ + '-fno-strict-aliasing', + '-Wdeclaration-after-statement', + '-Wfloat-equal', + '-Wimplicit-fallthrough', + '-Winit-self', + '-Wlogical-op', + '-Wmissing-declarations', + '-Wmissing-include-dirs', + '-Wmissing-prototypes', + '-Wno-duplicate-decl-specifier', + '-Wno-format-truncation', + '-Wno-missing-braces', + '-Wno-missing-field-initializers', + '-Wno-pragmas', + '-Wno-sign-compare', + '-Wno-unused-but-set-variable', + '-Wno-unused-parameter', + '-Wparentheses-equality', + '-Wpointer-arith', + '-Wshadow', + '-Wstrict-prototypes', + '-Wtypedef-redefinition', + '-Wundef', + '-Wunknown-attributes' + ] + + common_flags += cc.get_supported_arguments(test_cflags) +endif + +add_project_arguments(common_flags, language: 'c') +add_project_link_arguments(common_ldflags, language: 'c') + +ldflag = '-Wl,--version-script' +have_version_script = host_machine.system().contains('linux') and cc.has_argument(ldflag) + +if have_version_script + linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver') + linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver') + linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver') +endif + +uuid_dep = dependency('uuid') +libelogind_dep = dependency('libelogind', version: '>= 219', required: false) +libudev_dep = dependency('libudev', version: '>= 175') +dbus_dep = dependency('dbus-1', version: '>= 1.1') +libndp_dep = dependency('libndp') + +# libnl support for the linux platform +libnl_dep = dependency('libnl-3.0', version: '>= 3.2.8', required: false) + +jansson_dep = dependency('jansson', required: false) +config_h.set10('WITH_JANSSON', jansson_dep.found()) + +libsystemd_dep = dependency('libsystemd', version: '>= 209', required: false) +config_h.set10('HAVE_LIBSYSTEMD', libsystemd_dep.found()) + +systemd_dep = dependency('systemd', required: false) +have_systemd_200 = systemd_dep.found() and systemd_dep.version().version_compare('>= 200') + +gio_unix_dep = dependency('gio-unix-2.0', version: '>= 2.32') + +log_driver = join_paths(meson.source_root(), 'build-aux', (gio_unix_dep.version().version_compare('>= 2.37.6') ? 'tap-driver.sh' : 'test-driver')) + +# FIXME: same version? which version? +# GLIB_VERSION_MIN_REQUIRED should match the version above. +# GLIB_VERSION_MAX_ALLOWED should be set to the same version; +# nm-glib.h will cause it to be overridden for the functions +# we have compat versions of. +glib_dep = declare_dependency( + dependencies: [ + gio_unix_dep, + dependency('gmodule-2.0') + ], + compile_args: [ + '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32', + '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32' + ] +) + +check_distro = join_paths(meson.source_root(), 'check-distro.py') + +redhat_releases = ['/etc/redhat-release', '/etc/fedora-release', '/etc/mandriva-release'] +if run_command(check_distro, redhat_releases).returncode() == 0 + distro = 'redhat' +elif run_command(check_distro, '/etc/SuSE-release').returncode() == 0 + distro = 'suse' +elif run_command(check_distro, '/etc/debian_version').returncode() == 0 + distro = 'debian' +elif run_command(check_distro, '/etc/gentoo-release').returncode() == 0 + distro = 'gentoo' +else + distro = 'unknown' +endif + +enable_ifcfg_rh = get_option('ifcfg_rh') or (distro == 'redhat') +enable_ifcfg_suse = get_option('ifcfg_suse') or (distro == 'suse') +enable_ifupdown = get_option('ifupdown') or (distro == 'debian') +enable_ifnet = get_option('ifnet') or (distro == 'gentoo') + +enable_config_plugin_ibft = get_option('config_plugin_ibft') +config_h.set10('WITH_SETTINGS_PLUGIN_IBFT', enable_config_plugin_ibft) + +config_plugins_default = get_option('config_plugins_default') +if config_plugins_default == '' + config_plugins = [] + + if enable_ifcfg_rh + config_plugins += ['ifcfg-rh'] + endif + + if enable_ifcfg_suse + config_plugins += ['ifcfg-suse'] + endif + + if enable_ifupdown + config_plugins += ['ifupdown'] + endif + + if enable_ifnet + config_plugins += ['ifnet'] + endif + + if enable_config_plugin_ibft + config_plugins += ['ibft'] + endif + + config_plugins_default = ','.join(config_plugins) +endif +config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_PLUGINS', config_plugins_default) + +# Distribution version string +dist_version = get_option('dist_version') +if dist_version != '' + config_h.set('NM_DIST_VERSION', dist_version) +endif + +enable_wifi = get_option('wifi') +if enable_wifi + nl80211_src = ''' + #ifndef __user + #define __user + #endif + #include + #include + #include + #include + int main() { + int a = NL80211_RATE_INFO_BITRATE; + a++; + } + ''' + + assert(cc.compiles(nl80211_src), 'Linux kernel development header linux/nl80211.h not installed or not functional') + + nl80211_crit_proto_src = ''' + #ifndef __user + #define __user + #endif + #include + #include + #include + #include + int main() { + unsigned a = NL80211_CMD_CRIT_PROTOCOL_START; + a++; + } + ''' + + config_h.set10('HAVE_NL80211_CRITICAL_PROTOCOL_CMDS', cc.compiles(nl80211_crit_proto_src)) +endif +config_h.set10('WITH_WIFI', enable_wifi) + +enable_iwd = get_option('iwd') +if enable_iwd + assert(enable_wifi, 'Enabling iwd support requires Wi-Fi support as well') +endif +config_h.set10('WITH_IWD', enable_iwd) + +# Default to using WEXT but allow it to be disabled +enable_wext = get_option('wext') +if enable_wext + assert(enable_wifi, 'Enabling WEXT support and disabling Wi-Fi makes no sense') + iwevgenie_src = ''' + #ifndef __user + #define __user + #endif + #include + #include + #include + #include + #ifndef IWEVGENIE + #error "not found" + #endif + ''' + + assert(cc.compiles(iwevgenie_src), 'Linux kernel development header linux/wireless.h not installed or not functional') +endif +config_h.set10('HAVE_WEXT', enable_wext) + +# FIXME: it's not used at all? +# Check for newer VLAN flags +vlan_src = ''' + #ifndef __user + #define __user + #endif + #include + #include + #include + int main() { + unsigned a = VLAN_FLAG_LOOSE_BINDING; + } +''' +config_h.set('HAVE_VLAN_FLAG_LOOSE_BINDING', cc.compiles(vlan_src)) + +# Checks for libdl - on certain platforms its part of libc +dl_dep = cc.find_library('dl') +''' +dl_deps = [] + +dl_dep = cc.find_library('dl') +if dl_dep.found() and cc.has_function('dlopen') + dl_deps += dl_dep +else + dl_dep = dependency('dl', required: false) + if dl_dep.found() and cc.has_function('dlopen', dependencies: dl_dep) + dl_deps += dl_dep + else + dld_dep = dependency('dld', required: false) + if dld_dep.found() and cc.has_function('dlopen', dependencies: dld_dep) + dl_deps += dld_dep + endif + endif +endif +''' + +# introspection support +enable_introspection = get_option('introspection') +if enable_introspection + gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.9.6', required: false) + assert(gir_dep.found(), 'introspection support was requested, but the gobject-introspection library is not available. Use -Dintrospection=false to build without it.') +endif + +enable_libnm_glib = get_option('libnm_glib') +if enable_libnm_glib + dbus_glib_dep = dependency('dbus-glib-1', version: '>= 0.94', required: false) + assert(dbus_dep.found() and dbus_glib_dep.found(), 'Configure with -Dlibnm_glib=false if you do not need the legacy libraries') +endif +# FIXME: do this better!!! +have_fake_typelibs = enable_libnm_glib and enable_introspection +config_h.set10('WITH_FAKE_TYPELIBS', have_fake_typelibs) + +udev_dir = get_option('udev_dir') +install_udev_dir = (udev_dir != 'no') + +if install_udev_dir and udev_dir == '' + udev_dir = dependency('udev').get_pkgconfig_variable('udevdir') +endif + +systemd_system_unit_dir = get_option('systemdsystemunitdir') +install_systemd_unit_dir = (systemd_system_unit_dir != 'no') + +if install_systemd_unit_dir and systemd_system_unit_dir == '' + assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it') + systemd_system_unit_dir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir') +endif +config_h.set10('HAVE_SYSTEMD', install_systemd_unit_dir) + +enable_systemd_journal = get_option('systemd_journal') +if enable_systemd_journal + assert(libsystemd_dep.found(), 'Missing systemd-journald support') +endif +config_h.set10('SYSTEMD_JOURNAL', enable_systemd_journal) + +config_logging_backend_default = get_option('config_logging_backend_default') +if config_logging_backend_default == 'default' + config_logging_backend_default = (enable_systemd_journal ? 'journal' : 'syslog') +endif +config_h.set_quoted('NM_CONFIG_DEFAULT_LOGGING_BACKEND', config_logging_backend_default) + +session_tracking = get_option('session_tracking') +session_trackers = [] +enable_session_tracking = (session_tracking != 'no') + +if enable_session_tracking + if session_tracking == 'systemd' + logind_dep = libsystemd_dep + if not logind_dep.found() + logind_dep = dependency('libsystemd-login', required: false) + assert(logind_dep.found(), 'You must have libsystemd or libsystemd-login installed to build with systemd-logind support') + endif + session_trackers += 'systemd-logind' + config_h.set('SESSION_TRACKING_SYSTEMD', true) + else + logind_dep = libelogind_dep + assert(logind_dep.found() and libelogind_dep.version().version_compare('>= 229'), 'You must have libelogind installed to build with elogind support.') + session_trackers += 'elogind' + config_h.set('SESSION_TRACKING_ELOGIND', true) + endif + + enable_consolekit = get_option('consolekit') + if enable_consolekit + session_trackers += 'consolekit' + config_h.set_quoted('CKDB_PATH', '/var/run/ConsoleKit/database') + config_h.set('SESSION_TRACKING_CONSOLEKIT', enable_consolekit) + endif +endif + +hostname_persist = get_option('hostname_persist') +config_h.set('HOSTNAME_PERSIST_SUSE', (hostname_persist == 'suse')) +config_h.set('HOSTNAME_PERSIST_GENTOO', (hostname_persist == 'gentoo')) +config_h.set('HOSTNAME_PERSIST_SLACKWARE', (hostname_persist == 'slackware')) + +enable_suspend_resume = get_option('suspend_resume') +suspend_resume = '' + +if enable_suspend_resume + if libsystemd_dep.found() + system_inhibit_dep = libsystemd_dep + suspend_resume = 'systemd' + config_h.set('SUSPEND_RESUME_SYSTEMD', true) + else + system_inhibit_dep = dependency('libsystemd-login', version: '>= 183', required: false) + if system_inhibit_dep.found() + suspend_resume = 'systemd' + config_h.set('SUSPEND_RESUME_SYSTEMD', true) + elif libelogind_dep.found() + system_inhibit_dep = libelogind_dep + suspend_resume = 'elogind' + config_h.set('SUSPEND_RESUME_ELOGIND', true) + elif enable_consolekit + suspend_resume = 'consolekit' + config_h.set('SUSPEND_RESUME_CONSOLEKIT', true) + else + suspend_resume = 'upower' + config_h.set('SUSPEND_RESUME_UPOWER', true) + endif + endif +endif + +# SELinux support +enable_selinux = get_option('selinux') +if enable_selinux + selinux_dep = dependency('libselinux', required: false) + assert(selinux_dep.found(), 'You must have libselinux installed to build. Use -Dselinux=false to disable it') +endif +config_h.set10('HAVE_SELINUX', enable_selinux) + +# libaudit support +libaudit = get_option('libaudit') +enable_libaudit = libaudit.contains('yes') +if enable_libaudit + libaudit_dep = dependency('audit', required: false) + assert(libaudit_dep.found(), 'You must have libaudit installed to build. Use -Dlibaudit=false to disable it') +endif +config_default_logging_audit = (libaudit == 'yes').to_string() +config_h.set_quoted('NM_CONFIG_DEFAULT_LOGGING_AUDIT', config_default_logging_audit) +config_h.set10('HAVE_LIBAUDIT', enable_libaudit) + +# Teamd control checks +enable_teamdctl = get_option('teamdctl') +if enable_teamdctl + assert(jansson_dep.found(), 'You must have jansson installed to build. Use -Dteamdctl=false to disable it') + libteamdctl_dep = dependency('libteamdctl', version: '>= 1.9') + assert(libteamdctl_dep.found(), 'You must have libteamdctl installed to build. Use -Dteamdctl=false to disable it') +endif + +enable_json_validation = get_option('json_validation') +if enable_json_validation + assert(jansson_dep.found(), 'jansson is needed for team configuration validation. Use -Djson_validation=false to disable it') +endif +config_h.set10('WITH_JSON_VALIDATION', enable_json_validation) + +# polkit +polkit = get_option('polkit') +enable_polkit = (polkit != 'no') + +if enable_polkit + polkit_dir = get_option('polkit_dir') + if polkit_dir == '' + polkit_dir = dependency('polkit-gobject-1').get_pkgconfig_variable('policydir') + endif +endif + +config_default_main_auth_polkit = (polkit == 'yes').to_string() +config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT', config_default_main_auth_polkit) +config_h.set10('WITH_POLKIT', enable_polkit) + +enable_modify_system = get_option('modify_system') + +enable_polkit_agent = get_option('polkit_agent') +if enable_polkit_agent + polkit_agent_dep = dependency('polkit-agent-1', version: '>= 0.97') +endif +config_h.set10('WITH_POLKIT_AGENT', enable_polkit_agent) + +# crypto +crypto = get_option('crypto') +if crypto == 'nss' + crypto_dep = dependency('nss') +else + crypto_dep = dependency('gnutls', version: '>= 2.12') +endif + +dbus_conf_dir = get_option('dbus_conf_dir') +if dbus_conf_dir == '' + assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid system bus config dir') + dbus_conf_dir = join_paths(dbus_dep.get_pkgconfig_variable('sysconfdir'), 'dbus-1', 'system.d') +endif + +dbus_ifaces_dir = get_option('dbus_ifaces_dir') +if dbus_ifaces_dir == '' + assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid interfaces dir') + dbus_ifaces_dir = dbus_dep.get_pkgconfig_variable('interfaces_dir') +endif + +dbus_sys_dir = get_option('dbus_sys_dir') +if dbus_sys_dir == '' + assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid system bus services dir') + dbus_sys_dir = dbus_dep.get_pkgconfig_variable('system_bus_services_dir') +endif + +# pppd +enable_ppp = get_option('ppp') +if enable_ppp + assert(cc.has_header('pppd/pppd.h'), 'couldn\'t find pppd.h. pppd development headers are required') + + pppd_path = get_option('pppd') + if pppd_path == '' + pppd = find_program('pppd', '/sbin/pppd', '/usr/sbin/pppd', required: false) + assert(pppd.found(), 'pppd required but not found, please provide a valid pppd path or use -Dppp=false to disable it') + pppd_path = pppd.path() + endif + + pppd_plugin_dir = get_option('pppd_plugin_dir') + if pppd_plugin_dir == '' + pppd_plugin_dir = join_paths(nm_libdir, 'pppd', '2.4.5') + endif +endif +config_h.set10('WITH_PPP', enable_ppp) + +# ModemManager1 with libmm-glib +enable_modem_manager = get_option('modem_manager') +if enable_modem_manager + mm_glib_dep = dependency('mm-glib', version: '>= 0.7.991') +endif + +# Bluez5 DUN support +enable_bluez5_dun = get_option('bluez5_dun') +if enable_bluez5_dun + bluez5_dep = dependency('bluez', version: '>= 5', required: false) + assert(bluez5_dep.found(), 'Bluez 5.x development headers are required') +endif +config_h.set10('WITH_BLUEZ5_DUN', enable_bluez5_dun) + +# OFONO +enable_ofono = get_option('ofono') +config_h.set10('WITH_OFONO', enable_ofono) + +# DHCP client support with dhcpcanon +dhcpcanon_path = get_option('dhcpcanon') +enable_dhcpcanon = (dhcpcanon_path != 'no') +if enable_dhcpcanon + if dhcpcanon_path == '' + name = 'dhcpcanon' + locations = [ + name, + '/sbin/' + name, + '/usr/sbin/' + name, + '/usr/local/sbin/' + name, + '/usr/bin/' + name, + '/usr/local/bin/' + name + ] + else + locations = dhcpcanon_path + endif + + dhcpcanon = find_program(locations, required: false) + enable_dhcpcanon = dhcpcanon.found() + dhcpcanon_path = (enable_dhcpcanon ? dhcpcanon.path() : '') +endif + +if enable_dhcpcanon + config_h.set_quoted('DHCPCANON_PATH', dhcpcanon_path) +endif +config_h.set10('WITH_DHCPCANON', enable_dhcpcanon) + +# DHCP client support +dhclient_path = get_option('dhclient') +enable_dhclient = (dhclient_path != 'no') +if enable_dhclient + if dhclient_path == '' + name = 'dhclient' + locations = [ + name, + '/sbin/' + name, + '/usr/sbin/' + name, + '/usr/local/sbin/' + name + ] + else + locations = dhclient_path + endif + + dhclient = find_program(locations, required: false) + enable_dhclient = dhclient.found() + dhclient_path = (enable_dhclient ? dhclient.path() : '') +endif + +if enable_dhclient + res = run_command(dhclient, '--version') + # FIXME: dhcp outputs the version string through stderr!? + if not res.stderr().strip().contains('isc-dhclient-4.') + message('Seems version of dhclient ' + dhclient_path + ' is too old, version 4.x or newer is required') + endif + config_h.set_quoted('DHCLIENT_PATH', dhclient_path) +endif +config_h.set10('WITH_DHCLIENT', enable_dhclient) + +dhcpcd_path = get_option('dhcpcd') +enable_dhcpcd = (dhcpcd_path != 'no') +if enable_dhcpcd + if dhcpcd_path == '' + name = 'dhcpcd' + locations = [ + name, + '/sbin/' + name, + '/usr/sbin/' + name, + '/usr/local/sbin/' + name + ] + else + locations = dhcpcd_path + endif + + dhcpcd = find_program(locations, required: false) + enable_dhcpcd = dhcpcd.found() + dhcpcd_path = (enable_dhcpcd ? dhcpcd.path() : '') +endif + +enable_dhcpcd_supports_ipv6 = false +if enable_dhcpcd + res = run_command(dhcpcd, '--version').stdout().strip() + dhcpcd_version = res.split(' ')[1] + if not dhcpcd_version.version_compare('> 4') + message('Seems version of dhcpcd ' + dhcpcd_path + ' is too old, version 4.x or newer is required') + endif + + enable_dhcpcd_supports_ipv6 = get_option('dhcpcd_supports_ipv6') + if dhcpcd_version.version_compare('> 6') + if not enable_dhcpcd_supports_ipv6 + message('Seems version of dhcpcd ' + dhcpcd_path + ' supports IPv6, but compiling without IPv6 support.') + endif + else + if enable_dhcpcd_supports_ipv6 + message('Seems version of dhcpcd ' + dhcpcd_path +' does not support IPv6, but compiling with IPv6 support.') + endif + endif + config_h.set('DHCPCD_SUPPORTS_IPV6', enable_dhcpcd_supports_ipv6) + config_h.set_quoted('DHCPCD_PATH', dhcpcd_path) +endif +config_h.set10('WITH_DHCPCD', enable_dhcpcd) + +config_dhcp_default = get_option('config_dhcp_default') +if config_dhcp_default == 'dhcpcanon' and not enable_dhcpcanon + error(config_dhcp_default + ' has not been enabled. Please don\'t disable it or use another configuration option for main.dhcp setting') +endif + +if config_dhcp_default == 'dhclient' and not enable_dhclient + error(config_dhcp_default + ' has not been enabled. Please don\'t disable it or use another configuration option for main.dhcp setting') +endif + +if config_dhcp_default == 'dhcpcd' and not enable_dhcpcd + error(config_dhcp_default + ' has not been enabled. Please don\'t disable it or use another configuration option for main.dhcp setting') +endif + +config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) + +# OpenVSwitch integration +enable_ovs = get_option('ovs') +if enable_ovs + assert(jansson_dep.found(), 'jansson is needed for OpenVSwitch integration. Use -Dovs=false to disable it') +endif + +# resolvconf and netconfig support +resolvconf_path = get_option('resolvconf') +enable_resolvconf = (resolvconf_path != 'no') +if enable_resolvconf + if resolvconf_path == '' + name = 'resolvconf' + locations = [ + name, + '/sbin/' + name, + '/usr/sbin/' + name, + '/usr/local/sbin/' + name + ] + else + locations = resolvconf_path + endif + + resolvconf = find_program(locations, required: false) + enable_resolvconf = resolvconf.found() +endif +if enable_resolvconf + config_h.set_quoted('RESOLVCONF_PATH', resolvconf.path()) +endif + +netconfig_path = get_option('netconfig') +enable_netconfig = (netconfig_path != 'no') +if enable_netconfig + if netconfig_path == '' + name = 'netconfig' + locations = [ + name, + '/sbin/' + name, + '/usr/sbin/' + name, + '/usr/local/sbin/' + name + ] + else + locations = netconfig_path + endif + + netconfig = find_program(locations, required: false) + enable_netconfig = netconfig.found() +endif +if enable_netconfig + config_h.set_quoted('NETCONFIG_PATH', netconfig.path()) +endif + +config_dns_rc_manager_default = get_option('config_dns_rc_manager_default') +if config_dns_rc_manager_default == 'resolvconf' and not enable_resolvconf + error(config_dns_rc_manager_default + ' has not been enabled. Please don\'t disable it or use another configuration option for main.rc-manager setting') +endif + +if config_dns_rc_manager_default == 'netconfig' and not enable_netconfig + error(config_dns_rc_manager_default + ' has not been enabled. Please don\'t disable it or use another configuration option for main.rc-manager setting') +endif + +config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default) + +# iptables path +iptables_path = get_option('iptables') +if iptables_path == '' + iptables_path = find_program('iptables', '/sbin/iptables', '/usr/sbin/iptables').path() +endif +config_h.set_quoted('IPTABLES_PATH', iptables_path) + +# dnsmasq path +dnsmasq_path = get_option('dnsmasq') +if dnsmasq_path == '' + dnsmasq_path = find_program('dnsmasq', '/sbin/dnsmasq', '/usr/sbin/dnsmasq').path() +endif +config_h.set_quoted('DNSMASQ_PATH', dnsmasq_path) + +# dnssec-trigger-script path +dnssec_trigger_path = get_option('dnssec_trigger') +if dnssec_trigger_path == '' + locations = [ + 'dnssec-trigger-script', + '/usr/local/libexec/dnssec-trigger-script', + '/usr/local/lib/dnssec-trigger-script', + '/usr/local/lib/dnssec-trigger/dnssec-trigger-script', + '/usr/libexec/dnssec-trigger-script', + '/usr/lib/dnssec-trigger-script', + '/usr/lib/dnssec-trigger/dnssec-trigger-script' + ] + + dnssec_trigger_script = find_program(locations, required: false) + dnssec_trigger_path = (dnssec_trigger_script.found() ? dnssec_trigger_script.path() : '/usr/libexec/dnssec-trigger-script') +endif +config_h.set_quoted('DNSSEC_TRIGGER_SCRIPT', dnssec_trigger_path) + +# system CA certificates path +system_ca_path = get_option('system_ca_path') +config_h.set_quoted('SYSTEM_CA_PATH', system_ca_path) + +# kernel firmware dir +kernel_firmware_dir = get_option('kernel_firmware_dir') +config_h.set_quoted('KERNEL_FIRMWARE_DIR', kernel_firmware_dir) + +enable_libpsl = get_option('libpsl') +if enable_libpsl + libpsl_dep = dependency('libpsl', version: '>= 0.1') +endif +config_h.set10('WITH_LIBPSL', enable_libpsl) + +enable_concheck = get_option('concheck') +if enable_concheck + libcurl_dep = dependency('libcurl', version: '>= 7.24.0', required: false) + assert(libcurl_dep.found(), 'concheck requires libcurl library. Use -Dconcheck=false to disable it') +endif +config_h.set10('WITH_CONCHECK', enable_concheck) + +enable_nmcli = get_option('nmcli') +if enable_nmcli + # FIXME: check for readline + # AX_LIB_READLINE + readline_dep = declare_dependency(link_args: '-lreadline') + ''' + foreach readline_lib: ['-lreadline', '-ledit', '-leditline'] + if not is_variable('readline_dep') + foreach termcap_lib: ['', '-lncurses', '-ltermcap', '-lcurses'] + test_dep = declare_dependency(link_args: ' '.join([readline_lib, termcap_lib])) + if cc.has_function('readline', dependencies: test_dep) and cc.has_header('readline', dependencies: test_dep) + readline_dep = test_dep + endif + endforeach + endif + endforeach + ''' + assert(readline_dep.found(), 'readline library with terminfo support is required (one of readline, edit, or editline, AND one of ncurses, curses, or termcap)') +endif + +enable_nmtui = get_option('nmtui') +if enable_nmtui + newt_dep = dependency('libnewt', version: '>= 0.52.15', required: false) + assert(newt_dep.found(), 'You must have libnewt installed to build nmtui. Use -Dnmtui=false to disable it') +endif + +more_asserts = get_option('more_asserts') +if more_asserts == 'no' + more_asserts = 0 +elif more_asserts == 'all' + more_asserts = 100 +else + more_asserts = more_asserts.to_int() +endif +config_h.set('NM_MORE_ASSERTS', more_asserts) + +more_logging = get_option('more_logging') +config_h.set10('NM_MORE_LOGGING', more_logging) + +generic_support_src = 'int main() { int a = 0; int b = _Generic (a, int: 4); return b + a; };' +config_h.set10('_NM_CC_SUPPORT_GENERIC', cc.compiles(generic_support_src)) + +auto_support_src = 'int main() { int a = 0; __auto_type b = a; return b + a; };' +config_h.set10('_NM_CC_SUPPORT_AUTO_TYPE', cc.compiles(auto_support_src)) + +# Vala bindings +enable_vapi = get_option('vapi') +if enable_vapi + vala_req_version = '>= 0.17.1.24' + assert(add_languages('vala', required: false), 'vala is required to build. Use -Dvapi=false to disable it') + assert(meson.get_compiler('vala').version().version_compare(vala_req_version), 'vala ' + vala_req_version + ' is required to build. Use -Dvapi=false to disable it') +endif + +# Tests, utilities and documentation +tests = get_option('tests') +enable_tests = (tests != 'no') +require_root_tests = (tests == 'root') + +# valgrind +valgrind_path = get_option('valgrind') +if valgrind_path != 'no' + valgrind = find_program('valgrind', required: false) + valgrind_path = (valgrind.found() ? valgrind.path() : 'no') +endif + +enable_valgrind = (valgrind_path != 'no') +if enable_valgrind + valgrind_suppressions_path = get_option('valgrind_suppressions') + if valgrind_suppressions_path == '' + valgrind_suppressions_path = join_paths(meson.source_root(), 'valgrind.suppressions') + endif +endif + +# FIXME +#AC_SUBST(NM_LOG_COMPILER, 'LOG_COMPILER = "$(top_srcdir)/tools/run-nm-test.sh" --called-from-make "$(LIBTOOL)" "$(with_valgrind)" "'"$with_valgrind_suppressions"'" --launch-dbus=auto') + +py3 = import('python3') +python = py3.find_python() + +if python.found() + config_h.set_quoted('TEST_NM_PYTHON', python.path()) +endif + +# check if we can build setting property documentation +''' +build_docs=no +if test -n "$INTROSPECTION_MAKEFILE"; then + # If g-i is installed we know we have python, but we might not have pygobject + if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then + AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)]) + fi + + AC_PATH_PROG(PERL, perl) + if test -z "$PERL"; then + AC_MSG_ERROR([--enable-introspection requires perl]) + fi + AC_PATH_PROG(XSLTPROC, xsltproc) + if test -z "$XSLTPROC"; then + AC_MSG_ERROR([--enable-introspection requires xsltproc]) + fi + + have_introspection=yes + if test "$enable_gtk_doc" = "yes"; then + build_docs=yes + fi +else + if test "$enable_gtk_doc" = "yes"; then + # large parts of the documentation require introspection/pygobject to extract + # the documentation out of the source files. You cannot enable gtk-doc without alone. + AC_MSG_ERROR(["--with-gtk-doc requires --enable-introspection"]) + fi + have_introspection=no +fi +''' + +gnome = import('gnome') +i18n = import('i18n') +pkg = import('pkgconfig') + +po_dir = join_paths(meson.source_root(), 'po') + +intltool_merge = find_program('intltool-merge') +intltool_cache = join_paths(po_dir, '.intltool-merge-cache') +intltool_desktop_cmd = [intltool_merge, '-d', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@'] +intltool_xml_cmd = [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@'] + +perl = find_program('perl') +xsltproc = find_program('xsltproc') + +check_exports = join_paths(meson.source_root(), 'tools', 'check-exports.sh') + +content_files = [] + +# FIXME: every plugin calls to this: +''' +set_sanitizer_env = \ + [ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \ + if [ -n "$(1)" ] && echo $(CFLAGS) | grep -e -fsanitize=address ; then \ + export LD_PRELOAD="$${LD_PRELOAD}:$$(ldd $(1) | grep libasan\.so\.. -o | head -n 1)"; \ + fi + +check_so_symbols = \ + $(call set_sanitizer_env,$(1)); \ + LD_BIND_NOW=1 LD_PRELOAD=$${LD_PRELOAD}:$(1) $(builddir)/src/NetworkManager --version >/dev/null +''' + +top_inc = include_directories('.') + +subdir('introspection') +subdir('shared') +subdir('libnm-core') +subdir('libnm') + +install_headers( + libnm_core_headers + libnm_headers + libnm_headers_nointrospect + [version_header], + subdir: 'libnm' +) + +subdir('src') +subdir('dispatcher') +subdir('clients') +subdir('data') +subdir('po') + +if enable_libnm_glib + subdir('libnm-util') + subdir('libnm-glib') +endif + +if enable_vapi + subdir('vapi') +endif + +subdir('examples/C/glib') + +enable_qt = get_option('qt') +if enable_qt + add_languages('cpp') + subdir('examples/C/qt') +endif + +enable_docs = get_option('docs') +if enable_docs + subdir('man') + + #assert(enable_introspection, '-Dgtk_doc=true requires -Dintrospection=true') + + subdir('docs') +endif + +pkg.generate( + version: nm_version, + name: nm_name, + description: 'System for maintaining active network connection', + filebase: nm_name, + subdirs: nm_name, + requires: '', + variables: [ + 'exec_prefix=${prefix}', + 'libgnome_serverdir=' + nm_libexecdir, + 'plugindir=' + nm_pkglibdir, + 'configdir=' + nm_pkgconfdir + ], + install_dir: join_paths(nm_libdir, 'pkgconfig') +) + +config = 'config.h' + +configure_file( + input: config + '.meson', + output: config, + configuration: config_h +) + +meson.add_install_script( + 'meson_post_install.py', + nm_datadir, + nm_bindir, + nm_pkgconfdir, + nm_pkglibdir, + nm_localstatedir, + enable_docs ? 'install_docs' : '', + nm_mandir +) + +output = '\nSystem paths:\n' +output += ' prefix: ' + nm_prefix + '\n' +output += ' exec_prefix: ' + nm_prefix + '\n' +output += ' systemdunitdir: ' + systemd_system_unit_dir + '\n' +output += ' nmbinary: ' + nm_pkgsbindir + '\n' +output += ' nmconfdir: ' + nm_pkgconfdir + '\n' +output += ' nmlibdir: ' + nm_pkglibdir + '\n' +output += ' nmdatadir: ' + nm_pkgdatadir + '\n' +output += ' nmstatedir: ' + nm_pkgstatedir + '\n' +output += ' nmrundir: ' + nm_pkgrundir + '\n' +output += '\nPlatform:\n' +output += ' session tracking: ' + ','.join(session_trackers) + '\n' +output += ' suspend/resume: ' + suspend_resume + '\n' +output += ' policykit: ' + enable_polkit.to_string() +if enable_polkit + modify = (enable_modify_system ? 'permissive' : 'restrictive') + output += ' (' + modify + ' modify.system) (default: main.auth-polkit=' + polkit + ')' +endif +output += '\n' +output += ' polkit agent: ' + enable_polkit_agent.to_string() + '\n' +output += ' selinux: ' + enable_selinux.to_string() + '\n' +output += ' systemd-journald: ' + enable_systemd_journal.to_string() + ' (default: logging.backend=' + config_logging_backend_default + ')\n' +output += ' hostname persist: ' + hostname_persist + '\n' +output += ' libaudit: ' + enable_libaudit.to_string() + ' (default: logging.audit=' + config_default_logging_audit + ')\n' +output += '\nFeatures:\n' +output += ' wext: ' + enable_wext.to_string() + '\n' +output += ' wifi: ' + enable_wifi.to_string() + '\n' +output += ' iwd: ' + enable_iwd.to_string() + '\n' +output += ' pppd: ' + enable_ppp.to_string() +if enable_ppp + output += ' ' + pppd_path +endif +output += '\n' +output += ' modemmanager-1: ' + enable_modem_manager.to_string() + '\n' +output += ' ofono: ' + enable_ofono.to_string() + '\n' +output += ' concheck: ' + enable_concheck.to_string() + '\n' +output += ' libteamdctl: ' + enable_teamdctl.to_string() + '\n' +output += ' ovs: ' + enable_ovs.to_string() + '\n' +output += ' libnm-glib: ' + enable_libnm_glib.to_string() + '\n' +output += ' nmcli: ' + enable_nmcli.to_string() + '\n' +output += ' nmtui: ' + enable_nmtui.to_string() + '\n' +output += '\nConfiguration_plugins (main.plugins=' + config_plugins_default + ')\n' +output += ' ibft: ' + enable_config_plugin_ibft.to_string() + '\n' +output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + '\n' +output += ' ifupdown: ' + enable_ifupdown.to_string() + '\n' +output += ' ifnet: ' + enable_ifnet.to_string() + '\n' +output += '\nHandlers for /etc/resolv.conf:\n' +output += ' resolvconf: ' + enable_resolvconf.to_string() +if enable_resolvconf + output += ' ' + resolvconf.path() +endif +output += '\n' +output += ' netconfig: ' + enable_netconfig.to_string() +if enable_netconfig + output += ' ' + netconfig.path() +endif +output += '\n' +output += ' config-dns-rc-manager-default: ' + config_dns_rc_manager_default + '\n' +output += '\nDHCP clients (default ' + config_dhcp_default + '):\n' +output += ' dhcpcanon: ' + enable_dhcpcanon.to_string() +if enable_dhcpcd + output += ' ' + dhcpcanon_path +endif +output += '\n' +output += ' dhclient: ' + enable_dhclient.to_string() +if enable_dhclient + output += ' ' + dhclient_path +endif +output += '\n' +output += ' dhcpcd: ' + enable_dhcpcd.to_string() +if enable_dhcpcd + output += ' ' + dhcpcd_path +endif +output += '\n' +output += ' dhcpcd-supports-ipv6: ' + enable_dhcpcd_supports_ipv6.to_string() + '\n' +output += '\nMiscellaneous:\n' +output += ' have introspection: ' + enable_introspection.to_string() + '\n' +output += ' build documentation and manpages: ' + enable_docs.to_string() + '\n' +# FIXME +#output += ' install pregenerated documentation and manpages: no +output += ' tests: ' + tests + '\n' +output += ' more-asserts: @0@\n'.format(more_asserts) +output += ' more-logging: ' + more_logging.to_string() + '\n' +output += ' warning-level: ' + get_option('warning_level') + '\n' +output += ' valgrind: ' + valgrind_path + '\n' +output += ' code coverage: ' + get_option('b_coverage').to_string() + '\n' +output += ' LTO: ' + get_option('b_lto').to_string() + '\n' +output += ' Linker garbage collection: ' + enable_ld_gc.to_string() + '\n' +output += ' JSON validation for libnm: ' + enable_json_validation.to_string () + '\n' +output += ' sanitizers: ' + get_option('b_sanitize') + '\n' +output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n' +message(output) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..55f9ee7030 --- /dev/null +++ b/meson_options.txt @@ -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') diff --git a/meson_post_install.py b/meson_post_install.py new file mode 100644 index 0000000000..16dbc42b95 --- /dev/null +++ b/meson_post_install.py @@ -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) diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000000..a1e071ecd2 --- /dev/null +++ b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext(nm_name, preset: 'glib') diff --git a/shared/meson.build b/shared/meson.build new file mode 100644 index 0000000000..d3c1df0dff --- /dev/null +++ b/shared/meson.build @@ -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' +) diff --git a/src/devices/adsl/meson.build b/src/devices/adsl/meson.build new file mode 100644 index 0000000000..9b4dc84285 --- /dev/null +++ b/src/devices/adsl/meson.build @@ -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) +''' diff --git a/src/devices/bluetooth/meson.build b/src/devices/bluetooth/meson.build new file mode 100644 index 0000000000..2e59810dfa --- /dev/null +++ b/src/devices/bluetooth/meson.build @@ -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) +''' diff --git a/src/devices/meson.build b/src/devices/meson.build new file mode 100644 index 0000000000..2d874659c7 --- /dev/null +++ b/src/devices/meson.build @@ -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 diff --git a/src/devices/ovs/meson.build b/src/devices/ovs/meson.build new file mode 100644 index 0000000000..dbbb9e77a3 --- /dev/null +++ b/src/devices/ovs/meson.build @@ -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) +''' diff --git a/src/devices/team/meson.build b/src/devices/team/meson.build new file mode 100644 index 0000000000..64d6ab334a --- /dev/null +++ b/src/devices/team/meson.build @@ -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) +''' diff --git a/src/devices/tests/meson.build b/src/devices/tests/meson.build new file mode 100644 index 0000000000..015b2a6fe2 --- /dev/null +++ b/src/devices/tests/meson.build @@ -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 diff --git a/src/devices/wifi/meson.build b/src/devices/wifi/meson.build new file mode 100644 index 0000000000..0b681262be --- /dev/null +++ b/src/devices/wifi/meson.build @@ -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 diff --git a/src/devices/wifi/tests/meson.build b/src/devices/wifi/tests/meson.build new file mode 100644 index 0000000000..3dfa1a21e8 --- /dev/null +++ b/src/devices/wifi/tests/meson.build @@ -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) diff --git a/src/devices/wwan/meson.build b/src/devices/wwan/meson.build new file mode 100644 index 0000000000..3f3c70002d --- /dev/null +++ b/src/devices/wwan/meson.build @@ -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) +''' diff --git a/src/dhcp/meson.build b/src/dhcp/meson.build new file mode 100644 index 0000000000..d4ef4d7a8a --- /dev/null +++ b/src/dhcp/meson.build @@ -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 diff --git a/src/dhcp/tests/meson.build b/src/dhcp/tests/meson.build new file mode 100644 index 0000000000..85c6811bce --- /dev/null +++ b/src/dhcp/tests/meson.build @@ -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 diff --git a/src/dnsmasq/tests/meson.build b/src/dnsmasq/tests/meson.build new file mode 100644 index 0000000000..4c4173faa0 --- /dev/null +++ b/src/dnsmasq/tests/meson.build @@ -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) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000000..36bd64fc81 --- /dev/null +++ b/src/meson.build @@ -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') diff --git a/src/ndisc/tests/meson.build b/src/ndisc/tests/meson.build new file mode 100644 index 0000000000..83ffcc3843 --- /dev/null +++ b/src/ndisc/tests/meson.build @@ -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 diff --git a/src/platform/tests/meson.build b/src/platform/tests/meson.build new file mode 100644 index 0000000000..e8b9ca56b6 --- /dev/null +++ b/src/platform/tests/meson.build @@ -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 +) diff --git a/src/ppp/meson.build b/src/ppp/meson.build new file mode 100644 index 0000000000..4203561bfe --- /dev/null +++ b/src/ppp/meson.build @@ -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 +) diff --git a/src/settings/plugins/ibft/meson.build b/src/settings/plugins/ibft/meson.build new file mode 100644 index 0000000000..66ed0abe0c --- /dev/null +++ b/src/settings/plugins/ibft/meson.build @@ -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 diff --git a/src/settings/plugins/ibft/tests/meson.build b/src/settings/plugins/ibft/tests/meson.build new file mode 100644 index 0000000000..ed5cb3ffca --- /dev/null +++ b/src/settings/plugins/ibft/tests/meson.build @@ -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) diff --git a/src/settings/plugins/ifcfg-rh/meson.build b/src/settings/plugins/ifcfg-rh/meson.build new file mode 100644 index 0000000000..f480831a38 --- /dev/null +++ b/src/settings/plugins/ifcfg-rh/meson.build @@ -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 diff --git a/src/settings/plugins/ifcfg-rh/tests/meson.build b/src/settings/plugins/ifcfg-rh/tests/meson.build new file mode 100644 index 0000000000..359ed73600 --- /dev/null +++ b/src/settings/plugins/ifcfg-rh/tests/meson.build @@ -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) diff --git a/src/settings/plugins/ifnet/meson.build b/src/settings/plugins/ifnet/meson.build new file mode 100644 index 0000000000..65d537da18 --- /dev/null +++ b/src/settings/plugins/ifnet/meson.build @@ -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 diff --git a/src/settings/plugins/ifnet/tests/meson.build b/src/settings/plugins/ifnet/tests/meson.build new file mode 100644 index 0000000000..7cd06ef8a3 --- /dev/null +++ b/src/settings/plugins/ifnet/tests/meson.build @@ -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) diff --git a/src/settings/plugins/ifupdown/meson.build b/src/settings/plugins/ifupdown/meson.build new file mode 100644 index 0000000000..6e84951ce4 --- /dev/null +++ b/src/settings/plugins/ifupdown/meson.build @@ -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 diff --git a/src/settings/plugins/ifupdown/tests/meson.build b/src/settings/plugins/ifupdown/tests/meson.build new file mode 100644 index 0000000000..5d416b3836 --- /dev/null +++ b/src/settings/plugins/ifupdown/tests/meson.build @@ -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) diff --git a/src/settings/plugins/keyfile/tests/meson.build b/src/settings/plugins/keyfile/tests/meson.build new file mode 100644 index 0000000000..47a2af1f35 --- /dev/null +++ b/src/settings/plugins/keyfile/tests/meson.build @@ -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) diff --git a/src/settings/plugins/meson.build b/src/settings/plugins/meson.build new file mode 100644 index 0000000000..0fc38bebac --- /dev/null +++ b/src/settings/plugins/meson.build @@ -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 diff --git a/src/supplicant/tests/meson.build b/src/supplicant/tests/meson.build new file mode 100644 index 0000000000..357bcb5937 --- /dev/null +++ b/src/supplicant/tests/meson.build @@ -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) diff --git a/src/systemd/meson.build b/src/systemd/meson.build new file mode 100644 index 0000000000..3b3ba8837b --- /dev/null +++ b/src/systemd/meson.build @@ -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 +) diff --git a/src/tests/config/meson.build b/src/tests/config/meson.build new file mode 100644 index 0000000000..f80453ebc1 --- /dev/null +++ b/src/tests/config/meson.build @@ -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) diff --git a/src/tests/meson.build b/src/tests/meson.build new file mode 100644 index 0000000000..e65b83d1b7 --- /dev/null +++ b/src/tests/meson.build @@ -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) diff --git a/vapi/meson.build b/vapi/meson.build new file mode 100644 index 0000000000..330d055191 --- /dev/null +++ b/vapi/meson.build @@ -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 -- cgit v1.2.3