Ubuntu install location fixes

Attached is a patch for automatical determination of c++ include paths.
CXX_INCLUDE_ROOT and CXX_INCLUDE_ARCH can be set manually or otherwise are determined from the host system.
It works by looking at /usr/include/c++ and using the latest revision.
Then it looks for a list of files in that directory like i486-linux-gnu and uses the first existing one.
This patch is for the cmake build system only.
It is aimed to replace he hardcoded paths in clang's lib/Frontend/InitHeaderSearch.cpp.

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.

The list of directories only has 3 entries right now, it has to be expanded for all the other systems.


0001-Automatically-determine-c-include-paths.patch (1.66 KB)

Hi Gonosolo,

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.