This post: What is the default path for OSX system include files when building a C++ application? gives me a command I can run to see what my default g++ include path is:
echo "" | gcc - -xc -v -E
When I run this, among other things, I get my default include path:
#include <...> search starts here:
/Applications/gcc471/lib/gcc/x86_64-apple-darwin12.0.0/4.7.1/include
/usr/local/include
/Applications/gcc471/include
/Applications/gcc471/lib/gcc/x86_64-apple-darwin12.0.0/4.7.1/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
However, I have no idea how this path is constructed. How do I change the order of this default path? Note, this is not $PATH (I know how to do export $PATHs in my .profile). Checking /etc/paths led to a help file explaining how $PATH is actually constructed, but I want to know how this different include path (not sure if it has a system name like $INCLUDEPATH) is constructed, and how I can change its order.