qemu: Move capability checks for IOMMU features
[libvirt/ericb.git] / m4 / virt-macvtap.m4
blobc5da96ecf2f402458dee7638cea71d76206cfbc6
1 dnl The macvtap support
2 dnl
3 dnl Copyright (C) 2016 Red Hat, Inc.
4 dnl
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
9 dnl
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 dnl Lesser General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library.  If not, see
17 dnl <http://www.gnu.org/licenses/>.
18 dnl
20 AC_DEFUN([LIBVIRT_ARG_MACVTAP], [
21   LIBVIRT_ARG_WITH([MACVTAP], [enable macvtap device], [check])
24 AC_DEFUN([LIBVIRT_CHECK_MACVTAP], [
25   AC_MSG_CHECKING([whether to compile with macvtap support])
26   if test "$with_macvtap" != "no" ; then
27     AC_TRY_COMPILE([ #include <sys/socket.h>
28                      #include <linux/rtnetlink.h> ],
29                    [ int x = MACVLAN_MODE_BRIDGE;
30                      int y = IFLA_VF_MAX; ],
31                    [ with_macvtap=yes ],
32                    [ if test "$with_macvtap" = "yes" ; then
33                        AC_MSG_ERROR([Installed linux headers don't show support for macvtap device.])
34                      fi
35                      with_macvtap=no ])
36     if test "$with_macvtap" = "yes" ; then
37       val=1
38     else
39       val=0
40     fi
41     AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is enabled])
42   fi
43   AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"])
44   AC_MSG_RESULT([$with_macvtap])
46   if test "$with_macvtap" = yes; then
47     AC_CHECK_DECLS([MACVLAN_MODE_PASSTHRU], [], [], [[
48       #include <sys/socket.h>
49       #include <linux/if_link.h>
50     ]])
51   fi
54 AC_DEFUN([LIBVIRT_RESULT_MACVTAP], [
55   LIBVIRT_RESULT_LIB([MACVTAP])