Re: [gtk-vnc-devel] Porting gtk-vnc to Windows (MinGW)
- From: Anthony Liguori <anthony codemonkey ws>
- To: "Richard W.M. Jones" <rjones redhat com>
- Cc: gtk-vnc-devel List <gtk-vnc-devel lists sourceforge net>
- Subject: Re: [gtk-vnc-devel] Porting gtk-vnc to Windows (MinGW)
- Date: Tue, 18 Dec 2007 22:59:20 -0500
Hi Richard,
Richard W.M. Jones wrote:
I made a little attempt to port gtk-vnc over to Windows using MinGW &
MSYS, because we'd like to use gtk-vnc on Windows in various projects.
The port isn't going to be entirely straightforward, so here are my
notes, and attached is the output of 'make -k' after a few iterations
so you can see while files don't compile.
(1) getcontext/makecontext:
These are obviously missing on Windows. Win32 has similar functions
'GetThreadContext' and 'SetThreadContext', and there is an
implementation I found of the Unix functions in terms of the Windows
functions:
http://www.codeproject.com/KB/threads/ucontext.aspx?df=100&forumid=15621&exp=0&select=847762
I've mirrored the source files from the above page here; the license
is LGPLv2:
http://annexia.org/tmp/win32_ucontext/
So that is some hope that the continuation/coroutine stuff can be
ported with not too much work.
Okay, so with the GThread coroutine patch I just posted, this should
Just Work on Windows. If you can try the patch out and let me know if
it does, I'd appreciate it!
(2) Socket calls:
gvnc.c:13:24: error: sys/socket.h: No such file or directory
gvnc.c:14:24: error: netinet/in.h: No such file or directory
gvnc.c:15:23: error: arpa/inet.h: No such file or directory
gvnc.c:17:19: error: netdb.h: No such file or directory
When I ported libvirt, I found that most socket calls could be
replaced just by modifying the header files to include <winsock2.h>,
as in:
#ifndef HAVE_WINSOCK2_H
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#else
#include <winsock2.h>
#endif
A few other changes were needed in libvirt but they weren't very
invasive.
(3) getaddrinfo:
With libvirt we found that the best idea was to use the Gnulib
implementation of getaddrinfo and a handful of other functions.
Gnulib is a source library of useful functions which replaces
functions where they are broken or missing on a platform (but
otherwise leaves code unchanged). More about Gnulib here:
http://www.gnu.org/software/gnulib/
Gnulib also contains wrappers which add missing macros such as
F_GETFL, O_NONBLOCK.
Would gtk-vnc developers be happy with patches which pull in parts of
Gnulib?
I think all we need now for as-good-as-glib portability is a socket
portability layer. I don't have a Win32 development environment so I
can't really help much here.
(4) Shared memory X11:
Windows completely lacks any X11 calls or Unix shared memory (shmctl
etc.)
My reading of the code in vncshmimage.c is that it detects at runtime
if MIT-SHM is available and can run with it enabled or disabled. To
get this working under Windows, I think would require #ifdef-ing out
any code which uses anything other than pure gdk calls in this file.
(However my reading may be wrong ...)
Some shm code also leaks into vncdisplay.c, eg. calls to shmctl to
clean things up.
I've removed all of this so it shouldn't be an issue.
Regards,
Anthony Liguori
- - -
Any comments?
Rich.
------------------------------------------------------------------------
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
------------------------------------------------------------------------
_______________________________________________
Gtk-vnc-devel mailing list
Gtk-vnc-devel lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtk-vnc-devel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]