[aur-general] Conventions on packages for cross-compiling

Allan McRae allan at archlinux.org
Wed Oct 14 08:38:50 EDT 2009


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.

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


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


More information about the aur-general mailing list