blob: 97448ae2ea4450ab541fe72134b3559af1138a9d [file] [log] [blame]
armvixlad96eda2013-06-14 11:42:37 +01001#!/bin/sh
2
Alexandre Ramesb78f1392016-07-01 14:22:22 +01003# Copyright 2013, VIXL authors
armvixlad96eda2013-06-14 11:42:37 +01004# 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
29if [ "$#" -lt 1 ]; then
30 echo "Usage: tools/cross_build_gcc.sh <GCC prefix> [scons arguments ...]"
31 exit 1
32fi
33
34export CXX=$1g++
35export AR=$1ar
36export RANLIB=$1ranlib
37export CC=$1gcc
38export LD=$1ld
39
40OK=1
Pierre Langlois88c46b82016-06-02 18:15:32 +010041if [ ! -x "`which $CXX`" ]; then
armvixlad96eda2013-06-14 11:42:37 +010042 echo "Error: $CXX does not exist or is not executable."
43 OK=0
44fi
Pierre Langlois88c46b82016-06-02 18:15:32 +010045if [ ! -x "`which $AR`" ]; then
armvixlad96eda2013-06-14 11:42:37 +010046 echo "Error: $AR does not exist or is not executable."
47 OK=0
48fi
Pierre Langlois88c46b82016-06-02 18:15:32 +010049if [ ! -x "`which $RANLIB`" ]; then
armvixlad96eda2013-06-14 11:42:37 +010050 echo "Error: $RANLIB does not exist or is not executable."
51 OK=0
52fi
Pierre Langlois88c46b82016-06-02 18:15:32 +010053if [ ! -x "`which $CC`" ]; then
armvixlad96eda2013-06-14 11:42:37 +010054 echo "Error: $CC does not exist or is not executable."
55 OK=0
56fi
Pierre Langlois88c46b82016-06-02 18:15:32 +010057if [ ! -x "`which $LD`" ]; then
armvixlad96eda2013-06-14 11:42:37 +010058 echo "Error: $LD does not exist or is not executable."
59 OK=0
60fi
61if [ $OK -ne 1 ]; then
62 exit 1
63fi
64
65
66shift
67scons $@