On amd64, we currently have a biarch-gcc that builds 32bit binaries by default, and 64bit ones with a -m64 option. Coding debian/rules for this is pretty trivial but still requires some ugly architecture specific hacks in each debian/rules.
These hacks can be troublesome if the default compile target is ever changed (ie to 64bit, which may make more sense on most amd64 systems). Currently I emulate this mode using a modified version of Arnd Bergmann's /usr/bin/gcc script that injects -m64 before calling /use/bin/gcc-3.3. I propose obtaining the gcc specific options from a dpkg-libinfo (introduced by Gerhard Tonn's lib64 patches) or dpkg-architecture. debian/rules can query for said options, and use them in order to build for a given host architecture. Perhaps a better solution would be to have a dpkg-compiler that can answer the following questions given an architecture name: dpkg-compiler -a${DEB_HOST_ARCH} -qCC dpkg-compiler -a${DEB_HOST_ARCH} -qCXX - return the compiler to use to compile code for ${DEB_HOST_ARCH} - normally this would be gcc and g++, respectively, but could also be x86_64-linux-gcc for cross builds dpkg-compiler -a${DEB_HOST_ARCH} -qCFLAGS dpkg-compiler -a${DEB_HOST_ARCH} -qCXXFLAGS - return the CFLAGS and CXXFLAGS required for building for ${DEB_HOST_ARCH} I am guessing that some of this stuff would be obtained from gcc or can be retrieved from an /etc/*.conf file. Thoughts? Bart. -- WebSig: http://www.jukie.net/~bart/sig/
pgpS2OPB4h4Ix.pgp
Description: PGP signature