summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini2021-10-07 15:08:22 +0200
committerPaolo Bonzini2021-10-14 09:50:57 +0200
commit837b84b1c078bf3e909017ca11be7182a5df2ed0 (patch)
tree856fcdccf716735c50f3bdce97ecb6bc89da6d5c /meson.build
parentconfigure, meson: move vde detection to meson (diff)
downloadqemu-837b84b1c078bf3e909017ca11be7182a5df2ed0.tar.gz
qemu-837b84b1c078bf3e909017ca11be7182a5df2ed0.tar.xz
qemu-837b84b1c078bf3e909017ca11be7182a5df2ed0.zip
configure, meson: move netmap detection to meson
Message-Id: <20211007130829.632254-12-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build19
1 files changed, 18 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 0e948a8024..40563e3c24 100644
--- a/meson.build
+++ b/meson.build
@@ -1656,6 +1656,23 @@ config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + '''
return mlockall(MCL_FUTURE);
}'''))
+have_netmap = false
+if not get_option('netmap').disabled() and have_system
+ have_netmap = cc.compiles('''
+ #include <inttypes.h>
+ #include <net/if.h>
+ #include <net/netmap.h>
+ #include <net/netmap_user.h>
+ #if (NETMAP_API < 11) || (NETMAP_API > 15)
+ #error
+ #endif
+ int main(void) { return 0; }''')
+ if not have_netmap and get_option('netmap').enabled()
+ error('Netmap headers not available')
+ endif
+endif
+config_host_data.set('CONFIG_NETMAP', have_netmap)
+
# Work around a system header bug with some kernel/XFS header
# versions where they both try to define 'struct fsxattr':
# xfs headers will not try to redefine structs from linux headers
@@ -3311,7 +3328,7 @@ endif
summary_info += {'JACK support': jack}
summary_info += {'brlapi support': brlapi}
summary_info += {'vde support': vde}
-summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
+summary_info += {'netmap support': have_netmap}
summary_info += {'Linux AIO support': libaio}
summary_info += {'Linux io_uring support': linux_io_uring}
summary_info += {'ATTR/XATTR support': libattr}