[libvirt] [PATCH] build: port vbox to cygwin

I have no idea if a Cygwin app can be made to directly interact with VBoxXPCOMC.dll, but this at least lets compilation of vbox finish rather than requiring me to ./configure --without-vbox. * src/vbox/vbox_XPCOMCGlue.c (DYNLIB_NAME): Assume .dll under cygwin. Signed-off-by: Eric Blake <eblake@redhat.com> --- Although I'm tempted to push this under the build-breaker rule, and although I suspect no one else is trying to build libvirt on cygwin, I'll wait for a review on this one. An alternative, more conservative, patch might be to hack configure.ac to declare vbox and cygwin as incompatible. src/vbox/vbox_XPCOMCGlue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c index 9719014..9cc41b0 100644 --- a/src/vbox/vbox_XPCOMCGlue.c +++ b/src/vbox/vbox_XPCOMCGlue.c @@ -3,6 +3,7 @@ */ /* + * Copyright (C) 2013 Red Hat, Inc. * Copyright (C) 2008-2009 Sun Microsystems, Inc. * * This file is part of a free software library; you can redistribute @@ -54,7 +55,7 @@ # define DYNLIB_NAME "VBoxXPCOMC.so" #elif defined(__APPLE__) # define DYNLIB_NAME "VBoxXPCOMC.dylib" -#elif defined(_MSC_VER) || defined(__OS2__) +#elif defined(_MSC_VER) || defined(__OS2__) || defined(__CYGWIN__) # define DYNLIB_NAME "VBoxXPCOMC.dll" #else # error "Port me" -- 1.8.1.4

2013/5/30 Eric Blake <eblake@redhat.com>:
I have no idea if a Cygwin app can be made to directly interact with VBoxXPCOMC.dll, but this at least lets compilation of vbox finish rather than requiring me to ./configure --without-vbox.
* src/vbox/vbox_XPCOMCGlue.c (DYNLIB_NAME): Assume .dll under cygwin.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
Although I'm tempted to push this under the build-breaker rule, and although I suspect no one else is trying to build libvirt on cygwin, I'll wait for a review on this one. An alternative, more conservative, patch might be to hack configure.ac to declare vbox and cygwin as incompatible.
src/vbox/vbox_XPCOMCGlue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c index 9719014..9cc41b0 100644 --- a/src/vbox/vbox_XPCOMCGlue.c +++ b/src/vbox/vbox_XPCOMCGlue.c @@ -3,6 +3,7 @@ */
/* + * Copyright (C) 2013 Red Hat, Inc. * Copyright (C) 2008-2009 Sun Microsystems, Inc. * * This file is part of a free software library; you can redistribute @@ -54,7 +55,7 @@ # define DYNLIB_NAME "VBoxXPCOMC.so" #elif defined(__APPLE__) # define DYNLIB_NAME "VBoxXPCOMC.dylib" -#elif defined(_MSC_VER) || defined(__OS2__) +#elif defined(_MSC_VER) || defined(__OS2__) || defined(__CYGWIN__) # define DYNLIB_NAME "VBoxXPCOMC.dll" #else # error "Port me"
NACK. Cygwin compiled programs (in this case libvirtd) run on Windows. Therefore, the VrtualBox driver will have to deal with a Windows VirtualBox installation that uses the Microsoft COM infrastructure instead of XPCOM. So there is no VBoxXPCOMC.dll on Windows. I also think that the line you modified is wrong. It should not contain the check for _MSC_VER as there is no VBoxXPCOMC.dll on Windows and the XPCOM glue will never be compiled on Windows using the Microsoft compiler. I have no clue about the __OS2__ check there. The correct approach (assuming Cygwin comes with the required WinAPI headers) would be to use src/vbox/vbox_MSCOMCGlue.c for Cygwin. -- Matthias Bolte http://photron.blogspot.com

On 05/30/2013 04:02 AM, Matthias Bolte wrote:
Although I'm tempted to push this under the build-breaker rule, and although I suspect no one else is trying to build libvirt on cygwin, I'll wait for a review on this one. An alternative, more conservative, patch might be to hack configure.ac to declare vbox and cygwin as incompatible.
The conservative option may still be what I do as a stop-gap for 1.0.6...
The correct approach (assuming Cygwin comes with the required WinAPI headers) would be to use src/vbox/vbox_MSCOMCGlue.c for Cygwin.
I'll give that a shot when I've got time (but admit that I've never done COM programming, and have no idea how Cygwin will interact with it). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Matthias Bolte