summaryrefslogtreecommitdiff
path: root/x86/check_cc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'x86/check_cc.sh')
-rwxr-xr-xx86/check_cc.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/x86/check_cc.sh b/x86/check_cc.sh
new file mode 100755
index 0000000..172d329
--- /dev/null
+++ b/x86/check_cc.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# check_cc.sh - Helper to test userspace compilation support
+# Copyright (c) 2015 Andrew Lutomirski
+# GPL v2
+
+CC="$1"
+TESTPROG="$2"
+shift 2
+
+if "$CC" -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
+ echo 1
+else
+ echo 0
+fi
+
+exit 0