subdir('meson/dot') # DNS over TLS
subdir('meson/ipcipher') # IPCipher
subdir('meson/ragel') # Find Ragel
+subdir('meson/clock-gettime') # Clock_gettime
# Find or generate pdns/dnslabeltext.cc
if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc')
--- /dev/null
+# Clock_gettime
+# Inputs: deps
+
+found = cxx.has_function('clock_gettime')
+
+if not found
+ lib = cxx.find_library('rt', required: true)
+
+ if not cxx.has_function('clock_gettime', dependencies: lib)
+ error('Cannot find function ' + 'clock_gettime')
+ endif
+
+ deps += lib
+ found = lib.name() + ' ' + lib.version()
+endif
+
+summary('clock_gettime', found, bool_yn: true, section: 'System')