+Fri Apr 18 09:27:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
+
+ 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 <veillard@redhat.com>
* virsh.1 docs/virsh.pod: fix missing entries and small cleanups
[test "x$ac_cv_path_RPCGEN" != "xno" &&
$ac_cv_path_RPCGEN -t </dev/null >/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 <pthread.h>])
+ ]))
+
dnl Miscellaneous external programs.
AC_PATH_PROG(RM, rm, /bin/rm)
AC_PATH_PROG(MV, mv, /bin/mv)
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
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
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
EXTRA_DIST += storage_backend_disk.h storage_backend_disk.c
endif
-
+endif
libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
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
#include <libxml/threads.h>
#include "internal.h"
#include "hash.h"
-#include <pthread.h>
#define MAX_HASH_LEN 8
#include <sys/syslimits.h>
#endif
+#if HAVE_PTHREAD_H
+#include <pthread.h>
+#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"
* 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 */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
+#if HAVE_PWD_H
#include <pwd.h>
+#endif
#include <errno.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
+#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#include <string.h>
#include <ctype.h>