[libvirt] MinGW Windows cross-compiler in Fedora, compiling libvirt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We've set up a SIG (Special Interest Group) for people interested in
adding a Windows cross-compiler to Fedora:

  https://fedoraproject.org/wiki/SIGs/MinGW

The primary target at the moment is to allow libvirt to be cross-
compiled on a Fedora machine, targetting Windows.  This will allow us
to do more regular testing on the Windows build and ensure it doesn't
break so often.

At the moment you can already build all dependencies of libvirt, and
libvirt itself, but only statically (see detailed reasons below).  I
also got virsh.exe working, and there seems to be no reason why other
C programs linked to libvirt wouldn't work too.

For the dependencies, start with the README file here:

  http://hg.et.redhat.com/misc/fedora-mingw--devel

Building libvirt
----------------

After building and installing the dependencies, you will be able to
build libvirt from CVS (*not* libvirt 0.4.4 since that had a MinGW bug
which was subsequently patched):

  CC="i686-pc-mingw32-gcc -I/usr/i686-pc-mingw32/sys-root/mingw/include/libxml2" \
  ./configure \
    --host=i686-pc-mingw32 \
    --prefix=/usr/i686-pc-mingw32/sys-root/mingw \
    --without-xen \
    --without-qemu \
    --without-libvirtd \
    --without-sasl \
    --disable-shared

  make

Running programs under Wine
---------------------------

If Wine is installed, you can just run programs like virsh.exe
directly.  Make sure any required DLLs are on your path.

It's possible we could get the test suite running using Wine, but I
haven't tried this.

Current problems for libvirt on Windows/MinGW
---------------------------------------------

No python.  Either it was my imagination, or we've lost the
'--disable-python' configure option.  In any case we should be able to
detect that Python isn't going to work or disable it completely, so
the build doesn't fail at this point.

Libxml2 detection is broken (again?).  The configure script insists on
finding the system library, not the MinGW sys-root library.  Hence the
strange $CC variable above.

Static linking only: The problem here is that PortableXDR uses a
Windows library called Winsock (ws2_32.dll).  MinGW doesn't provide a
dynamic version of this library, only a static version -- I'm not sure
why this is, obviously though if you were running on Windows then
you'd have the MSFT binary DLL.  Hence PortableXDR can only be linked
statically.  This implies that libvirt can also only be linked
statically.  I think this is easy to solve: PortableXDR only uses a
handful of simple functions from Winsock, which we can just get from
Gnulib or some other source instead.

-----------

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]