Commit 871bd23e authored by Alexis Ballier's avatar Alexis Ballier Committed by John Koleszar
Browse files

Allow target autodetection to work when cross-compiling.

Allow CHOST to override the gcc -dumpmachine output. This allows to
use the target autodetection code when cross compiling by setting the
CHOST variable.

On Gentoo, we would like to support easy cross-compilation, and for
libvpx this would basically mean copying the code in
build/make/ to setup the right --target option. It seems a
lot easier to let it guess by itself.

Another option I considered was using CROSS-gcc instead but this would
not work for our multilib setups: They use gcc -m32 to build 32bits
binaries and gcc -m32 -dumpmachine will output the 64bits version,
which would then make libvpx wrongly believe it is building for a
64bits architecture.

Change-Id: I05a19be402228f749e23be7473ca53ae74fd2186
parent 44d35f7b
......@@ -549,7 +549,7 @@ setup_gnu_toolchain() {
process_common_toolchain() {
if [ -z "$toolchain" ]; then
gcctarget="$(gcc -dumpmachine 2> /dev/null)"
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
# detect tgt_isa
case "$gcctarget" in
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment