check_cc.sh 250 B

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