[libvirt] [PATCH 26/89] configure: move macvtap check to its own file

Pavel Hrdina phrdina at redhat.com
Fri Dec 16 09:10:54 UTC 2016


This patch moves the macvtap result out of *Driver* section because
it's not a driver.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 configure.ac       | 32 +++----------------------------
 m4/virt-macvtap.m4 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 29 deletions(-)
 create mode 100644 m4/virt-macvtap.m4

diff --git a/configure.ac b/configure.ac
index c040707397..694823b5e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1796,34 +1796,8 @@ AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], [/usr/libexec/qemu-brid
                   [/usr/libexec:/usr/lib/qemu:/usr/lib])
 AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], [QEMU bridge helper])
 
-LIBVIRT_ARG_WITH_ALT([MACVTAP], [enable macvtap device], [check])
-
-AC_MSG_CHECKING([whether to compile with macvtap support])
-if test "$with_macvtap" != "no" ; then
-    AC_TRY_COMPILE([ #include <sys/socket.h>
-                     #include <linux/rtnetlink.h> ],
-                   [ int x = MACVLAN_MODE_BRIDGE;
-                     int y = IFLA_VF_MAX; ],
-                   [ with_macvtap=yes ],
-                   [ if test "$with_macvtap" = "yes" ; then
-                         AC_MSG_ERROR([Installed linux headers don't show support for macvtap device.])
-                     fi
-                     with_macvtap=no ])
-    if test "$with_macvtap" = "yes" ; then
-        val=1
-    else
-        val=0
-    fi
-    AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is enabled])
-fi
-AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"])
-AC_MSG_RESULT([$with_macvtap])
-if test "$with_macvtap" = yes; then
-    AC_CHECK_DECLS([MACVLAN_MODE_PASSTHRU], [], [], [[
-      #include <sys/socket.h>
-      #include <linux/if_link.h>
-    ]])
-fi
+LIBVIRT_ARG_MACVTAP
+LIBVIRT_CHECK_MACVTAP
 
 
 LIBVIRT_ARG_WITH_ALT([VIRTUALPORT], [enable virtual port support], [check])
@@ -2086,7 +2060,6 @@ AC_MSG_NOTICE([   Remote: $with_remote])
 AC_MSG_NOTICE([  Network: $with_network])
 AC_MSG_NOTICE([ Libvirtd: $with_libvirtd])
 AC_MSG_NOTICE([Interface: $with_interface])
-AC_MSG_NOTICE([  macvtap: $with_macvtap])
 AC_MSG_NOTICE([ virtport: $with_virtualport])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Storage Drivers])
@@ -2132,6 +2105,7 @@ LIBVIRT_RESULT_HAL
 LIBVIRT_RESULT_LIBPCAP
 LIBVIRT_RESULT_LIBSSH
 LIBVIRT_RESULT_LIBXML
+LIBVIRT_RESULT_MACVTAP
 LIBVIRT_RESULT_NETCF
 LIBVIRT_RESULT_NSS
 LIBVIRT_RESULT_NUMACTL
diff --git a/m4/virt-macvtap.m4 b/m4/virt-macvtap.m4
new file mode 100644
index 0000000000..daf48b045a
--- /dev/null
+++ b/m4/virt-macvtap.m4
@@ -0,0 +1,56 @@
+dnl The macvtap support
+dnl
+dnl Copyright (C) 2016 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_ARG_MACVTAP], [
+  LIBVIRT_ARG_WITH_ALT([MACVTAP], [enable macvtap device], [check])
+])
+
+AC_DEFUN([LIBVIRT_CHECK_MACVTAP], [
+  AC_MSG_CHECKING([whether to compile with macvtap support])
+  if test "$with_macvtap" != "no" ; then
+    AC_TRY_COMPILE([ #include <sys/socket.h>
+                     #include <linux/rtnetlink.h> ],
+                   [ int x = MACVLAN_MODE_BRIDGE;
+                     int y = IFLA_VF_MAX; ],
+                   [ with_macvtap=yes ],
+                   [ if test "$with_macvtap" = "yes" ; then
+                       AC_MSG_ERROR([Installed linux headers don't show support for macvtap device.])
+                     fi
+                     with_macvtap=no ])
+    if test "$with_macvtap" = "yes" ; then
+      val=1
+    else
+      val=0
+    fi
+    AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is enabled])
+  fi
+  AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"])
+  AC_MSG_RESULT([$with_macvtap])
+
+  if test "$with_macvtap" = yes; then
+    AC_CHECK_DECLS([MACVLAN_MODE_PASSTHRU], [], [], [[
+      #include <sys/socket.h>
+      #include <linux/if_link.h>
+    ]])
+  fi
+])
+
+AC_DEFUN([LIBVIRT_RESULT_MACVTAP], [
+  LIBVIRT_RESULT_LIB([MACVTAP])
+])
-- 
2.11.0




More information about the libvir-list mailing list