From: Andrea Bolognani Date: Wed, 26 May 2021 16:20:04 +0000 (+0200) Subject: meson: Use built-in pcap detection X-Git-Tag: v7.5.0-rc1~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70670d4af7c302d3f009e71aa891c4a266ebdd01;p=thirdparty%2Flibvirt.git meson: Use built-in pcap detection Meson already knows how to look for pcap using pkg-config first, and falling back to pcap-config if that didn't work. https://mesonbuild.com/Dependencies.html#pcap Signed-off-by: Andrea Bolognani Reviewed-by: Pavel Hrdina --- diff --git a/meson.build b/meson.build index 9e60677513..1c46e8b2a8 100644 --- a/meson.build +++ b/meson.build @@ -978,19 +978,7 @@ endif libpcap_version = '1.5.0' if not get_option('libpcap').disabled() - libpcap_dep = dependency('libpcap', version: '>=' + libpcap_version, required: false) - - if not libpcap_dep.found() - pcap_config_prog = find_program('pcap-config', required: get_option('libpcap')) - if pcap_config_prog.found() - pcap_args = run_command(pcap_config_prog, '--cflags').stdout().strip().split() - pcap_libs = run_command(pcap_config_prog, '--libs').stdout().strip().split() - libpcap_dep = declare_dependency( - compile_args: pcap_args, - link_args: pcap_libs, - ) - endif - endif + libpcap_dep = dependency('pcap', version: '>=' + libpcap_version, required: get_option('libpcap')) else libpcap_dep = dependency('', required: false) endif