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

Re: Cross-compiling for Win32



[putting back on list (I accidentally mailed volker privately)]

On Wed, Jun 20, 2007 at 09:36:09AM +0100, Wookey wrote:
> >     http://www.profv.de/mingw_cross_env/
> 
> That looks like verg goood work volker.

Thank you.

> Volker - have you tried this with the debian sources?

No, I didn't. This has several reasons:

* When porting to win32, you have different requirements to the
  libraries. You generall just want to link them statically into
  your .exe binary.

* I haven't been able to reuse the existing debian/rules, or
  to modify them in a debian-compatible way. The main problems
  are the different binary and shared library file extensions
  (.exe and .dll instead of .so)

* There are some (partly ugly) hacks necessary to make some sources
  mingw32-compatible.

* The script sould run on any distribution, thus building its
  own cross compiler instead of reusing e.g. the "mingw32" package.

    (However, it works with that cross compiler, too. Indeed, that
     was my first trial. But then I needed to run it on a SuSE
     system, so I thought it's a good idea to make it more portable.)

But nevertheless, the script should also be able work with the
Debian sources of that packages.

> Can we just build cross for the win32 target as we do for other arches
> or does that need a pile more work? Is it useful to do that so that
> one could use dpkg-cross and apt-cross to manage the process,

In general, with some patches to the sources, we can. My script shows
that it isn't that hard, but it's more than an adjustment of dpkg-cross.
There are some different library dependencies and special file naming
conventions.

However, simple packages like SDL can really be ported with dpkg-cross
and some very small changes to the debian/rules.

> or does than not really suit the way people work? (I have no idea -
> I never target win32).

It depends on what you want. There are people who want to use all
GNU tools on a win32 system, i.e. who must develop on a win32 system,
but want to use at least Unix tools. And there are other people who
just want to port some applications for win32.

I'm part of the latter group. I need a cross compiler and cross
compiled libraries. For people like me, it would be great to have
an APT repository of cross compiled libraries that work with the
already present cross compiler, the "mingw32" package.

But as those library packages are usually smaller and differently
configured, it is more work to adapt them to the Debian process than
to adapt the upstream sources. It also would make the whole project
debian-specific. But it would have the advantage to benefit from
Debian's security patches and quality assurance.

In any case the "win32" arch would not be interesting, but the
dpkg-cross'ed variants.

Another solution would be a big package like "mingw32-libs" which
is arch-independent and contains many small libraries for use
with the cross compiler of the existing Debian package "mingw32".
This solution wouldn't use any dpkg-cross mechanism, and it would
be much simpler. In fact, this would be the same spirit as the
"mingw32" package which is also a "big" package that corrensponds
to many small "normal" Debian packages (gcc, g++, binutils, libc, ...).

I hope this makes some things clearer.


Greets,

    Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR
--
Wookey



Reply to: