check_cc.sh 295 B

12345678910111213141516
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-only
  3. # check_cc.sh - Helper to test userspace compilation support
  4. # Copyright (c) 2015 Andrew Lutomirski
  5. CC="$1"
  6. TESTPROG="$2"
  7. shift 2
  8. if [ -n "$CC" ] && $CC -o /dev/null "$TESTPROG" -O0 "$@" 2>/dev/null; then
  9. echo 1
  10. else
  11. echo 0
  12. fi
  13. exit 0