]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: use build options for client/daemon builds
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 25 Jan 2019 10:57:37 +0000 (11:57 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:41:48 +0000 (10:41 +0100)
client/meson.build
daemon/lua/meson.build
daemon/meson.build
meson.build
meson_options.txt

index 5a6d848e4137af574b969ff336773b30c5d24879..c9068fede1d88d6d1e4c28e4bbbbff837cdda61e 100644 (file)
@@ -2,25 +2,17 @@ kresc_src = [
   'kresc.c',
 ]
 
+if get_option('client')
 
-# client dependencies
-skip_client = false
-
-libedit = dependency('libedit', required: false)
-if not libedit.found()
-  # TODO why call find_library? osx workaround?
-  libedit = meson.get_compiler('c').find_library('edit', required: false)
+  # client dependencies
+  libedit = dependency('libedit', required: false)
   if not libedit.found()
-    skip_client = true
-    message('kresc client: libedit not found')
+    # TODO why call find_library? osx workaround?
+    libedit = meson.get_compiler('c').find_library('edit')
   endif
-endif
 
 
-# build
-if skip_client
-  warning('kresc client: skipping build')
-else
+  # build
   kresc = executable(
     'kresc',
     kresc_src,
index 19beee952c5641b3e06e713ef4666943144b2bca..5256c7e03d69a99f86f7f29437c96948c4034b45 100644 (file)
@@ -5,15 +5,24 @@ lua_modules_daemon = [
   'zonefile',
 ]
 
-embed_lua = generator(
-  find_program('../../scripts/embed-lua.sh'),
-  arguments: ['@INPUT@'],
-  output: '@BASENAME@.inc',
-  capture: true,
-)
 
-kresd_lua = embed_lua.process(
-  'sandbox.lua',
-  'config.lua',
-  preserve_path_from: meson.source_root(),
-)
+if get_option('daemon')
+  # dependencies for embedding lua
+  xxd = find_program('xxd', required: false)
+  if not xxd.found()
+    hexdump = find_program('hexdump')
+  endif
+
+  embed_lua = generator(
+    find_program('../../scripts/embed-lua.sh'),
+    arguments: ['@INPUT@'],
+    output: '@BASENAME@.inc',
+    capture: true,
+  )
+
+  kresd_lua = embed_lua.process(
+    'sandbox.lua',
+    'config.lua',
+    preserve_path_from: meson.source_root(),
+  )
+endif
index c58c5c86523743bea68b59a98ca4ef642e589e23..37db785b5b4242bcdf390a48df5b26e074caead1 100644 (file)
@@ -14,6 +14,9 @@ kresd_sources = [
 ]
 
 
+subdir('lua')
+
+
 lib_suffix = '.so'
 # TODO seek&destroy LIBEXT
 if host_machine.system() == 'darwin'
@@ -42,41 +45,18 @@ if host_machine.system() == 'darwin'
 endif
 
 
-# daemon dependencies
-skip_daemon = false
+if get_option('daemon')
+  # daemon dependencies
+  luajit = dependency('luajit')
 
-luajit = dependency('luajit', required: false)
-if not luajit.found()
-  skip_daemon = true
-  message('kresd daemon: luajit not found')
-endif
-
-xxd = find_program('xxd', required: false)
-if not xxd.found()
-  hexdump = find_program('hexdump', required: false)
-  if not hexdump.found()
-    skip_daemon = true
-    message('kresd daemon: neither xxd nor hexdump found')
+  # optional dependencies
+  ## systemd socket activation
+  libsystemd = dependency('libsystemd', version: '>=227', required: false)
+  if libsystemd.found()
+    c_args += ['-DHAS_SYSTEMD']
   endif
-endif
-
-
-# optional dependencies
-
-## systemd socket activation
-libsystemd = dependency('libsystemd', version: '>=227', required: false)
-if libsystemd.found()
-  c_args += ['-DHAS_SYSTEMD']
-endif
-
-
-subdir('lua')
-
 
-# build
-if skip_daemon
-  warning('kresd daemon: skipping build')
-else
+  # build
   kresd = executable(
     'kresd',
     kresd_sources, kresd_lua,
index 963944445a72a64edee347ecf00b20179fb16b78..204b726786b86f64f2d22414f3393e5b26969d1c 100644 (file)
@@ -122,18 +122,18 @@ subdir('daemon')
 #  name_prefix: '',
 #)
 
-library(
-  'stats',
-  ['modules/stats/stats.c'],
-  dependencies: [
-    contrib_dep,
-    libkres_dep,
-    luajit,
-  ],
-  install: true,
-  install_dir: modules_dir,
-  name_prefix: '',
-)
+#library(
+#  'stats',
+#  ['modules/stats/stats.c'],
+#  dependencies: [
+#    contrib_dep,
+#    libkres_dep,
+#    luajit,
+#  ],
+#  install: true,
+#  install_dir: modules_dir,
+#  name_prefix: '',
+#)
 
 # TODO: dnstap
 
index 533900b5452626630eb051991e7b968c4c7c15d4..750fdeac2f50abdac47194b8a48bd90053ce32fa 100644 (file)
@@ -1 +1,3 @@
 option('cookies', type: 'boolean', value: false, description: 'Support for DNS Cookies.')
+option('client', type : 'boolean', value : true, description: 'kresc client binary')
+option('daemon', type: 'boolean', value: true, description: 'kresd daemon binary')