Bug 5084 - [patch] add support for Debian cross compiling
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: PC Linux
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2011-07-17 01:55 EDT by q3urt.undead
Modified: 2011-07-18 18:27:54 EDT
3 users (show)

See Also:


Attachments
Add support for more mingw prefixes (r2086) (1.84 KB, patch)
2011-07-17 01:55 EDT, q3urt.undead

Description q3urt.undead 2011-07-17 01:55:07 EDT
Created attachment 2840 [details]
Add support for more mingw prefixes (r2086)

The cross compile scripts assume you define CC/WINDRES or it is using the i586-mingw32msvc or amd64-mingw32msvc prefix.  Debian and possibly others do not use this convention.  I'm not sure if this is a Debian thing or if upstream updated it since I don't cross compile very often.  Debian testing/unstable use i686-w64-mingw32 and x86_64-w64-mingw32, respectively.

While you could force Debian users to set the CC/WINDRES, it seems like a simple check would be better.  Hence this patch.

I'm able to cross compile using these packages (note these do 32bit and 64bit cross compiling despite the w64 name):

binutils-mingw-w64  2.21.52.20110606-1
gcc-mingw-w64       4.6.0-11
mingw-w64           1.0+20110523-1
mingw-w64-dev       1.0+20110523-1
Comment 1 /dev/humancontroller 2011-07-17 13:55:30 EDT
the X characters are not required.

on FreeBSD, i have mingw32-gcc and mingw32-windres.

the scripts should use
  exec gmake "$@"
instead of
  exec make $*
.
Comment 2 Simon McVittie 2011-07-17 14:34:05 EDT
(In reply to comment #0)
> The cross compile scripts assume you define CC/WINDRES or it is using the
> i586-mingw32msvc or amd64-mingw32msvc prefix.  Debian and possibly others do
> not use this convention.  I'm not sure if this is a Debian thing or if upstream
> updated it since I don't cross compile very often.

FYI: this is because Debian testing/unstable has switched to using a different upstream for mingw (mingw-w64 instead of mingw32 - but despite their confusing names, both can compile for either 32- or 64-bit Windows!) in order to get better support for modern versions of Wine.
Comment 3 Simon McVittie 2011-07-17 14:36:07 EDT
(In reply to comment #1)
> the X characters are not required.

Probably not in this specific case, but their purpose is to avoid any of the arguments ever being things that test(1) treats specially, like "=" or "-a" or whatever; it's generally easier to add prefixes consistently than to remember under which exact circumstances it can be a problem.
Comment 4 Thilo Schulz 2011-07-18 18:27:54 EDT
Yeah it looks reasonable and my gentoo can cross-compile it now as well without modifications. Committed r2095