Index: src/driver.h
===================================================================
RCS file: /data/cvs/libvirt/src/driver.h,v
retrieving revision 1.50
diff -u -r1.50 driver.h
--- src/driver.h	10 Jun 2008 10:43:28 -0000	1.50
+++ src/driver.h	17 Jun 2008 11:47:08 -0000
@@ -584,6 +584,7 @@
 typedef int (*virDrvStateCleanup) (void);
 typedef int (*virDrvStateReload) (void);
 typedef int (*virDrvStateActive) (void);
+#ifdef WITH_LIBVIRTD
 typedef int (*virDrvSigHandler) (siginfo_t *siginfo);
 
 typedef struct _virStateDriver virStateDriver;
@@ -596,6 +597,7 @@
     virDrvStateActive      active;
     virDrvSigHandler       sigHandler;
 };
+#endif
 
 /*
  * Registration
@@ -605,7 +607,9 @@
 int virRegisterDriver(virDriverPtr);
 int virRegisterNetworkDriver(virNetworkDriverPtr);
 int virRegisterStorageDriver(virStorageDriverPtr);
+#ifdef WITH_LIBVIRTD
 int virRegisterStateDriver(virStateDriverPtr);
+#endif
 
 #ifdef __cplusplus
 }
Index: src/internal.h
===================================================================
RCS file: /data/cvs/libvirt/src/internal.h,v
retrieving revision 1.74
diff -u -r1.74 internal.h
--- src/internal.h	23 May 2008 08:32:08 -0000	1.74
+++ src/internal.h	17 Jun 2008 11:47:08 -0000
@@ -346,6 +346,7 @@
 #define virGetStoragePool(c,n,u) __virGetStoragePool((c),(n),(u))
 #define virGetStorageVol(c,p,n,u) __virGetStorageVol((c),(p),(n),(u))
 
+#ifdef WITH_LIBVIRTD
 int __virStateInitialize(void);
 int __virStateCleanup(void);
 int __virStateReload(void);
@@ -356,6 +357,7 @@
 #define virStateReload() __virStateReload()
 #define virStateActive() __virStateActive()
 #define virStateSigDispatcher(s) __virStateSigDispatcher(s)
+#endif
 
 int __virDrvSupportsFeature (virConnectPtr conn, int feature);
 
Index: src/libvirt.c
===================================================================
RCS file: /data/cvs/libvirt/src/libvirt.c,v
retrieving revision 1.146
diff -u -r1.146 libvirt.c
--- src/libvirt.c	10 Jun 2008 10:43:28 -0000	1.146
+++ src/libvirt.c	17 Jun 2008 11:47:10 -0000
@@ -60,8 +60,10 @@
 static int virNetworkDriverTabCount = 0;
 static virStorageDriverPtr virStorageDriverTab[MAX_DRIVERS];
 static int virStorageDriverTabCount = 0;
+#ifdef WITH_LIBVIRTD
 static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
 static int virStateDriverTabCount = 0;
+#endif
 static int initialized = 0;
 
 #define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
@@ -532,6 +534,7 @@
     return virDriverTabCount++;
 }
 
+#ifdef WITH_LIBVIRTD
 /**
  * virRegisterStateDriver:
  * @driver: pointer to a driver block
@@ -620,6 +623,7 @@
     }
     return ret;
 }
+#endif
 
 
 
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
retrieving revision 1.87
diff -u -r1.87 qemu_driver.c
--- src/qemu_driver.c	12 Jun 2008 13:47:38 -0000	1.87
+++ src/qemu_driver.c	17 Jun 2008 11:47:11 -0000
@@ -69,7 +69,9 @@
 /* For storing short-lived temporary files. */
 #define TEMPDIR LOCAL_STATE_DIR "/cache/libvirt"
 
+#ifdef WITH_LIBVIRTD
 static int qemudShutdown(void);
+#endif
 
 /* qemudDebug statements should be changed to use this macro instead. */
 #define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
@@ -169,6 +171,7 @@
     }
 }
 
+#ifdef WITH_LIBVIRTD
 /**
  * qemudStartup:
  *
@@ -375,6 +378,7 @@
 
     return 0;
 }
+#endif
 
 /* Return -1 for error, 1 to continue reading and 0 for success */
 typedef int qemudHandlerMonitorOutput(virConnectPtr conn,
@@ -3675,6 +3679,7 @@
     qemudNetworkSetAutostart, /* networkSetAutostart */
 };
 
+#ifdef WITH_LIBVIRTD
 static virStateDriver qemuStateDriver = {
     qemudStartup,
     qemudShutdown,
@@ -3682,11 +3687,14 @@
     qemudActive,
     NULL
 };
+#endif
 
 int qemudRegister(void) {
     virRegisterDriver(&qemuDriver);
     virRegisterNetworkDriver(&qemuNetworkDriver);
+#ifdef WITH_LIBVIRTD
     virRegisterStateDriver(&qemuStateDriver);
+#endif
     return 0;
 }
 
Index: src/remote_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/remote_internal.c,v
retrieving revision 1.79
diff -u -r1.79 remote_internal.c
--- src/remote_internal.c	10 Jun 2008 10:43:28 -0000	1.79
+++ src/remote_internal.c	17 Jun 2008 11:47:17 -0000
@@ -168,6 +168,7 @@
 static int initialise_gnutls (virConnectPtr conn);
 static gnutls_session_t negotiate_gnutls_on_connection (virConnectPtr conn, struct private_data *priv, int no_verify);
 
+#ifdef WITH_LIBVIRTD
 static int
 remoteStartup(void)
 {
@@ -177,6 +178,7 @@
     inside_daemon = 1;
     return 0;
 }
+#endif
 
 /**
  * remoteFindServerPath:
@@ -4930,6 +4932,7 @@
     .volGetPath = remoteStorageVolGetPath,
 };
 
+#ifdef WITH_LIBVIRTD
 static virStateDriver state_driver = {
     remoteStartup,
     NULL,
@@ -4937,6 +4940,7 @@
     NULL,
     NULL
 };
+#endif
 
 
 /** remoteRegister:
@@ -4951,7 +4955,9 @@
     if (virRegisterDriver (&driver) == -1) return -1;
     if (virRegisterNetworkDriver (&network_driver) == -1) return -1;
     if (virRegisterStorageDriver (&storage_driver) == -1) return -1;
+#ifdef WITH_LIBVIRTD
     if (virRegisterStateDriver (&state_driver) == -1) return -1;
+#endif
 
     return 0;
 }
Index: qemud/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/qemud/Makefile.am,v
retrieving revision 1.48
diff -u -r1.48 Makefile.am
--- qemud/Makefile.am	29 May 2008 20:09:56 -0000	1.48
+++ qemud/Makefile.am	17 Jun 2008 11:47:18 -0000
@@ -1,5 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
+INCLUDES = $(LIBVIRT_FEATURES)
+
 # Distribute the generated files so that rpcgen isn't required on the
 # target machine (although almost any Unix machine will have it).
 EXTRA_DIST = libvirtd.init.in libvirtd.sysconf default-network.xml \
Index: tests/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/tests/Makefile.am,v
retrieving revision 1.45
diff -u -r1.45 Makefile.am
--- tests/Makefile.am	29 May 2008 15:21:45 -0000	1.45
+++ tests/Makefile.am	17 Jun 2008 11:47:18 -0000
@@ -36,7 +36,6 @@
         oomtrace.pl     \
 	test-lib.sh	\
 	xmlrpcserver.py	\
-	test_conf.sh	\
 	qemuxml2argvdata \
 	nodeinfodata
 
@@ -44,15 +43,19 @@
 	reconnect xmconfigtest xencapstest qemuxml2argvtest qemuxml2xmltest \
         nodeinfotest statstest qparamtest
 
-test_scripts = \
+test_scripts =
+if WITH_LIBVIRTD
+test_scripts += \
+	test_conf.sh \
 	daemon-conf \
 	int-overflow \
 	read-non-seekable \
 	vcpupin
+endif
 
 EXTRA_DIST += $(test_scripts)
 
-TESTS = xml2sexprtest sexpr2xmltest virshtest test_conf.sh xmconfigtest \
+TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
         xencapstest qemuxml2argvtest qemuxml2xmltest nodeinfotest \
 	statstest qparamtest $(test_scripts)
 if ENABLE_XEN_TESTS
Index: tests/testutils.c
===================================================================
RCS file: /data/cvs/libvirt/tests/testutils.c,v
retrieving revision 1.17
diff -u -r1.17 testutils.c
--- tests/testutils.c	12 Jun 2008 13:48:29 -0000	1.17
+++ tests/testutils.c	17 Jun 2008 11:47:18 -0000
@@ -17,7 +17,9 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef WIN32
 #include <sys/wait.h>
+#endif
 #include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
@@ -139,6 +141,7 @@
     return st.st_size;
 }
 
+#ifndef WIN32
 static
 void virtTestCaptureProgramExecChild(const char *const argv[],
                                      int pipefd) {
@@ -181,7 +184,6 @@
         close(stderrfd);
 }
 
-
 int virtTestCaptureProgramOutput(const char *const argv[],
                                  char **buf,
                                  int buflen) {
@@ -227,6 +229,7 @@
         }
     }
 }
+#endif /* !WIN32 */
 
 
 /**
Index: tests/testutilsqemu.c
===================================================================
RCS file: /data/cvs/libvirt/tests/testutilsqemu.c,v
retrieving revision 1.2
diff -u -r1.2 testutilsqemu.c
--- tests/testutilsqemu.c	22 May 2008 16:18:40 -0000	1.2
+++ tests/testutilsqemu.c	17 Jun 2008 11:47:18 -0000
@@ -1,5 +1,5 @@
 #include <config.h>
-
+#ifdef WITH_QEMU
 #include <sys/utsname.h>
 #include <stdlib.h>
 
@@ -70,3 +70,4 @@
     virCapabilitiesFree(caps);
     return NULL;
 }
+#endif
Index: tests/virshtest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/virshtest.c,v
retrieving revision 1.13
diff -u -r1.13 virshtest.c
--- tests/virshtest.c	29 May 2008 19:20:23 -0000	1.13
+++ tests/virshtest.c	17 Jun 2008 11:47:18 -0000
@@ -270,7 +270,7 @@
 }
 
 
-
+#ifndef WIN32
 static int
 mymain(int argc, char **argv)
 {
@@ -358,5 +358,10 @@
 
     return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
+#else /* ! WIN32 */
+
+static int mymain (void) { exit (77); /* means 'test skipped' for automake */ }
+
+#endif /* WIN32 */
 
 VIRT_TEST_MAIN(mymain)
