Commit Graph

9 Commits

Author SHA1 Message Date
Gustavo Jose de Sousa 6e658452ec waf: toolchain: filter supported compilers for cross-compilation
We currently only support GNU and clang compilers.
2016-03-23 17:11:02 -03:00
Gustavo Jose de Sousa 1b6a87d8b4 waf: toolchain: clang: use waf to find toolchain path
The find_realexec_path function was used for finding the toolchain path mostly
because of two reasons:

 1) We couldn't really use CXX or CC variables because the user could set those
 from the OS's environment and Waf wouldn't look for the executable file in
 that case.

 2) Our CI configuration sets up symlinks for ccache and find_realexec_path
 works around that issue.

The bad side about using find_realexec_path() is that, besides working aroung
symlinks, it does the same thing that is done by Waf. This patch removes the
dependency for such a function by addressing each of the reasons above stated:

 1) We create a local copy of os.environ and, if there's a variable with the
 same name we are using, we remove it from the local copy.

 2) As done before, we are looking for the cross ar program instead of gcc
 program, since that is not used for ccache symlinks.
2016-03-23 17:11:02 -03:00
Gustavo Jose de Sousa 019cf3d483 waf: toolchain: clang: use configure wrapper
This is a better approach than checking command line options
--check-cxx-compiler and --check-c-compiler. Those values expect a list of
compilers to try instead of the compiler to use.

The benefits of this approach are:
 - Allowing correct use of options --check-cxx-compiler and --check-c-compiler.
 - Allowing user to pass CXX and CC environment variables, which is a common
   way of selecting the compiler.
 - Configuration is done *and committed* only for the specific compiler.
2016-03-23 17:11:02 -03:00
Gustavo Jose de Sousa 7ede9600db waf: toolchain: gcc: use cross-compilation prefix wrapper
This is a better approach than checking command line options
--check-cxx-compiler and --check-c-compiler. Those values expect a list of
compilers to try instead of the compiler to use.

The benefits of this approach are:
 - Allowing correct use of options --check-cxx-compiler and --check-c-compiler.
 - Allowing user to pass CXX and CC environment variables, which is a common
   way of selecting the compiler.
 - Configuration is done *and committed* only for the specific compiler.
2016-03-23 17:11:02 -03:00
Gustavo Jose de Sousa 95aeb0346e waf: load compilers tools in toolchain tool
It makes more sense the toolchain Waf tool to be responsible of loading the
compilers. Furthermore, that allows toolchain tool to have control on doing
configuration before and after loading compiler tools.
2016-03-23 17:11:02 -03:00
Gustavo Jose de Sousa 19d6a88e84 waf: toolchain: refactor configure function
- Use early return and reduce one indentation level.
- Set AR for both GNU compilers and clang just once and reduce redundancy.
- Reduce indentation level for clang-specific setup. There's no need to nest it
  inside check if compilers are GNU or clang.
2016-03-23 17:11:02 -03:00
Gustavo Jose de Sousa ceda86bbd8 waf: toolchain: get rid of suffixes variable
The only variables used so far are CXX, CC and AR. Let's make it
simpler.
2016-03-23 17:05:33 -03:00
Francisco Ferreira 02af9b6ab1 waf: toolchain: support Clang in toolchain for cross-compilation
Define function to help find the toolchain path
2016-03-20 00:17:02 -03:00
Gustavo Jose de Sousa e7312a1f81 waf: add toolchain tool for cross-compiling 2016-01-11 16:31:59 -02:00