summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build49
1 files changed, 13 insertions, 36 deletions
diff --git a/meson.build b/meson.build
index 24fa16e..c05dc47 100644
--- a/meson.build
+++ b/meson.build
@@ -4,13 +4,12 @@ project(
'nvme-cli', ['c'],
meson_version: '>= 0.50.0',
license: 'GPL-2.0-only',
- version: '2.4',
+ version: '2.3',
default_options: [
'c_std=gnu99',
'buildtype=debug',
'prefix=/usr/local',
'warning_level=1',
- 'sysconfdir=etc',
]
)
@@ -45,25 +44,24 @@ endif
conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
# Check for libnvme availability
-libnvme_dep = dependency('libnvme', version: '>=1.4', required: true,
+libnvme_dep = dependency('libnvme', version: '>=1.3', required: true,
fallback : ['libnvme', 'libnvme_dep'])
libnvme_mi_dep = dependency('libnvme-mi', required: true,
fallback : ['libnvme', 'libnvme_mi_dep'])
# Check for libjson-c availability
-if get_option('json-c').disabled()
- json_c_dep = dependency('', required: false)
+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
- 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
+ requires = 'Requires: json-c >= 0.13'
endif
-conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c available?')
+
+# Check for zlib availability
+libz_dep = dependency('zlib', required: true,
+ fallback : ['zlib', 'zlib_dep'])
# Check for libhugetlbfs availability (optional)
if cc.has_header('hugetlbfs.h')
@@ -250,11 +248,6 @@ sources = [
'plugin.c',
'libnvme-wrap.c',
]
-if json_c_dep.found()
- sources += [
- 'nvme-print-json.c',
- ]
-endif
subdir('ccan')
subdir('plugins')
@@ -268,7 +261,7 @@ subdir('Documentation')
executable(
'nvme',
sources,
- dependencies: [ libnvme_dep, libnvme_mi_dep, json_c_dep,
+ dependencies: [ libnvme_dep, libnvme_mi_dep, json_c_dep, libz_dep,
libhugetlbfs_dep ],
link_args: '-ldl',
include_directories: incdir,
@@ -300,19 +293,3 @@ 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