RPM Community Forums

Mailing List Message of <rpm-devel>

[PATCH] Compile popt under Windows using gnulib

From: Richard W.M. Jones <rjones@redhat.com>
Date: Sat 25 Oct 2008 - 16:52:03 CEST
Message-ID: <20081025145203.GE3678@amd.home.annexia.org>

This patch allows popt from CVS to be cross-compiled for Windows using
MinGW and Win32 API (not Cygwin).

It uses Gnulib to supply the missing functionality -- mainly glob(3)
and globfree(3).

Note that the patch isn't "complete".  As you can see from the
modification to autogen.sh you are expected to have a checkout of
gnulib itself in a directory adjacent to popt (../gnulib/).  That will
pull in the additional files from Gnulib.  A better explanation is
probably to read the Gnulib manual:

http://www.gnu.org/software/gnulib/manual/gnulib.html#Initial-import

All the Gnulib modules imported are LGPLv2+ (except for one which is
public domain).

If you have the MinGW cross-compiler installed, eg. from [1], then you
can compile popt for Windows by doing:

  PKG_CONFIG_PATH=/usr/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig   ./autogen.sh     --host=i686-pc-mingw32 --prefix=/usr/i686-pc-mingw32/sys-root/mingw

  make -C lib fnmatch.h                   # BUG IN GNULIB?

  make

You'll get a DLL, and test{1,2,3}.exe which can be run under Wine (or
even on Windows :-).

For reference you can find our mingw32-popt RPM sources here:

http://hg.et.redhat.com/misc/fedora-mingw--devel/?cmd=manifest;manifest=6651a3a433544afe0cc67b0fcb5668d71d3ecfbf;path=/popt/

Rich.

[1] http://www.annexia.org/tmp/mingw/fedora-9/i386/

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v


Received on Sat Oct 25 17:13:26 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.