SCons and gdc

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Oct 22 12:54:23 PDT 2012


On Mon, Oct 22, 2012 at 08:15:13PM +0100, Russel Winder wrote:
> On Mon, 2012-10-22 at 11:23 -0700, H. S. Teoh wrote:
> […]
> > Hmm. How does it determine which tool to use? I currently have gdc on a
> > non-standard path, so my environment looks like:
> > 
> > 	env = Environment(
> > 		DC = '/usr/src/d/gdcroot/bin/gdc',
> > 		DFLAGS = ['-O', '-g', '-funittest']
> > 	)
> > 
> > But it is still using dmd-style options on the command line. Is
> > there some other setting that I need to put in to specifically tell
> > it to use the GDC tool?
> 
> There are now three tools: dmd, gdc, and ldc. Currently with the above
> it looks like you are using the dmd tool and replacing the dmd with
> gdc.

Does it use the dmd tool by default? How do I select the gdc tool
instead? I tried env.Append(tools = 'gdc') but it didn't make any
difference.


> There is not yet a d tool which tries a specific sequence according to
> some priority.  I couldn't decide on a Windows/OS X/Linux best
> priority order for DMD, GDC and LDC so I ran away form trying to
> implement it.  This needs doing.

If there's an easy way to select which tool to use, then it's good
enough for me. Having a tool that tries to guess what you want usually
ends up doing the wrong thing, especially since I have both compilers
installed and often switch between them in different projects for
testing, comparison, profiling, etc., purposes.


[…]
> > I've managed to build the gcc-4.7 git branch of GDC, which supports
> > 2.059 (at least), so I've been able to test it on my newer code
> > which uses some new Phobos features introduced in 2.059. I might try
> > GDC's git master with gcc-4.8 sometime, now that I figured out how
> > to make things work on my machine (GCC's build system is extremely
> > fragile and a nightmare to debug when something goes wrong) -- it
> > should support 2.060.
> 
> I build LDC from it's repository, but I have not tried this approach
> with GCC and hence GDC. I guess I am waiting for GDC to be in GCC 4.8
> and for that to be in Debian and/or Fedora.
[...]

I'm going to take a shot at building a .deb for the latest git gdc-4.7
branch, which AFAIK should support at least 2.059 (and maybe 2.060?).
It's probably non-trivial, as the debian gcc build scripts are a tangled
labyrinth I've yet to unravel. :)


T

-- 
If you think you are too small to make a difference, try sleeping in a closed room with a mosquito. -- Jan van Steenbergen


More information about the Digitalmars-d mailing list