Add optional systemd integration
[tinc] / src / linux / meson.build
index 5725b4a..1b94f95 100644 (file)
@@ -1,13 +1,20 @@
 check_headers += [
   'linux/if_tun.h',
-  'sys/epoll.h',
   'netpacket/packet.h',
+  'sys/epoll.h',
 ]
 
 check_functions += 'recvmmsg'
 
 src_tincd += files('device.c')
 
+dep_libsystemd = dependency('libsystemd', required: opt_systemd)
+if dep_libsystemd.found()
+  src_tincd += files('watchdog.c')
+  deps_tincd += dep_libsystemd
+  cdata.set('HAVE_WATCHDOG', 1)
+endif
+
 if opt_uml
   src_tincd += files('uml_device.c')
   cdata.set('ENABLE_UML', 1)