<p dir="ltr">On 15 Oct 2015 1:35 am, "John Colvin via D.gnu" <<a href="mailto:d.gnu@puremagic.com">d.gnu@puremagic.com</a>> wrote:<br>
><br>
> On Wednesday, 14 October 2015 at 22:08:25 UTC, Johannes Pfau wrote:<br>
>><br>
>> Am Tue, 13 Oct 2015 10:16:11 +0000<br>
>> schrieb John Colvin <<a href="mailto:john.loughran.colvin@gmail.com">john.loughran.colvin@gmail.com</a>>:<br>
>><br>
>>> On Tuesday, 13 October 2015 at 10:09:03 UTC, John Colvin wrote:<br>
>>> > Where does the information<br>
>>><br>
>>> sorry, pressed enter by accident.<br>
>>><br>
>>> What is the process by which gdc knows what the default import path for object.d is?<br>
>>><br>
>><br>
>> It uses all standard C include paths (/usr/inlcude, ...) and adds /d<br>
>> at the end of the path.<br>
>><br>
>> It might additionally add multilib path variants (/usr/include/d/32).<br>
>><br>
>> (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.)<br>
>></p>
<p dir="ltr">If I recall right, it's infact all relative paths based on where the compiler driver and proper is installed. But allows to be overriden based on compilation flags such as changing architecture.</p>
<p dir="ltr">>>> 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<br>
>><br>
>><br>
>> Can't you just use --prefix when configuring?<br>
><br>
><br>
> That deals with the prefix, but not the suffix.<br>
><br>
><br>
>> Ore use -I or the D_IMPORT_PATH environment variable?<br>
><br>
><br>
> I'm packaging GDC, so those aren't good solutions here.<br>
><br>
></p>
<p dir="ltr">Just packaging GDC? Or do you plan to have third party development libraries packaged too?</p>
<p dir="ltr">The defaults install everything into a version and multiarch specific directory. This allows having any arbitrary number of versions installed, both native and cross compilations. You probably want a very good reason to change that.<br></p>
<p dir="ltr">>> Anyway, the code you'll have to look at is here: <a href="https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/d-incpath.cc">https://github.com/D-Programming-GDC/GDC/blob/master/gcc/d/d-incpath.cc</a><br>
>><br>
>> Look at add_import_paths, called from d_init in d-lang.cc<br>
>><br>
>><br>
>>> <a href="https://github.com/Dicebot/Arch-PKGBUILDs/blob/master/gdc/folders.diff">https://github.com/Dicebot/Arch-PKGBUILDs/blob/master/gdc/folders.diff</a> and followed that example, but of course changing <a href="http://configure.ac">configure.ac</a> 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<br>
>><br>
>><br>
>> That code was refactored and the patch isn't valid anymore: <a href="https://github.com/D-Programming-GDC/GDC/commit/5ea9c2a61d548d2edb65401cbb88c88b123aef53?w=0">https://github.com/D-Programming-GDC/GDC/commit/5ea9c2a61d548d2edb65401cbb88c88b123aef53?w=0</a><br>
><br>
><br>
> So the /d suffix is hard-coded in to gdc? Can I just patch it to be whatever I want before compiling gdc or are there other places that would also need changing?<br>
><br>
><br>
>>><br>
>>> 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)<br>
>><br>
>><br>
>> Which error message exactly? Does DMD print the import path for these errors?<br>
><br>
><br>
> I don't have the exact ones to hand right now, but it's the usual complaint about not being able to find object.d. When an import is missing, the compiler normally spits out a list of the include paths (same as in dmd, checked also with gdc on archlinux), but in this case it didn't print any.</p>
<p dir="ltr">Probably because none of the directories the compiler looked for exists.</p>