# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1197304307 28800
# Node ID 27dd39ce2e0d3c9b73edce39498acd7ac723b917
# Parent 6526275a35d9ebffc8bf2ad7295a843482d25293
[RFC] Cleanup libvirt checks in acinclude.m4
This changes the existing (hard to follow, debug, and change) libvirt
detection code with the standard pkg-config method. This gives us an
easy version check, as well as access to the package-specified information
about CPPFLAGS and LDFLAGS. It also makes us obey the system package
search path.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 6526275a35d9 -r 27dd39ce2e0d acinclude.m4
--- a/acinclude.m4 Mon Dec 10 07:59:41 2007 -0800
+++ b/acinclude.m4 Mon Dec 10 08:31:47 2007 -0800
@@ -297,67 +297,12 @@ AC_DEFUN([CHECK_LIBCU],
]
)
-dnl
-dnl The check for the libvirt library
-dnl Sets the LIBVIRTDIR variable
-dnl
-
-AC_DEFUN([_CHECK_LIBVIRT],
-[
- AC_MSG_CHECKING($1)
- AC_TRY_LINK(
- [
- #include <libvirt.h>
- #include <virterror.h>
- ],
- [
- virConnectPtr connectPtr;
- ],
- [
- have_LIBVIRT=yes
- dnl AC_MSG_RESULT(yes)
- ],
- [
- have_LIBVIRT=no
- dnl AC_MSG_RESULT(no)
- ])
-])
-
AC_DEFUN([CHECK_LIBVIRT],
[
- AC_MSG_CHECKING(for libvirt package)
- LIBVIRT_CPP_FLAGS="$CPPFLAGS"
- dnl The standard include paths worked.
- _CHECK_LIBVIRT(standard)
- if test x"$LIBVIRTDIR" == x ; then
- _DIRS_="/usr/include/libvirt \
- /usr/local/include/libvirt"
- else
- _DIRS_="$LIBVIRTDIR/include/libvirt"
- fi
- for _DIR_ in $_DIRS_
- do
- _cppflags=$CPPFLAGS
- _include_LIBVIRT="$_DIR_"
- CPPFLAGS="$CPPFLAGS -I$_include_LIBVIRT"
- _CHECK_LIBVIRT($_DIR_)
- if test "$have_LIBVIRT" == "yes"; then
- dnl Found it
- AC_MSG_RESULT(yes)
- dnl Save the new -I parameter
- LIBVIRT_CPP_FLAGS="$CPPFLAGS"
- LIBLIBVIRT=-lvirt
- break
- fi
- CPPFLAGS=$_cppflags
- done
- CPPFLAGS=$LIBVIRT_CPP_FLAGS
- AC_SUBST(LIBLIBVIRT)
- if test "$have_LIBVIRT" == "no"; then
- AC_MSG_ERROR(no. The required libvirt package is missing.)
- fi
- ]
-)
+ PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.3.2])
+ CPPFLAGS="$CPPFLAGS $LIBVIRT_CFLAGS"
+ LDFLAGS="$LDFLAGS $LIBVIRT_LIBS"
+ ])
dnl
dnl The check for the SBLIM test suite
diff -r 6526275a35d9 -r 27dd39ce2e0d autoconfiscate.sh
--- a/autoconfiscate.sh Mon Dec 10 07:59:41 2007 -0800
+++ b/autoconfiscate.sh Mon Dec 10 08:31:47 2007 -0800
@@ -18,5 +18,3 @@ autoconf --force &&
autoconf --force &&
echo "You may now run ./configure"
-echo "You may now run ./configure LIBVIRTDIR=/usr/local"
-
diff -r 6526275a35d9 -r 27dd39ce2e0d configure.ac
--- a/configure.ac Mon Dec 10 07:59:41 2007 -0800
+++ b/configure.ac Mon Dec 10 08:31:47 2007 -0800
@@ -31,7 +31,6 @@ AC_ARG_VAR([CIMSERVER],[the target CIM s
])
AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be install
ed.])
-AC_ARG_VAR([LIBVIRTDIR],[the directory where the libvirt package is installed.])
AC_ARG_VAR([TESTSUITEDIR],[the directory where the SBLIM testsuite is installed.
])
@@ -179,7 +178,6 @@ echo "The following configuration option
echo "The following configuration options have been selected:"
echo " CIMSERVER: " $CIMSERVER
echo " PROVIDERDIR: " $PROVIDERDIR
-echo " LIBVIRTDIR: " $LIBVIRTDIR
echo " TESTSUITE_SUPPORT: " $TESTSUITE_SUPPORT
if test x"$TESTSUITEDIR" != x; then
echo " TESTSUITEDIR: " $TESTSUITEDIR