1#!/bin/sh 2 3# Copyright 2013, VIXL authors 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 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 41if [ ! -x "`which $CXX`" ]; then 42 echo "Error: $CXX does not exist or is not executable." 43 OK=0 44fi 45if [ ! -x "`which $AR`" ]; then 46 echo "Error: $AR does not exist or is not executable." 47 OK=0 48fi 49if [ ! -x "`which $RANLIB`" ]; then 50 echo "Error: $RANLIB does not exist or is not executable." 51 OK=0 52fi 53if [ ! -x "`which $CC`" ]; then 54 echo "Error: $CC does not exist or is not executable." 55 OK=0 56fi 57if [ ! -x "`which $LD`" ]; then 58 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 $@ 68