The attached patch fixes three separate build problems on Debian:(1) The libtool autoconf macro is wrong in that it requires a C++ compiler and /lib/cpp, neither of which seems to be really needed.
(2) If you pass -fstack-protector while compiling, then you also need to pass it while linking, so that gcc knows to link -lssp.
(3) Long-standing problem that xencapstest.c won't compile --without-xen.Well, OK so I didn't actually fix (1), but I did add a note to the TODO file pointing out the problem. So you'll still need to install the Debian "g++" package before you can compile libvirt.
Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
Index: TODO
===================================================================
RCS file: /data/cvs/libvirt/TODO,v
retrieving revision 1.23
diff -u -r1.23 TODO
--- TODO 23 Mar 2007 16:15:07 -0000 1.23
+++ TODO 29 May 2007 14:17:35 -0000
@@ -22,3 +22,8 @@
- now that libxml2 is linked in, drop hash.[ch] and get back to libxml2 ones ?
same for the buffers
+Autoconf:
+- On Debian and other platforms, C++ compiler is required because
+ autoconf macros to detect libtool depend on it. (This is probably
+ an autoconf or libtool m4 macro bug, and the fact that it happens
+ on Debian is a red herring).
Index: docs/examples/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/docs/examples/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- docs/examples/Makefile.am 26 Jun 2006 15:02:18 -0000 1.7
+++ docs/examples/Makefile.am 29 May 2007 14:17:35 -0000
@@ -2,7 +2,7 @@
SUBDIRS=python
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I srcdir@/include
DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
rebuild: examples.xml index.html
Index: proxy/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/proxy/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- proxy/Makefile.am 15 Mar 2007 07:43:16 -0000 1.9
+++ proxy/Makefile.am 29 May 2007 14:17:35 -0000
@@ -11,7 +11,7 @@
@top_srcdir@/src/xen_internal.c @top_srcdir@/src/virterror.c \
@top_srcdir@/src/sexpr.c @top_srcdir@/src/xml.c \
@top_srcdir@/src/xs_internal.c
-libvirt_proxy_LDFLAGS =
+libvirt_proxy_LDFLAGS = $(WARN_CFLAGS)
libvirt_proxy_DEPENDENCIES =
libvirt_proxy_LDADD =
Index: qemud/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/qemud/Makefile.am,v
retrieving revision 1.18
diff -u -r1.18 Makefile.am
--- qemud/Makefile.am 18 May 2007 18:36:24 -0000 1.18
+++ qemud/Makefile.am 29 May 2007 14:17:35 -0000
@@ -19,7 +19,7 @@
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
-libvirt_qemud_LDFLAGS = $(LIBXML_LIBS) $(SYSFS_LIBS)
+libvirt_qemud_LDFLAGS = $(WARN_CFLAGS) $(LIBXML_LIBS) $(SYSFS_LIBS)
libvirt_qemud_DEPENDENCIES =
libvirt_qemud_LDADD =
Index: src/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/src/Makefile.am,v
retrieving revision 1.37
diff -u -r1.37 Makefile.am
--- src/Makefile.am 4 Apr 2007 14:19:49 -0000 1.37
+++ src/Makefile.am 29 May 2007 14:17:35 -0000
@@ -36,7 +36,7 @@
bin_PROGRAMS = virsh
virsh_SOURCES = virsh.c console.c console.h
-virsh_LDFLAGS = $(COVERAGE_LDFLAGS)
+virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
virsh_DEPENDENCIES = $(DEPS)
virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
virsh_CFLAGS = $(COVERAGE_CFLAGS)
Index: tests/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/tests/Makefile.am,v
retrieving revision 1.18
diff -u -r1.18 Makefile.am
--- tests/Makefile.am 27 Mar 2007 14:45:17 -0000 1.18
+++ tests/Makefile.am 29 May 2007 14:17:36 -0000
@@ -25,6 +25,7 @@
LDADDS = \
@STATIC_BINARIES@ \
@LIBXML_LIBS@ \
+ $(WARN_CFLAGS) \
$(LIBVIRT) \
$(COVERAGE_LDFLAGS)
Index: tests/xencapstest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
retrieving revision 1.1
diff -u -r1.1 xencapstest.c
--- tests/xencapstest.c 27 Mar 2007 14:45:17 -0000 1.1
+++ tests/xencapstest.c 29 May 2007 14:17:36 -0000
@@ -1,4 +1,10 @@
#include <stdio.h>
+#include <stdlib.h>
+
+#include "config.h"
+
+#ifdef WITH_XEN
+
#include <string.h>
#include "xml.h"
@@ -197,3 +203,13 @@
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
+
+#else /* !WITH_XEN */
+
+int
+main (void)
+{
+ exit (EXIT_SUCCESS);
+}
+
+#endif /* !WITH_XEN */
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature