configure, meson: Migrate libpcap check to meson

This commit is contained in:
Matt Borgerson 2023-01-23 00:30:40 -07:00
parent ed042c141f
commit ef44344d06
2 changed files with 9 additions and 19 deletions

17
configure vendored
View File

@ -1562,20 +1562,6 @@ if test "$opengl" != "no" ; then
QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags"
fi # test "$opengl" != "no"
##########################################
# libpcap probe
if test "$mingw32" = "yes"; then
libpcap_cflags="-I$source_path/winpcap-loader/include"
libpcap_libs="-lws2_32"
else
if $pkg_config --exists "libpcap"; then
libpcap_cflags=$($pkg_config --cflags libpcap)
libpcap_libs=$($pkg_config --libs libpcap)
else
feature_not_found "libpcap" "Install libpcap"
fi
fi
##########################################
# libsamplerate probe
if $pkg_config --exists samplerate; then
@ -2426,9 +2412,6 @@ if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then
echo "CONFIG_TSAN=y" >> $config_host_mak
fi
echo "LIBPCAP_CFLAGS=$libpcap_cflags" >> $config_host_mak
echo "LIBPCAP_LIBS=$libpcap_libs" >> $config_host_mak
echo "LIBSAMPLERATE_CFLAGS=$libsamplerate_cflags" >> $config_host_mak
echo "LIBSAMPLERATE_LIBS=$libsamplerate_libs" >> $config_host_mak

View File

@ -1186,8 +1186,15 @@ openssl = dependency('openssl',
required: true,
kwargs: static_kwargs)
libpcap = declare_dependency(compile_args: config_host['LIBPCAP_CFLAGS'].split(),
link_args: config_host['LIBPCAP_LIBS'].split())
if targetos == 'windows'
libpcap = declare_dependency(include_directories: 'winpcap-loader/include',
link_args: ['-lws2_32'])
else
libpcap = dependency('libpcap',
method: 'pkg-config',
required: true,
kwargs: static_kwargs)
endif
libsamplerate = declare_dependency(compile_args: config_host['LIBSAMPLERATE_CFLAGS'].split(),
link_args: config_host['LIBSAMPLERATE_LIBS'].split())