[libvirt PATCH 055/351] meson: add libnl build dependency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 configure.ac     |  2 --
 m4/virt-libnl.m4 | 47 -----------------------------------------------
 meson.build      | 20 ++++++++++++++++++++
 3 files changed, 20 insertions(+), 49 deletions(-)
 delete mode 100644 m4/virt-libnl.m4

diff --git a/configure.ac b/configure.ac
index 456e60e62bc..755fe0073f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
@@ -432,7 +431,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
diff --git a/m4/virt-libnl.m4 b/m4/virt-libnl.m4
deleted file mode 100644
index cd780cf90e7..00000000000
--- a/m4/virt-libnl.m4
+++ /dev/null
@@ -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])
-])
diff --git a/meson.build b/meson.build
index ce3dbca83e0..d096a531bb7 100644
--- a/meson.build
+++ b/meson.build
@@ -1068,6 +1068,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
@@ -1190,6 +1205,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
 
@@ -1228,6 +1247,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(),
 }
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux