[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

GCC - Best way to build cross compiler?



Hi all,

So, I want to create packages for a cross compiler targeting powerpc-wrs-vxworks on Wheezy. I don't exactly know how to approach the problem.

With binutils it's easy enough to just grab the sources with apt-get source and then run 'TARGET=powerpc-wrs-vxworks debuild'. However, it's a little different with gcc.

With GCC, it's a little more difficult. I need to have a little more control over the flags passed to configure. At the same time, the debian/rules et al for gcc is _very_ intimidating. I could make my own source package, but that seems like a lot of duplicated effort. At the same time, because I need a very specialized build (I need to add a dependency on a custom package, add some patches, and exactly control configure flags) that seems like the only option available to me. PLEASE, stop me now if I'm not seeing the solution in front of my face - I really did try to sort through all of the debian sources!

On the other hand, it seems like it would be nice if environment variables for build/host/target and appending to configure flags is standardized and documented. It may be (/probably is), but I didn't see it :-(, at least for pre-written debian/rules scripts - debhelper >= 7 makes everything easier if you're writing from scratch.

One more thing- why are there so many build-depends for gcc? I've successfully built gcc many times before and never needed all of those - just the compiler, mpfr-dev, mpc-dev, gmp-dev, and build-essential. Please forgive the ignorance :-)

OK, so how I would try to do this is I would make two directories, gcc-4.7 and gcc-4.7-src. I would make a script in gcc-4.7, and name it configure:

#!/bin/sh

../gcc-4.7-src/configure "$@"

Then I'd run dh_make -p..., edit debian/*, and then in debian/rules:

#!/usr/bin/make -f
export DH_OPTIONS

override_dh_auto_configure:
    dh_auto_configure -- \
        --target=powerpc-wrs-vxworks \
        #lots of compile options, etc.

%:
    dh $@  --with autotools-dev

Then, hopefully, just a simple debuild would work. Then I'd just copy over the debian/control files from my box and edit them appropriately.

Any feedback/sanity checking would be AWESOME.  Thank you all,

--
rbmj


Reply to: