DFLAGS and gdc

Johannes Pfau via D.gnu d.gnu at puremagic.com
Thu Jul 10 22:52:26 PDT 2014


Am Fri, 11 Jul 2014 00:49:48 +0200
schrieb "Joseph Rushton Wakeling via D.gnu" <d.gnu at puremagic.com>:

> On 08/07/14 17:58, Iain Buclaw via D.gnu wrote:
> > My stance at the moment is that DFLAGS should be recognised by the
> > build tool, not the compiler.
> 
> I wonder if John's specific concern may be to do with how dmd uses
> the DFLAGS environment variable to specify the standard import and
> library paths.
> 
> Is there an equivalent for gdc, or does it simply assume that imports
> and libraries will be in well-defined locations relative to where the
> executable is located?

Yes, gdc searchs these files in some standard search paths (the exact
details depend on whether you used a sysroot, the --prefix configure
option and a few more things).

You could implement a DFLAGS like variable with a little known GCC
feature, spec files (spec files can read env variables, IIRC):
https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Spec-Files.html


But if you only want to set import paths, we have a D_IMPORT_PATH env
variable:
https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/d-incpath.cc#L208


More information about the D.gnu mailing list