Skip to content

Commit e172399

Browse files
committed
configure, meson: move vde detection to meson
Reviewed-by: Marc-André Lureau <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent ff66f3e commit e172399

File tree

4 files changed

+30
-35
lines changed

4 files changed

+30
-35
lines changed

configure

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ libudev="auto"
301301
mpath="auto"
302302
vnc="auto"
303303
sparse="auto"
304-
vde="$default_feature"
304+
vde="auto"
305305
vnc_sasl="auto"
306306
vnc_jpeg="auto"
307307
vnc_png="auto"
@@ -1022,9 +1022,9 @@ for opt do
10221022
;;
10231023
--enable-slirp=system) slirp="system"
10241024
;;
1025-
--disable-vde) vde="no"
1025+
--disable-vde) vde="disabled"
10261026
;;
1027-
--enable-vde) vde="yes"
1027+
--enable-vde) vde="enabled"
10281028
;;
10291029
--disable-netmap) netmap="no"
10301030
;;
@@ -2903,30 +2903,6 @@ EOF
29032903
fi
29042904
fi
29052905

2906-
##########################################
2907-
# vde libraries probe
2908-
if test "$vde" != "no" ; then
2909-
vde_libs="-lvdeplug"
2910-
cat > $TMPC << EOF
2911-
#include <libvdeplug.h>
2912-
int main(void)
2913-
{
2914-
struct vde_open_args a = {0, 0, 0};
2915-
char s[] = "";
2916-
vde_open(s, s, &a);
2917-
return 0;
2918-
}
2919-
EOF
2920-
if compile_prog "" "$vde_libs" ; then
2921-
vde=yes
2922-
else
2923-
if test "$vde" = "yes" ; then
2924-
feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel"
2925-
fi
2926-
vde=no
2927-
fi
2928-
fi
2929-
29302906
##########################################
29312907
# netmap support probe
29322908
# Apart from looking for netmap headers, we make sure that the host API version
@@ -4199,10 +4175,6 @@ if test "$slirp_smbd" = "yes" ; then
41994175
echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak
42004176
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
42014177
fi
4202-
if test "$vde" = "yes" ; then
4203-
echo "CONFIG_VDE=y" >> $config_host_mak
4204-
echo "VDE_LIBS=$vde_libs" >> $config_host_mak
4205-
fi
42064178
if test "$netmap" = "yes" ; then
42074179
echo "CONFIG_NETMAP=y" >> $config_host_mak
42084180
fi
@@ -4752,6 +4724,7 @@ if test "$skip_meson" = no; then
47524724
-Dalsa=$alsa -Dcoreaudio=$coreaudio -Ddsound=$dsound -Djack=$jack -Doss=$oss \
47534725
-Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \
47544726
-Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \
4727+
-Dvde=$vde \
47554728
$cross_arg \
47564729
"$PWD" "$source_path"
47574730

meson.build

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,28 @@ else
500500
xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
501501
method: 'pkg-config', kwargs: static_kwargs)
502502
endif
503+
503504
vde = not_found
504-
if config_host.has_key('CONFIG_VDE')
505-
vde = declare_dependency(link_args: config_host['VDE_LIBS'].split())
505+
if not get_option('vde').auto() or have_system or have_tools
506+
vde = cc.find_library('vdeplug', has_headers: ['libvdeplug.h'],
507+
required: get_option('vde'),
508+
kwargs: static_kwargs)
509+
endif
510+
if vde.found() and not cc.links('''
511+
#include <libvdeplug.h>
512+
int main(void)
513+
{
514+
struct vde_open_args a = {0, 0, 0};
515+
char s[] = "";
516+
vde_open(s, s, &a);
517+
return 0;
518+
}''', dependencies: vde)
519+
vde = not_found
520+
if get_option('cap_ng').enabled()
521+
error('could not link libvdeplug')
522+
else
523+
warning('could not link libvdeplug, disabling')
524+
endif
506525
endif
507526

508527
pulse = not_found
@@ -1441,6 +1460,7 @@ config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
14411460
config_host_data.set('CONFIG_SECCOMP', seccomp.found())
14421461
config_host_data.set('CONFIG_SNAPPY', snappy.found())
14431462
config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
1463+
config_host_data.set('CONFIG_VDE', vde.found())
14441464
config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
14451465
config_host_data.set('CONFIG_VNC', vnc.found())
14461466
config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
@@ -3290,7 +3310,7 @@ if targetos == 'linux'
32903310
endif
32913311
summary_info += {'JACK support': jack}
32923312
summary_info += {'brlapi support': brlapi}
3293-
summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
3313+
summary_info += {'vde support': vde}
32943314
summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')}
32953315
summary_info += {'Linux AIO support': libaio}
32963316
summary_info += {'Linux io_uring support': linux_io_uring}

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ option('u2f', type : 'feature', value : 'auto',
129129
description: 'U2F emulation support')
130130
option('usb_redir', type : 'feature', value : 'auto',
131131
description: 'libusbredir support')
132+
option('vde', type : 'feature', value : 'auto',
133+
description: 'vde network backend support')
132134
option('virglrenderer', type : 'feature', value : 'auto',
133135
description: 'virgl rendering support')
134136
option('vnc', type : 'feature', value : 'auto',

net/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c'))
2020

2121
softmmu_ss.add(when: 'CONFIG_L2TPV3', if_true: files('l2tpv3.c'))
2222
softmmu_ss.add(when: slirp, if_true: files('slirp.c'))
23-
softmmu_ss.add(when: ['CONFIG_VDE', vde], if_true: files('vde.c'))
23+
softmmu_ss.add(when: vde, if_true: files('vde.c'))
2424
softmmu_ss.add(when: 'CONFIG_NETMAP', if_true: files('netmap.c'))
2525
vhost_user_ss = ss.source_set()
2626
vhost_user_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c'))

0 commit comments

Comments
 (0)