summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2018-01-09 08:05:15 +0100
committerThomas Haller <thaller@redhat.com>2018-01-10 12:22:55 +0100
commit50930ed19a476f060b77f630111e7eb4c18b8008 (patch)
treedcf2b9b2e71482560045294c3b4eeaa9794de314
parent5e16bcf268b0a88764c06ecdb0d694cff560d201 (diff)
downloadNetworkManager-50930ed19a476f060b77f630111e7eb4c18b8008.tar.gz
meson: Use string variables extensively
The strings holding the names used for libraries have also been moved to different variables. This way they would be less error as these variables can be reused easily and any typing error would be quickly detected.
-rw-r--r--clients/cli/meson.build6
-rw-r--r--clients/tui/meson.build6
-rw-r--r--docs/api/meson.build2
-rw-r--r--docs/libnm-glib/meson.build2
-rw-r--r--docs/libnm-util/meson.build2
-rw-r--r--docs/libnm/meson.build2
-rw-r--r--libnm-core/meson.build2
-rw-r--r--libnm-glib/meson.build22
-rw-r--r--libnm-util/meson.build10
-rw-r--r--libnm/meson.build14
-rw-r--r--meson.build11
-rw-r--r--src/meson.build8
-rw-r--r--src/ppp/meson.build4
-rw-r--r--vapi/meson.build6
14 files changed, 54 insertions, 43 deletions
diff --git a/clients/cli/meson.build b/clients/cli/meson.build
index e03b127872..5b50018934 100644
--- a/clients/cli/meson.build
+++ b/clients/cli/meson.build
@@ -1,3 +1,5 @@
+name = 'nmcli'
+
# FIXME: nmcli-completion should be renamed to nmcli
install_data(
'nmcli-completion',
@@ -25,7 +27,7 @@ deps = [
]
cflags = clients_cflags + [
- '-DG_LOG_DOMAIN="nmcli"',
+ '-DG_LOG_DOMAIN="@0@"'.format(name),
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir)
]
@@ -41,7 +43,7 @@ if enable_polkit_agent
endif
executable(
- 'nmcli',
+ name,
sources,
dependencies: deps,
c_args: cflags,
diff --git a/clients/tui/meson.build b/clients/tui/meson.build
index fc1ce3462e..37428655a6 100644
--- a/clients/tui/meson.build
+++ b/clients/tui/meson.build
@@ -1,10 +1,12 @@
+name = 'nmtui'
+
deps = [
newt_dep,
nm_core_dep
]
cflags = clients_cflags + [
- '-DG_LOG_DOMAIN="nmtui"',
+ '-DG_LOG_DOMAIN="@0@"'.format(name),
'-DLOCALEDIR="@0@"'.format(nm_localedir)
]
@@ -65,7 +67,7 @@ if have_version_script
endif
executable(
- 'nmtui',
+ name,
sources,
dependencies: deps,
c_args: cflags,
diff --git a/docs/api/meson.build b/docs/api/meson.build
index 7b9166a328..71c0286eb4 100644
--- a/docs/api/meson.build
+++ b/docs/api/meson.build
@@ -1,4 +1,4 @@
-doc_module = 'NetworkManager'
+doc_module = nm_name
settings = 'settings-spec'
output = settings + '.xml'
diff --git a/docs/libnm-glib/meson.build b/docs/libnm-glib/meson.build
index 1368a2d458..b760ce003e 100644
--- a/docs/libnm-glib/meson.build
+++ b/docs/libnm-glib/meson.build
@@ -1,4 +1,4 @@
-doc_module = 'libnm-glib'
+doc_module = libnm_glib_name
private_headers = [
'common.h',
diff --git a/docs/libnm-util/meson.build b/docs/libnm-util/meson.build
index 47f53b0a8a..7b06baf3d4 100644
--- a/docs/libnm-util/meson.build
+++ b/docs/libnm-util/meson.build
@@ -1,4 +1,4 @@
-doc_module = 'libnm-util'
+doc_module = libnm_util_name
private_headers = [
'crypto.h',
diff --git a/docs/libnm/meson.build b/docs/libnm/meson.build
index bccd8e6884..7baf09f823 100644
--- a/docs/libnm/meson.build
+++ b/docs/libnm/meson.build
@@ -1,4 +1,4 @@
-doc_module = 'libnm'
+doc_module = libnm_name
private_headers = [
'common.h',
diff --git a/libnm-core/meson.build b/libnm-core/meson.build
index 946ffb18f7..89988a296d 100644
--- a/libnm-core/meson.build
+++ b/libnm-core/meson.build
@@ -136,7 +136,7 @@ deps = [
]
cflags = [
- '-DG_LOG_DOMAIN="libnm"',
+ '-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
'-DLOCALEDIR="@0@"'.format(nm_localedir),
diff --git a/libnm-glib/meson.build b/libnm-glib/meson.build
index 4c3f23cc1e..b4e3f0dcb7 100644
--- a/libnm-glib/meson.build
+++ b/libnm-glib/meson.build
@@ -13,7 +13,7 @@ common_cflags = [
]
cflags = common_cflags + [
- '-DG_LOG_DOMAIN="libnm-glib"'
+ '-DG_LOG_DOMAIN="@0@"'.format(libnm_glib_name)
]
vpn_headers = files(
@@ -57,7 +57,7 @@ deprecated_headers = files('libnm_glib.h')
install_headers(
headers + vpn_headers + deprecated_headers,
- subdir: 'libnm-glib'
+ subdir: libnm_glib_name
)
libdeprecated_nm_glib = static_library(
@@ -126,10 +126,10 @@ libnm_glib_vpn_dep = declare_dependency(
pkg.generate(
libraries: libnm_glib_vpn,
version: nm_version,
- name: 'libnm-glib-vpn',
+ name: libnm_glib_vpn_name,
description: 'Convenience library for NetworkManager VPN plugins',
- filebase: 'libnm-glib-vpn',
- subdirs: 'libnm-glib',
+ filebase: libnm_glib_vpn_name,
+ subdirs: libnm_glib_name,
requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1',
variables: 'exec_prefix=${prefix}'
)
@@ -222,10 +222,10 @@ libnm_glib_dep = declare_dependency(
pkg.generate(
libraries: libnm_glib,
version: nm_version,
- name: 'libnm-glib',
+ name: libnm_glib_name,
description: 'Convenience library for clients of NetworkManager',
- filebase: 'libnm-glib',
- subdirs: 'libnm-glib',
+ filebase: libnm_glib_name,
+ subdirs: libnm_glib_name,
requires: 'libnm-util >= ' + nm_version + ' NetworkManager >= ' + nm_version + ' gobject-2.0 dbus-glib-1',
variables: 'exec_prefix=${prefix}'
)
@@ -252,7 +252,7 @@ if enable_introspection
namespace: 'NMClient',
identifier_prefix: nm_id_prefix,
symbol_prefix: nm_id_prefix.to_lower(),
- export_packages: ['libnm-glib', 'libnm-glib-vpn'],
+ export_packages: [libnm_glib_name, libnm_glib_vpn_name],
includes: gir_includes,
extra_args: cflags + [
'--include-uninstalled=' + libnm_util_gir[0].full_path(),
@@ -261,7 +261,7 @@ if enable_introspection
)
endif
-name = 'libnm-glib-test'
+name = libnm_glib_name + '-test'
deps = common_deps + [libnm_util_dep]
@@ -274,7 +274,7 @@ executable(
)
run_target(
- 'check-local-exports-libnm-glib',
+ 'check-local-exports-' + libnm_glib_name,
command: [check_exports, libnm_glib.full_path(), symbol_map],
depends: libnm_glib
)
diff --git a/libnm-util/meson.build b/libnm-util/meson.build
index e04b98ec28..db2bb44f39 100644
--- a/libnm-util/meson.build
+++ b/libnm-util/meson.build
@@ -105,7 +105,7 @@ common_cflags = [
]
cflags = common_cflags + [
- '-DG_LOG_DOMAIN="libnm-util"'
+ '-DG_LOG_DOMAIN="@0@"'.format(libnm_util_name)
]
symbol_map = join_paths(meson.current_source_dir(), 'libnm-util.ver')
@@ -135,9 +135,9 @@ libnm_util_dep = declare_dependency(
pkg.generate(
libraries: libnm_util,
version: nm_version,
- name: 'libnm-util',
+ name: libnm_util_name,
description: 'Convenience library for clients of NetworkManager',
- filebase: 'libnm-util',
+ filebase: libnm_util_name,
subdirs: nm_name,
requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1',
variables: 'exec_prefix=${prefix}'
@@ -158,7 +158,7 @@ if enable_introspection
namespace: nm_name,
identifier_prefix: nm_id_prefix,
symbol_prefix: nm_id_prefix.to_lower(),
- export_packages: 'libnm-util',
+ export_packages: libnm_util_name,
includes: gir_includes,
install: true
)
@@ -170,7 +170,7 @@ if enable_introspection
endif
run_target(
- 'check-local-exports-libnm-util',
+ 'check-local-exports-' + libnm_util_name,
command: [check_exports, libnm_util.full_path(), symbol_map],
depends: libnm_util
)
diff --git a/libnm/meson.build b/libnm/meson.build
index e3b0d65ec7..ea1445f906 100644
--- a/libnm/meson.build
+++ b/libnm/meson.build
@@ -14,7 +14,7 @@ deps = [
]
cflags = [
- '-DG_LOG_DOMAIN="libnm"',
+ '-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
]
@@ -72,7 +72,7 @@ libnm_headers = files(
install_headers(
libnm_core_headers + libnm_headers + [version_header],
- subdir: 'libnm'
+ subdir: libnm_name
)
enum_headers = libnm_headers + [version_header]
@@ -174,10 +174,10 @@ libnm_dep = declare_dependency(
pkg.generate(
libraries: libnm,
version: nm_version,
- name: 'libnm',
+ name: libnm_name,
description: 'Convenience library for clients of NetworkManager',
- filebase: 'libnm',
- subdirs: 'libnm',
+ filebase: libnm_name,
+ subdirs: libnm_name,
requires: 'gio-2.0',
variables: [
'exec_prefix=${prefix}',
@@ -186,7 +186,7 @@ pkg.generate(
)
run_target(
- 'check-local-exports-libnm',
+ 'check-local-exports-' + libnm_name,
command: [check_exports, libnm.full_path(), symbol_map],
depends: libnm
)
@@ -201,7 +201,7 @@ if enable_introspection
namespace: 'NM',
identifier_prefix: nm_id_prefix,
symbol_prefix: nm_id_prefix.to_lower(),
- export_packages: 'libnm',
+ export_packages: libnm_name,
includes: 'Gio-2.0',
extra_args: cflags,
install: true
diff --git a/meson.build b/meson.build
index c2b9831b63..75f542084e 100644
--- a/meson.build
+++ b/meson.build
@@ -42,24 +42,31 @@ nm_pkglibdir = join_paths(nm_libdir, nm_name)
nm_pkgrundir = join_paths(nm_runstatedir, nm_name)
nm_pkgstatedir = join_paths(nm_localstatedir, nm_name)
+libnm_name = 'libnm'
+
current = 1
revision = 0
age = 1
libnm_version = '@0@.@1@.@2@'.format(current - age, age, revision)
-libnm_pkgincludedir = join_paths(nm_includedir, 'libnm')
+libnm_pkgincludedir = join_paths(nm_includedir, libnm_name)
+
+libnm_util_name = 'libnm-util'
current = 9
revision = 0
age = 7
libnm_util_version = '@0@.@1@.@2@'.format(current - age, age, revision)
+libnm_glib_name = 'libnm-glib'
+libnm_glib_vpn_name = libnm_glib_name + '-vpn'
+
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')
+libnm_glib_pkgincludedir = join_paths(nm_includedir, libnm_glib_name)
current = 3
revision = 0
diff --git a/src/meson.build b/src/meson.build
index 1c5b6921b0..df197bd28f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -83,7 +83,7 @@ if enable_wext
endif
libnetwork_manager_base = static_library(
- 'NetworkManagerBase',
+ nm_name + 'Base',
sources: sources,
dependencies: deps,
c_args: cflags,
@@ -200,7 +200,7 @@ if enable_session_tracking
endif
libnetwork_manager = static_library(
- 'NetworkManager',
+ nm_name,
sources: sources,
dependencies: deps,
c_args: cflags,
@@ -238,7 +238,7 @@ endif
'''
network_manager = executable(
- meson.project_name(),
+ nm_name,
'main.c',
dependencies: deps,
c_args: cflags,
@@ -298,7 +298,7 @@ if enable_tests
test_cflags_platform = '-DSETUP=nm_' + platform + '_platform_setup'
libnetwork_manager_test = static_library(
- 'NetworkManagerTest',
+ nm_name + 'Test',
sources: sources,
dependencies: deps,
c_args: cflags + test_cflags,
diff --git a/src/ppp/meson.build b/src/ppp/meson.build
index c0f1f1b107..fc6a319670 100644
--- a/src/ppp/meson.build
+++ b/src/ppp/meson.build
@@ -12,7 +12,7 @@ nm_pppd_plugin = shared_module(
include_directories: src_inc,
dependencies: deps,
c_args: [
- '-DG_LOG_DOMAIN="nm-pppd-plugin"',
+ '-DG_LOG_DOMAIN="@0@"'.format(name),
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB',
],
install: true,
@@ -26,7 +26,7 @@ deps = [
nm_dep
]
-symbol_map = join_paths(meson.current_source_dir(), name + '.ver')
+symbol_map = join_paths(meson.current_source_dir(), 'nm-ppp-plugin.ver')
ldflags = []
if have_version_script
diff --git a/vapi/meson.build b/vapi/meson.build
index 330d055191..835a0b9aaf 100644
--- a/vapi/meson.build
+++ b/vapi/meson.build
@@ -1,5 +1,5 @@
gnome.generate_vapi(
- 'libnm',
+ libnm_name,
sources: libnm_gir[0],
packages: 'gio-2.0',
install: true
@@ -12,7 +12,7 @@ if enable_libnm_glib
]
libnm_util_vapi = gnome.generate_vapi(
- 'libnm-util',
+ libnm_util_name,
sources: libnm_util_gir[0],
packages: packages,
install: true
@@ -21,7 +21,7 @@ if enable_libnm_glib
packages += libnm_util_vapi
gnome.generate_vapi(
- 'libnm-glib',
+ libnm_glib_name,
sources: libnm_glib_gir[0],
packages: packages,
install: true