Skip to content

Commit

Permalink
Default to C compiler OCaml was configured with
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed May 11, 2018
1 parent 29955d7 commit fd1eb7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ echo

stdlib=`ocamlc -where`

# This slightly strange looking command will prefer c_compiler for versions
# of OCaml which have it, but will fallback to bytecode_c_compiler otherwise
CC=${CC:-`ocamlc -config | tr -d '\r' | sed -ne 's/.*c_compiler: //p' | head -n 1`}

hasgot() {
rm -f hasgot.c
(echo "#include <$2>"
Expand All @@ -36,7 +40,7 @@ hasgot() {
fi
echo ' return 0;'
echo '}') > hasgot.c
${CC:-cc} -I$1 -o hasgot.exe hasgot.c $3 $4
$CC -I$1 -o hasgot.exe hasgot.c $3 $4 2>/dev/null
res=$?
rm -f hasgot.c hasgot.exe
return $res
Expand Down

0 comments on commit fd1eb7d

Please sign in to comment.