Commit 98058bcc authored by John Koleszar's avatar John Koleszar
Browse files

configure: detect toolchain if not specified

Try to select an optimized target based on the host's uname, as this
is the expected behavior of most configure scripts.

Change-Id: I1408ece70c43487902ea6edc6450d6a55abc424a
parent 75befc7a
No related merge requests found
Showing with 36 additions and 0 deletions
...@@ -478,6 +478,42 @@ setup_gnu_toolchain() { ...@@ -478,6 +478,42 @@ setup_gnu_toolchain() {
} }
process_common_toolchain() { process_common_toolchain() {
if [ -z "$toolchain" ]; then
uname="$(uname -a)"
# detect tgt_isa
case "$uname" in
*x86_64*)
tgt_isa=x86_64
;;
*i[3456]86*)
tgt_isa=x86
;;
esac
# detect tgt_os
case "$uname" in
*Darwin\ Kernel\ Version\ 8*)
tgt_isa=universal
tgt_os=darwin8
;;
*Darwin\ Kernel\ Version\ 9*)
tgt_isa=universal
tgt_os=darwin9
;;
*Msys*|*Cygwin*)
tgt_os=win32
;;
*Linux*|*BSD*)
tgt_os=linux
;;
esac
if [ -n "$tgt_isa" ] && [ -n "$tgt_os" ]; then
toolchain=${tgt_isa}-${tgt_os}-gcc
fi
fi
toolchain=${toolchain:-generic-gnu} toolchain=${toolchain:-generic-gnu}
is_in ${toolchain} ${all_platforms} || enabled force_toolchain \ is_in ${toolchain} ${all_platforms} || enabled force_toolchain \
......
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