armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Alexandre Rames | b78f139 | 2016-07-01 14:22:22 +0100 | [diff] [blame] | 3 | # Copyright 2013, VIXL authors |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 4 | # All rights reserved. |
| 5 | # |
| 6 | # Redistribution and use in source and binary forms, with or without |
| 7 | # modification, are permitted provided that the following conditions are met: |
| 8 | # |
| 9 | # * Redistributions of source code must retain the above copyright notice, |
| 10 | # this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above copyright notice, |
| 12 | # this list of conditions and the following disclaimer in the documentation |
| 13 | # and/or other materials provided with the distribution. |
| 14 | # * Neither the name of ARM Limited nor the names of its contributors may be |
| 15 | # used to endorse or promote products derived from this software without |
| 16 | # specific prior written permission. |
| 17 | # |
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND |
| 19 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | |
| 29 | if [ "$#" -lt 1 ]; then |
| 30 | echo "Usage: tools/cross_build_gcc.sh <GCC prefix> [scons arguments ...]" |
| 31 | exit 1 |
| 32 | fi |
| 33 | |
| 34 | export CXX=$1g++ |
| 35 | export AR=$1ar |
| 36 | export RANLIB=$1ranlib |
| 37 | export CC=$1gcc |
| 38 | export LD=$1ld |
| 39 | |
| 40 | OK=1 |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 41 | if [ ! -x "`which $CXX`" ]; then |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 42 | echo "Error: $CXX does not exist or is not executable." |
| 43 | OK=0 |
| 44 | fi |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 45 | if [ ! -x "`which $AR`" ]; then |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 46 | echo "Error: $AR does not exist or is not executable." |
| 47 | OK=0 |
| 48 | fi |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 49 | if [ ! -x "`which $RANLIB`" ]; then |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 50 | echo "Error: $RANLIB does not exist or is not executable." |
| 51 | OK=0 |
| 52 | fi |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 53 | if [ ! -x "`which $CC`" ]; then |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 54 | echo "Error: $CC does not exist or is not executable." |
| 55 | OK=0 |
| 56 | fi |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 57 | if [ ! -x "`which $LD`" ]; then |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 58 | echo "Error: $LD does not exist or is not executable." |
| 59 | OK=0 |
| 60 | fi |
| 61 | if [ $OK -ne 1 ]; then |
| 62 | exit 1 |
| 63 | fi |
| 64 | |
| 65 | |
| 66 | shift |
| 67 | scons $@ |