diff --git a/configure.ac b/configure.ac index ebd208240e..36ba703c07 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,7 @@ HAL_REQUIRED=0.5.0 DEVMAPPER_REQUIRED=1.0.0 LIBCURL_REQUIRED="7.18.0" LIBPCAP_REQUIRED="1.0.0" +LIBNL_REQUIRED="1.1" dnl Checks for C compiler. AC_PROG_CC @@ -2005,6 +2006,24 @@ fi AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"]) +dnl netlink library + +LIBNL_CFLAGS="" +LIBNL_LIBS="" + +if test "$with_macvtap" = "yes"; then + PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [ + ], [ + AC_MSG_ERROR([libnl >= $LIBNL_REQUIRED is required for macvtap support]) + ]) +fi + +AC_SUBST([LIBNL_CFLAGS]) +AC_SUBST([LIBNL_LIBS]) + + + + # Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball. # Copy one to the other, but only if this is a srcdir-build. @@ -2183,6 +2202,11 @@ AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS]) else AC_MSG_NOTICE([ pcap: no]) fi +if test "$with_macvtap" = "yes" ; then +AC_MSG_NOTICE([ nl: $LIBNL_CFLAGS $LIBNL_LIBS]) +else +AC_MSG_NOTICE([ nl: no]) +fi AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) diff --git a/libvirt.spec.in b/libvirt.spec.in index 3d3b8718da..0629f67c55 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -63,6 +63,7 @@ %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} +%define with_macvtap 0%{!?_without_macvtap:0} # Non-server/HV driver defaults which are always enabled %define with_python 0%{!?_without_python:1} @@ -153,6 +154,11 @@ %if %{with_qemu} %define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}} %define with_libpcap 0%{!?_without_libpcap:%{server_drivers}} +%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}} +%endif + +%if %{with_macvtap} +%define with_libnl 1 %endif # Force QEMU to run as non-root @@ -282,6 +288,9 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +%endif %if %{with_avahi} BuildRequires: avahi-devel %endif @@ -531,6 +540,10 @@ of recent versions of Linux (and other OSes). %define _without_libpcap --without-libpcap %endif +%if ! %{with_macvtap} +%define _without_macvtap --without-macvtap +%endif + %configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \ @@ -560,6 +573,7 @@ of recent versions of Linux (and other OSes). %{?_without_udev} \ %{?_without_yajl} \ %{?_without_libpcap} \ + %{?_without_macvtap} \ --with-qemu-user=%{qemu_user} \ --with-qemu-group=%{qemu_group} \ --with-init-script=redhat \ diff --git a/src/Makefile.am b/src/Makefile.am index 8413285dd0..00f2530af6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -999,7 +999,7 @@ libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \ $(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS) libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la libvirt_la_LIBADD += $(LIBXML_LIBS) \ - $(LIBPCAP_LIBS) \ + $(LIBPCAP_LIBS) $(LIBNL_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT @@ -1058,7 +1058,7 @@ libvirt_lxc_SOURCES = \ libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \ $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \ - ../gnulib/lib/libgnu.la + $(LIBNL_LIBS) ../gnulib/lib/libgnu.la libvirt_lxc_CFLAGS = \ $(LIBPARTED_CFLAGS) \ $(NUMACTL_CFLAGS) \