[libvirt] [PATCH 5/5] Use pkg_config in configure.in to detect presence of libnetcf and
Daniel P. Berrange
berrange at redhat.com
Mon May 11 10:40:56 UTC 2009
On Fri, May 08, 2009 at 01:52:27PM -0400, Laine Stump wrote:
> From: Laine Stump <laine at redhat.com>
>
> ---
> configure.in | 35 ++++++++++++++++++++++++++++++++---
> src/Makefile.am | 5 +++++
> 2 files changed, 37 insertions(+), 3 deletions(-)
>
> diff --git a/configure.in b/configure.in
> index 1cdb64c..4ce4342 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -28,6 +28,7 @@ GNUTLS_REQUIRED="1.0.25"
> AVAHI_REQUIRED="0.6.0"
> POLKIT_REQUIRED="0.6"
> PARTED_REQUIRED="1.8.0"
> +NETCF_REQUIRED="0.0.1"
>
> dnl Checks for C compiler.
> AC_PROG_CC
> @@ -789,9 +790,31 @@ if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then
> fi
> AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
>
> -dnl
> -dnl Storage driver checks
> -dnl
> +dnl netcf library
> +AC_ARG_WITH([netcf],
> +[ --with-netcf libnetcf support to configure physical host network interfaces],
> +[], [with_netcf=check])
> +
> +NETCF_CFLAGS=
> +NETCF_LIBS=
> +if test "$with_netcf" = "yes" -o "$with_netcf" = "check"; then
> + PKG_CHECK_MODULES(NETCF, netcf >= $NETCF_REQUIRED,
> + [with_netcf=yes], [
> + if test "$with_netcf" = "check" ; then
> + with_netcf=no
> + else
> + AC_MSG_ERROR(
> + [You must install libnetcf >= $NETCF_REQUIRED to compile libvirt])
> + fi
> + ])
> + if test "$with_netcf" = "yes" ; then
> + AC_DEFINE_UNQUOTED([WITH_NETCF], 1,
> + [whether libnetcf is available to configure physical host network interfaces])
> + fi
> +fi
> +AM_CONDITIONAL([WITH_NETCF], [test "$with_netcf" = "yes"])
> +AC_SUBST([NETCF_CFLAGS])
> +AC_SUBST([NETCF_LIBS])
>
> AC_ARG_WITH([storage-fs],
> [ --with-storage-fs with FileSystem backend for the storage driver (on)],[],[with_storage_fs=check])
> @@ -1376,6 +1399,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([])
> @@ -1443,6 +1467,11 @@ AC_MSG_NOTICE([ devkit: $DEVKIT_CFLAGS $DEVKIT_LIBS])
> else
> AC_MSG_NOTICE([ devkit: no])
> fi
> +if test "$with_netcf" = "yes" ; then
> +AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $NETCF_LIBS])
> +else
> +AC_MSG_NOTICE([ netcf: no])
> +fi
> AC_MSG_NOTICE([])
> AC_MSG_NOTICE([Test suite])
> AC_MSG_NOTICE([])
> diff --git a/src/Makefile.am b/src/Makefile.am
> index fd692b4..7d7ef74 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -351,6 +351,11 @@ endif
> libvirt_driver_network_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
> endif
>
> +if WITH_NETCF
> +libvirt_driver_interface_la_CFLAGS = $(NETCF_CFLAGS)
> +libvirt_driver_interface_la_LDFLAGS = $(NETCF_LIBS)
> +endif
> +
> # Needed to keep automake quiet about conditionals
> libvirt_driver_storage_la_SOURCES =
> if WITH_STORAGE_DIR
ACK, looks good to me.
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 :|
More information about the libvir-list
mailing list