D.gnu - DFLAGS and gdc
- John Colvin (1/1) Jul 08 2014 Does gdc have an equivalent to the DFLAGS environment variable?
- Iain Buclaw via D.gnu (5/6) Jul 08 2014 My stance at the moment is that DFLAGS should be recognised by the
- Joseph Rushton Wakeling via D.gnu (6/8) Jul 10 2014 I wonder if John's specific concern may be to do with how dmd uses the D...
- Johannes Pfau (11/22) Jul 10 2014 Yes, gdc searchs these files in some standard search paths (the exact
- Timo Sintonen (19/29) Jul 10 2014 As an ordinary user I might say that the basic idea is a little
Does gdc have an equivalent to the DFLAGS environment variable?
Jul 08 2014
On 8 July 2014 16:46, John Colvin via D.gnu <d.gnu puremagic.com> wrote:Does gdc have an equivalent to the DFLAGS environment variable?My stance at the moment is that DFLAGS should be recognised by the build tool, not the compiler. Regards Iain.
Jul 08 2014
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?
Jul 10 2014
Am Fri, 11 Jul 2014 00:49:48 +0200 schrieb "Joseph Rushton Wakeling via D.gnu" <d.gnu puremagic.com>:On 08/07/14 17:58, Iain Buclaw via D.gnu wrote: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#L208My 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?
Jul 10 2014
On Thursday, 10 July 2014 at 23:54:08 UTC, Joseph Rushton Wakeling via D.gnu wrote:On 08/07/14 17:58, Iain Buclaw via D.gnu wrote:As an ordinary user I might say that the basic idea is a little different. Dmd is more a standalone tool. All options, files, libs etc are passed to it at the same time. Gdc and other gcc tools are more like parts in a toolchain. It is not meant to call them directly. It is the job of a build system like make to parse the environment. When using gcc it is common to compile each file separately and then link all of them together. This is a make rule I have been using to compile a d file: $(dobjects): %.o: %.d $(deps) $(gccprefix)$(gdc) -c $(dflags) $(flags) $(includes) $< -o $ I think that if libraries are installed to standard place, they are found automatically. A special feature of D language is that full library sources have to be available for imports. I do not know where they are located in different distros but it may be necessary always to give gdc the correct path for imports.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?
Jul 10 2014