]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: compat - use string instead of feature
authorTomas Krizek <tomas.krizek@nic.cz>
Mon, 25 Feb 2019 13:34:04 +0000 (14:34 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:37 +0000 (10:43 +0100)
client/meson.build
doc/meson.build
etc/config/meson.build
meson.build
meson_options.txt
tests/meson.build

index cb297d42059d8331779b4f2a7a9e2e4fc34fcd88..334f1b6d1a3b5d3cd8392b19b56dffe45d15780e 100644 (file)
@@ -6,13 +6,14 @@ kresc_src = files([
 c_src_lint += kresc_src
 
 build_client = false
-if not get_option('client').disabled()
+if get_option('client') != 'disabled'
   message('--- client dependencies ---')
   libedit = dependency('libedit', required: false)
   if libedit.found()
     build_client = true
   else  # darwin workaround: missing pkgconfig
-    libedit = meson.get_compiler('c').find_library('edit', required: get_option('client'))
+    libedit = meson.get_compiler('c').find_library(
+      'edit', required: get_option('client') == 'enabled')
     if libedit.found()
       build_client = true
     endif
index 4e72499c3641c75819b7b059fddf0b7815cfe402..2f49a0f22cf0868004a8dc4a497f1115be4e5890 100644 (file)
@@ -3,7 +3,7 @@
 # man page
 man_config = configuration_data()
 man_config.set('version', meson.project_version())
-man_config.set('date', run_command('../scripts/get-date.sh', check: true).stdout())
+man_config.set('date', run_command('../scripts/get-date.sh').stdout())
 man_config.set('keyfile_default', keyfile_default)
 man_config.set('man_seealso_systemd',
   libsystemd.found() ? '\\fIkresd.systemd(7)\\fR, ' : '')
@@ -17,7 +17,7 @@ install_man(man_kresd)
 
 
 # html documentation
-if get_option('doc').enabled()
+if get_option('doc') == 'enabled'
   message('--- doc dependencies ---')
   doxygen = find_program('doxygen')
   sphinx_build = find_program('sphinx-build-3', required: false)
index c6f5023b8d5ad63e87aa4b2d8f629740400eb0fa..be18cb8a3ed7931c934654b23539e4daa3a8ec77 100644 (file)
@@ -37,8 +37,8 @@ endforeach
 
 
 # kresd.conf
-install_kresd_conf = get_option('install_kresd_conf').enabled()
-if get_option('install_kresd_conf').auto()
+install_kresd_conf = get_option('install_kresd_conf') == 'enabled'
+if get_option('install_kresd_conf') == 'auto'
   if run_command(['test', '-r', join_paths(etc_dir, 'kresd.conf')]).returncode() == 1
     install_kresd_conf = true
   endif
index bca7ccdc59bcc541385d2cd56ba5233d586d20ca..1b635c9712f17745314e8d3d5d9962f526abd319 100644 (file)
@@ -4,7 +4,7 @@ project(
   license: 'GPLv3+',
   version: '3.2.1',
   default_options: ['c_std=gnu11', 'b_ndebug=if-release'],
-  meson_version: '>=0.47.0',
+  meson_version: '>=0.46',
 )
 
 
@@ -46,11 +46,11 @@ systemd_unit_dir = ''
 systemd_tmpfiles_dir = ''
 
 ## Trust anchors
-managed_ta = get_option('managed_ta').enabled()
+managed_ta = get_option('managed_ta') == 'enabled'
 keyfile_default = join_paths(etc_dir, get_option('keyfile_default'))
 if keyfile_default == join_paths(etc_dir, 'root.keys')
   install_root_keys = true
-  managed_ta = managed_ta or get_option('managed_ta').auto()
+  managed_ta = managed_ta or get_option('managed_ta') == 'auto'
 else
   install_root_keys = false
   if managed_ta
@@ -68,8 +68,7 @@ else
 endif
 
 ## Additional options
-opt_verbose_log = get_option('verbose_log')
-verbose_log = opt_verbose_log.enabled() or opt_verbose_log.auto()
+verbose_log = get_option('verbose_log') == 'enabled' or get_option('verbose_log') == 'auto'
 user = get_option('user')
 group = get_option('group')
 
@@ -146,7 +145,7 @@ subdir('lib')
 subdir('client')
 subdir('daemon')
 subdir('modules')
-if get_option('bench').enabled()
+if get_option('bench') == 'enabled'
   subdir('bench')
 endif
 
index bd15eef51b36f64b3cf961953394f143e00c2c7d..06cc823b4d4806c666b80ec05a9ae12d01a72abc 100644 (file)
@@ -8,7 +8,12 @@ option(
 
 option(
   'managed_ta',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'auto',
   description: 'auto-manage DNSSEC trust anchors (RFC 5011)',
 )
@@ -22,15 +27,25 @@ option(
 
 option(
   'install_kresd_conf',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'auto',
   description: 'creates kresd.conf in config directory',
 )
 
 option(
   'verbose_log',
-  type: 'feature',
-  value: 'enabled',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
+  value: 'auto',
   description: 'support verbose logging',
 )
 
@@ -65,35 +80,60 @@ option(
 # Component options
 option(
   'bench',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'disabled',
   description: 'build benchmarks',
 )
 
 option(
   'client',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'auto',
   description: 'build kresc client binary',
 )
 
 option(
   'doc',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'disabled',
   description: 'html documentation dependencies and installation',
 )
 
 option(
   'postinstall_tests',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'disabled',
   description: 'postinstall tests with extra dependencies',
 )
 
 option(
   'unit_tests',
-  type: 'feature',
+  type: 'combo',
+  choices: [
+    'auto',
+    'enabled',
+    'disabled',
+  ],
   value: 'auto',
   description: 'cmocka unit tests',
 )
index e57735b60e1292a2c2982977beaa9598ae9c6f81..eabf6f5c1b380a28e3fe6655724fb2040f28f6bf 100644 (file)
@@ -2,9 +2,9 @@
 
 ## unit tests
 build_unit_tests = false
-if not get_option('unit_tests').disabled()
+if get_option('unit_tests') != 'disabled'
   message('--- unit_tests dependencies ---')
-  cmocka = dependency('cmocka', required: get_option('unit_tests'))
+  cmocka = dependency('cmocka', required: get_option('unit_tests') == 'enabled')
   if cmocka.found()
     build_unit_tests = true
     subdir('unit')
@@ -14,8 +14,12 @@ endif
 
 
 ## postinstall tests
-build_postinstall_tests = get_option('postinstall_tests').enabled()
+build_postinstall_tests = get_option('postinstall_tests') == 'enabled'
 if build_postinstall_tests
+  if meson.version().version_compare('<0.46')
+    error('meson 0.46+ is required for postinstall_tests')
+  endif
+
   subdir('config')
 
   message('--- postinstall_tests dependencies ---')