0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2012, 2013, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews# test cross compiler
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrewsfor t in ${BUILD_CC} gcc cc
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews type $t > /dev/null 2>&1 && cc=$t && break
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrewsfor i in "$@"
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews [ $next = 1 ] && chmod="$i"
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews case "$i" in
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews -o) next=1;;
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrewsif ${cc:-false} "$@"
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews [ "$chmod" != "" ] && chmod a-x "$chmod"