First, does anyone know why the search paths take one of the following two sequences?<div><br></div><div>If no C_INCLUDE_DIRS are provided:</div><div>1) /usr/local/include</div><div>2) <builtin-headers></div><div>3) <massive platform-specific location set></div>
<div>4) /usr/include</div><div><br></div><div>If C_INCLUDE_DIRS is provided:</div><div>1) /usr/local/include</div><div>2) <builtin-headers></div><div>3) C_INCLUDE_DIRS</div><div><br></div><div>The thing that I don't get here is '/usr/local/include'. Why do we always do this, unconditionally, and *before* the builtin headers? It means that if your libc's 'limits.h' is in /usr/local/include, the wrong thing happens with the builtin 'limits.h' include_next directive. I propose moving '/usr/local/include' down to live with (and precede) '/usr/include'.</div>
<div><br></div><div><br></div><div>Second, there is no way to change the relative path used for the builtin headers easily. The resource dir has 'include' appended to it, and neither this relative path, nor the resource dir itself can be configured in any way.</div>
<div><br></div><div>The resource dir seems to have two uses: finding static libraries on the Darwin platform, and locating the builtin header files. I'd rather these concepts were independent as one is Darwin-specific, and the other is needed everywhere. We could still use the resource directory as a default for the bultin header directory when on the Darwin platform. Others could specify more likely defaults. My vague plan would be:</div>
<div><br></div><div>- create a dedicated option for tracking the bultin header location</div><div>- default it to <resource-dir>/include on Darwin, and possibly other platforms initially</div><div>- allow compile-time default override to be specified much like we allow C_INCLUDE_DIRS: BUILTIN_INCLUDE_DIR?</div>
<div>- investigate a better default for Linux systems; suggestions welcome here.</div>