meson: add libnl build dependency

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-04-29 12:08:33 +02:00
parent edd227afa5
commit f596485601
3 changed files with 20 additions and 49 deletions

View File

@ -130,7 +130,6 @@ LIBVIRT_ARG_VIRTUALPORT
LIBVIRT_ARG_WIRESHARK
LIBVIRT_ARG_YAJL
LIBVIRT_CHECK_LIBNL
LIBVIRT_CHECK_LIBPARTED
LIBVIRT_CHECK_LIBPCAP
LIBVIRT_CHECK_LIBSSH
@ -430,7 +429,6 @@ LIBVIRT_RESULT_DRIVER_MODULES
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Libraries])
AC_MSG_NOTICE([])
LIBVIRT_RESULT_LIBNL
LIBVIRT_RESULT_LIBPCAP
LIBVIRT_RESULT_LIBSSH
LIBVIRT_RESULT_LIBXL

View File

@ -1,47 +0,0 @@
dnl The libnl library
dnl
dnl Copyright (C) 2012-2013 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_CHECK_LIBNL], [
AC_REQUIRE([LIBVIRT_CHECK_MACVTAP])
with_libnl=no
if test "$with_linux" = "yes"; then
PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [
with_libnl=yes
AC_DEFINE([HAVE_LIBNL], [1], [whether the netlink library is available])
PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0])
LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE_CFLAGS"
LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE_LIBS"
], [:])
fi
if test "$with_libnl" = no; then
if test "$with_macvtap" = "yes"; then
AC_MSG_ERROR([libnl3-devel is required for macvtap support])
fi
fi
AM_CONDITIONAL([HAVE_LIBNL], [test "$with_libnl" = "yes"])
AC_SUBST([LIBNL_CFLAGS])
AC_SUBST([LIBNL_LIBS])
])
AC_DEFUN([LIBVIRT_RESULT_LIBNL], [
LIBVIRT_RESULT_LIB([LIBNL])
])

View File

@ -1084,6 +1084,21 @@ endif
libiscsi_version = '1.18.0'
libiscsi_dep = dependency('libiscsi', version: '>=' + libiscsi_version, required: get_option('libiscsi'))
libnl_version = '3.0'
if host_machine.system() == 'linux'
libnl_dep = dependency('libnl-3.0', version: '>=' + libnl_version, required: false)
libnl_route_dep = dependency('libnl-route-3.0', version: '>=' + libnl_version, required: false)
if libnl_dep.found() and libnl_route_dep.found()
libnl_dep = declare_dependency(
dependencies: [ libnl_dep, libnl_route_dep ],
)
conf.set('HAVE_LIBNL', 1)
endif
else
libnl_dep = dependency('', required: false)
endif
use_macvtap = false
if not get_option('macvtap').disabled()
if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and
@ -1206,6 +1221,10 @@ elif get_option('firewalld_zone').enabled()
error('You must have firewalld support enabled to enable firewalld_zone')
endif
if conf.has('WITH_MACVTAP') and not conf.has('HAVE_LIBNL')
error('libnl3-devel is required for macvtap support')
endif
# define top include directory
@ -1244,6 +1263,7 @@ libs_summary = {
'gnutls': gnutls_dep.found(),
'hal': hal_dep.found(),
'libiscsi': libiscsi_dep.found(),
'libnl': libnl_dep.found(),
'macvtap': conf.has('WITH_MACVTAP'),
'readline': readline_dep.found(),
}