Skip to content

Commit

Permalink
testenv.sh: use clang if gcc not available
Browse files Browse the repository at this point in the history
  • Loading branch information
tgingold committed May 29, 2024
1 parent ecbf82b commit b4701c0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions testsuite/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,18 @@ verilog_synth_tb()
# Check if a C compiler is installed on this system
c_compiler_is_available ()
{
if [ -z $CC ]; then
CC="gcc"
fi
which $CC
if [ -z $CC ]; then
if which gcc 2> /dev/null; then
CC=gcc
elif which clang 2> /dev/null; then
CC=clang
else
CC=cc
fi
fi

# Check the presence of the C compiler
which $CC
}

# Check if a feature is present
Expand Down

0 comments on commit b4701c0

Please sign in to comment.