Yesterday evening I built a recent version (7.2) of the avr-gcc toolchain (see this post). I started the day with a quick test, and it can not locate the default include files (e.g. avr/io.h and all that it pulls with it).
I tested by actually placing a minimal C++ test program in the bin directory and tried a straight compile:
$ ./avr-gcc -std=c++11 -mmcu=atmega328 -c test.cpp test.cpp:1:10: fatal error: avr/io.h: No such file or directory #include <avr/io.h> ^~~~~~~~~~ compilation terminated.
So, the toolchain sort of "works", but can't get to the include files that should be "built in" for an avr-gcc.
Note: I also have Atmels build/distribution of the tool chain installed (gcc version 4.9.2), and performing the same procedure there succeeds. As I recall I only unzipped that package and made PATH point to it and it worked.
So, how does a gcc compiler know of its default include directories?
I assume it has something to do with the configure-scripts and/or building of the toolchain. The build script I used is a variant of the script here (originally pointed out by El Tangas) - I just set it to not build the Windows tool chains (and after a first run I commented out the downloading of the source tarballs so as not to eat on my metered connection). Sorry, the build script I have and use is somewhat of a mess because of all those comments. I'll clean it up later and post here. But for the time being, I'm primarily looking for a better understanding of how in general the "built in" include paths work in (avr-)gcc.
I have a rudimentary to fair knowledge of Autotools and friends, so don't be afraid of using such terminology. I'll ask if I loose you re such matters.