summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build96
1 files changed, 66 insertions, 30 deletions
diff --git a/meson.build b/meson.build
index d389cbf..007ffdc 100644
--- a/meson.build
+++ b/meson.build
@@ -8,13 +8,14 @@
project(
'libnvme', ['c'],
meson_version: '>= 0.50.0',
- version: '1.3',
+ version: '1.4',
license: 'LGPL-2.1-or-later',
default_options: [
'c_std=gnu99',
'warning_level=1',
'buildtype=debug',
'prefix=/usr/local',
+ 'sysconfdir=etc',
]
)
@@ -50,44 +51,61 @@ conf.set('PROJECT_VERSION', '"@0@"'.format(meson.project_version()))
conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
-# Check for json-c availability
-json_c_dep = dependency('json-c',
- version: '>=0.13',
- required: true,
- fallback : ['json-c', 'json_c_dep'])
+if get_option('json-c').disabled()
+ json_c_dep = dependency('', required: false)
+else
+ json_c_dep = dependency('json-c',
+ version: '>=0.13',
+ required: true,
+ fallback : ['json-c', 'json_c_dep'])
+endif
conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c required?')
-# Check for OpenSSL availability
-openssl_dep = dependency('openssl',
- version: '>=1.1.0',
- required: get_option('openssl'),
- fallback : ['openssl', 'libssl_dep'])
-if openssl_dep.found()
- conf.set('CONFIG_OPENSSL', true,
- description: 'Is OpenSSL/LibreSSL available?')
-
- if openssl_dep.version().version_compare('<2.0.0')
- api_version = 1
- endif
+if get_option('openssl').disabled()
+ openssl_dep = dependency('', required: false)
+else
+ openssl_dep = dependency('openssl',
+ version: '>=1.1.0',
+ required: get_option('openssl'),
+ fallback : ['openssl', 'libssl_dep'])
- if openssl_dep.version().version_compare('>=3.0.0')
- api_version = 3
+ if openssl_dep.found()
+ if openssl_dep.version().version_compare('<2.0.0')
+ api_version = 1
+ endif
+
+ if openssl_dep.version().version_compare('>=3.0.0')
+ api_version = 3
+ endif
# Test for LibreSSL v3.x with incomplete OpenSSL v3 APIs
- is_libressl = cc.has_header_symbol('openssl/opensslv.h',
- 'LIBRESSL_VERSION_NUMBER',
- dependencies: openssl_dep)
- has_header = cc.has_header('openssl/core_names.h',
- dependencies: openssl_dep)
- if is_libressl and not has_header
- api_version = 1
+ if openssl_dep.type_name() != 'internal'
+ is_libressl = cc.has_header_symbol('openssl/opensslv.h',
+ 'LIBRESSL_VERSION_NUMBER',
+ dependencies: openssl_dep)
+ has_header = cc.has_header('openssl/core_names.h',
+ dependencies: openssl_dep)
+ if is_libressl and not has_header
+ api_version = 1
+ endif
endif
+ conf.set('CONFIG_OPENSSL_@0@'.format(api_version), true,
+ description: 'OpenSSL/LibreSSL API version @0@'.format(api_version))
endif
+endif
- conf.set('CONFIG_OPENSSL_@0@'.format(api_version), true,
- description: 'OpenSSL/LibreSSL API version @0@'.format(api_version))
+conf.set('CONFIG_OPENSSL', openssl_dep.found(),
+ description: 'Is OpenSSL/LibreSSL available?')
+
+if get_option('keyutils').disabled()
+ keyutils_dep = dependency('', required: false)
+else
+ keyutils_dep = dependency('libkeyutils',
+ required : get_option('keyutils'))
endif
+conf.set('CONFIG_KEYUTILS', keyutils_dep.found(),
+ description: 'Is libkeyutils available?')
if get_option('libdbus').disabled()
libdbus_dep = dependency('', required: false)
@@ -199,7 +217,10 @@ conf.set10(
conf.set(
'HAVE_LIBNSS',
cc.links(
- '''int main(int argc, char **argv) {
+ '''#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ int main(int argc, char **argv) {
struct addrinfo hints, *result;
return getaddrinfo(argv[1], argv[2], &hints, &result);
}
@@ -245,3 +266,18 @@ subdir('libnvme')
subdir('test')
subdir('examples')
subdir('doc')
+
+################################################################################
+if meson.version().version_compare('>=0.53.0')
+ summary_dict = {
+ 'prefixdir': prefixdir,
+ 'sysconfdir': sysconfdir,
+ 'bindir': bindir,
+ 'includedir': includedir,
+ 'datadir': datadir,
+ 'mandir': mandir,
+ 'libdir': libdir,
+ 'build location': meson.current_build_dir(),
+ }
+ summary(summary_dict)
+endif