Hi Larry,

cross compiling is a nice fun, but be prepared that it will most likely
not go smoothly.

I have recently cross compiled some modules, so I can give you some
hints. Autotools should be fine, but still it depends much on how the
automake or configure is created.

First of all, I have used Ruben's personal build which is most likely
newer than the cross compiler from the deb package. So I don't know
whether it already delivers some precompiled dll's like libz.dll etc.
Look into your usr or etc folders if there is something like that.

If there is such a folder where some essential dll files can be found,
then you can use it as your target directory. The dll's should be in a
folder named bin. At the same level, there should be also directories
etc, include, lib, man and share. There should be a subfolder of "lib"
folder named "pkgconfig", this one is of special importance.

If there is nothing like that on your system, create a target folder
somewhere in your local profile - so that you don't have problems to
write there. Create the mentioned subfolders bin, etc, etc. And create
the pkgconfig folder under lib.

Once you have that, try to run ./configure with the following arguments:

--host=x86_64-w64-mingw32 // this is the target
--build=x86_64-unknown-linux-gnu // this is only to prevent some
annoying warning messages
--prefix=/home/.../local64 // this is the path to your target folder,
which contains bin etc.
PKG_CONFIG_PATH=/home/.../local64/lib/pkgconfig

the last argument is important and a well written configure script
should know everything after that. However, sometimes the script is not
as good and you need to add some more:

CFLAGS=-I/home/.../local64/include
CPPFLAGS=-I/home/.../local64/include
LDFLAGS=-L/home/.../local64/lib

When you run configure with these arguments, you will most likely get a
message that some dependency package is missing. Then go to web and
download the source of the missing package and try to configure the
package. It is a recursive process, if you are lucky, it will end up one
day. If you have bad luck, ghostscript will be requested.

Sometimes, you can also download already precompiled packages. The
developer version of such precompiled package should be packed exactly
with the directory structure as your target folder, so just unpack them
there and run configure again on the previous package.

Sometimes it is also good to run "./configure --help" to see what
options the script accepts. You can for example turn off features which
has no meaning for MS Windows.

Once "configure" finishes without errors, run "make", and if make
finishes without errors, run "make install". This will copy all
necessary files into your target folder. Your exe or dll should appear
in your target/bin folder then. It most likely means that compilation
was successful.

Finally, it is quite brave decision to cross compile something with
little knowledge of programming in general, although not impossible. But
a 3D game is most likely going to be even tougher than anything else.
Are you sure that this game has been ever ported to Windows? If not,
then because of OpenGL, your chance to succeed is really not big.

But I cross fingers and wish you good luck.

Pavel


On Thu, 2013-02-07 at 21:30 -0500, Larry Pottle wrote:
> Hi,
> 
> I am new to mingw and have only rudimentary knowledge of cross
> compilling and even programing in general.  I have source code of a
> long abandoned 64bit 3D open source Linux game that I would like to
> cross compile for Windows7 64bit.  My devel box has Ubuntu 11.04 Linux
> installed as well as mingw-w64 from the Ubuntu repositories and all
> the necessary build dependencies for compiling the game on Linux.
> After a long and arduous journey through dependency hell, I am able to
> successfully configure, build and install a Debian package of the game
> from source and run it on my system.  
> 
> Since Mingw, for all practical purposes; is not self intuitive to the
> novice or non-programmer, I am wondering what to expect when I attempt
> to cross compile a program using it.  Since the source is based on
> Autotools; I understand that ./configure used in conjunction with the
> triplet --host=x86_64-w64-mingw32 from the command line will cross
> compile to a windows 64bit host.   Assuming that the cross compilation
> was a success and that I desire a monolithic executable, How may I
> find the name of the cross compiled file and its suffix.  Where should
> I expect to find the cross compiled file and how may I package this
> file so that I may actually run it on Windows7? Also how may I know
> that the cross compilation was successful or not?
> 
> Thank you for your patience!
> 
> Larry
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013 
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________ Mingw-w64-public mailing list 
> Mingw-w64-public@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public



------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to