On Thu, Aug 14, 2008 at 01:00:45PM +1000, Gregory McGarry wrote: > The build system currently doesn't provide itself with hooks for an > alternative compiler. Here's what I did for PCC: > > - HAVE_GCC and HAVE_PCC variables control which compiler will be used. > defaults to HAVE_GCC = 4 > - MKPCC variable controls whether PCC is compiled during the build > > For build.sh: > > - PCC compiles the do-gnu-lib-crtstuff4 target, although this code actually > appears to be NetBSD code, not GNU code. > - there are no c++ nor objc compilers in PCC, so these host tools use > false(1) > - a directory tools/pcc is created to build a host tool > > It seems to work reasonably well. Is there a fundamental problem with this > approach? I think you're on the right track (once you take into consideration the feedback from others, including veego@ and mrg@). One comment: > Index: Makefile > =================================================================== > RCS file: /cvsroot/src/Makefile,v > retrieving revision 1.255 > diff -u -r1.255 Makefile > -BUILDTARGETS+= do-lib do-gnu-lib do-external-lib > +BUILDTARGETS+= do-lib > +.if defined(HAVE_GCC) > +BUILDTARGETS+= do-gnu-lib > +.endif > +BUILDTARGETS+= do-external-lib I'm not convinced about this part of your proposal; do-gnu-lib is intended to build all of gnu/lib "early" in the build, not just the bfd and gcc libraries. Whilst the only exception is gnu/lib/libmalloc; it's more the general principle. cheers, Luke.
Attachment:
pgpb6S8w6TH7j.pgp
Description: PGP signature