main: Add a 'dbus' set of sink actions

The sysrq sink actions are are intended for use with kdump, which will
capture relevant kernel and userspace memory. It's implementation is
thus pretty straight forward.

Most BMCs don't use kdump, so implement a set of sink actions that talk
via D-Bus to generate a dump and gracefully reboot the BMC.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I126b0118faaa793011268a785eeb955139739eaf
diff --git a/meson.build b/meson.build
index 96f437e..a75e122 100644
--- a/meson.build
+++ b/meson.build
@@ -6,7 +6,9 @@
 		'werror=true',
 		'c_std=gnu18',
 	])
-executable('debug-trigger', 'main.c', install: true)
+
+config = configuration_data()
+debug_trigger_deps = []
 
 if get_option('systemd')
 	systemd = dependency('systemd')
@@ -15,8 +17,12 @@
 		       output: 'debug-trigger@.service',
 		       copy: true,
 		       install_dir: unitdir)
+	debug_trigger_deps += dependency('libsystemd')
 endif
 
+config.set10('HAVE_SYSTEMD', get_option('systemd'))
+config_h = configure_file(configuration: config, output: 'config.h')
+
 udev = dependency('udev')
 udevdir = udev.get_pkgconfig_variable('udevdir')
 
@@ -27,3 +33,7 @@
 	rulesdir = udevdir + '/rules.d'
 	configure_file(input: src, output: dst, copy: true, install_dir: rulesdir)
 endforeach
+
+executable('debug-trigger', 'main.c', config_h,
+	   dependencies: debug_trigger_deps,
+	   install: true)