Commit 0118009b authored by Nikias Bassen's avatar Nikias Bassen

Prefer clang/clang++ over gcc/g++ (if installed)

parent 99f3ab14
...@@ -19,6 +19,12 @@ LIBPLIST_SO_VERSION=4:0:1 ...@@ -19,6 +19,12 @@ LIBPLIST_SO_VERSION=4:0:1
AC_SUBST(LIBPLIST_SO_VERSION) AC_SUBST(LIBPLIST_SO_VERSION)
# prefer clang if it is available and CC is not set
if test -z "$CC" && test -z "$CXX" && test -x "`which clang`"; then
CC=clang
CXX=clang++
fi
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
...@@ -162,6 +168,9 @@ AC_ARG_WITH([fuzzers], ...@@ -162,6 +168,9 @@ AC_ARG_WITH([fuzzers],
[build_fuzzers=true], [build_fuzzers=true],
[build_fuzzers=false]) [build_fuzzers=false])
if test "x$build_fuzzers" = "xtrue"; then if test "x$build_fuzzers" = "xtrue"; then
if test "$CXX" != "clang++"; then
AC_MSG_WARN([building fuzzers requires clang/clang++ (continuing anyway)])
fi
AS_COMPILER_FLAG([-fsanitize=address], [ AS_COMPILER_FLAG([-fsanitize=address], [
SANITIZER_FLAGS+=" -fsanitize=address" SANITIZER_FLAGS+=" -fsanitize=address"
ASAN_AVAILABLE=yes ASAN_AVAILABLE=yes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment