[PATCH] tests: try both 'gcc' and 'cc' for the C compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: Ed Maste <emaste@xxxxxxxxxxx>

FreeBSD does not have a 'gcc' in the PATH by default.

Signed-off-by: Ed Maste <emaste@xxxxxxxxxxx>
---
 tests/run_tests.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 081f1ee..00bd1b3 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -4,7 +4,15 @@ SRCDIR=`dirname "$0"`
 . "$SRCDIR/testutils.sh"
 
 if [ -z "$CC" ]; then
-    CC=gcc
+    for cc in gcc cc; do
+        if which $cc 2>/dev/null; then
+            CC=$cc
+            break
+        fi
+    done
+    if [ -z "$CC" ]; then
+        FAIL "C compiler gcc/cc not found - set CC appropriately"
+    fi
 fi
 
 # stat differs between platforms
-- 
2.23.0




[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux