import problems

Johannes Pfau via D.gnu d.gnu at puremagic.com
Wed Oct 14 15:08:24 PDT 2015


Am Tue, 13 Oct 2015 10:16:11 +0000
schrieb John Colvin <john.loughran.colvin at gmail.com>:

> On Tuesday, 13 October 2015 at 10:09:03 UTC, John Colvin wrote:
> > Where does the information  
> 
> sorry, pressed enter by accident.
> 
> What is the process by which gdc knows what the default import 
> path for object.d is?
> 

It uses all standard C include paths (/usr/inlcude, ...) and adds /d
at the end of the path.

It might additionally add multilib path variants (/usr/include/d/32).

(In practice it's more complicated to also support 'relocated'
compilers. GCC remembers the full path at compilation time but if you
move the gdc executable it will replace the paths prefix. I don't
remember how it works exactly.)

> Alternatively, what do I have to change to choose my own location 
> for gdc to install its imports to and have it automatically use 
> that as an import path? I have seen

Can't you just use --prefix when configuring? Ore use -I or the
D_IMPORT_PATH environment variable?

Anyway, the code you'll have to look at is here:
https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/d-incpath.cc

Look at add_import_paths, called from d_init in d-lang.cc

 
> https://github.com/Dicebot/Arch-PKGBUILDs/blob/master/gdc/folders.diff
> and followed that example, but of course changing configure.ac is a
> pain because then you have to have exactly the right version of
> autoconf to update configure. Also, I couldn't find the relevant
> lines to change in gcc/d/Make-lang.in

That code was refactored and the patch isn't valid anymore:
https://github.com/D-Programming-GDC/GDC/commit/5ea9c2a61d548d2edb65401cbb88c88b123aef53?w=0

> 
> Currently I tried changing gdc_include_dir in the generated 
> configure, which gets everything installed in the right place, 
> but gdc doesn't import it (and doesn't show any import paths in 
> the error message)

Which error message exactly? Does DMD print the import path for these
errors? 


More information about the D.gnu mailing list