2017-11-25 11:39:06 +01:00
|
|
|
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
|
|
|
|
|
)
|
|
|
|
|
|
2017-12-16 14:59:37 +01:00
|
|
|
enum_types = 'nm-utils-enum-types'
|
2017-11-25 11:39:06 +01:00
|
|
|
|
2017-12-16 14:59:37 +01:00
|
|
|
libnm_utils_enum = gnome.mkenums(
|
|
|
|
|
enum_types,
|
2017-11-25 11:39:06 +01:00
|
|
|
sources: enums_headers,
|
|
|
|
|
identifier_prefix: nm_id_prefix,
|
2017-12-16 14:59:37 +01:00
|
|
|
c_template: enum_types + '.c.template',
|
|
|
|
|
h_template: enum_types + '.h.template',
|
2017-11-25 11:39:06 +01:00
|
|
|
install_header: true,
|
|
|
|
|
install_dir: nm_pkgincludedir
|
|
|
|
|
)
|
|
|
|
|
|
build/meson: fix meson build for shared files
The files in shared/nm-utils are not compiled as one static library,
instead each subproject that needs (parts of) them, re-compiles the
files individually.
The major reason for that is, because we might have different compile
flags, depending on whether we build libnm-core or
libnm-util/libnm-glib. Actually, I think that is not really the case,
and maybe this should be refactored, to indeed build them all as a
static library first.
Anyway, libnm-util, libnm-glib, clients' common lib, they all need a
different set of shared files that they should compile. Refactor
"shared/meson.build" to account for that and handle it like autotools
does.
Another change is, that "shared_c_siphash_dep" no longer advertises
"include_directories: include_directories('c-siphash/src')". We don't
put c-siphash.h into the include search path. Users who need it, should
include it via "#include <c-siphash/src/c-siphash.h>". The only exception
is when building shared_n_acd library, which is not under our control.
2018-05-30 15:16:01 +02:00
|
|
|
sources = files(
|
2017-11-25 11:39:06 +01:00
|
|
|
'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'
|
|
|
|
|
)
|
build/meson: fix meson build for shared files
The files in shared/nm-utils are not compiled as one static library,
instead each subproject that needs (parts of) them, re-compiles the
files individually.
The major reason for that is, because we might have different compile
flags, depending on whether we build libnm-core or
libnm-util/libnm-glib. Actually, I think that is not really the case,
and maybe this should be refactored, to indeed build them all as a
static library first.
Anyway, libnm-util, libnm-glib, clients' common lib, they all need a
different set of shared files that they should compile. Refactor
"shared/meson.build" to account for that and handle it like autotools
does.
Another change is, that "shared_c_siphash_dep" no longer advertises
"include_directories: include_directories('c-siphash/src')". We don't
put c-siphash.h into the include search path. Users who need it, should
include it via "#include <c-siphash/src/c-siphash.h>". The only exception
is when building shared_n_acd library, which is not under our control.
2018-05-30 15:16:01 +02:00
|
|
|
sources += shared_files_libnm_util
|
2017-11-25 11:39:06 +01:00
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
dbus_dep,
|
|
|
|
|
dbus_glib_dep,
|
2018-01-07 15:39:42 +01:00
|
|
|
shared_dep,
|
2017-11-25 11:39:06 +01:00
|
|
|
uuid_dep
|
|
|
|
|
]
|
|
|
|
|
|
2018-01-02 13:37:06 +01:00
|
|
|
common_cflags = [
|
|
|
|
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
cflags = common_cflags + [
|
2018-01-09 08:05:15 +01:00
|
|
|
'-DG_LOG_DOMAIN="@0@"'.format(libnm_util_name)
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
2018-09-08 12:01:00 +02:00
|
|
|
if crypto_gnutls_dep.found()
|
|
|
|
|
libnm_util_crypto_gnutls = static_library(
|
|
|
|
|
'nm-util-crypto-gnutls',
|
|
|
|
|
sources: [ 'crypto_gnutls.c' ],
|
|
|
|
|
dependencies: deps + [ crypto_gnutls_dep ],
|
|
|
|
|
c_args: cflags
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if crypto_nss_dep.found()
|
|
|
|
|
libnm_util_crypto_nss = static_library(
|
|
|
|
|
'nm-util-crypto-nss',
|
|
|
|
|
sources: [ 'crypto_nss.c' ],
|
|
|
|
|
dependencies: deps + [ crypto_nss_dep ],
|
|
|
|
|
c_args: cflags
|
|
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if crypto == 'gnutls'
|
|
|
|
|
libnm_util_crypto = libnm_util_crypto_gnutls
|
|
|
|
|
elif crypto == 'nss'
|
|
|
|
|
libnm_util_crypto = libnm_util_crypto_nss
|
|
|
|
|
else
|
|
|
|
|
error('bug')
|
|
|
|
|
endif
|
|
|
|
|
|
2018-01-11 12:34:40 +01:00
|
|
|
linker_script = join_paths(meson.current_source_dir(), 'libnm-util.ver')
|
2017-11-25 11:39:06 +01:00
|
|
|
|
|
|
|
|
libnm_util = shared_library(
|
|
|
|
|
'nm-util',
|
2017-12-16 14:59:37 +01:00
|
|
|
sources: sources + libnm_utils_enum,
|
2017-11-25 11:39:06 +01:00
|
|
|
version: libnm_util_version,
|
|
|
|
|
dependencies: deps,
|
|
|
|
|
c_args: cflags,
|
2018-01-11 12:34:40 +01:00
|
|
|
link_args: [
|
|
|
|
|
'-Wl,--version-script,@0@'.format(linker_script),
|
|
|
|
|
],
|
|
|
|
|
link_depends: linker_script,
|
2018-09-08 12:01:00 +02:00
|
|
|
link_with: libnm_util_crypto,
|
2017-12-24 14:52:01 +01:00
|
|
|
install: true
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
libnm_util_dep = declare_dependency(
|
2018-01-07 15:39:42 +01:00
|
|
|
sources: libnm_utils_enum[1],
|
|
|
|
|
include_directories: libnm_util_inc,
|
|
|
|
|
link_with: libnm_util
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
pkg.generate(
|
|
|
|
|
libraries: libnm_util,
|
|
|
|
|
version: nm_version,
|
2018-01-09 08:05:15 +01:00
|
|
|
name: libnm_util_name,
|
2017-11-25 11:39:06 +01:00
|
|
|
description: 'Convenience library for clients of NetworkManager',
|
2018-01-09 08:05:15 +01:00
|
|
|
filebase: libnm_util_name,
|
2017-11-25 11:39:06 +01:00
|
|
|
subdirs: nm_name,
|
|
|
|
|
requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1',
|
2017-12-24 14:52:01 +01:00
|
|
|
variables: 'exec_prefix=${prefix}'
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if enable_introspection
|
2017-12-16 14:59:37 +01:00
|
|
|
gir_sources = sources + headers + libnm_utils_enum
|
2017-11-25 11:39:06 +01:00
|
|
|
|
|
|
|
|
gir_includes = [
|
|
|
|
|
'DBusGLib-1.0',
|
|
|
|
|
'GObject-2.0'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
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(),
|
2018-01-09 08:05:15 +01:00
|
|
|
export_packages: libnm_util_name,
|
2017-11-25 11:39:06 +01:00
|
|
|
includes: gir_includes,
|
2017-12-24 14:52:01 +01:00
|
|
|
install: true
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
libnm_util_gir_dep = declare_dependency(
|
2018-01-07 15:39:42 +01:00
|
|
|
sources: libnm_util_gir,
|
|
|
|
|
link_with: libnm_util
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
2018-06-26 18:36:31 +02:00
|
|
|
test(
|
2018-01-09 08:05:15 +01:00
|
|
|
'check-local-exports-' + libnm_util_name,
|
2018-06-26 18:36:31 +02:00
|
|
|
check_exports,
|
|
|
|
|
args: [libnm_util.full_path(), linker_script],
|
2017-11-25 11:39:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
sources = files(
|
|
|
|
|
'crypto.c',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
deps = [
|
2018-01-07 15:39:42 +01:00
|
|
|
shared_dep
|
2017-11-25 11:39:06 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
libtest_crypto = static_library(
|
|
|
|
|
'test-crypto',
|
|
|
|
|
sources: sources,
|
|
|
|
|
dependencies: deps,
|
2018-09-08 12:01:00 +02:00
|
|
|
link_with: libnm_util_crypto,
|
2017-11-25 11:39:06 +01:00
|
|
|
c_args: cflags
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if enable_tests
|
|
|
|
|
subdir('tests')
|
|
|
|
|
endif
|