Related in any way to this problem?
Most probably yes.
If i remember correctly FPCDir is either an environment variable that gets used for substitution in the makefile or the compiler itself checks for this environment variable. Setting such variable thus influences the build-script. Lazarus codetools seems to use the same naming as well.
Just do a grep for it in the fpc source-tree and you can spot the usage of this variable.
The plot thickens :-)
PS:
This is getting a little bit off-topic.
Is it really ?
Although you perhaps might believe otherwise, it is still related to the topic on how to approach such situation in a quick manner.
In that regards i thank @lucamar for his neat grep trick. For some reason I never thought about grepping it directly.
On the other hand, i make my builds unattended doing it as clean as possible and when my script encounters an error it then re-tries failed build automatically with -va parameter and stores the output. That way i'm f.e. able to directly see what fpc.cfg was loaded and what options where set for that specific part that failed.
These days I have but one fpc.cfg file to rule them all, no matter which version/revision of the compiler.
But... it is your thread so i'll keep quiet if you prefer. Just wanted to say thank you to lucamar.
For the record I added -vu to the compiler flags and it shows me the units it tries, that's how I got the output from my first post.
Yeah, but that still does not tell you where it came from. First thing that I always try to rule out are dangling/overlooked fpc.cfg file (and where in the build process does it get loaded), or in your case where the heck does this option/setting originate from.