mingw-cross-env-list
[Top][All Lists]
Advanced

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

Re: [Mingw-cross-env-list] Some Library Build Questions


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Some Library Build Questions
Date: Wed, 14 Sep 2011 16:43:17 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Thomas Dineen schrieb:
> Yes I read the tutorial, and correct me if I am wrong,
> it seems to focus on the steps required to set up the
> build to call the cross environment tools and set the
> required paths.

That's only the first part of the tutorial (steps 1-4).

The remaining steps are about actually building stuff
with it, which of course depends on the build system
(Autotools, CMake, QMake, etc) used by the project you
want to cross-compile.

The tutorial assumes that you want to cross-compile an
application, but all advice should work for libraries, too.

Normally, no "special tricks" or "special options" should
be necessary.

Nevertheless, some applications as well as libraries do
need some tweaks for win32 cross compiling. This depends
highly on the concrete project.

However, if you find some more general issues, feel free
to raise them here. Those might be fixed directly in the
corresponding package (e.g. src/gtk.mk), or will be added
to the documentation in case there is no proper place to
fix them.

Regarding project specific issues: If your library is Free
Software, just propose them it be added to mingw-cross-env.
We have guidelines for that. If your library is proprietary,
you are on your own. But feel free to ask for help on this
list anyway, maybe some others are using that library, too.
Also, a big part of our guidelines should still be helpful.

> For example I successfully built and ran a GTK example
> in the cross environment which required the following:
> -mms-bitfields

This is strange. Could you elaborate on that? Which
GTK example were you trying, and which exact commands
were you using?

For instance, if "-mms-bitfields" is really needed, it
should be returned by the corresponding pkg-config call,
e.g. "i686-pc-mingw32-pkg-config gtk+-2.0 --libs".

> 1) What about 32 bit versus 64 bit? This all runs 32
> bit right?  Is the default (meaning no command line
> switch) in this environment 32bit?

Currently, everything is 32-bit. But we're planing to
support 64-bit as well. Please have a look at the latest
emails from Tony on this list.

> 2) Some libraries have a --static command line
> parameter. These libraries should all be compiled
> as static? With the -static parameter?

That's a good point! This is really missing in the
tutorial. Since mingw-cross-env is meant to be used
for static linking, we should recommend to force
static builds for custom libraries, too. I just fixed
this in the tutorial:

http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/4b241c0e5435
http://mingw-cross-env.nongnu.org/#tutorial

> 3) Beyond doing a link to a test application, what
> unix tool will tell me that I have succeeded in producing
> library of the proper format for MS linking and execution?
> File and objdump are my old favorites but do not
> seem to be helping here.

I don't know what you mean by "MS linking", but the
classic tools "file" and "objdump" should work. You
could also try "i686-pc-mingw32-objdump" which is
created by mingw-cross-env, but to my understanding
it should produce the same out as your native "objdump"
tool.

Having said that, I think this is a waste of time.
If you want to check a library, just build a test
program that runs your unit tests, and run it under
Wine or Windows. Or, simply build your final application
(which uses the library), and run that under Wine/Windows.


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]