[libvirt] [PATCH 1/2] Add mkfs and libblkid to build system

Daniel P. Berrange berrange at redhat.com
Mon May 17 15:51:20 UTC 2010


On Thu, May 13, 2010 at 10:18:23PM -0400, David Allan wrote:
> ---
>  configure.ac |   25 +++++++++++++++++++++++++
>  1 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index c187420..b10e4b0 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"
> +LIBBLKID_REQUIRED="2.17"
> 
>  dnl Checks for C compiler.
>  AC_PROG_CC
> @@ -1308,6 +1309,25 @@ if test "$with_nwfilter" = "yes" ; then
>  fi
>  AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"])
> 
> +dnl libblkid is used by several storage drivers; therefore we probe
> +dnl for it unconditionally.
> +AC_ARG_WITH([libblkid],
> +  [AS_HELP_STRING([--with-libblkid],
> +    [use libblkid to scan for filesystems and partitions @<:@default=check@:>@])],
> +  [],
> +  [with_libblkid=check])
> +
> +if test "x$with_libblkid" = "xyes" || test "x$with_libblkid" = "xcheck"; then
> +   PKG_CHECK_MODULES([BLKID],
> +                     [blkid >= $LIBBLKID_REQUIRED],
> +                     [with_libblkid="yes"],
> +                     [with_libblkid="no"])
> +fi
> +
> +if test x"$with_libblkid" = x"yes"; then
> +  AC_DEFINE([HAVE_LIBBLKID], [1], [libblkid is present])
> +fi
> +AM_CONDITIONAL([HAVE_LIBBLKID], [test x"$with_libblkid" = x"yes"])
> 
>  AC_ARG_WITH([storage-fs],
>    AC_HELP_STRING([--with-storage-fs], [with FileSystem backend for the storage driver @<:@default=check@:>@]),[],[with_storage_fs=check])
> @@ -1341,12 +1361,15 @@ AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"])
>  if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then
>    AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin])
>    AC_PATH_PROG([UMOUNT], [umount], [], [$PATH:/sbin:/usr/sbin])
> +  AC_PATH_PROG([MKFS], [mkfs], [], [$PATH:/sbin:/usr/sbin])
>    if test "$with_storage_fs" = "yes" ; then
>      if test -z "$MOUNT" ; then AC_MSG_ERROR([We need mount for FS storage driver]) ; fi
>      if test -z "$UMOUNT" ; then AC_MSG_ERROR([We need umount for FS storage driver]) ; fi
> +    if test -z "$MKFS" ; then AC_MSG_ERROR([We need mkfs for FS storage driver]) ; fi
>    else
>      if test -z "$MOUNT" ; then with_storage_fs=no ; fi
>      if test -z "$UMOUNT" ; then with_storage_fs=no ; fi
> +    if test -z "$MKFS" ; then with_storage_fs=no ; fi
> 
>      if test "$with_storage_fs" = "check" ; then with_storage_fs=yes ; fi
>    fi
> @@ -1357,6 +1380,8 @@ if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then
>          [Location or name of the mount program])
>      AC_DEFINE_UNQUOTED([UMOUNT],["$UMOUNT"],
>          [Location or name of the mount program])
> +    AC_DEFINE_UNQUOTED([MKFS],["$MKFS"],
> +        [Location or name of the mkfs program])
>    fi
>  fi
>  AM_CONDITIONAL([WITH_STORAGE_FS], [test "$with_storage_fs" = "yes"])

It is also neccessary to add dependancies to libvirt.spec.in for these
new build time requirements on libblkid-devel

Regards,
Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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