Hi, 2009/10/14 Allan McRae <allan@archlinux.org>:
Hi,
I have spent the last couple of days looking into what should be a reasonably general method for packaging cross compilers. You can get my PKGBUILDs for a i686-pc-mingw32 cross-compiler from http://allanmcrae.com/packages/cross-i686-pc-mingw32.tar.gz . They can probably use more work, but the general idea is there. They look great - I admit defeat :-) - putting files to /usr/lib/cross-<arch>/ is cleaner than trying to put them to their normal locations and dealing with possible conflicts. Moreover, it does not break FHS.
The basic principles I came up with are:
1) define these variables _target=i686-pc-mingw32 _sysroot=/usr/lib/${_target} pkgname=cross-${_target}-<program>
2) build most stuff using: --prefix=${_sysroot} --sysroot=${_sysroot}
3) add symlinks for all ${_sysroot}/bin/${_target}-* to /usr/bin Is there any special reason why not to use directly --bindir=/usr/bin?
An amusing anecdote... the result from building "Hello World!" for Windows using this cross compiler resulted in binary which AntiVir said had a virus. Strip that binary and all was OK!
Allan
If there aren't any objections to this file placement, will you update the wiki proposal or shall I do it? - Vojta