summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-07 12:43:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-07 12:43:18 +0000
commit9e5cc7f9eb4204e7f05018783dcc7c68783bc266 (patch)
treee7a40dd5265005869a4e85eb1e96fdc588b42ef0 /meson.build
parentAdding upstream version 2.4+really2.3. (diff)
downloadnvme-cli-9e5cc7f9eb4204e7f05018783dcc7c68783bc266.tar.xz
nvme-cli-9e5cc7f9eb4204e7f05018783dcc7c68783bc266.zip
Adding upstream version 2.4+really2.4.upstream/2.4+really2.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--meson.build49
1 files changed, 36 insertions, 13 deletions
diff --git a/meson.build b/meson.build
index c05dc47..24fa16e 100644
--- a/meson.build
+++ b/meson.build
@@ -4,12 +4,13 @@ project(
'nvme-cli', ['c'],
meson_version: '>= 0.50.0',
license: 'GPL-2.0-only',
- version: '2.3',
+ version: '2.4',
default_options: [
'c_std=gnu99',
'buildtype=debug',
'prefix=/usr/local',
'warning_level=1',
+ 'sysconfdir=etc',
]
)
@@ -44,24 +45,25 @@ endif
conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
# Check for libnvme availability
-libnvme_dep = dependency('libnvme', version: '>=1.3', required: true,
+libnvme_dep = dependency('libnvme', version: '>=1.4', required: true,
fallback : ['libnvme', 'libnvme_dep'])
libnvme_mi_dep = dependency('libnvme-mi', required: true,
fallback : ['libnvme', 'libnvme_mi_dep'])
# Check for libjson-c availability
-json_c_dep = dependency('json-c', required: true, version: '>=0.13',
- fallback : ['json-c', 'json_c_dep'])
-if json_c_dep.version().version_compare('>=0.14')
- conf.set('CONFIG_JSONC_14', true, description: 'Is json-c at least 0.14?')
- requires = 'Requires: json-c >= 0.14'
+if get_option('json-c').disabled()
+ json_c_dep = dependency('', required: false)
else
- requires = 'Requires: json-c >= 0.13'
+ json_c_dep = dependency('json-c', required: true, version: '>=0.13',
+ fallback : ['json-c', 'json_c_dep'])
+ if json_c_dep.version().version_compare('>=0.14')
+ conf.set('CONFIG_JSONC_14', true, description: 'Is json-c at least 0.14?')
+ requires = 'Requires: json-c >= 0.14'
+ else
+ requires = 'Requires: json-c >= 0.13'
+ endif
endif
-
-# Check for zlib availability
-libz_dep = dependency('zlib', required: true,
- fallback : ['zlib', 'zlib_dep'])
+conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c available?')
# Check for libhugetlbfs availability (optional)
if cc.has_header('hugetlbfs.h')
@@ -248,6 +250,11 @@ sources = [
'plugin.c',
'libnvme-wrap.c',
]
+if json_c_dep.found()
+ sources += [
+ 'nvme-print-json.c',
+ ]
+endif
subdir('ccan')
subdir('plugins')
@@ -261,7 +268,7 @@ subdir('Documentation')
executable(
'nvme',
sources,
- dependencies: [ libnvme_dep, libnvme_mi_dep, json_c_dep, libz_dep,
+ dependencies: [ libnvme_dep, libnvme_mi_dep, json_c_dep,
libhugetlbfs_dep ],
link_args: '-ldl',
include_directories: incdir,
@@ -293,3 +300,19 @@ endforeach
install_data(disc,
install_dir: join_paths(sysconfdir, 'nvme'))
+
+################################################################################
+if meson.version().version_compare('>=0.53.0')
+ summary_dict = {
+ 'prefixdir': prefixdir,
+ 'sysconfdir': sysconfdir,
+ 'sbindir': sbindir,
+ 'datadir': datadir,
+ 'mandir': mandir,
+ 'udevrulesdir': udevrulesdir,
+ 'dracutrulesdir': dracutrulesdir,
+ 'systemddir': systemddir,
+ 'build location': meson.current_build_dir(),
+ }
+ summary(summary_dict)
+endif