# HG changeset patch
# User Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
# Date 1304539509 10800
# Node ID 662adcc6b7d033ccfba6ce5471ab0c13e0f34235
# 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.
diff -r 8b428df21c36 -r 662adcc6b7d0 acinclude.m4
--- a/acinclude.m4 Wed Apr 13 12:27:33 2011 -0700
+++ b/acinclude.m4 Wed May 04 17:05:09 2011 -0300
@@ -238,10 +238,24 @@
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], [LIBUUID_FOUND=yes], [LIBUUID_FOUND=no])
+ if test "$LIBUUID_FOUND" = "no" ; then
+ AC_MSG_ERROR([libuuid development files required])
+ 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 662adcc6b7d0 configure.ac
--- a/configure.ac Wed Apr 13 12:27:33 2011 -0700
+++ b/configure.ac Wed May 04 17:05:09 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 662adcc6b7d0 libxkutil/Makefile.am
--- a/libxkutil/Makefile.am Wed Apr 13 12:27:33 2011 -0700
+++ b/libxkutil/Makefile.am Wed May 04 17:05:09 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 662adcc6b7d0 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c Wed Apr 13 12:27:33 2011 -0700
+++ b/libxkutil/xmlgen.c Wed May 04 17:05:09 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 662adcc6b7d0 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 13 12:27:33 2011 -0700
+++ b/src/Virt_SettingsDefineCapabilities.c Wed May 04 17:05:09 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 662adcc6b7d0 src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Wed Apr 13 12:27:33 2011 -0700
+++ b/src/Virt_VSMigrationService.c Wed May 04 17:05:09 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 662adcc6b7d0 src/Virt_VirtualSystemSnapshotService.c
--- a/src/Virt_VirtualSystemSnapshotService.c Wed Apr 13 12:27:33 2011 -0700
+++ b/src/Virt_VirtualSystemSnapshotService.c Wed May 04 17:05:09 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>
Show replies by date