my question is: how do I make sure gcc automatically finds the right include files by default? what I did is compile gcc modules branch with --prefix=$HOME/.local and it worked. next thing to try it out with the next requirement: install "build2" with that new compiler. so I do
PATH="$HOME/.local/bin:$HOME/.local/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/:$PATH" LD_LIBRARY_PATH="/home/p/.local/lib64" sh build2-install-0.13.0.sh --sudo false $HOME/.local/
and I get lots of errors about missing header-files, like array, stddef.h, sstream, bits/c++config.h and limits.h
adding -I$HOME/.local/{include/c++/11.0.0/x86_64-pc-linux-gnu,include/c++/11.0.0,lib/gcc/x86_64-pc-linux-gnu/11.0.0/include,lib/gcc/x86_64-pc-linux-gnu/11.0.0/include-fixed}
to the g++ options fixes those, but I'd like to have those paths built into my compiler. how do I do that? where in the gcc sources do I have to change something to make gcc aware of where it had installed all those headers?
edit: the fix for my problem was simple: problem is that ~/.local/bin was symlink to ~/bin, so I only need to rm that, move ~/bin in its place and optionally create a symlink from ~/.local/bin to ~/bin. my question still stands though, maybe a bit more academic now: how do I force gcc to look for headers at a certain location by default?