From ef44344d0684de05b416a5e28bf607e9a6cb1295 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 23 Jan 2023 00:30:40 -0700 Subject: [PATCH] configure, meson: Migrate libpcap check to meson --- configure | 17 ----------------- meson.build | 11 +++++++++-- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 749b83bd6e..11d69ca2f3 100755 --- a/configure +++ b/configure @@ -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 diff --git a/meson.build b/meson.build index a07c2378d1..114eee4da7 100644 --- a/meson.build +++ b/meson.build @@ -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())