diff options
| author | 2017-05-29 04:10:55 +0200 | |
|---|---|---|
| committer | 2017-05-29 04:10:55 +0200 | |
| commit | 0118009bb56e84e6fa57dda7bf473958ae01256f (patch) | |
| tree | 77a9d8de77abd51a13cb55714c5d1d2702145891 /configure.ac | |
| parent | 99f3ab144dcaa97a2be37e562740dbff2de350c6 (diff) | |
| download | libplist-0118009bb56e84e6fa57dda7bf473958ae01256f.tar.gz libplist-0118009bb56e84e6fa57dda7bf473958ae01256f.tar.bz2 | |
Prefer clang/clang++ over gcc/g++ (if installed)
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 9 |
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 | |||
| 19 | 19 | ||
| 20 | AC_SUBST(LIBPLIST_SO_VERSION) | 20 | AC_SUBST(LIBPLIST_SO_VERSION) |
| 21 | 21 | ||
| 22 | # prefer clang if it is available and CC is not set | ||
| 23 | if test -z "$CC" && test -z "$CXX" && test -x "`which clang`"; then | ||
| 24 | CC=clang | ||
| 25 | CXX=clang++ | ||
| 26 | fi | ||
| 27 | |||
| 22 | # Checks for programs. | 28 | # Checks for programs. |
| 23 | AC_PROG_CC | 29 | AC_PROG_CC |
| 24 | AC_PROG_CXX | 30 | AC_PROG_CXX |
| @@ -162,6 +168,9 @@ AC_ARG_WITH([fuzzers], | |||
| 162 | [build_fuzzers=true], | 168 | [build_fuzzers=true], |
| 163 | [build_fuzzers=false]) | 169 | [build_fuzzers=false]) |
| 164 | if test "x$build_fuzzers" = "xtrue"; then | 170 | if test "x$build_fuzzers" = "xtrue"; then |
| 171 | if test "$CXX" != "clang++"; then | ||
| 172 | AC_MSG_WARN([building fuzzers requires clang/clang++ (continuing anyway)]) | ||
| 173 | fi | ||
| 165 | AS_COMPILER_FLAG([-fsanitize=address], [ | 174 | AS_COMPILER_FLAG([-fsanitize=address], [ |
| 166 | SANITIZER_FLAGS+=" -fsanitize=address" | 175 | SANITIZER_FLAGS+=" -fsanitize=address" |
| 167 | ASAN_AVAILABLE=yes | 176 | ASAN_AVAILABLE=yes |
