diff options
author | Philip Jägenstedt <philipj@opera.com> | 2010-06-07 06:12:14 +0200 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2010-06-10 10:20:12 -0400 |
commit | ffd5b58f9144c40dbfd1cf9ea99d089a3f4e4f42 (patch) | |
tree | 76e8598da792dc3b815bcdd0f76a00d73c89edca /build/make/configure.sh | |
parent | 4bb895e85401d81d7dd2615380309812edfefc5e (diff) | |
download | libvpx-ffd5b58f9144c40dbfd1cf9ea99d089a3f4e4f42.tar libvpx-ffd5b58f9144c40dbfd1cf9ea99d089a3f4e4f42.tar.gz libvpx-ffd5b58f9144c40dbfd1cf9ea99d089a3f4e4f42.tar.bz2 libvpx-ffd5b58f9144c40dbfd1cf9ea99d089a3f4e4f42.zip |
Detect toolchain based on gcc -dumpmachine
Using uname fails e.g. on a 64-bit machine with a 32-bit toolchain.
The following gcc -dumpmachine strings have been verified:
* 32-bit Linux gives i486-linux-gnu
* 64-bit Linux gives x86_64-linux-gnu
* Mac OS X 10.5 gives i686-apple-darwin9
* MinGW gives mingw32
*darwin8* and *bsd* can safely be assumed to be correct, but *cygwin*
is a guess.
Change-Id: I6bef2ab5e97cbd3410aa66b0c4f84d2231884b05
Diffstat (limited to 'build/make/configure.sh')
-rwxr-xr-x | build/make/configure.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/build/make/configure.sh b/build/make/configure.sh index a70a84eec..28ed21cf5 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -497,10 +497,10 @@ setup_gnu_toolchain() { process_common_toolchain() { if [ -z "$toolchain" ]; then - uname="$(uname -a)" + gcctarget="$(gcc -dumpmachine 2> /dev/null)" # detect tgt_isa - case "$uname" in + case "$gcctarget" in *x86_64*) tgt_isa=x86_64 ;; @@ -510,19 +510,19 @@ process_common_toolchain() { esac # detect tgt_os - case "$uname" in - *Darwin\ Kernel\ Version\ 8*) + case "$gcctarget" in + *darwin8*) tgt_isa=universal tgt_os=darwin8 ;; - *Darwin\ Kernel\ Version\ 9*) + *darwin9*) tgt_isa=universal tgt_os=darwin9 ;; - *Msys*|*Cygwin*) + *msys*|*cygwin*) tgt_os=win32 ;; - *Linux*|*BSD*) + *linux*|*bsd*) tgt_os=linux ;; esac |