aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/test23
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/test b/scripts/test
index d874b64..2148d52 100755
--- a/scripts/test
+++ b/scripts/test
@@ -16,21 +16,20 @@ ENABLE_ASM="${ENABLE_ASM:=ON}"
16setup_cross_compiler() { 16setup_cross_compiler() {
17 cross_prefix=$1 17 cross_prefix=$1
18 18
19 # Use unversioned symlink if available, otherwise find versioned binary 19 CC=${cross_prefix}-gcc
20 if command -v "${cross_prefix}-gcc" >/dev/null 2>&1; then 20 CXX=${cross_prefix}-g++
21 CC=${cross_prefix}-gcc
22 CXX=${cross_prefix}-g++
23 else
24 gcc_ver=$(find /usr/bin -name "${cross_prefix}-gcc-[0-9]*" -prune 2>/dev/null \
25 | sed "s/.*${cross_prefix}-gcc-//" | sort -n | tail -n 1)
26 CC=${cross_prefix}-gcc-${gcc_ver}
27 CXX=${cross_prefix}-g++-${gcc_ver}
28 fi
29
30 AR=${cross_prefix}-ar 21 AR=${cross_prefix}-ar
31 STRIP=${cross_prefix}-strip 22 STRIP=${cross_prefix}-strip
32 RANLIB=${cross_prefix}-ranlib 23 RANLIB=${cross_prefix}-ranlib
33 24
25 # If the unversioned symlink for gcc doesn't exist, find versioned binary.
26 if ! command -v "$CC" >/dev/null 2>&1; then
27 gcc_ver=$(find /usr/bin -name "${CC}-[0-9]*" -prune 2>/dev/null \
28 | sed "s/.*${CC}-//" | sort -n | tail -n 1)
29 CC=${CC}-${gcc_ver}
30 CXX=${CXX}-${gcc_ver}
31 fi
32
34 # Check all binaries actually exist. 33 # Check all binaries actually exist.
35 for c in "$CC" "$CXX" "$AR" "$STRIP" "$RANLIB"; do 34 for c in "$CC" "$CXX" "$AR" "$STRIP" "$RANLIB"; do
36 if ! command -v "$c" >/dev/null 2>&1; then 35 if ! command -v "$c" >/dev/null 2>&1; then
@@ -39,7 +38,7 @@ setup_cross_compiler() {
39 fi 38 fi
40 done 39 done
41 40
42 echo "##### Using $($CC --version | head -1)" 41 echo "##### Using $($CC --version | head -n 1)"
43} 42}
44 43
45if type apt-get >/dev/null 2>&1; then 44if type apt-get >/dev/null 2>&1; then