<div dir="ltr">Hi Gonosolo,<br><br>What happens when you change the compiler on your system? The clang will fail again to find the correct includes. IMHO, the real solution is to find the path in runtime not in compile time.<br>

<br><br><div class="gmail_quote">On Mon, Mar 1, 2010 at 10:08 PM, Gonsolo <span dir="ltr"><<a href="mailto:gonsolo@gmail.com">gonsolo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Attached is a patch for automatical determination of c++ include paths.<br>
CXX_INCLUDE_ROOT and CXX_INCLUDE_ARCH can be set manually or otherwise are determined from the host system.<br>
It works by looking at /usr/include/c++ and using the latest revision.<br>
Then it looks for a list of files in that directory like i486-linux-gnu and uses the first existing one.<br>
This patch is for the cmake build system only.<br>
It is aimed to replace he hardcoded paths in clang's lib/Frontend/InitHeaderSearch.cpp.<br>
<br>
This patch is tested with Ubuntu 9.10. It correctly guesses /usr/include/c++/4.4.1 and i486-linux-gnu on my system. After that clang doesn't abort with "cannot find bits/c++config.h" anymore.<br>
<br>
The list of directories only has 3 entries right now, it has to be expanded for all the other systems.<br><font color="#888888">
<br>
g<br>
</font><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>