[Libvir] Libvirt on Mac OS X 10.5
Daniel Veillard
veillard at redhat.com
Wed Jan 23 14:33:04 UTC 2008
On Wed, Jan 23, 2008 at 01:21:29PM +0000, Richard W.M. Jones wrote:
> I got a little bit further with this, my current patch is attached.
>
> At the moment, it gets as far as building libvirt & virsh, but fails to
> build the Python bindings. However virsh doesn't run, apparently
> because of a simple dynamic linking problem because of where the
> libraries are (not yet) installed. I'm afraid that my understanding of
> how to build and install applications on Mac OS X ends around here. In
> particular I have no idea how to get the detailed abort trace that
> Andrew showed up in his previous email.
maybe some parts of it should be checked in purely as cleanup/portability
enhancement, see comment below
> dnl Availability of various common headers (non-fatal if missing).
> AC_CHECK_HEADERS([pwd.h paths.h sys/syslimits.h sys/utsname.h sys/wait.h winsock2.h])
>
> -dnl Need -lrpc or -lxdr? (Cygwin and MinGW resp. need this)
> -AC_SEARCH_LIBS(xdrmem_create,[rpc xdr])
> +dnl Where are the XDR functions?
> +dnl If portablexdr is installed, prefer that.
> +dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW) or none (most Unix)
> +AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
> + AC_SEARCH_LIBS([xdrmem_create],[rpc xdr])
> + ])
Should be fine I think
> dnl Do we have rpcgen?
> AC_PATH_PROG(RPCGEN, rpcgen, no)
> @@ -621,8 +625,8 @@
> [enableval=no])
>
> if test "${enableval}" = yes; then
> - gl_COMPILER_FLAGS(-fprofile-arcs)
> - gl_COMPILER_FLAGS(-ftest-coverage)
> + dnl gl_COMPILER_FLAGS(-fprofile-arcs)
> + dnl gl_COMPILER_FLAGS(-ftest-coverage)
We really shouldn't assume such recent features of gcc, I understand
it's useful from for coverage reports, but it really can't get in the
way for normal compilations, maybe this need to be refined a bit so that
we can keep it. I would have assumed that if --enable-test-coverage wasn't
explicitely asked for, then those bits would not need to be disabled, right ?
> AC_SUBST([COVERAGE_CFLAGS], [$COMPILER_FLAGS])
> AC_SUBST([COVERAGE_LDFLAGS], [$COMPILER_FLAGS])
> COMPILER_FLAGS=
> Index: qemud/internal.h
> ===================================================================
> RCS file: /data/cvs/libvirt/qemud/internal.h,v
> retrieving revision 1.41
> diff -u -r1.41 internal.h
> --- qemud/internal.h 5 Dec 2007 18:21:27 -0000 1.41
> +++ qemud/internal.h 23 Jan 2008 13:21:42 -0000
> @@ -25,6 +25,10 @@
> #ifndef QEMUD_INTERNAL_H__
> #define QEMUD_INTERNAL_H__
>
> +#include <config.h>
> +
> +#include "../src/socketcompat.h"
> +
> #include <gnutls/gnutls.h>
> #include <gnutls/x509.h>
> #include "../src/gnutls_1_0_compat.h"
> @@ -43,7 +47,6 @@
> #include <rpc/types.h>
> #include <rpc/xdr.h>
> #include "remote_protocol.h"
> -#include "../config.h"
Looks like a good change
> #ifdef __GNUC__
> #ifdef HAVE_ANSIDECL_H
> Index: qemud/qemud.c
> ===================================================================
> RCS file: /data/cvs/libvirt/qemud/qemud.c,v
> retrieving revision 1.76
> diff -u -r1.76 qemud.c
> --- qemud/qemud.c 11 Dec 2007 21:57:29 -0000 1.76
> +++ qemud/qemud.c 23 Jan 2008 13:21:43 -0000
> @@ -47,6 +47,7 @@
> #include <assert.h>
> #include <fnmatch.h>
> #include <grp.h>
> +#include <signal.h>
>
> #include "libvirt/virterror.h"
looks safe too
> ===================================================================
> RCS file: /data/cvs/libvirt/src/Makefile.am,v
> retrieving revision 1.62
> diff -u -r1.62 Makefile.am
> --- src/Makefile.am 5 Jan 2008 16:06:36 -0000 1.62
> +++ src/Makefile.am 23 Jan 2008 13:21:44 -0000
> @@ -66,7 +66,7 @@
> libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
> libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
> @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
> -libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
> +libvirt_la_LDFLAGS = \
> -version-info @LIBVIRT_VERSION_INFO@ \
> $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
> @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
Hum, we really rely on libvirt_sym.version to define the exported list,
someone may be able to help on how to do this on OS X, but as is we can't
apply it seems.
> Index: src/sexpr.c
> ===================================================================
> RCS file: /data/cvs/libvirt/src/sexpr.c,v
> retrieving revision 1.12
> diff -u -r1.12 sexpr.c
> --- src/sexpr.c 21 Jan 2008 14:22:15 -0000 1.12
> +++ src/sexpr.c 23 Jan 2008 13:21:44 -0000
> @@ -13,7 +13,7 @@
> #include "config.h"
>
> #include <stdio.h>
> -#include <malloc.h>
> +#include <stdlib.h>
> #include <string.h>
> #include <ctype.h>
> #include <errno.h>
portability++
> Index: src/socketcompat.h
> ===================================================================
> RCS file: /data/cvs/libvirt/src/socketcompat.h,v
> retrieving revision 1.1
> diff -u -r1.1 socketcompat.h
> --- src/socketcompat.h 5 Jan 2008 16:06:36 -0000 1.1
> +++ src/socketcompat.h 23 Jan 2008 13:21:44 -0000
> @@ -28,6 +28,7 @@
> #ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */
>
> #include <sys/socket.h>
> +#include <sys/un.h>
> #include <net/if.h>
> #include <netinet/in.h>
> #include <netinet/tcp.h>
we already include sys/un.h in xend_internal.c and proxy_internal.c
so this can't break anything, looks safe.
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the libvir-list
mailing list