curses="auto"
docs="auto"
fdt="auto"
-netmap="no"
+netmap="auto"
sdl="auto"
sdl_image="auto"
virtiofsd="auto"
bsd_user="yes"
make="${MAKE-gmake}"
# needed for kinfo_getvmmap(3) in libutil.h
- netmap="" # enable netmap autodetect
;;
DragonFly)
bsd="yes"
;;
--enable-vde) vde="enabled"
;;
- --disable-netmap) netmap="no"
+ --disable-netmap) netmap="disabled"
;;
- --enable-netmap) netmap="yes"
+ --enable-netmap) netmap="enabled"
;;
--disable-xen) xen="disabled"
;;
fi
##########################################
-# netmap support probe
-# Apart from looking for netmap headers, we make sure that the host API version
-# supports the netmap backend (>=11). The upper bound (15) is meant to simulate
-# a minor/major version number. Minor new features will be marked with values up
-# to 15, and if something happens that requires a change to the backend we will
-# move above 15, submit the backend fixes and modify this two bounds.
-if test "$netmap" != "no" ; then
- cat > $TMPC << EOF
-#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; }
-EOF
- if compile_prog "" "" ; then
- netmap=yes
- else
- if test "$netmap" = "yes" ; then
- feature_not_found "netmap"
- fi
- netmap=no
- fi
-fi
-
-##########################################
# plugin linker support probe
if test "$plugins" != "no"; then
echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
fi
-if test "$netmap" = "yes" ; then
- echo "CONFIG_NETMAP=y" >> $config_host_mak
-fi
if test "$l2tpv3" = "yes" ; then
echo "CONFIG_L2TPV3=y" >> $config_host_mak
fi
-Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \
-Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \
-Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \
- -Dvde=$vde \
+ -Dnetmap=$netmap -Dvde=$vde \
$cross_arg \
"$PWD" "$source_path"
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
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}
description: 'U2F emulation support')
option('usb_redir', type : 'feature', value : 'auto',
description: 'libusbredir support')
+option('netmap', type : 'feature', value : 'auto',
+ description: 'netmap network backend support')
option('vde', type : 'feature', value : 'auto',
description: 'vde network backend support')
option('virglrenderer', type : 'feature', value : 'auto',
softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c'))
softmmu_ss.add(when: slirp, if_true: files('slirp.c'))
softmmu_ss.add(when: vde, if_true: files('vde.c'))
-softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c'))
+if have_netmap
+ softmmu_ss.add(files('netmap.c'))
+endif
vhost_user_ss = ss.source_set()
vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c'))
softmmu_ss.add_all(when: 'CONFIG_VHOST_NET_USER', if_true: vhost_user_ss)