summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-30 22:38:48 +0000
commit01c4d3d32c5044d3d17055c2d94d40fee9d130e1 (patch)
tree2c213cd5436bff644fa7023b94674a9c12d2e1af /meson.build
parentAdding upstream version 2.4+really2.4. (diff)
downloadnvme-cli-01c4d3d32c5044d3d17055c2d94d40fee9d130e1.tar.xz
nvme-cli-01c4d3d32c5044d3d17055c2d94d40fee9d130e1.zip
Adding upstream version 2.5.upstream/2.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build41
1 files changed, 31 insertions, 10 deletions
diff --git a/meson.build b/meson.build
index 24fa16e..af79bd4 100644
--- a/meson.build
+++ b/meson.build
@@ -4,13 +4,14 @@ project(
'nvme-cli', ['c'],
meson_version: '>= 0.50.0',
license: 'GPL-2.0-only',
- version: '2.4',
+ version: '2.5',
default_options: [
'c_std=gnu99',
'buildtype=debug',
'prefix=/usr/local',
'warning_level=1',
'sysconfdir=etc',
+ 'wrap_mode=nofallback',
]
)
@@ -26,6 +27,7 @@ sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
udevrulesdir = join_paths(prefixdir, get_option('udevrulesdir'))
dracutrulesdir = join_paths(prefixdir, get_option('dracutrulesdir'))
systemddir = join_paths(prefixdir, get_option('systemddir'))
+rundir = join_paths(prefixdir, get_option('rundir'))
###############################################################################
conf = configuration_data()
@@ -35,7 +37,7 @@ version_tag = get_option('version-tag')
if version_tag != ''
conf.set('GIT_VERSION', '"@0@"'.format(version_tag))
else
- r = run_command('meson-vcs-tag.sh',
+ r = run_command('scripts/meson-vcs-tag.sh',
meson.current_source_dir(),
meson.project_version(),
check: true)
@@ -43,9 +45,10 @@ else
endif
conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
+conf.set('RUNDIR', '"@0@"'.format(rundir))
# Check for libnvme availability
-libnvme_dep = dependency('libnvme', version: '>=1.4', required: true,
+libnvme_dep = dependency('libnvme', version: '>=1.5', required: true,
fallback : ['libnvme', 'libnvme_dep'])
libnvme_mi_dep = dependency('libnvme-mi', required: true,
fallback : ['libnvme', 'libnvme_mi_dep'])
@@ -54,7 +57,7 @@ libnvme_mi_dep = dependency('libnvme-mi', required: true,
if get_option('json-c').disabled()
json_c_dep = dependency('', required: false)
else
- json_c_dep = dependency('json-c', required: true, version: '>=0.13',
+ json_c_dep = dependency('json-c', required: get_option('json-c'), 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?')
@@ -69,12 +72,10 @@ conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c available?'
if cc.has_header('hugetlbfs.h')
libhugetlbfs_dep = cc.find_library('hugetlbfs',
required : false)
- have_libhugetlbfs = libhugetlbfs_dep.found()
else
- libhugetlbfs_dep = []
- have_libhugetlbfs = false
+ libhugetlbfs_dep = dependency('', required: false)
endif
-conf.set('CONFIG_LIBHUGETLBFS', have_libhugetlbfs, description: 'Is libhugetlbfs available?')
+conf.set('CONFIG_LIBHUGETLBFS', libhugetlbfs_dep.found(), description: 'Is libhugetlbfs available?')
# Set the nvme-cli version
conf.set('NVME_VERSION', '"' + meson.project_version() + '"')
@@ -157,6 +158,12 @@ conf.set10(
description: 'Is sys/random.h(getrandom) include-able?'
)
+if cc.has_function_attribute('fallthrough')
+ conf.set('fallthrough', '__attribute__((__fallthrough__))')
+else
+ conf.set('fallthrough', 'do {} while (0) /* fallthrough */')
+endif
+
configure_file(
output: 'config.h',
configuration: conf
@@ -177,6 +184,7 @@ substs.set('DRACUTRILESDIR', dracutrulesdir)
substs.set('REQUIRES', requires)
substs.set('DATADIR', datadir)
substs.set('MANDIR', mandir)
+substs.set('RUNDIR', rundir)
substs.set('SBINDIR', sbindir)
substs.set('SYSCONFDIR', sysconfdir)
substs.set('SYSTEMDDIR', systemddir)
@@ -241,10 +249,13 @@ incdir = include_directories(['ccan'])
################################################################################
sources = [
+ 'nbft.c',
'fabrics.c',
'nvme.c',
'nvme-models.c',
'nvme-print.c',
+ 'nvme-print-stdout.c',
+ 'nvme-print-binary.c',
'nvme-rpmb.c',
'nvme-wrap.c',
'plugin.c',
@@ -303,7 +314,7 @@ install_data(disc,
################################################################################
if meson.version().version_compare('>=0.53.0')
- summary_dict = {
+ path_dict = {
'prefixdir': prefixdir,
'sysconfdir': sysconfdir,
'sbindir': sbindir,
@@ -311,8 +322,18 @@ if meson.version().version_compare('>=0.53.0')
'mandir': mandir,
'udevrulesdir': udevrulesdir,
'dracutrulesdir': dracutrulesdir,
+ 'rundir': rundir,
'systemddir': systemddir,
'build location': meson.current_build_dir(),
}
- summary(summary_dict)
+ summary(path_dict, section: 'Paths')
+ dep_dict = {
+ 'json-c': json_c_dep.found(),
+ 'libhugetlbfs': libhugetlbfs_dep.found(),
+ }
+ summary(dep_dict, section: 'Dependencies')
+ conf_dict = {
+ 'pdc enabled': get_option('pdc-enabled')
+ }
+ summary(conf_dict, section: 'Configuration')
endif