diff --git a/ChangeLog b/ChangeLog index 64caa21850eb0b17eed236dba61e7191118b4751..6ccf374cac440d3895bef95c6c4218e500517f49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Apr 18 09:27:00 BST 2008 Richard W.M. Jones + + Fixes for MinGW. + * configure.in: Fix pkg-config detection of libxml2, + add -lgcrypt to gnutls lib. + * src/Makefile.am: If compiling --without-libvirtd then + don't compile any part of the storage driver. + * configure.in, src/hash.c, src/internal.h: Detect availability + of pthread library and compile out mutex code if not available. + * src/storage_driver.c, src/util.c: Ignore some missing + headers on MinGW. + Tue Apr 15 17:19:16 CEST 2008 Daniel Veillard * virsh.1 docs/virsh.pod: fix missing entries and small cleanups diff --git a/configure.in b/configure.in index 13a9f0a76de57554a3bb2bf047db08528299c120..f707229d2069b889c3d2c08f3e2081718d0ffc0f 100644 --- a/configure.in +++ b/configure.in @@ -81,6 +81,13 @@ AM_CONDITIONAL(GLIBC_RPCGEN, [test "x$ac_cv_path_RPCGEN" != "xno" && $ac_cv_path_RPCGEN -t /dev/null 2>&1]) +dnl pthread? +AC_CHECK_HEADER(pthread.h, + AC_CHECK_LIB(pthread,pthread_join,[ + AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if pthread (-lpthread)]) + AC_DEFINE([HAVE_PTHREAD_H],[],[Define if ]) + ])) + dnl Miscellaneous external programs. AC_PATH_PROG(RM, rm, /bin/rm) AC_PATH_PROG(MV, mv, /bin/mv) @@ -301,7 +308,7 @@ AC_ARG_WITH(libxml, [ --with-libxml=[PFX] libxml2 location]) if test "x$with_libxml" = "xno" ; then AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED) AC_MSG_ERROR(libxml2 >= $LIBXML_REQUIRED is required for libvirt) -elif test "x$with_libxml" = "x" -a "x$PKG_CONFIG" = "x" ; then +elif test "x$with_libxml" = "x" -a "x$PKG_CONFIG" != "x" ; then PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no]) fi if test "$LIBXML_FOUND" = "no" ; then @@ -356,7 +363,8 @@ if test "$GNUTLS_FOUND" = "no"; then AC_CHECK_LIB(gnutls, gnutls_handshake, [], [AC_MSG_ERROR( - [You must install the GnuTLS library in order to compile and run libvirt])]) + [You must install the GnuTLS library in order to compile and run libvirt])], + [-lgcrypt]) GNUTLS_LIBS=$LIBS LIBS="$old_libs" fi diff --git a/src/Makefile.am b/src/Makefile.am index 35b0cece1bfcd283ed72899fec224beea74fa886..7110420914697549cb06d006ab801158cbe3d134 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,17 +61,21 @@ CLIENT_SOURCES = \ openvz_driver.c openvz_driver.h \ lxc_driver.c lxc_driver.h \ lxc_conf.c lxc_conf.h \ - lxc_container.c lxc_container.h \ + lxc_container.c lxc_container.h \ nodeinfo.h nodeinfo.c \ - storage_conf.h storage_conf.c \ - storage_driver.h storage_driver.c \ - storage_backend.h storage_backend.c \ - storage_backend_fs.h storage_backend_fs.c \ util.c util.h SERVER_SOURCES = \ ../qemud/remote_protocol.c ../qemud/remote_protocol.h +if WITH_LIBVIRTD + +CLIENT_SOURCES += \ + storage_conf.h storage_conf.c \ + storage_driver.h storage_driver.c \ + storage_backend.h storage_backend.c \ + storage_backend_fs.h storage_backend_fs.c + if WITH_STORAGE_LVM CLIENT_SOURCES += storage_backend_logical.h storage_backend_logical.c else @@ -90,7 +94,7 @@ else EXTRA_DIST += storage_backend_disk.h storage_backend_disk.c endif - +endif libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES) @@ -130,12 +134,14 @@ virsh_LDADD = $(LDADDS) $(VIRSH_LIBS) virsh_CFLAGS = $(COVERAGE_CFLAGS) $(READLINE_CFLAGS) if WITH_STORAGE_DISK +if WITH_LIBVIRTD libexec_PROGRAMS = libvirt_parthelper libvirt_parthelper_SOURCES = parthelper.c libvirt_parthelper_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS) libvirt_parthelper_LDADD = $(LIBPARTED_LIBS) libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) +endif else EXTRA_DIST += parthelper.c endif diff --git a/src/hash.c b/src/hash.c index 409400bd924a253077b68e9e3dc32dd98e8cc9ed..2cb60b2a6100c772d9916a309a2cc7e4fd030879 100644 --- a/src/hash.c +++ b/src/hash.c @@ -25,7 +25,6 @@ #include #include "internal.h" #include "hash.h" -#include #define MAX_HASH_LEN 8 diff --git a/src/internal.h b/src/internal.h index 07a109ebe2bb8efe96f493461472ee2cfe17df51..6b2b6332179e8040fda6a73ca057d307fbf414e4 100644 --- a/src/internal.h +++ b/src/internal.h @@ -12,6 +12,18 @@ #include #endif +#if HAVE_PTHREAD_H +#include +#define PTHREAD_MUTEX_T(v) pthread_mutex_t v +#else +/* Mutex functions disappear if we don't have pthread. */ +#define PTHREAD_MUTEX_T(v) /*empty*/ +#define pthread_mutex_init(lk,p) /*empty*/ +#define pthread_mutex_destroy(lk) /*empty*/ +#define pthread_mutex_lock(lk) /*empty*/ +#define pthread_mutex_unlock(lk) /*empty*/ +#endif + #include "gettext.h" #include "hash.h" @@ -195,7 +207,7 @@ struct _virConnect { * count of any virDomain/virNetwork object associated with * this connection */ - pthread_mutex_t lock; + PTHREAD_MUTEX_T (lock); virHashTablePtr domains; /* hash table for known domains */ virHashTablePtr networks; /* hash table for known domains */ virHashTablePtr storagePools;/* hash table for known storage pools */ diff --git a/src/storage_driver.c b/src/storage_driver.c index d0e38f66d3051fc2765a67ba932c3b11b2eafdaf..7f1ce0cdc99041ca6fa2ea84aaa9dc5f7764083d 100644 --- a/src/storage_driver.c +++ b/src/storage_driver.c @@ -26,7 +26,9 @@ #include #include #include +#if HAVE_PWD_H #include +#endif #include #include diff --git a/src/util.c b/src/util.c index bd7bb92af178e9c6c6591afb3aa17ca0e234c2f9..5a44f1865cd1575fafc47c4f11165b689604b707 100644 --- a/src/util.c +++ b/src/util.c @@ -33,7 +33,9 @@ #include #include #include +#if HAVE_SYS_WAIT_H #include +#endif #include #include