summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:25:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:34:52 +0000
commit9ecff41dd11e920286f9be670a0ec3a668371d1d (patch)
tree89c73ab6742847ca5f12056e6c0dd4ec6bbe79d0 /meson.build
parentAdding debian version 1.0-1. (diff)
downloadlibnvme-9ecff41dd11e920286f9be670a0ec3a668371d1d.tar.xz
libnvme-9ecff41dd11e920286f9be670a0ec3a668371d1d.zip
Merging upstream version 1.1~rc0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build37
1 files changed, 31 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index da7d05e..f64bd7a 100644
--- a/meson.build
+++ b/meson.build
@@ -6,10 +6,10 @@
# Authors: Martin Belanger <Martin.Belanger@dell.com>
#
project(
- 'libnvme', ['c', 'cpp'],
+ 'libnvme', ['c'],
meson_version: '>= 0.47.0',
- version: '1.0',
- license: 'LGPLv2+',
+ version: '1.1',
+ license: 'LGPL-2.1-or-later',
default_options: [
'c_std=gnu99',
'warning_level=1',
@@ -22,6 +22,7 @@ library_version = meson.project_version() + '.0'
################################################################################
cc = meson.get_compiler('c')
+cxx_available = add_languages('cpp', required: false)
prefixdir = get_option('prefix')
libdir = join_paths(prefixdir, get_option('libdir'))
@@ -36,10 +37,22 @@ pkgconfiglibdir = get_option('pkgconfiglibdir') == '' ? join_paths(libdir, 'pkgc
################################################################################
conf = configuration_data()
+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',
+ meson.current_source_dir(),
+ meson.project_version(),
+ check: true)
+ conf.set('GIT_VERSION', '"@0@"'.format(r.stdout().strip()))
+endif
+conf.set('PROJECT_VERSION', '"@0@"'.format(meson.project_version()))
+
conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
# Check for libuuid availability
-libuuid_dep = dependency('uuid', required: true)
+libuuid_dep = dependency('uuid', required: true, fallback : ['uuid', 'uuid_dep'])
conf.set('CONFIG_LIBUUID', libuuid_dep.found(), description: 'Is libuuid required?')
# Check for json-c availability
@@ -65,6 +78,10 @@ if openssl_dep.found()
description: 'OpenSSL version 3.x')
endif
+# Check for libsystemd availability. Optional, only required for MCTP dbus scan
+libsystemd_dep = dependency('libsystemd', version: '>219', required: false)
+conf.set('CONFIG_LIBSYSTEMD', libsystemd_dep.found(), description: 'Is libsystemd(>219) available?')
+
# local (cross-compilable) implementations of ccan configure steps
conf.set10(
'HAVE_BUILTIN_TYPES_COMPATIBLE_P',
@@ -112,12 +129,12 @@ conf.set10(
)
conf.set10(
'HAVE_LITTLE_ENDIAN',
- build_machine.endian() == 'little',
+ host_machine.endian() == 'little',
description: 'Building for little-endian'
)
conf.set10(
'HAVE_BIG_ENDIAN',
- build_machine.endian() == 'big',
+ host_machine.endian() == 'big',
description: 'Building for big-endian'
)
conf.set10(
@@ -143,6 +160,14 @@ conf.set10(
),
description: 'Is isblank() available?'
)
+conf.set10(
+ 'HAVE_LINUX_MCTP_H',
+ cc.compiles(
+ '''#include <linux/mctp.h>''',
+ name: 'linux/mctp.h'
+ ),
+ description: 'Is linux/mctp.h include-able?'
+)
################################################################################
substs = configuration_data()