summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-05-29 04:10:55 +0200
committerGravatar Nikias Bassen2017-05-29 04:10:55 +0200
commit0118009bb56e84e6fa57dda7bf473958ae01256f (patch)
tree77a9d8de77abd51a13cb55714c5d1d2702145891 /configure.ac
parent99f3ab144dcaa97a2be37e562740dbff2de350c6 (diff)
downloadlibplist-0118009bb56e84e6fa57dda7bf473958ae01256f.tar.gz
libplist-0118009bb56e84e6fa57dda7bf473958ae01256f.tar.bz2
Prefer clang/clang++ over gcc/g++ (if installed)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 43017bf..187ab11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,12 @@ LIBPLIST_SO_VERSION=4:0:1
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.
AC_PROG_CC
AC_PROG_CXX
@@ -162,6 +168,9 @@ AC_ARG_WITH([fuzzers],
[build_fuzzers=true],
[build_fuzzers=false])
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], [
SANITIZER_FLAGS+=" -fsanitize=address"
ASAN_AVAILABLE=yes