
On Thu, Apr 02, 2009 at 02:18:40PM -0400, laine@laine.org wrote:
dnl +dnl Is the netcf library available and desired? +dnl +AC_ARG_WITH([netcf], +[ --with-netcf add libnetcf support (on)],[],[with_netcf=yes]) +if test "$with_netcf" = "yes" ; then + AC_CHECK_LIB([netcf], [ncf_init], + [AC_CHECK_HEADER([netcf.h], + [LIB_NETCF=-lnetcf], + [AC_MSG_WARN([header netcf.h was not found, support for libnetcf will not be built])] + [with_netcf=no] + )], + [AC_MSG_WARN([libnetcf library was not found or not usable, support for libnetcf will not be built])] + [with_netcf=no])
I'm fairly sure netcf has support for pkg-config, so this CHECK_LIB/HEADER bit can be simplified. Take a look at te AVAHI check for a good example usage of pkg-config.
+ AC_SUBST([LIB_NETCF]) +fi +if test "$with_netcf" = "yes" ; then + AC_DEFINE_UNQUOTED([WITH_NETCF], 1, [whether host interface config via libnetcf is enabled]) +fi +AM_CONDITIONAL([WITH_NETCF], [test "$with_netcf" = "yes"])
+ +dnl dnl Storage driver checks dnl
@@ -1367,6 +1388,7 @@ AC_MSG_NOTICE([ Test: $with_test]) AC_MSG_NOTICE([ Remote: $with_remote]) AC_MSG_NOTICE([ Network: $with_network]) AC_MSG_NOTICE([Libvirtd: $with_libvirtd]) +AC_MSG_NOTICE([ netcf: $with_netcf]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) diff --git a/src/Makefile.am b/src/Makefile.am index 60b2d46..39766ee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -207,7 +207,7 @@ libvirt_driver_la_SOURCES = \ $(NODE_DEVICE_CONF_SOURCES)
libvirt_driver_la_CFLAGS = $(XEN_CFLAGS) $(NUMACTL_CFLAGS) -libvirt_driver_la_LDFLAGS = $(XEN_LIBS) $(NUMACTL_LIBS) +libvirt_driver_la_LDFLAGS = $(XEN_LIBS) $(NUMACTL_LIBS) $(LIB_NETCF)
The 'netcf' stuff I imagine will only need to be used by the 'interface', so I expect you'd end up with a libvirt_driver_interface_la... which would have the NETCF_LIBS & NETCF_CFLAGS settings Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|