Ubuntu install location fixes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ubuntu install location fixes

Gonsolo
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.

g

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

0001-Automatically-determine-c-include-paths.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu install location fixes

Diego Iastrubni
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.


On Mon, Mar 1, 2010 at 10:08 PM, Gonsolo <[hidden email]> wrote:
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.

g

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev