On Fri, Oct 26, 2007 at 01:36:30PM -0700, Dan Smith wrote:
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1193430866 25200
# Node ID aaad430ea766d9a3bc0be035e595d8da17ee2122
# Parent 239f76be94c5fbf730a315408af156c3b0b0d092
Build changes for new libcmpiutil header placement
This attempts to find libcmpiutil by pkg-config, but falls back on
looking in some of the normal locations.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
I ended up with a different version in my attempt to package
libvirt-cim with RPM by adding the following to configure.ac:
diff -r 239f76be94c5 configure.ac
--- a/configure.ac Fri Oct 26 09:15:15 2007 -0700
+++ b/configure.ac Fri Oct 26 23:11:23 2007 +0200
@@ -89,6 +89,9 @@ AC_CHECK_HEADERS([stdlib.h string.h unis
# Check if the system headers conform to ANSI C
AC_HEADER_STDC
+dnl Need to test if pkg-config exists
+PKG_PROG_PKG_CONFIG
+
# Check for specific add on libraries that we know we'll need
# - libuuid
#AC_CHECK_LIB([uuid], [uuid_generate], [have_uuid=yes], [
@@ -133,10 +136,15 @@ fi
CFLAGS_STRICT="-Werror"
-AC_CHECK_LIB(cmpiutil, cu_check_args, [], [
- echo "libcmpiutil not found"
- exit 1
- ])
+
+if test "x$PKG_CONFIG" != "x" ; then
+ PKG_CHECK_MODULES(LIBCMPIUTIL, libcmpiutil, ,exit)
+else
+ AC_CHECK_LIB(cmpiutil, cu_check_args, [], [
+ echo "libcmpiutil not found"
+ exit 1
+ ])
+fi
AC_ARG_ENABLE([werror],
[ --enable-werror enable werror on builds [[default=yes]]],
---------------------------------
and then adding references to $(LIBCMPIUTIL_LIBS) and $(LIBCMPIUTIL_CFLAGS)
to src/Makefile.am and libxkutil/Makefile.am ...
No idea what you would prefer, yours is probably more complete ...
BTW concerning the werror, I get the following on Fedora 7 which should
probably be fixed :-)
gcc -DHAVE_CONFIG_H -I. -I.. -DCMPI_VERSION=100 -I/usr/include/cmpi
-I/usr/include/libxml2 -I/usr/include/libvirt -g -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
-Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith
-Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-format-y2k -Wcast-align
-Wno-unused-value -I/usr/include/libcmpiutil -I../libxkutil -Werror -c Virt_DevicePool.c
-fPIC -DPIC -o .libs/Virt_DevicePool.o
cc1: warnings being treated as errors
Virt_DevicePool.c: In function 'netpool_member_of':
Virt_DevicePool.c:73: warning: ignoring return value of 'asprintf', declared with
attribute warn_unused_result
make[3]: *** [Virt_DevicePool.lo] Error 1
make[3]: Leaving directory `/u/veillard/libvirt-cim/src'
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/