[Libvirt-cim] [PATCH] (#3) Configure: Check for libuuid
Chip Vincent
cvincent at linux.vnet.ibm.com
Fri May 20 14:34:06 UTC 2011
Patch looks good and works as expected on RHEL 6. +1.
On 05/13/2011 11:13 AM, Eduardo Lima (Etrunko) wrote:
> # HG changeset patch
> # User Eduardo Lima (Etrunko)<eblima at br.ibm.com>
> # Date 1304971973 10800
> # Node ID 845daca07eed6b26555f71a7c761ec945fdc644a
> # Parent 8b428df21c360d1eaedba7157b0dfd429d2db121
> Configure: Check for libuuid
>
> This patch introduces a macro in acinclude.m4 to check for libuuid
> development files and fixes the build accordingly.
>
> Changes from v1:
> Added specific check for libuuid version< 1.41.2
>
> Changes from v2:
> Respect 80 characters limit
>
> Signed-off-by: Eduardo Lima (Etrunko)<eblima at br.ibm.com>
>
> diff -r 8b428df21c36 -r 845daca07eed acinclude.m4
> --- a/acinclude.m4 Wed Apr 13 12:27:33 2011 -0700
> +++ b/acinclude.m4 Mon May 09 17:12:53 2011 -0300
> @@ -238,10 +238,32 @@
> AC_DEFUN([CHECK_LIBVIRT],
> [
> PKG_CHECK_MODULES([LIBVIRT], [libvirt>= 0.3.2])
> + AC_SUBST([LIBVIRT_CFLAGS])
> + AC_SUBST([LIBVIRT_LIBS])
> CPPFLAGS="$CPPFLAGS $LIBVIRT_CFLAGS"
> LDFLAGS="$LDFLAGS $LIBVIRT_LIBS"
> ])
>
> +AC_DEFUN([CHECK_LIBUUID],
> + [
> + PKG_CHECK_MODULES([LIBUUID], [uuid>= 1.41.2],
> + [LIBUUID_FOUND=yes], [LIBUUID_FOUND=no])
> + if test "$LIBUUID_FOUND" = "no" ; then
> + PKG_CHECK_MODULES([LIBUUID], [uuid],
> + [LIBUUID_FOUND=yes], [LIBUUID_FOUND=no])
> + if test "$LIBUUID_FOUND" = "no" ; then
> + AC_MSG_ERROR([libuuid development files required])
> + else
> + LIBUUID_INCLUDEDIR=$(pkg-config --variable=includedir uuid)
> + LIBUUID_CFLAGS+=" -I$LIBUUID_INCLUDEDIR/uuid "
> + fi
> + fi
> + AC_SUBST([LIBUUID_CFLAGS])
> + AC_SUBST([LIBUUID_LIBS])
> + CPPFLAGS="$CPPFLAGS $LIBUUID_CFLAGS"
> + LDFLAGS="$LDFLAGS $LIBUUID_LIBS"
> + ])
> +
> # A convenience macro that spits out a fail message for a particular test
> #
> # AC_CHECK_FAIL($LIBNAME,$PACKAGE_SUGGEST,$URL,$EXTRA)
> diff -r 8b428df21c36 -r 845daca07eed configure.ac
> --- a/configure.ac Wed Apr 13 12:27:33 2011 -0700
> +++ b/configure.ac Mon May 09 17:12:53 2011 -0300
> @@ -148,10 +148,14 @@
> # Check for presense of a CIM server (this macro is defined in acinclude.m4)
> CHECK_CIMSERVER
>
> +# Check pkg-config program
> +PKG_PROG_PKG_CONFIG
> +
> # Check for presence of libraries
> CHECK_LIBVIRT
> CHECK_LIBXML2
> CHECK_LIBCU
> +CHECK_LIBUUID
>
> CFLAGS_STRICT="-Werror"
>
> diff -r 8b428df21c36 -r 845daca07eed libxkutil/Makefile.am
> --- a/libxkutil/Makefile.am Wed Apr 13 12:27:33 2011 -0700
> +++ b/libxkutil/Makefile.am Mon May 09 17:12:53 2011 -0300
> @@ -1,7 +1,6 @@
> # Copyright IBM Corp. 2007
> SUBDIRS = tests
>
> -
> CFLAGS += $(CFLAGS_STRICT)
>
> noinst_HEADERS = cs_util.h misc_util.h device_parsing.h xmlgen.h infostore.h \
> @@ -9,14 +8,14 @@
>
> lib_LTLIBRARIES = libxkutil.la
>
> -AM_LDFLAGS = -lvirt -luuid
> -
> libxkutil_la_SOURCES = cs_util_instance.c misc_util.c device_parsing.c \
> xmlgen.c infostore.c pool_parsing.c
>
> +libxkutil_la_LIBADD = @LIBVIRT_LIBS@ \
> + @LIBUUID_LIBS@
> +
> noinst_PROGRAMS = xml_parse_test
>
> xml_parse_test_SOURCES = xml_parse_test.c
> -xml_parse_test_LDADD = -lvirt
> -xml_parse_test_LDFLAGS = libxkutil.la
> -xml_parse_test_DEPENDENCIES = libxkutil.la
> +xml_parse_test_LDADD = libxkutil.la \
> + @LIBVIRT_LIBS@
> diff -r 8b428df21c36 -r 845daca07eed libxkutil/xmlgen.c
> --- a/libxkutil/xmlgen.c Wed Apr 13 12:27:33 2011 -0700
> +++ b/libxkutil/xmlgen.c Mon May 09 17:12:53 2011 -0300
> @@ -22,7 +22,7 @@
> #include<string.h>
> #include<stdlib.h>
> #include<inttypes.h>
> -#include<uuid/uuid.h>
> +#include<uuid.h>
>
> #include<libxml/tree.h>
> #include<libxml/xmlsave.h>
> diff -r 8b428df21c36 -r 845daca07eed src/Virt_SettingsDefineCapabilities.c
> --- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 13 12:27:33 2011 -0700
> +++ b/src/Virt_SettingsDefineCapabilities.c Mon May 09 17:12:53 2011 -0300
> @@ -26,7 +26,7 @@
> #include<stdbool.h>
> #include<sys/vfs.h>
> #include<errno.h>
> -#include<uuid/uuid.h>
> +#include<uuid.h>
>
> #include<libvirt/libvirt.h>
>
> diff -r 8b428df21c36 -r 845daca07eed src/Virt_VSMigrationService.c
> --- a/src/Virt_VSMigrationService.c Wed Apr 13 12:27:33 2011 -0700
> +++ b/src/Virt_VSMigrationService.c Mon May 09 17:12:53 2011 -0300
> @@ -29,7 +29,7 @@
> #include<dirent.h>
> #include<errno.h>
>
> -#include<uuid/uuid.h>
> +#include<uuid.h>
>
> #include<libvirt/libvirt.h>
>
> diff -r 8b428df21c36 -r 845daca07eed src/Virt_VirtualSystemSnapshotService.c
> --- a/src/Virt_VirtualSystemSnapshotService.c Wed Apr 13 12:27:33 2011 -0700
> +++ b/src/Virt_VirtualSystemSnapshotService.c Mon May 09 17:12:53 2011 -0300
> @@ -24,7 +24,7 @@
> #include<string.h>
> #include<stdbool.h>
>
> -#include<uuid/uuid.h>
> +#include<uuid.h>
>
> #include<cmpidt.h>
> #include<cmpift.h>
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Chip Vincent
Open Virtualization
IBM Linux Technology Center
cvincent at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list