]> xenbits.xensource.com Git - libvirt.git/commitdiff
vepa+vsi: Introduce dependency on libnl
authorStefan Berger <stefanb@us.ibm.com>
Tue, 25 May 2010 19:31:38 +0000 (15:31 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 25 May 2010 19:31:38 +0000 (15:31 -0400)
This patch introduces a dependency on libnl, which subsequent patches
will then use.

Changes from V1 to V2:
- added diffstats
- following changes in tree

configure.ac
libvirt.spec.in
src/Makefile.am

index ebd208240e7da34a6c396824edc151204a544445..36ba703c075ef4d60432ca10d37f73295107dfb9 100644 (file)
@@ -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([])
index 3d3b8718da01216d712104218235f5845b848365..0629f67c553e56759381046742f53e418f29315d 100644 (file)
@@ -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}
 %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 \
index 8413285dd0960fe91464867bd24ea33387759c81..00f2530af6cd7c1fdc5783ead837f424cc08d008 100644 (file)
@@ -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)               \