]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Check for sys/mman.h and mmap
authorFred Morcos <fred.morcos@open-xchange.com>
Sat, 17 Jun 2023 09:18:49 +0000 (11:18 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:24 +0000 (13:28 +0100)
meson.build

index 6897b4d264ee4292aa638bccb968f6fb1aedcc74..2cf18d431fc98057c94a225bba4372a7462ff0cb 100644 (file)
@@ -417,6 +417,19 @@ if has
 endif
 summary('tm_gmtoff', has, bool_yn: true, section: 'System')
 
+# Check for mmap -------------------------------------------------------------------------
+mman_h = false
+have_mmap = false
+if cxx.has_header('sys/mman.h', required: false)
+  mman_h = true
+  if cxx.has_function('mmap', prefix: '''#include <sys/mman.h>''')
+    have_mmap = true
+    conf.set('HAVE_MMAP', 1, description: 'Whether we have mmap')
+  endif
+endif
+summary('sys/mman.h', mman_h, bool_yn: true, section: 'System')
+summary('Have mmap', have_mmap, bool_yn: true, section: 'System')
+
 # Generate config.h ----------------------------------------------------------------------
 config_h = configure_file(configuration: conf, output: 'config.h')
 # summary('Defines', conf.keys(), section: 'Build Configuration') # Meson 0.57